From c22e55b99a38d405fb79184106261229bd2d1855 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 10 Jul 2014 16:52:29 +0200 Subject: Removed some unused code related to Quit button The button itself has been removed a long time ago --- src/common/event.cpp | 1 - src/common/event.h | 1 - src/common/restext.cpp | 1 - src/object/robotmain.cpp | 40 ---------------------------------------- src/ui/maindialog.cpp | 12 ------------ src/ui/studio.cpp | 10 ---------- 6 files changed, 65 deletions(-) (limited to 'src') diff --git a/src/common/event.cpp b/src/common/event.cpp index 9dc3943..9e23b18 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -67,7 +67,6 @@ void InitializeEventTypeTexts() EVENT_TYPE_TEXT[EVENT_BUTTON_CANCEL] = "EVENT_BUTTON_CANCEL"; EVENT_TYPE_TEXT[EVENT_BUTTON_NEXT] = "EVENT_BUTTON_NEXT"; EVENT_TYPE_TEXT[EVENT_BUTTON_PREV] = "EVENT_BUTTON_PREV"; - EVENT_TYPE_TEXT[EVENT_BUTTON_QUIT] = "EVENT_BUTTON_QUIT"; EVENT_TYPE_TEXT[EVENT_BUTTON0] = "EVENT_BUTTON0"; EVENT_TYPE_TEXT[EVENT_BUTTON1] = "EVENT_BUTTON1"; diff --git a/src/common/event.h b/src/common/event.h index c5eb615..1d2dbc9 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -90,7 +90,6 @@ enum EventType EVENT_BUTTON_CANCEL = 41, EVENT_BUTTON_NEXT = 42, EVENT_BUTTON_PREV = 43, - EVENT_BUTTON_QUIT = 44, EVENT_BUTTON0 = 50, EVENT_BUTTON1 = 51, diff --git a/src/common/restext.cpp b/src/common/restext.cpp index b63160d..37b1e9c 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -141,7 +141,6 @@ void InitializeRestext() stringsEvent[EVENT_BUTTON_CANCEL] = "Cancel"; stringsEvent[EVENT_BUTTON_NEXT] = "Next"; stringsEvent[EVENT_BUTTON_PREV] = "Previous"; - stringsEvent[EVENT_BUTTON_QUIT] = "Menu (\\key quit;)"; stringsEvent[EVENT_DIALOG_OK] = "OK"; stringsEvent[EVENT_DIALOG_CANCEL] = "Cancel"; diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 76c234d..83b9fc9 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -859,8 +859,6 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile) CBotProgram::DefineNum("ResearchSubber", RESEARCH_SUBM); CBotProgram::DefineNum("ResearchSniffer", RESEARCH_SNIFFER); -//? CBotProgram:: - CBotProgram::DefineNum("PolskiPortalColobota", 1337); CBotClass* bc; @@ -1215,14 +1213,6 @@ void CRobotMain::ChangePhase(Phase phase) m_app->ResetTimeAfterLoading(); - /*Math::Point ddim; - - pos.x = 620.0f/640.0f; - pos.y = 460.0f/480.0f; - ddim.x = 20.0f/640.0f; - ddim.y = 20.0f/480.0f; - m_interface->CreateButton(pos, ddim, 11, EVENT_BUTTON_QUIT);*/ - if (m_immediatSatCom && !loading && m_infoFilename[SATCOM_HUSTON][0] != 0) StartDisplayInfo(SATCOM_HUSTON, false); // shows the instructions @@ -1638,18 +1628,6 @@ bool CRobotMain::ProcessEvent(Event &event) m_cameraZoom = 0.0f; break; - case EVENT_BUTTON_QUIT: - if (m_movie->IsExist()) - StartDisplayInfo(SATCOM_HUSTON, false); - else if (m_winDelay > 0.0f) - ChangePhase(PHASE_WIN); - else if (m_lostDelay > 0.0f) - - ChangePhase(PHASE_LOST); - else - m_dialog->StartAbort(); // do you want to leave? - break; - case EVENT_OBJECT_LIMIT: StartShowLimit(); break; @@ -2189,12 +2167,6 @@ void CRobotMain::StartDisplayInfo(const char *filename, int index) m_sound->MuteAll(true); } - Ui::CButton* pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if (pb != nullptr) - { - pb->ClearState(Ui::STATE_VISIBLE); - } - bool soluce = m_dialog->GetSceneSoluce(); m_displayInfo = new Ui::CDisplayInfo(); @@ -2223,10 +2195,6 @@ void CRobotMain::StopDisplayInfo() if (!m_editLock) { - Ui::CButton* pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if (pb != nullptr) - pb->SetState(Ui::STATE_VISIBLE); - SelectObject(m_infoObject, false); // gives the command buttons m_displayText->HideText(false); @@ -2264,20 +2232,12 @@ void CRobotMain::StartSuspend() m_infoObject = DeselectAll(); // removes the control buttons m_displayText->HideText(true); - Ui::CButton* pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if (pb != nullptr) - pb->ClearState(Ui::STATE_VISIBLE); - m_suspend = true; } //! End of dialogue during the game void CRobotMain::StopSuspend() { - Ui::CButton* pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if (pb != nullptr) - pb->SetState(Ui::STATE_VISIBLE); - SelectObject(m_infoObject, false); // gives the command buttons m_map->ShowMap(m_mapShow); m_displayText->HideText(false); diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index 11f8f4a..e09e5a0 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -5852,12 +5852,6 @@ void CMainDialog::StartDialog(Math::Point dim, bool bFire, bool bOK, bool bCance pw = static_cast(m_interface->SearchControl(EVENT_WINDOW8)); if ( pw != 0 ) pw->ClearState(STATE_ENABLE); - pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if ( pb != 0 ) - { - pb->ClearState(STATE_VISIBLE); - } - m_bDialogFire = bFire; std::string name; @@ -6040,12 +6034,6 @@ void CMainDialog::StopDialog() pw = static_cast(m_interface->SearchControl(EVENT_WINDOW8)); if ( pw != 0 ) pw->SetState(STATE_ENABLE); - pb = static_cast(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if ( pb != 0 ) - { - pb->SetState(STATE_VISIBLE); - } - StopSuspend(); m_interface->DeleteControl(EVENT_WINDOW9); m_bDialog = false; diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index f83704e..91e4ea2 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -573,10 +573,6 @@ void CStudio::StartEditScript(CScript *script, std::string name, int rank) m_bRealTime = m_bRunning; m_script->SetStepMode(!m_bRealTime); - button = static_cast< CButton* >(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if (button != nullptr) - button->ClearState(STATE_VISIBLE); - pos = m_editFinalPos = m_editActualPos = m_main->GetWindowPos(); dim = m_editFinalDim = m_editActualDim = m_main->GetWindowDim(); pw = m_interface->CreateWindows(pos, dim, 8, EVENT_WINDOW3); @@ -877,12 +873,6 @@ bool CStudio::StopEditScript(bool bCancel) m_interface->DeleteControl(EVENT_WINDOW3); - button = static_cast< CButton* >(m_interface->SearchControl(EVENT_BUTTON_QUIT)); - if ( button != 0 ) - { - button->SetState(STATE_VISIBLE); - } - m_pause->SetPause(m_bInitPause); m_sound->MuteAll(false); m_main->SetEditLock(false, true); -- cgit v1.2.3-1-g7c22