2020-12-02 16:19:16 -05:00
|
|
|
#pragma once
|
|
|
|
class Visual
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static bool lock_weather;
|
|
|
|
static int weather_type_backup;
|
|
|
|
|
|
|
|
// Timecyc
|
|
|
|
static std::vector<std::string> weather_names;
|
|
|
|
static int timecyc_hour;
|
|
|
|
|
|
|
|
static void GenerateTimecycFile();
|
|
|
|
static int GetCurrentHourTimeId();
|
2021-02-24 16:54:45 -05:00
|
|
|
static bool TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b, ImGuiColorEditFlags flags = 0);
|
|
|
|
static bool TimeCycColorEdit4(const char* label, uchar* r, uchar* g, uchar* b, uchar* a, ImGuiColorEditFlags flags = 0);
|
2020-12-02 16:19:16 -05:00
|
|
|
template<typename T>
|
|
|
|
static void TimecycSlider(const char* label, T* data, int min, int max);
|
|
|
|
public:
|
|
|
|
Visual();
|
|
|
|
~Visual();
|
2021-02-24 16:54:45 -05:00
|
|
|
static void Draw();
|
2020-12-02 16:19:16 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T>
|
2021-02-19 12:23:08 -05:00
|
|
|
void Visual::TimecycSlider(const char* label, T* ptr, int min, int max)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-02-01 08:31:20 -05:00
|
|
|
int val = 23 * GetCurrentHourTimeId() + CWeather::OldWeatherType;
|
2021-02-24 16:54:45 -05:00
|
|
|
T* arr = (T*)patch::GetPointer(int(ptr));
|
2021-02-19 12:23:08 -05:00
|
|
|
int a = arr[val];
|
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
if (ImGui::SliderInt(label, &a, min, max))
|
2021-02-19 12:23:08 -05:00
|
|
|
arr[val] = (T)a;
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|