This commit is contained in:
milek7
2019-07-02 15:33:49 +02:00
parent d039207b03
commit a0c44fbaa3
15 changed files with 140 additions and 135 deletions

View File

@@ -37,17 +37,17 @@ driver_ui::driver_ui() {
add_external_panel( &m_cameraviewpanel );
m_logpanel.is_open = false;
m_aidpanel.title = locale::strings[ locale::string::driver_aid_header ];
m_aidpanel.title = STR(driver_aid_header);
m_scenariopanel.title = locale::strings[ locale::string::driver_scenario_header ];
m_scenariopanel.title = STR(driver_scenario_header);
m_scenariopanel.size_min = { 435, 85 };
m_scenariopanel.size_max = { Global.iWindowWidth * 0.95, Global.iWindowHeight * 0.95 };
m_timetablepanel.title = locale::strings[ locale::string::driver_timetable_header ];
m_timetablepanel.title = STR(driver_timetable_header);
m_timetablepanel.size_min = { 435, 110 };
m_timetablepanel.size_max = { 435, Global.iWindowHeight * 0.95 };
m_transcriptspanel.title = locale::strings[ locale::string::driver_transcripts_header ];
m_transcriptspanel.title = STR(driver_transcripts_header);
m_transcriptspanel.size_min = { 435, 85 };
m_transcriptspanel.size_max = { Global.iWindowWidth * 0.95, Global.iWindowHeight * 0.95 };
}
@@ -55,10 +55,10 @@ driver_ui::driver_ui() {
void driver_ui::render_menu_contents() {
ui_layer::render_menu_contents();
if (ImGui::BeginMenu(locale::strings[locale::string::ui_mode_windows].c_str()))
if (ImGui::BeginMenu(STR_C(ui_mode_windows)))
{
ImGui::MenuItem(m_aidpanel.title.c_str(), "F1", &m_aidpanel.is_open);
ImGui::MenuItem(locale::strings[locale::string::driver_timetable_name].c_str(), "F2", &m_timetablepanel.is_open);
ImGui::MenuItem(STR_C(driver_timetable_name), "F2", &m_timetablepanel.is_open);
ImGui::MenuItem(m_debugpanel.name().c_str(), "F12", &m_debugpanel.is_open);
ImGui::MenuItem(m_mappanel.name().c_str(), "Tab", &m_mappanel.is_open);
ImGui::MenuItem(m_vehiclelist.name().c_str(), nullptr, &m_vehiclelist.is_open);
@@ -192,7 +192,7 @@ driver_ui::update() {
if( ( train != nullptr ) && ( false == FreeFlyModeFlag ) ) {
if( false == DebugModeFlag ) {
// in regular mode show control functions, for defined controls
set_tooltip( locale::label_cab_control( train->GetLabel( GfxRenderer.get_picked_control() ) ) );
set_tooltip( Translations.label_cab_control( train->GetLabel( GfxRenderer.get_picked_control() ) ) );
}
else {
// in debug mode show names of submodels, to help with cab setup and/or debugging
@@ -228,18 +228,18 @@ driver_ui::set_cursor( bool const Visible ) {
void
driver_ui::render_() {
// pause/quit modal
auto const popupheader { locale::strings[ locale::string::driver_pause_header ].c_str() };
auto const popupheader { STR_C(driver_pause_header) };
if (m_paused && !m_pause_modal_opened)
{
m_pause_modal_opened = true;
ImGui::OpenPopup(popupheader);
}
if( ImGui::BeginPopupModal( popupheader, &m_pause_modal_opened, ImGuiWindowFlags_AlwaysAutoResize ) ) {
auto const popupwidth{ locale::strings[ locale::string::driver_pause_header ].size() * 7 };
if( ImGui::Button( locale::strings[ locale::string::driver_pause_resume ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
auto const popupwidth{ STR(driver_pause_header).size() * 7 };
if( ImGui::Button( STR_C(driver_pause_resume), ImVec2( popupwidth, 0 ) ) ) {
m_relay.post(user_command::pausetoggle, 0.0, 0.0, GLFW_PRESS, 0);
}
if( ImGui::Button( locale::strings[ locale::string::driver_pause_quit ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
if( ImGui::Button( STR_C(driver_pause_quit), ImVec2( popupwidth, 0 ) ) ) {
m_relay.post(user_command::quitsimulation, 0.0, 0.0, GLFW_PRESS, 0);
}
if (!m_paused)