mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge pull request #44 from jerrrrycho/trivia-remove-legacy-randomization
remove legacy background loading
This commit is contained in:
@@ -15,7 +15,6 @@ launcher_ui::launcher_ui() : m_scenery_scanner(m_vehicles_bank), m_scenerylist_p
|
|||||||
open_panel(&m_vehiclepicker_panel);
|
open_panel(&m_vehiclepicker_panel);
|
||||||
m_suppress_menu = true;
|
m_suppress_menu = true;
|
||||||
|
|
||||||
load_random_background();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool launcher_ui::on_key(const int Key, const int Action)
|
bool launcher_ui::on_key(const int Key, const int Action)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ using json = nlohmann::json;
|
|||||||
scenarioloader_ui::scenarioloader_ui()
|
scenarioloader_ui::scenarioloader_ui()
|
||||||
{
|
{
|
||||||
m_suppress_menu = true;
|
m_suppress_menu = true;
|
||||||
load_random_background();
|
|
||||||
generate_gradient_tex();
|
generate_gradient_tex();
|
||||||
load_wheel_frames();
|
load_wheel_frames();
|
||||||
|
|
||||||
|
|||||||
14
uilayer.cpp
14
uilayer.cpp
@@ -129,20 +129,6 @@ bool ui_layer::mouse_button_callback(int button, int action, int mods)
|
|||||||
return m_imguiio->WantCaptureMouse;
|
return m_imguiio->WantCaptureMouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_layer::load_random_background()
|
|
||||||
{
|
|
||||||
std::vector<std::string> images;
|
|
||||||
for (auto &f : std::filesystem::directory_iterator("textures/logo"))
|
|
||||||
if (f.is_regular_file())
|
|
||||||
images.emplace_back(std::filesystem::relative(f.path(), "textures/").string());
|
|
||||||
|
|
||||||
if (!images.empty())
|
|
||||||
{
|
|
||||||
std::string &selected = images[std::lround(LocalRandom(images.size() - 1))];
|
|
||||||
set_background(selected);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static ImVec4 imvec_lerp(const ImVec4 &a, const ImVec4 &b, float t)
|
static ImVec4 imvec_lerp(const ImVec4 &a, const ImVec4 &b, float t)
|
||||||
{
|
{
|
||||||
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t);
|
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t);
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ protected:
|
|||||||
static ImGuiIO *m_imguiio;
|
static ImGuiIO *m_imguiio;
|
||||||
static bool m_cursorvisible;
|
static bool m_cursorvisible;
|
||||||
|
|
||||||
void load_random_background();
|
|
||||||
virtual void render_menu_contents();
|
virtual void render_menu_contents();
|
||||||
ui_log_panel m_logpanel { "Log", true };
|
ui_log_panel m_logpanel { "Log", true };
|
||||||
bool m_suppress_menu = false; // if `true`, the menu at the top of the window will not be present
|
bool m_suppress_menu = false; // if `true`, the menu at the top of the window will not be present
|
||||||
|
|||||||
Reference in New Issue
Block a user