From a0c7dd50c4aed59c282404c2dc481a8603b6eb8e Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Mon, 1 Feb 2021 19:31:20 +0600 Subject: [PATCH] Fixed timecyc editor, added veh engine toggle hotkey --- src/Menu.cpp | 11 +++++- src/Menu.h | 1 + src/Player.cpp | 1 + src/TimeCycle.h | 99 ++++++++++++++++++++++++++++++++++++++++++++++ src/Vehicle.cpp | 13 ++++++ src/Visual.cpp | 89 ++++++++++++++++++++--------------------- src/Visual.h | 6 ++- src/tests/Test.cpp | 12 +----- 8 files changed, 174 insertions(+), 58 deletions(-) create mode 100644 src/TimeCycle.h diff --git a/src/Menu.cpp b/src/Menu.cpp index 795ae46..c77b961 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -25,9 +25,9 @@ HotKeyData Menu::hotkeys::flip_veh{}; HotKeyData Menu::hotkeys::fix_veh{}; HotKeyData Menu::hotkeys::god_mode{}; HotKeyData Menu::hotkeys::menu_open{}; - HotKeyData Menu::hotkeys::quick_ss{}; HotKeyData Menu::hotkeys::quick_tp{}; +HotKeyData Menu::hotkeys::veh_engine{}; bool Menu::commands::show_menu = false; char Menu::commands::input_buffer[INPUT_BUFFER_SIZE] = ""; @@ -75,6 +75,9 @@ Menu::Menu() hotkeys::god_mode.key1 = config.GetValue("hotkey.god_mode.key1", VK_NONE); hotkeys::god_mode.key2 = config.GetValue("hotkey.god_mode.key2", VK_NONE); + + hotkeys::veh_engine.key1 = config.GetValue("hotkey.veh_engine.key1", VK_NONE); + hotkeys::veh_engine.key2 = config.GetValue("hotkey.veh_engine.key2", VK_NONE); }; } @@ -387,6 +390,12 @@ void Menu::Main() config.SetValue("hotkey.god_mode.key2", hotkeys::god_mode.key2); } + if (Ui::HotKey("Toggle veh engine", hotkeys::veh_engine)) + { + config.SetValue("hotkey.veh_engine.key1", hotkeys::veh_engine.key1); + config.SetValue("hotkey.veh_engine.key2", hotkeys::veh_engine.key2); + } + ImGui::Dummy(ImVec2(0, 10)); ImGui::EndChild(); diff --git a/src/Menu.h b/src/Menu.h index cb3bada..0f4d0c8 100644 --- a/src/Menu.h +++ b/src/Menu.h @@ -28,6 +28,7 @@ public: static HotKeyData menu_open; static HotKeyData quick_ss; static HotKeyData quick_tp; + static HotKeyData veh_engine; }; struct commands { diff --git a/src/Player.cpp b/src/Player.cpp index 9beaa9b..156ce11 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -223,6 +223,7 @@ void Player::Main() ImGui::SameLine(); if (ImGui::Button("Suicide", ImVec2(Ui::GetSize(2)))) player->m_fHealth = 0.0; + ImGui::Spacing(); if (ImGui::BeginTabBar("Player", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) diff --git a/src/TimeCycle.h b/src/TimeCycle.h new file mode 100644 index 0000000..8dea347 --- /dev/null +++ b/src/TimeCycle.h @@ -0,0 +1,99 @@ +#include "plugin.h" + +unsigned char* m_nDirectionalMult{ (unsigned char*)patch::GetPointer(0x55F7C7)}; //m_nDirectionalMult[184] + +unsigned char* m_nWaterFogAlpha{ (unsigned char*)patch::GetPointer(0x55F7B8)}; //m_nWaterFogAlpha[184] + +unsigned char* m_nHighLightMinIntensity{ (unsigned char*)patch::GetPointer(0x55F7A9)}; //m_nHighLightMinIntensity[184] + +unsigned char* m_fCloudAlpha{ (unsigned char*)patch::GetPointer(0x55F793)}; //m_fCloudAlpha[184] + +unsigned char* m_fPostFx2Alpha{ (unsigned char*)patch::GetPointer(0x55F77D)}; //m_fPostFx2Alpha[184] + +unsigned char* m_fPostFx2Blue{ (unsigned char*)patch::GetPointer(0x55F767)}; //m_fPostFx2Blue[184] + +unsigned char* m_fPostFx2Green{ (unsigned char*)patch::GetPointer(0x55F751)}; //m_fPostFx2Green[184] + +unsigned char* m_fPostFx2Red{ (unsigned char*)patch::GetPointer(0x55F73B)}; //m_fPostFx2Red[184] + +unsigned char* m_fPostFx1Alpha{ (unsigned char*)patch::GetPointer(0x55F725)}; //m_fPostFx1Alpha[184] + +unsigned char* m_fPostFx1Blue{ (unsigned char*)patch::GetPointer(0x55F70F)}; //m_fPostFx1Blue[184] + +unsigned char* m_fPostFx1Green{ (unsigned char*)patch::GetPointer(0x55F6FC)}; //m_fPostFx1Green[184] + +unsigned char* m_fPostFx1Red{ (unsigned char*)patch::GetPointer(0x55F6E9)}; //m_fPostFx1Red[184] + +unsigned char* m_fWaterAlpha{ (unsigned char*)patch::GetPointer(0x55F6D6)}; //m_fWaterAlpha[184] + +unsigned char* m_fWaterBlue{ (unsigned char*)patch::GetPointer(0x55F6C3)}; //m_fWaterBlue[184] + +unsigned char* m_fWaterGreen{ (unsigned char*)patch::GetPointer(0x55F6B0)}; //m_fWaterGreen[184] + +unsigned char* m_fWaterRed{ (unsigned char*)patch::GetPointer(0x55F69C)}; //m_fWaterRed[184] + +unsigned char* m_nFluffyCloudsBottomBlue{ (unsigned char*)patch::GetPointer(0x55F690)}; //m_nFluffyCloudsBottomBlue[184] + +unsigned char* m_nFluffyCloudsBottomGreen{ (unsigned char*)patch::GetPointer(0x55F683)}; //m_nFluffyCloudsBottomGreen[184] + +unsigned char* m_nFluffyCloudsBottomRed{ (unsigned char*)patch::GetPointer(0x55F677)}; //m_nFluffyCloudsBottomRed[184] + +unsigned char* m_nLowCloudsBlue{ (unsigned char*)patch::GetPointer(0x55F66B)}; //m_nLowCloudsBlue[184] + +unsigned char* m_nLowCloudsGreen{ (unsigned char*)patch::GetPointer(0x55F65F)}; //m_nLowCloudsGreen[184] + +unsigned char* m_nLowCloudsRed{ (unsigned char*)patch::GetPointer(0x55F653)}; //m_nLowCloudsRed[184] + +unsigned char* m_fLightsOnGroundBrightness{ (unsigned char*)patch::GetPointer(0x55F640)}; //m_fLightsOnGroundBrightness[184] + +short* m_fFogStart{ (short*)patch::GetPointer(0x55F62E)}; //m_fFogStart[184] + +short* m_fFarClip{ (short*)patch::GetPointer(0x55F61B)}; //m_fFarClip[184] + +unsigned char* m_nPoleShadowStrength{ (unsigned char*)patch::GetPointer(0x55F60F)}; //m_nPoleShadowStrength[184] + +unsigned char* m_nLightShadowStrength{ (unsigned char*)patch::GetPointer(0x55F603)}; //m_nLightShadowStrength[184] + +unsigned char* m_nShadowStrength{ (unsigned char*)patch::GetPointer(0x55F5F7)}; //m_nShadowStrength[184] + +unsigned char* m_fSpriteBrightness{ (unsigned char*)patch::GetPointer(0x55F5E4)}; //m_fSpriteBrightness[184] + +unsigned char* m_fSpriteSize{ (unsigned char*)patch::GetPointer(0x55F5D2)}; //m_fSpriteSize[184] + +unsigned char* m_fSunSize{ (unsigned char*)patch::GetPointer(0x55F5C0)}; //m_fSunSize[184] + +unsigned char* m_nSunCoronaBlue{ (unsigned char*)patch::GetPointer(0x55F5B5)}; //m_nSunCoronaBlue[184] + +unsigned char* m_nSunCoronaGreen{ (unsigned char*)patch::GetPointer(0x55F5A9)}; //m_nSunCoronaGreen[184] + +unsigned char* m_nSunCoronaRed{ (unsigned char*)patch::GetPointer(0x55F59D)}; //m_nSunCoronaRed[184] + +unsigned char* m_nSunCoreBlue{ (unsigned char*)patch::GetPointer(0x55F591)}; //m_nSunCoreBlue[184] + +unsigned char* m_nSunCoreGreen{ (unsigned char*)patch::GetPointer(0x55F585)}; //m_nSunCoreGreen[184] + +unsigned char* m_nSunCoreRed{ (unsigned char*)patch::GetPointer(0x55F579)}; //m_nSunCoreRed[184] + +unsigned char* m_nSkyBottomBlue{ (unsigned char*)patch::GetPointer(0x55F56D)}; //m_nSkyBottomBlue[184] + +unsigned char* m_nSkyBottomGreen{ (unsigned char*)patch::GetPointer(0x55F561)}; //m_nSkyBottomGreen[184] + +unsigned char* m_nSkyBottomRed{ (unsigned char*)patch::GetPointer(0x55F555)}; //m_nSkyBottomRed[184] + +unsigned char* m_nSkyTopBlue{ (unsigned char*)patch::GetPointer(0x55F549)}; //m_nSkyTopBlue[45] + +unsigned char* m_nSkyTopGreen{ (unsigned char*)patch::GetPointer(0x55F53D)}; //m_nSkyTopGreen[45] + +unsigned char* m_nSkyTopRed{ (unsigned char*)patch::GetPointer(0x55F531)}; //m_nSkyTopRed[45] + +unsigned char* m_nAmbientBlue_Obj{ (unsigned char*)patch::GetPointer(0x55F51E)}; //m_nAmbientBlue_Obj[184] + +unsigned char* m_nAmbientGreen_Obj{ (unsigned char*)patch::GetPointer(0x55F50C)}; //m_nAmbientGreen_Obj[184] + +unsigned char* m_nAmbientRed_Obj{ (unsigned char*)patch::GetPointer(0x55F4FA)}; //m_nAmbientRed_Obj[184] + +unsigned char* m_nAmbientBlue{ (unsigned char*)patch::GetPointer(0x55F4E8)}; //m_nAmbientBlue[184] + +unsigned char* m_nAmbientGreen{ (unsigned char*)patch::GetPointer(0x55F4D6)}; //m_nAmbientGreen[184] + +unsigned char* m_nAmbientRed{ (unsigned char*)patch::GetPointer(0x560C61)}; //m_nAmbientRed[184] diff --git a/src/Vehicle.cpp b/src/Vehicle.cpp index a0d90b0..3553073 100644 --- a/src/Vehicle.cpp +++ b/src/Vehicle.cpp @@ -106,6 +106,19 @@ Vehicle::Vehicle() player->m_pVehicle->m_fHealth = 1000.0f; CHud::SetHelpMessage("Vehicle fixed",false,false,false); } + + if (Ui::HotKeyPressed(Menu::hotkeys::veh_engine)) + { + bool state = !veh->m_nVehicleFlags.bEngineBroken || veh->m_nVehicleFlags.bEngineOn; + + if (state) + CHud::SetHelpMessage("Vehicle engine off",false,false,false); + else + CHud::SetHelpMessage("Vehicle engine on",false,false,false); + + veh->m_nVehicleFlags.bEngineBroken = state; + veh->m_nVehicleFlags.bEngineOn = !state; + } if (veh_nodmg) { diff --git a/src/Visual.cpp b/src/Visual.cpp index db9997c..c621e40 100644 --- a/src/Visual.cpp +++ b/src/Visual.cpp @@ -4,6 +4,8 @@ #include "Util.h" #include "Game.h" #include "CHudColours.h" +#include "TimeCycle.h" + bool Visual::lock_weather = false; int Visual::weather_type_backup = 0; @@ -48,10 +50,10 @@ Visual::~Visual() { } - +// Thanks to GuruGuru int Visual::GetCurrentHourTimeId() { - uchar hour = CClock::ms_nGameClockHours; + int hour = CClock::ms_nGameClockHours; if (timecyc_hour == 24) return hour; @@ -61,8 +63,8 @@ int Visual::GetCurrentHourTimeId() if (hour == 6) return 2; - if (7 >= hour && hour < 12) return 2; - if (12 >= hour && hour < 19) return 4; + if (7 <= hour && hour < 12) return 3; + if (12 <= hour && hour < 19) return 4; if (hour == 19) return 5; if (hour == 20 || hour == 21) return 6; @@ -144,37 +146,37 @@ void Visual::GenerateTimecycFile() int val = 23 * j + i; - file << "\t" << +CTimeCycle::m_nAmbientRed[val] << " " << +CTimeCycle::m_nAmbientGreen[val] << " " << +CTimeCycle::m_nAmbientBlue[val] << " \t\t" + file << "\t" << +m_nAmbientRed[val] << " " << +m_nAmbientGreen[val] << " " << +m_nAmbientBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_nAmbientRed_Obj[val] << " " << +CTimeCycle::m_nAmbientGreen_Obj[val] << " " << +CTimeCycle::m_nAmbientBlue_Obj[val] << " \t\t" + << "\t" << +m_nAmbientRed_Obj[val] << " " << +m_nAmbientGreen_Obj[val] << " " << +m_nAmbientBlue_Obj[val] << " \t\t" << "\t255 255 255\t\t" // unused - << "\t" << +CTimeCycle::m_nSkyTopRed[val] << " " << +CTimeCycle::m_nSkyTopGreen[val] << " " << +CTimeCycle::m_nSkyTopBlue[val] << " \t\t" + << "\t" << +m_nSkyTopRed[val] << " " << +m_nSkyTopGreen[val] << " " << +m_nSkyTopBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_nSkyBottomRed[val] << " " << +CTimeCycle::m_nSkyBottomGreen[val] << " " << +CTimeCycle::m_nSkyBottomBlue[val] << " \t\t" + << "\t" << +m_nSkyBottomRed[val] << " " << +m_nSkyBottomGreen[val] << " " << +m_nSkyBottomBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_nSunCoreRed[val] << " " << +CTimeCycle::m_nSunCoreGreen[val] << " " << +CTimeCycle::m_nSunCoreBlue[val] << " \t\t" + << "\t" << +m_nSunCoreRed[val] << " " << +m_nSunCoreGreen[val] << " " << +m_nSunCoreBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_nSunCoronaRed[val] << " " << +CTimeCycle::m_nSunCoronaGreen[val] << " " << +CTimeCycle::m_nSunCoronaBlue[val] << " \t\t" + << "\t" << +m_nSunCoronaRed[val] << " " << +m_nSunCoronaGreen[val] << " " << +m_nSunCoronaBlue[val] << " \t\t" - << "\t" << (+CTimeCycle::m_fSunSize[val] - 0.5f) / 10.0f << " " << (+CTimeCycle::m_fSpriteSize[val] - 0.5f) / 10.0f << " " << (+CTimeCycle::m_fSpriteBrightness[val] - 0.5f) / 10.0f << " \t\t" + << "\t" << (+m_fSunSize[val] - 0.5f) / 10.0f << " " << (+m_fSpriteSize[val] - 0.5f) / 10.0f << " " << (+m_fSpriteBrightness[val] - 0.5f) / 10.0f << " \t\t" - << "\t" << +CTimeCycle::m_nShadowStrength[val] << " " << +CTimeCycle::m_nLightShadowStrength[val] << " " << +CTimeCycle::m_nPoleShadowStrength[val] << " \t\t" + << "\t" << +m_nShadowStrength[val] << " " << +m_nLightShadowStrength[val] << " " << +m_nPoleShadowStrength[val] << " \t\t" - << "\t" << +CTimeCycle::m_fFarClip[val] << " " << +CTimeCycle::m_fFogStart[val] << " " << (+CTimeCycle::m_fLightsOnGroundBrightness[val] - 0.5) / 10.0f << " \t\t" + << "\t" << +m_fFarClip[val] << " " << +m_fFogStart[val] << " " << (+m_fLightsOnGroundBrightness[val] - 0.5) / 10.0f << " \t\t" - << "\t" << +CTimeCycle::m_nLowCloudsRed[val] << " " << +CTimeCycle::m_nLowCloudsGreen[val] << " " << +CTimeCycle::m_nLowCloudsBlue[val] << " \t\t" + << "\t" << +m_nLowCloudsRed[val] << " " << +m_nLowCloudsGreen[val] << " " << +m_nLowCloudsBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_nFluffyCloudsBottomRed[val] << " " << +CTimeCycle::m_nFluffyCloudsBottomGreen[val] << " " << +CTimeCycle::m_nFluffyCloudsBottomBlue[val] << " \t\t" + << "\t" << +m_nFluffyCloudsBottomRed[val] << " " << +m_nFluffyCloudsBottomGreen[val] << " " << +m_nFluffyCloudsBottomBlue[val] << " \t\t" - << "\t" << +CTimeCycle::m_fWaterRed[val] << " " << +CTimeCycle::m_fWaterGreen[val] << " " << +CTimeCycle::m_fWaterBlue[val] << " " << +CTimeCycle::m_fWaterAlpha[val] << " \t\t" + << "\t" << +m_fWaterRed[val] << " " << +m_fWaterGreen[val] << " " << +m_fWaterBlue[val] << " " << +m_fWaterAlpha[val] << " \t\t" - << "\t" << +CTimeCycle::m_fPostFx1Alpha[val] << " " << +CTimeCycle::m_fPostFx1Red[val] << " " << +CTimeCycle::m_fPostFx1Green[val] << " " << +CTimeCycle::m_fPostFx1Blue[val] << " \t\t" + << "\t" << +m_fPostFx1Alpha[val] << " " << +m_fPostFx1Red[val] << " " << +m_fPostFx1Green[val] << " " << +m_fPostFx1Blue[val] << " \t\t" - << "\t" << +CTimeCycle::m_fPostFx2Alpha[val] << " " << +CTimeCycle::m_fPostFx2Red[val] << " " << +CTimeCycle::m_fPostFx2Green[val] << " " << +CTimeCycle::m_fPostFx2Blue[val] << " \t\t" + << "\t" << +m_fPostFx2Alpha[val] << " " << +m_fPostFx2Red[val] << " " << +m_fPostFx2Green[val] << " " << +m_fPostFx2Blue[val] << " \t\t" - << "\t" << +CTimeCycle::m_fCloudAlpha[val] << " " << +CTimeCycle::m_nHighLightMinIntensity[val] << " " << +CTimeCycle::m_nWaterFogAlpha[val] << " " << +CTimeCycle::m_nDirectionalMult[val] / 100.0 << " \t\t" << std::endl; + << "\t" << +m_fCloudAlpha[val] << " " << +m_nHighLightMinIntensity[val] << " " << +m_nWaterFogAlpha[val] << " " << +m_nDirectionalMult[val] / 100.0 << " \t\t" << std::endl; } } } @@ -341,20 +343,20 @@ void Visual::Main() ImGui::BeginChild("TimecycColors"); ImGui::Spacing(); - TimeCycColorEdit3("Ambient", CTimeCycle::m_nAmbientRed, CTimeCycle::m_nAmbientGreen, CTimeCycle::m_nAmbientBlue); - TimeCycColorEdit3("Ambient obj", CTimeCycle::m_nAmbientRed_Obj, CTimeCycle::m_nAmbientGreen_Obj, CTimeCycle::m_nAmbientBlue_Obj); - TimeCycColorEdit3("Fluffy clouds", CTimeCycle::m_nFluffyCloudsBottomRed , CTimeCycle::m_nFluffyCloudsBottomGreen, CTimeCycle::m_nFluffyCloudsBottomBlue); - TimeCycColorEdit3("Low clouds", CTimeCycle::m_nLowCloudsRed, CTimeCycle::m_nLowCloudsGreen, CTimeCycle::m_nLowCloudsBlue); + TimeCycColorEdit3("Ambient", m_nAmbientRed, m_nAmbientGreen, m_nAmbientBlue); + TimeCycColorEdit3("Ambient obj", m_nAmbientRed_Obj, m_nAmbientGreen_Obj, m_nAmbientBlue_Obj); + TimeCycColorEdit3("Fluffy clouds", m_nFluffyCloudsBottomRed , m_nFluffyCloudsBottomGreen, m_nFluffyCloudsBottomBlue); + TimeCycColorEdit3("Low clouds", m_nLowCloudsRed, m_nLowCloudsGreen, m_nLowCloudsBlue); - TimeCycColorEdit4("Postfx 1", CTimeCycle::m_fPostFx1Red, CTimeCycle::m_fPostFx1Green, CTimeCycle::m_fPostFx1Blue, CTimeCycle::m_fPostFx1Alpha); - TimeCycColorEdit4("Postfx 2", CTimeCycle::m_fPostFx2Red, CTimeCycle::m_fPostFx2Green, CTimeCycle::m_fPostFx2Blue, CTimeCycle::m_fPostFx1Alpha); + TimeCycColorEdit4("Postfx 1", m_fPostFx1Red, m_fPostFx1Green, m_fPostFx1Blue, m_fPostFx1Alpha); + TimeCycColorEdit4("Postfx 2", m_fPostFx2Red, m_fPostFx2Green, m_fPostFx2Blue, m_fPostFx1Alpha); - TimeCycColorEdit3("Sky bottom", CTimeCycle::m_nSkyBottomRed, CTimeCycle::m_nSkyBottomGreen, CTimeCycle::m_nSkyBottomBlue); - TimeCycColorEdit3("Sun core", CTimeCycle::m_nSunCoreRed, CTimeCycle::m_nSunCoreGreen, CTimeCycle::m_nSunCoreBlue); - TimeCycColorEdit3("Sun corona", CTimeCycle::m_nSunCoronaRed, CTimeCycle::m_nSunCoronaGreen, CTimeCycle::m_nSunCoronaBlue); - TimeCycColorEdit3("Sky top", CTimeCycle::m_nSkyTopRed, CTimeCycle::m_nSkyTopGreen, CTimeCycle::m_nSkyTopBlue); + TimeCycColorEdit3("Sky bottom", m_nSkyBottomRed, m_nSkyBottomGreen, m_nSkyBottomBlue); + TimeCycColorEdit3("Sun core", m_nSunCoreRed, m_nSunCoreGreen, m_nSunCoreBlue); + TimeCycColorEdit3("Sun corona", m_nSunCoronaRed, m_nSunCoronaGreen, m_nSunCoronaBlue); + TimeCycColorEdit3("Sky top", m_nSkyTopRed, m_nSkyTopGreen, m_nSkyTopBlue); - TimeCycColorEdit4("Water", CTimeCycle::m_fWaterRed, CTimeCycle::m_fWaterGreen, CTimeCycle::m_fWaterBlue, CTimeCycle::m_fWaterAlpha); + TimeCycColorEdit4("Water", m_fWaterRed, m_fWaterGreen, m_fWaterBlue, m_fWaterAlpha); ImGui::EndChild(); ImGui::EndTabItem(); @@ -362,21 +364,20 @@ void Visual::Main() if (ImGui::BeginTabItem("Misc")) { ImGui::BeginChild("TimecycMisc"); - ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() / 2); - TimecycSlider("Cloud alpha", CTimeCycle::m_fCloudAlpha, 0, 255); - TimecycSlider("Directional mult", CTimeCycle::m_nDirectionalMult , 0, 255); - TimecycSlider("Far clip", CTimeCycle::m_fFarClip, 0, 2000); - TimecycSlider("Fog start", CTimeCycle::m_fFogStart, 0, 2000); - TimecycSlider("High light min intensity", CTimeCycle::m_nHighLightMinIntensity, 0, 255); - TimecycSlider("Light on ground brightness", CTimeCycle::m_fLightsOnGroundBrightness, 0, 255); - TimecycSlider("Light shadow strength", CTimeCycle::m_nLightShadowStrength, 0, 255); - TimecycSlider("Pole shadow strength", CTimeCycle::m_nPoleShadowStrength, 0, 255); - TimecycSlider("Shadow strength", CTimeCycle::m_nShadowStrength, 0, 255); - TimecycSlider("Sprite brightness", CTimeCycle::m_fSpriteBrightness, -127, 127); - TimecycSlider("Sprite size", CTimeCycle::m_fSpriteSize, -127, 127); - TimecycSlider("Sun size", CTimeCycle::m_fSunSize, -127, 127); - TimecycSlider("Water fog alpha", CTimeCycle::m_nWaterFogAlpha, 0, 255); + TimecycSlider("Cloud alpha", m_fCloudAlpha, 0, 255); + TimecycSlider("Directional mult", m_nDirectionalMult , 0, 255); + TimecycSlider("Far clip", m_fFarClip, 0, 2000); + TimecycSlider("Fog start", m_fFogStart, 0, 2000); + TimecycSlider("High light min intensity", m_nHighLightMinIntensity, 0, 255); + TimecycSlider("Light on ground brightness", m_fLightsOnGroundBrightness, 0, 255); + TimecycSlider("Light shadow strength", m_nLightShadowStrength, 0, 255); + TimecycSlider("Pole shadow strength", m_nPoleShadowStrength, 0, 255); + TimecycSlider("Shadow strength", m_nShadowStrength, 0, 255); + TimecycSlider("Sprite brightness", m_fSpriteBrightness, 0, 127); + TimecycSlider("Sprite size", m_fSpriteSize, 0, 127); + TimecycSlider("Sun size", m_fSunSize, 0, 127); + TimecycSlider("Water fog alpha", m_nWaterFogAlpha, 0, 255); ImGui::PopItemWidth(); ImGui::Spacing(); diff --git a/src/Visual.h b/src/Visual.h index 4f9409f..0ffe42d 100644 --- a/src/Visual.h +++ b/src/Visual.h @@ -24,7 +24,9 @@ public: template void Visual::TimecycSlider(const char* label, T* data, int min, int max) { - int a = *data; + int val = 23 * GetCurrentHourTimeId() + CWeather::OldWeatherType; + int a = data[val]; + if (ImGui::SliderInt(label, &a, min, max)) - *data = a; + data[val] = (T)a; } \ No newline at end of file diff --git a/src/tests/Test.cpp b/src/tests/Test.cpp index ed89a84..7e2c68d 100644 --- a/src/tests/Test.cpp +++ b/src/tests/Test.cpp @@ -2,16 +2,6 @@ using namespace plugin; -_asm -{ - xor ebx, ebx - cmp eax, ebx - jz short loc_6D1CFD - call _ZN10CGameLogic17IsCoopGameGoingOnEv ; CGameLogic::IsCoopGameGoingOn(void) - test al, al - jnz short loc_6D1CC4 -} - class Test { public: @@ -19,7 +9,7 @@ public: { Events::initGameEvent += [] { - patch::ReplaceFunctionCall(0x6D1C80); + patch::PutRetn0(0x4B35A4); }; } } test;