feat(session): Add Local Weather Options (#123)
Co-authored-by: LiamD-Flop <contact@liamd.me>
This commit is contained in:
parent
c659f68ab5
commit
0efb118349
@ -132,7 +132,9 @@ namespace big
|
|||||||
|
|
||||||
struct session
|
struct session
|
||||||
{
|
{
|
||||||
|
int local_weather = 0;
|
||||||
bool override_time = {};
|
bool override_time = {};
|
||||||
|
bool override_weather = false;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int hour{}, minute{}, second{};
|
int hour{}, minute{}, second{};
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "core/data/session_types.hpp"
|
#include "core/data/session_types.hpp"
|
||||||
#include "script_global.hpp"
|
#include "script_global.hpp"
|
||||||
#include "script.hpp"
|
#include "script.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
|
||||||
namespace big::session
|
namespace big::session
|
||||||
{
|
{
|
||||||
@ -16,4 +17,15 @@ namespace big::session
|
|||||||
script::get_current()->yield(200ms);
|
script::get_current()->yield(200ms);
|
||||||
*script_global(1574587).as<int*>() = 0;
|
*script_global(1574587).as<int*>() = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr char const* weathers[] = { "EXTRASUNNY", "CLEAR", "CLOUDS", "SMOG", "FOGGY", "OVERCAST", "RAIN", "THUNDER", "CLEARING", "NEUTRAL", "SNOW", "BLIZZARD", "SNOWLIGHT", "XMAS", "HALLOWEEN" };
|
||||||
|
|
||||||
|
void local_weather()
|
||||||
|
{
|
||||||
|
MISC::CLEAR_OVERRIDE_WEATHER();
|
||||||
|
|
||||||
|
MISC::SET_OVERRIDE_WEATHER(weathers[g->session.local_weather]);
|
||||||
|
|
||||||
|
*script_global(262145).at(4723).as<bool*>() = g->session.local_weather == 13;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "fiber_pool.hpp"
|
||||||
#include "util/session.hpp"
|
#include "util/session.hpp"
|
||||||
#include "views/view.hpp"
|
#include "views/view.hpp"
|
||||||
|
|
||||||
@ -64,6 +65,26 @@ namespace big
|
|||||||
ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59);
|
ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
if (ImGui::TreeNode("Local Weather"))
|
||||||
|
{
|
||||||
|
if (ImGui::Button("Clear Override"))
|
||||||
|
{
|
||||||
|
g_fiber_pool->queue_job([]
|
||||||
|
{
|
||||||
|
MISC::CLEAR_OVERRIDE_WEATHER();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::ListBox("", &g->session.local_weather, session::weathers, 15))
|
||||||
|
{
|
||||||
|
g_fiber_pool->queue_job([]
|
||||||
|
{
|
||||||
|
session::local_weather();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user