Merge branch 'milek-dev' into gfx-work

This commit is contained in:
milek7
2019-03-16 02:28:36 +01:00
35 changed files with 2358 additions and 1764 deletions

View File

@@ -23,6 +23,7 @@ driver_ui::driver_ui() {
clear_panels();
// bind the panels with ui object. maybe not the best place for this but, eh
push_back( &m_aidpanel );
push_back( &m_scenariopanel );
push_back( &m_timetablepanel );
push_back( &m_debugpanel );
push_back( &m_transcriptspanel );
@@ -35,6 +36,10 @@ driver_ui::driver_ui() {
m_aidpanel.title = locale::strings[ locale::string::driver_aid_header ];
m_scenariopanel.title = locale::strings[ locale::string::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.size_min = { 435, 110 };
m_timetablepanel.size_max = { 435, Global.iWindowHeight * 0.95 };
@@ -50,7 +55,7 @@ void driver_ui::render_menu_contents() {
if (ImGui::BeginMenu(locale::strings[locale::string::ui_mode_windows].c_str()))
{
ImGui::MenuItem(m_aidpanel.title.c_str(), "F1", &m_aidpanel.is_open);
ImGui::MenuItem(m_timetablepanel.title.c_str(), "F2", &m_timetablepanel.is_open);
ImGui::MenuItem(locale::strings[locale::string::driver_timetable_name].c_str(), "F2", &m_timetablepanel.is_open);
ImGui::MenuItem(m_debugpanel.get_name().c_str(), "F12", &m_debugpanel.is_open);
ImGui::MenuItem(m_mappanel.get_name().c_str(), "Tab", &m_mappanel.is_open);
@@ -72,6 +77,7 @@ driver_ui::on_key( int const Key, int const Action ) {
case GLFW_KEY_TAB:
case GLFW_KEY_F1:
case GLFW_KEY_F2:
case GLFW_KEY_F3:
case GLFW_KEY_F10:
case GLFW_KEY_F12: { // ui mode selectors
@@ -125,6 +131,12 @@ driver_ui::on_key( int const Key, int const Action ) {
return true;
}
case GLFW_KEY_F3: {
// debug panel
m_scenariopanel.is_open = !m_scenariopanel.is_open;
return true;
}
case GLFW_KEY_F12: {
// debug panel
m_debugpanel.is_open = !m_debugpanel.is_open;