diff options
Diffstat (limited to 'src/ui/maindialog.cpp')
-rw-r--r-- | src/ui/maindialog.cpp | 129 |
1 files changed, 27 insertions, 102 deletions
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index 236c9a4..be48a2e 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -20,6 +20,7 @@ #include "common/global.h" #include "common/event.h" +#include "common/logger.h" #include "common/misc.h" #include "common/profile.h" #include "common/iman.h" @@ -53,9 +54,6 @@ namespace Ui const int KEY_VISIBLE = 6; // number of visible keys redefinable -/*TODO: #if _SCHOOL & _TEEN -const int KEY_TOTAL = 13; // total number of keys redefinable -#else*/ const int KEY_TOTAL = 21; // total number of keys redefinable const float WELCOME_LENGTH = 2.0f; @@ -100,36 +98,6 @@ static int perso_color[3*10*3] = }; -/* TODO: ? #if _NET -// Check if the key "school" is present in the registry. - -bool SchoolCheck() -{ - HKEY key; - char buffer[100]; - LONG i; - DWORD type, len; - - i = RegOpenKeyEx(HKEY_LOCAL_MACHINE, -#if _NEWLOOK - "Software\\Epsitec\\CeeBot\\Setup", -#else - "Software\\Epsitec\\Colobot\\Setup", -#endif - 0, KEY_READ, &key); - if ( i != ERROR_SUCCESS ) return false; - - type = REG_SZ; - len = sizeof(buffer); - i = RegQueryValueEx(key, "School", NULL, &type, (LPBYTE)buffer, &len); - if ( i != ERROR_SUCCESS || type != REG_SZ ) return false; - - if ( strcmp(buffer, "ToBoLoC") != 0 ) return false; - - return true; -} -#endif -*/ // Constructor of robot application. @@ -157,11 +125,7 @@ CMainDialog::CMainDialog(CInstanceManager* iMan) m_sceneRank = 0; m_bSceneSoluce = false; m_bSimulSetup = false; -/* TODO: ? #if _NET - m_accessEnable = SchoolCheck(); - m_accessMission= false; - m_accessUser = false; -#else*/ + m_accessEnable = true; m_accessMission= true; m_accessUser = true; @@ -363,14 +327,9 @@ void CMainDialog::ChangePhase(Phase phase) pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_DEFI); pb->SetState(STATE_SHADOW); - - /* TODO: setup mode? - if ( m_engine->GetSetupMode() ) - { - pos.y = oy+sy*5.1f; - pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_SETUP); - pb->SetState(STATE_SHADOW); - } */ + pos.y = oy+sy*5.1f; + pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_SETUP); + pb->SetState(STATE_SHADOW); pos.y = oy+sy*4.0f; pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_NAME); @@ -499,14 +458,12 @@ void CMainDialog::ChangePhase(Phase phase) pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_NOK); pb->SetState(STATE_SHADOW); -/* TODO: #if !_TEEN pos.x = 380.0f/640.0f; pos.y = 250.0f/480.0f; ddim.x =100.0f/640.0f; ddim.y = 52.0f/480.0f; pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PERSO); pb->SetState(STATE_SHADOW); -#endif*/ pos.x = 200.0f/640.0f; pos.y = 150.0f/480.0f; @@ -2037,7 +1994,7 @@ void CMainDialog::ChangePhase(Phase phase) // Processing an event. -// Geturns false if the event has been processed completely. +// Returns false if the event has been processed completely. bool CMainDialog::EventProcess(const Event &event) { @@ -2209,7 +2166,7 @@ bool CMainDialog::EventProcess(const Event &event) return false; } - if ( /*TODO: m_engine->GetMouseVisible() &&*/ + if ( /* m_engine->GetMouseVisible() && TODO: WTF ?! */ !m_interface->EventProcess(event) ) { return false; @@ -2786,8 +2743,11 @@ bool CMainDialog::EventProcess(const Event &event) break; case EVENT_INTERFACE_MOUSE: - m_engine->SetMouseVisible(!m_engine->GetMouseVisible()); - // TODO: system mouse visible + if (m_app->GetMouseMode() == MOUSE_ENGINE) + m_app->SetMouseMode(MOUSE_SYSTEM); + else if (m_app->GetMouseMode() == MOUSE_SYSTEM) + m_app->SetMouseMode(MOUSE_ENGINE); + ChangeSetupButtons(); UpdateSetupButtons(); break; @@ -3243,7 +3203,7 @@ void CMainDialog::GlintMove() } -// Geturns the position for a sound. +// Returns the position for a sound. Math::Vector SoundPos(Math::Point pos) { @@ -3256,7 +3216,7 @@ Math::Vector SoundPos(Math::Point pos) return s; } -// Geturns a random position for a sound. +// Returns a random position for a sound. Math::Vector SoundRand() { @@ -3643,7 +3603,7 @@ void CMainDialog::BuildResumeName(char *filename, char *base, int rank) sprintf(filename, "Scene %s %d", base, rank); } -// Geturns the name of the file or save the files. +// Returns the name of the file or save the files. char* CMainDialog::GetFilesDir() { @@ -4679,7 +4639,7 @@ bool CMainDialog::IOReadScene() } -// Geturns the number of accessible chapters. +// Returns the number of accessible chapters. int CMainDialog::GetChapPassed() { @@ -5968,21 +5928,6 @@ void CMainDialog::ChangeSetupQuality(int quality) static int key_table[KEY_TOTAL] = { -/* TODO: #if _SCHOOL & _TEEN - INPUT_SLOT_LEFT, - INPUT_SLOT_RIGHT, - INPUT_SLOT_UP, - INPUT_SLOT_DOWN, - INPUT_SLOT_CAMERA, - INPUT_SLOT_NEAR, - INPUT_SLOT_AWAY, - INPUT_SLOT_HELP, - INPUT_SLOT_PROG, - INPUT_SLOT_SPEED10, - INPUT_SLOT_SPEED15, - INPUT_SLOT_SPEED20, - INPUT_SLOT_QUIT, -#else */ INPUT_SLOT_LEFT, INPUT_SLOT_RIGHT, INPUT_SLOT_UP, @@ -6004,26 +5949,10 @@ static int key_table[KEY_TOTAL] = INPUT_SLOT_SPEED15, INPUT_SLOT_SPEED20, INPUT_SLOT_QUIT, -// #endif }; static EventType key_event[KEY_TOTAL] = { -/* TODO: #if _SCHOOL & _TEEN - EVENT_INTERFACE_KLEFT, - EVENT_INTERFACE_KRIGHT, - EVENT_INTERFACE_KUP, - EVENT_INTERFACE_KDOWN, - EVENT_INTERFACE_KCAMERA, - EVENT_INTERFACE_KNEAR, - EVENT_INTERFACE_KAWAY, - EVENT_INTERFACE_KHELP, - EVENT_INTERFACE_KPROG, - EVENT_INTERFACE_KSPEED10, - EVENT_INTERFACE_KSPEED15, - EVENT_INTERFACE_KSPEED20, - EVENT_INTERFACE_KQUIT, -#else */ EVENT_INTERFACE_KLEFT, EVENT_INTERFACE_KRIGHT, EVENT_INTERFACE_KUP, @@ -6045,7 +5974,6 @@ static EventType key_event[KEY_TOTAL] = EVENT_INTERFACE_KSPEED15, EVENT_INTERFACE_KSPEED20, EVENT_INTERFACE_KQUIT, -//#endif }; // Updates the list of keys. @@ -6179,13 +6107,9 @@ void CMainDialog::StartAbort() pb->SetState(STATE_WARNING); } - /* TODO: setup mode? - if ( m_engine->GetSetupMode() ) - { - pos.y = 0.39f; - pb = pw->CreateButton(pos, dim, -1, EVENT_INTERFACE_SETUP); - pb->SetState(STATE_SHADOW); - }*/ + pos.y = 0.39f; + pb = pw->CreateButton(pos, dim, -1, EVENT_INTERFACE_SETUP); + pb->SetState(STATE_SHADOW); pos.y = 0.25f; pb = pw->CreateButton(pos, dim, -1, EVENT_INTERFACE_AGAIN); @@ -6591,7 +6515,7 @@ void CMainDialog::SetSceneRead(const char* name) strcpy(m_sceneRead, name); } -// Geturns the name of the scene to read. +// Returns the name of the scene to read. char* CMainDialog::GetSceneRead() { @@ -6605,7 +6529,7 @@ void CMainDialog::SetStackRead(const char* name) strcpy(m_stackRead, name); } -// Geturns the name of the scene to read. +// Returns the name of the scene to read. char* CMainDialog::GetStackRead() { @@ -6619,7 +6543,7 @@ void CMainDialog::SetSceneName(const char* name) strcpy(m_sceneName, name); } -// Geturns the name of the chosen to play scene. +// Returns the name of the chosen to play scene. char* CMainDialog::GetSceneName() { @@ -6633,14 +6557,14 @@ void CMainDialog::SetSceneRank(int rank) m_sceneRank = rank; } -// Geturns the rank of the chosen to play scene. +// Returns the rank of the chosen to play scene. int CMainDialog::GetSceneRank() { return m_sceneRank; } -// Geturns folder name of the scene that user selected to play. +// Returns folder name of the scene that user selected to play. char* CMainDialog::GetSceneDir() { @@ -6659,14 +6583,14 @@ bool CMainDialog::GetSceneSoluce() return m_bSceneSoluce; } -// Geturns the name of the folder to save. +// Returns the name of the folder to save. char* CMainDialog::GetSavegameDir() { return m_savegameDir; } -// Geturns the name of public folder. +// Returns the name of public folder. char* CMainDialog::GetPublicDir() { @@ -6966,5 +6890,6 @@ bool CMainDialog::NextMission() return true; } + } // namespace Ui |