diff --git a/src/editor/C4Console.cpp b/src/editor/C4Console.cpp index 0597004a4..f51149c9b 100644 --- a/src/editor/C4Console.cpp +++ b/src/editor/C4Console.cpp @@ -134,9 +134,9 @@ void C4Console::DoHalt() Game.Pause(); } -bool C4Console::UpdateStatusBars() +void C4Console::UpdateStatusBars() { - if (!Active) return false; + if (!Active) return; // Frame counter if (Game.FrameCounter!=FrameCounter) { @@ -162,7 +162,6 @@ bool C4Console::UpdateStatusBars() str.Format("%02d:%02d:%02d (%i FPS)",Time/3600,(Time%3600)/60,Time%60,FPS); C4ConsoleGUI::DisplayInfoText(CONSOLE_TimeFPS, str); } - return true; } bool C4Console::SaveGame(bool fSaveGame) diff --git a/src/editor/C4Console.h b/src/editor/C4Console.h index b0d449932..7dfabc030 100644 --- a/src/editor/C4Console.h +++ b/src/editor/C4Console.h @@ -74,7 +74,7 @@ public: bool CloseGame(); bool UpdatePlayerMenu(); bool UpdateViewportMenu(); - bool UpdateStatusBars(); + void UpdateStatusBars(); // Menu void ClearViewportMenu(); void UpdateNetMenu(); diff --git a/src/editor/C4ConsoleGTK.cpp b/src/editor/C4ConsoleGTK.cpp index 48217475f..89b133f63 100644 --- a/src/editor/C4ConsoleGTK.cpp +++ b/src/editor/C4ConsoleGTK.cpp @@ -626,10 +626,15 @@ void C4ConsoleGUI::State::Clear() } void C4ConsoleGUI::DisplayInfoText(InfoTextType type, StdStrBuf& text) -{ +{ + if (!Active) + return; GtkWidget* label; switch (type) { + case CONSOLE_Cursor: + label = state->lblCursor; + break; case CONSOLE_FrameCounter: label = state->lblFrame; break; @@ -680,14 +685,6 @@ void C4ConsoleGUI::ShowAboutWithCopyright(StdStrBuf ©right) gtk_show_about_dialog(GTK_WINDOW(window), "name", C4ENGINECAPTION, "version", C4VERSION, "copyright", copyright.getData(), NULL); } -bool C4ConsoleGUI::UpdateCursorBar(const char *szCursor) -{ - if (!Active) - return false; - gtk_label_set_label(GTK_LABEL(state->lblCursor), szCursor); - return true; -} - bool C4ConsoleGUI::UpdateModeCtrls(int iMode) { if (!Active) diff --git a/src/editor/C4ConsoleGUI.h b/src/editor/C4ConsoleGUI.h index c8164385e..c2c2bb011 100644 --- a/src/editor/C4ConsoleGUI.h +++ b/src/editor/C4ConsoleGUI.h @@ -58,6 +58,7 @@ public: enum InfoTextType { + CONSOLE_Cursor, CONSOLE_FrameCounter, CONSOLE_ScriptCounter, CONSOLE_TimeFPS @@ -90,7 +91,6 @@ public: void SetCursor(Cursor cursor); void RecordingEnabled(); void ShowAboutWithCopyright(StdStrBuf ©right); - bool UpdateCursorBar(const char *szCursor); bool UpdateModeCtrls(int iMode); void UpdateNetMenu(Stage stage); void ClearNetMenu(Stage stage); diff --git a/src/editor/C4ConsoleWin32.cpp b/src/editor/C4ConsoleWin32.cpp index b3a48ed43..fb034f166 100644 --- a/src/editor/C4ConsoleWin32.cpp +++ b/src/editor/C4ConsoleWin32.cpp @@ -728,9 +728,14 @@ void C4ConsoleGUI::SetCaptionToFileName(const char* file_name) void C4ConsoleGUI::DisplayInfoText(C4ConsoleGUI::InfoTextType type, StdStrBuf& text) { + if (!Active) + return; int dialog_item; switch (type) { + case CONSOLE_Cursor: + dialog_item = IDC_STATICCURSOR; + break; case CONSOLE_FrameCounter: dialog_item = IDC_STATICFRAME; break; @@ -763,16 +768,6 @@ void C4ConsoleGUI::ShowAboutWithCopyright(StdStrBuf ©right) MessageBox(NULL, strMessage.getData(), C4ENGINECAPTION, MB_ICONINFORMATION | MB_TASKMODAL); } -bool C4ConsoleGUI::UpdateCursorBar(const char *szCursor) -{ - if (!Active) - return false; - // Cursor - SetDlgItemText(hWindow,IDC_STATICCURSOR,szCursor); - UpdateWindow(GetDlgItem(hWindow,IDC_STATICCURSOR)); - return true; -} - bool C4ConsoleGUI::FileSelect(char *sFilename, int iSize, const char * szFilter, DWORD dwFlags, bool fSave) { OPENFILENAME ofn; diff --git a/src/editor/C4EditCursor.cpp b/src/editor/C4EditCursor.cpp index 5ee8b51bd..a58abfa7c 100644 --- a/src/editor/C4EditCursor.cpp +++ b/src/editor/C4EditCursor.cpp @@ -187,7 +187,7 @@ bool C4EditCursor::Move(float iX, float iY, WORD wKeyFlags) return true; } -bool C4EditCursor::UpdateStatusBar() +void C4EditCursor::UpdateStatusBar() { int32_t X=this->X, Y=this->Y; StdStrBuf str; @@ -207,7 +207,7 @@ bool C4EditCursor::UpdateStatusBar() break; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - return Console.UpdateCursorBar(str.getData()); + Console.DisplayInfoText(C4ConsoleGUI::CONSOLE_Cursor, str); } void C4EditCursor::OnSelectionChanged() diff --git a/src/editor/C4EditCursor.h b/src/editor/C4EditCursor.h index e887ffe1f..d6cbd6582 100644 --- a/src/editor/C4EditCursor.h +++ b/src/editor/C4EditCursor.h @@ -82,7 +82,7 @@ public: bool AltDown(); bool AltUp(); protected: - bool UpdateStatusBar(); + void UpdateStatusBar(); void ApplyToolPicker(); void ToolFailure(); void PutContents();