17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 06:19:19 +02:00

Editor: brace ImGui clipper loops, rename scenery wizard file name field

This commit is contained in:
2026-10-10 19:55:50 +02:00
parent 21445507cc
commit 7d331ee65a
3 changed files with 59 additions and 55 deletions

View File

@@ -274,8 +274,8 @@ void ui::scenerywizard_panel::render_form()
ImGui::Spacing();
ImGui::SetNextItemWidth(-1.f);
ImGui::InputTextWithHint("##name", STR_C("file name, e.g. my_line"), m_name, sizeof(m_name), ImGuiInputTextFlags_CharsNoBlank);
std::string name{m_name};
ImGui::InputTextWithHint("##name", STR_C("file name, e.g. my_line"), m_filename, sizeof(m_filename), ImGuiInputTextFlags_CharsNoBlank);
std::string name{m_filename};
std::transform(name.begin(), name.end(), name.begin(), [](unsigned char const Character) { return static_cast<char>(std::tolower(Character)); });
auto const path{Global.asCurrentSceneryPath + name + ".scn"};
auto const named{valid_name(name)};
@@ -352,7 +352,7 @@ void ui::scenerywizard_panel::render_form()
bool ui::scenerywizard_panel::create_scenery()
{
std::string name{m_name};
std::string name{m_filename};
std::transform(name.begin(), name.end(), name.begin(), [](unsigned char const Character) { return static_cast<char>(std::tolower(Character)); });
auto const file{name + ".scn"};
std::ofstream output(Global.asCurrentSceneryPath + file, std::ios::binary);

View File

@@ -61,7 +61,7 @@ class scenerywizard_panel : public ui_panel
bool m_picked{false};
glm::dvec2 m_point{0.0};
char m_name[64]{};
char m_filename[64]{};
char m_title[128]{};
char m_latlon[64]{};
std::string m_status;