From d201c5de7e65d315406f893b84a6be6ce443c150 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 31 Dec 2020 01:45:27 +0100 Subject: [PATCH] feat(TabOnline): Added set session weather --- BigBaseV2/src/function_types.hpp | 1 + BigBaseV2/src/gui/tab_bar/tab_online.cpp | 37 ++++++++++++++++++++++++ BigBaseV2/src/pointers.cpp | 5 ++++ BigBaseV2/src/pointers.hpp | 1 + 4 files changed, 44 insertions(+) diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index c9830038..f19f698a 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -13,6 +13,7 @@ namespace big::functions using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3); using get_player_name = char*(Player player); using script_event_handler = bool(void* events, CNetGamePlayer* sourcePlayer, CNetGamePlayer* targetPlayer); + using set_session_weather = void(char a1, int a2, int a3, int64_t a4); using sync_local_time = void(int h, int m); using trigger_script_event = int(bool unk0, uint64_t* args, int argCount, int bitFlags); } diff --git a/BigBaseV2/src/gui/tab_bar/tab_online.cpp b/BigBaseV2/src/gui/tab_bar/tab_online.cpp index fbc1b089..58050786 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_online.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_online.cpp @@ -4,6 +4,24 @@ namespace big { + const char* weatherTypes[] = { + "Sunny", + "Clear", + "Clouds", + "Smog", + "Fog", + "Overcast", + "Rain", + "Thunder", + "Clearing", + "Neatral (weird)", + "Snow", + "Blizzard", + "Light Snow", + "Christmas", + "Halloween" + }; + void tabbar::render_online() { if (ImGui::BeginTabItem("Online")) @@ -79,6 +97,25 @@ namespace big }QUEUE_JOB_END_CLAUSE } + ImGui::Text("Weather:"); + ImGui::BeginCombo("##weather", weatherTypes[g_temp.weather_type]); + for (uint8_t i = 0; i < IM_ARRAYSIZE(weatherTypes); i++) + { + bool is_selected = (g_temp.weather_type == i); + if (ImGui::Selectable(weatherTypes[i], is_selected)) + { + g_temp.weather_type = i; + + QUEUE_JOB_BEGIN_CLAUSE(=) + { + g_pointers->m_set_session_weather(1, i, 76, 0); + }QUEUE_JOB_END_CLAUSE + } + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + ImGui::TreePop(); } diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index dbddbc69..19e65d7c 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -78,6 +78,11 @@ namespace big m_sync_local_time = ptr.as(); }); + main_batch.add("Session Weather", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 30 40 8A E9", [this](memory::handle ptr) + { + m_set_session_weather = ptr.as(); + }); + main_batch.add("Get Player Name", "40 53 48 83 EC 20 80 3D ? ? ? ? ? 8B D9 74 22", [this](memory::handle ptr) { m_get_player_name = ptr.as(); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 4e70175c..680b6fd0 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -39,6 +39,7 @@ namespace big functions::get_player_name* m_get_player_name{}; functions::increment_stat_event* m_increment_stat_event{}; functions::script_event_handler* m_script_event_handler{}; + functions::set_session_weather* m_set_session_weather{}; functions::sync_local_time* m_sync_local_time{}; functions::trigger_script_event* m_trigger_script_event{}; };