From 4aa4f3460a05d63a85f794650e49fa0de7baf143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Tue, 5 Dec 2023 21:29:13 +0100 Subject: [PATCH] Removed the uicustomcontrol file --- src/smw/CMakeLists.txt | 2 - src/smw/GSMenu.cpp | 2 + src/smw/GSMenu.h | 6 ++- src/smw/menu/WorldMenu.cpp | 1 - src/smw/menu/network/NetLobbyMenu.cpp | 2 + src/smw/menu/network/NetLobbyMenu.h | 33 ++++++------ src/smw/menu/network/NetServersMenu.cpp | 2 + src/smw/menu/network/NetServersMenu.h | 41 +++++++-------- src/smw/menu/options/PowerupSettingsMenu.cpp | 2 + src/smw/menu/options/PowerupSettingsMenu.h | 48 +++++++++-------- src/smw/uicustomcontrol.cpp | 54 -------------------- src/smw/uicustomcontrol.h | 25 --------- 12 files changed, 69 insertions(+), 149 deletions(-) delete mode 100644 src/smw/uicustomcontrol.cpp delete mode 100644 src/smw/uicustomcontrol.h diff --git a/src/smw/CMakeLists.txt b/src/smw/CMakeLists.txt index 1d31ed6ed..4cef10294 100644 --- a/src/smw/CMakeLists.txt +++ b/src/smw/CMakeLists.txt @@ -27,8 +27,6 @@ add_executable(smw WIN32 objecthazard.h player.cpp player.h - uicustomcontrol.cpp - uicustomcontrol.h world.cpp world.h diff --git a/src/smw/GSMenu.cpp b/src/smw/GSMenu.cpp index e0168ed5e..1f32c720e 100644 --- a/src/smw/GSMenu.cpp +++ b/src/smw/GSMenu.cpp @@ -12,10 +12,12 @@ #include "Score.h" #include "ui/MI_BonusWheel.h" #include "ui/MI_MapBrowser.h" +#include "ui/MI_MapField.h" #include "ui/MI_MapFilterScroll.h" #include "ui/MI_TournamentScoreboard.h" #include "ui/MI_TourStop.h" #include "ui/MI_World.h" +#include "world.h" #include "menu/BonusWheelMenu.h" #include "menu/GameSettingsMenu.h" diff --git a/src/smw/GSMenu.h b/src/smw/GSMenu.h index b7620760d..54cea401d 100644 --- a/src/smw/GSMenu.h +++ b/src/smw/GSMenu.h @@ -1,10 +1,12 @@ #ifndef GAMESTATE_MENU_H #define GAMESTATE_MENU_H -#include "uicustomcontrol.h" - #include "GameState.h" +#include + +class UI_Menu; + class UI_BonusWheelMenu; class UI_GameSettingsMenu; class UI_MainMenu; diff --git a/src/smw/menu/WorldMenu.cpp b/src/smw/menu/WorldMenu.cpp index bd5d2fa90..762eef007 100644 --- a/src/smw/menu/WorldMenu.cpp +++ b/src/smw/menu/WorldMenu.cpp @@ -7,7 +7,6 @@ #include "ui/MI_Text.h" #include "ui/MI_TourStop.h" #include "ui/MI_World.h" -#include "uicustomcontrol.h" extern CResourceManager* rm; extern CGameValues game_values; diff --git a/src/smw/menu/network/NetLobbyMenu.cpp b/src/smw/menu/network/NetLobbyMenu.cpp index bbb3ddc4a..b20fa8a61 100644 --- a/src/smw/menu/network/NetLobbyMenu.cpp +++ b/src/smw/menu/network/NetLobbyMenu.cpp @@ -2,9 +2,11 @@ #include "net.h" #include "ResourceManager.h" +#include "ui/MI_Button.h" #include "ui/MI_Image.h" #include "ui/MI_Text.h" #include "ui/MI_TextField.h" +#include "ui/NetworkListScroll.h" extern CResourceManager* rm; diff --git a/src/smw/menu/network/NetLobbyMenu.h b/src/smw/menu/network/NetLobbyMenu.h index b7795a189..6b8168f18 100644 --- a/src/smw/menu/network/NetLobbyMenu.h +++ b/src/smw/menu/network/NetLobbyMenu.h @@ -1,17 +1,18 @@ -#ifndef MENU_NETLOBBY_H -#define MENU_NETLOBBY_H +#pragma once #include "uimenu.h" -#include "uicustomcontrol.h" +class MI_Button; +class MI_Image; +class MI_NetworkListScroll; +class MI_Text; class MI_TextField; /* Description. */ -class UI_NetLobbyMenu : public UI_Menu -{ +class UI_NetLobbyMenu : public UI_Menu { public: UI_NetLobbyMenu(); ~UI_NetLobbyMenu(); @@ -21,19 +22,17 @@ class UI_NetLobbyMenu : public UI_Menu void Restore(); private: - MI_NetworkListScroll * miNetLobbyScroll; + MI_NetworkListScroll* miNetLobbyScroll = nullptr; - MI_Button * miNetLobbyNewRoomButton; - MI_TextField * miNetLobbyFilterField; - MI_Button * miNetLobbyRefreshButton; - MI_Button * miNetLobbyBackButton; + MI_Button* miNetLobbyNewRoomButton = nullptr; + MI_TextField* miNetLobbyFilterField = nullptr; + MI_Button* miNetLobbyRefreshButton = nullptr; + MI_Button* miNetLobbyBackButton = nullptr; - MI_Image * miNetLobbyJoiningDialogImage; - MI_Text * miNetLobbyJoiningDialogText; + MI_Image* miNetLobbyJoiningDialogImage = nullptr; + MI_Text* miNetLobbyJoiningDialogText = nullptr; - MI_Image * miNetLobbyLeftHeaderBar; - MI_Image * miNetLobbyRightHeaderBar; - MI_Text * miNetLobbyHeaderText; + MI_Image* miNetLobbyLeftHeaderBar = nullptr; + MI_Image* miNetLobbyRightHeaderBar = nullptr; + MI_Text* miNetLobbyHeaderText = nullptr; }; - -#endif // MENU_NETLOBBY_H diff --git a/src/smw/menu/network/NetServersMenu.cpp b/src/smw/menu/network/NetServersMenu.cpp index ad767ecb7..68632c4f9 100644 --- a/src/smw/menu/network/NetServersMenu.cpp +++ b/src/smw/menu/network/NetServersMenu.cpp @@ -2,9 +2,11 @@ #include "net.h" #include "ResourceManager.h" +#include "ui/MI_Button.h" #include "ui/MI_Image.h" #include "ui/MI_Text.h" #include "ui/MI_TextField.h" +#include "ui/NetworkListScroll.h" extern CResourceManager* rm; diff --git a/src/smw/menu/network/NetServersMenu.h b/src/smw/menu/network/NetServersMenu.h index de1fa9d90..633968c51 100644 --- a/src/smw/menu/network/NetServersMenu.h +++ b/src/smw/menu/network/NetServersMenu.h @@ -1,18 +1,15 @@ -#ifndef MENU_NETSERVERS_H -#define MENU_NETSERVERS_H +#pragma once #include "uimenu.h" -#include "uicontrol.h" -#include "uicustomcontrol.h" +class MI_Button; +class MI_Image; +class MI_NetworkListScroll; +class MI_Text; class MI_TextField; -/* - Description. -*/ -class UI_NetServersMenu : public UI_Menu -{ +class UI_NetServersMenu : public UI_Menu { public: UI_NetServersMenu(); ~UI_NetServersMenu(); @@ -24,21 +21,19 @@ class UI_NetServersMenu : public UI_Menu void RefreshScroll(); private: - MI_Button * miNetServersSelectButton; - MI_Text * miNetServersSelectedHostText; - MI_Button * miNetServersConnectButton; - MI_Button * miNetServersAddRemoveButton; - MI_TextField * miNetServersNicknameField; - MI_Button * miNetServersBackButton; + MI_Button* miNetServersSelectButton = nullptr; + MI_Text* miNetServersSelectedHostText = nullptr; + MI_Button* miNetServersConnectButton = nullptr; + MI_Button* miNetServersAddRemoveButton = nullptr; + MI_TextField* miNetServersNicknameField = nullptr; + MI_Button* miNetServersBackButton = nullptr; - MI_NetworkListScroll * miNetServersScroll; + MI_NetworkListScroll* miNetServersScroll = nullptr; - MI_Image * miNetServersConnectingDialogImage; - MI_Text * miNetServersConnectingDialogText; + MI_Image* miNetServersConnectingDialogImage = nullptr; + MI_Text* miNetServersConnectingDialogText = nullptr; - MI_Image * miNetServersLeftHeaderBar; - MI_Image * miNetServersRightHeaderBar; - MI_Text * miNetServersHeaderText; + MI_Image* miNetServersLeftHeaderBar = nullptr; + MI_Image* miNetServersRightHeaderBar = nullptr; + MI_Text* miNetServersHeaderText = nullptr; }; - -#endif // MENU_NETSERVERS_H diff --git a/src/smw/menu/options/PowerupSettingsMenu.cpp b/src/smw/menu/options/PowerupSettingsMenu.cpp index fbc28838c..d978e5620 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.cpp +++ b/src/smw/menu/options/PowerupSettingsMenu.cpp @@ -2,7 +2,9 @@ #include "GameValues.h" #include "ResourceManager.h" +#include "ui/MI_Button.h" #include "ui/MI_Image.h" +#include "ui/MI_SelectField.h" #include "ui/MI_StoredPowerupResetButton.h" #include "ui/MI_Text.h" diff --git a/src/smw/menu/options/PowerupSettingsMenu.h b/src/smw/menu/options/PowerupSettingsMenu.h index ef698002f..4dcb8ff9b 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.h +++ b/src/smw/menu/options/PowerupSettingsMenu.h @@ -1,44 +1,42 @@ -#ifndef MENU_POWERUPSETTINGS_H -#define MENU_POWERUPSETTINGS_H +#pragma once #include "uimenu.h" -#include "uicontrol.h" -#include "uicustomcontrol.h" +class MI_Button; +class MI_Image; +class MI_SelectField; class MI_StoredPowerupResetButton; +class MI_Text; /* In this menu, you can change some powerup settings, like fire rate, reloading of [?] blocks and bonus items. */ -class UI_PowerupSettingsMenu : public UI_Menu -{ +class UI_PowerupSettingsMenu : public UI_Menu { public: UI_PowerupSettingsMenu(); ~UI_PowerupSettingsMenu(); private: - MI_SelectField * miStoredPowerupDelayField; - MI_SelectField * miItemRespawnField; - MI_SelectField * miSwapStyleField; - MI_SelectField * miBonusWheelField; - MI_SelectField * miKeepPowerupField; - MI_SelectField * miHiddenBlockRespawnField; - MI_StoredPowerupResetButton * miStoredPowerupResetButton; - MI_Button * miPowerupSettingsMenuBackButton; - - MI_Image * miPowerupSettingsMenuLeftHeaderBar; - MI_Image * miPowerupSettingsMenuRightHeaderBar; - MI_Text * miPowerupSettingsMenuHeaderText; + MI_SelectField* miStoredPowerupDelayField = nullptr; + MI_SelectField* miItemRespawnField = nullptr; + MI_SelectField* miSwapStyleField = nullptr; + MI_SelectField* miBonusWheelField = nullptr; + MI_SelectField* miKeepPowerupField = nullptr; + MI_SelectField* miHiddenBlockRespawnField = nullptr; + MI_StoredPowerupResetButton* miStoredPowerupResetButton = nullptr; + MI_Button* miPowerupSettingsMenuBackButton = nullptr; + + MI_Image* miPowerupSettingsMenuLeftHeaderBar = nullptr; + MI_Image* miPowerupSettingsMenuRightHeaderBar = nullptr; + MI_Text* miPowerupSettingsMenuHeaderText = nullptr; /* - MI_Image * miPowerupSelectionDialogImage; - MI_Text * miPowerupSelectionDialogExitText; - MI_Text * miPowerupSelectionDialogTournamentText; - MI_Button * miPowerupSelectionDialogYesButton; - MI_Button * miPowerupSelectionDialogNoButton; + MI_Image* miPowerupSelectionDialogImage = nullptr; + MI_Text* miPowerupSelectionDialogExitText = nullptr; + MI_Text* miPowerupSelectionDialogTournamentText = nullptr; + MI_Button* miPowerupSelectionDialogYesButton = nullptr; + MI_Button* miPowerupSelectionDialogNoButton = nullptr; */ }; - -#endif // MENU_POWERUPSETTINGS_H diff --git a/src/smw/uicustomcontrol.cpp b/src/smw/uicustomcontrol.cpp deleted file mode 100644 index e8407d03e..000000000 --- a/src/smw/uicustomcontrol.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "uicustomcontrol.h" - -#include "SDL_image.h" - -#include "FileList.h" -#include "Game.h" -#include "GameMode.h" -#include "gamemodes.h" -#include "GameValues.h" -#include "map.h" -#include "MapList.h" -#include "RandomNumberGenerator.h" -#include "ResourceManager.h" -#include "Score.h" -#include "ui/MI_Image.h" -#include "ui/MI_ScoreText.h" -#include "ui/MI_Text.h" - -#include -#include // abs() -#include -#include - -#ifndef __EMSCRIPTEN__ - inline void smallDelay() { SDL_Delay(10); } -#else - inline void smallDelay() {} -#endif - -extern SDL_Surface* screen; -extern SDL_Surface* blitdest; - -extern CScore* score[4]; - -extern CMap* g_map; - -extern short g_iDefaultPowerupPresets[NUM_POWERUP_PRESETS][NUM_POWERUPS]; -extern short g_iCurrentPowerupPresets[NUM_POWERUP_PRESETS][NUM_POWERUPS]; -extern short iScoreboardPlayerOffsetsX[3][3]; -extern WorldMap g_worldmap; -extern short LookupTeamID(short id); - -extern CGameMode * gamemodes[GAMEMODE_LAST]; -extern CGM_Pipe_MiniGame * pipegamemode; -extern CGM_Boss_MiniGame * bossgamemode; -extern CGM_Boxes_MiniGame * boxesgamemode; - -extern MapList *maplist; -extern MusicList *musiclist; -extern WorldMusicList *worldmusiclist; - -extern CGameValues game_values; -extern CResourceManager* rm; -extern CGame* smw; diff --git a/src/smw/uicustomcontrol.h b/src/smw/uicustomcontrol.h deleted file mode 100644 index 6a2bd63f2..000000000 --- a/src/smw/uicustomcontrol.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef UICUSTOMCONTROL_H -#define UICUSTOMCONTROL_H - -#include "input.h" -#include "uicontrol.h" -#include "ui/MI_AnnouncerField.h" -#include "ui/MI_Button.h" -#include "ui/MI_MapField.h" -#include "ui/MI_PowerupSlider.h" -#include "ui/MI_ImageSelectField.h" -#include "ui/NetworkListScroll.h" -#include "uimenu.h" -#include "world.h" - -#include -#include - -#define NUMBONUSITEMSONWHEEL 10 - -class SimpleFileList; -class MapListNode; -class MI_ScoreText; -class MI_Text; - -#endif // UICUSTOMCONTROL_H