From 6ccdb6fcc531e9f0e36dd2635f6feb20b404475e Mon Sep 17 00:00:00 2001 From: KaiN Date: Tue, 20 Sep 2022 20:14:13 +0200 Subject: [PATCH] Rename control enum id values to match code style --- libs/s25main/desktops/dskGameLobby.cpp | 146 +++---- libs/s25main/desktops/dskOptions.cpp | 518 ++++++++++++------------- 2 files changed, 315 insertions(+), 349 deletions(-) diff --git a/libs/s25main/desktops/dskGameLobby.cpp b/libs/s25main/desktops/dskGameLobby.cpp index ddac3f27a..06e041aa4 100644 --- a/libs/s25main/desktops/dskGameLobby.cpp +++ b/libs/s25main/desktops/dskGameLobby.cpp @@ -50,24 +50,24 @@ namespace { enum CtrlIds { - ID_PLAYER_ROW_NAME = 1, - ID_PLAYER_ROW_NATION = 3, - ID_PLAYER_ROW_PORTRAIT = 9, - ID_PLAYER_ROW_COLOR = 4, - ID_PLAYER_ROW_TEAM = 5, - ID_PLAYER_ROW_READY = 6, - ID_PLAYER_ROW_PING = 7, - ID_PLAYER_ROW_PAST_PLAYER = 8, - - ID_PLAYER_GROUP_START = 50, - ID_SWAP_BUTTON = 80, - ID_FIRST_FREE = ID_SWAP_BUTTON + MAX_PLAYERS, - ID_GAME_CHAT, - ID_LOBBY_CHAT, - ID_CHAT_INPUT, - ID_CHAT_TAB, - TAB_GAMECHAT, - TAB_LOBBYCHAT + ID_btPlayerRowName = 1, + ID_btPlayerRowNation = 3, + ID_btPlayerRowPortrait = 9, + ID_btPlayerRowColor = 4, + ID_btPlayerRowTeam = 5, + ID_cbPlayerRowReady = 6, + ID_dpPlayerRowPing = 7, + ID_cbPlayerRowPastPlayer = 8, + + ID_groupPlayerStart = 50, + ID_btnSwap = 80, + ID_FIRST_FREE = ID_btnSwap + MAX_PLAYERS, + ID_chatGame, + ID_chatLobby, + ID_edtChatMsg, + ID_optChatTab, + ID_btChatGame, + ID_btChatLobby }; template constexpr T nextEnumValue(T value) @@ -151,23 +151,23 @@ dskGameLobby::dskGameLobby(ServerType serverType, std::shared_ptr gam // Enable lobby chat when we are logged in if(lobbyClient_ && lobbyClient_->IsLoggedIn()) { - ctrlOptionGroup* chatTab = AddOptionGroup(ID_CHAT_TAB, GroupSelectType::Check); - chatTab->AddTextButton(TAB_GAMECHAT, DrawPoint(20, 320), Extent(178, 22), TextureColor::Green2, + ctrlOptionGroup* chatTab = AddOptionGroup(ID_optChatTab, GroupSelectType::Check); + chatTab->AddTextButton(ID_btChatGame, DrawPoint(20, 320), Extent(178, 22), TextureColor::Green2, _("Game Chat"), NormalFont); - chatTab->AddTextButton(TAB_LOBBYCHAT, DrawPoint(202, 320), Extent(178, 22), TextureColor::Green2, + chatTab->AddTextButton(ID_btChatLobby, DrawPoint(202, 320), Extent(178, 22), TextureColor::Green2, _("Lobby Chat"), NormalFont); gameChat = - AddChatCtrl(ID_GAME_CHAT, DrawPoint(20, 345), Extent(360, 218 - 25), TextureColor::Grey, NormalFont); + AddChatCtrl(ID_chatGame, DrawPoint(20, 345), Extent(360, 218 - 25), TextureColor::Grey, NormalFont); lobbyChat = - AddChatCtrl(ID_LOBBY_CHAT, DrawPoint(20, 345), Extent(360, 218 - 25), TextureColor::Grey, NormalFont); - chatTab->SetSelection(TAB_GAMECHAT, true); + AddChatCtrl(ID_chatLobby, DrawPoint(20, 345), Extent(360, 218 - 25), TextureColor::Grey, NormalFont); + chatTab->SetSelection(ID_btChatGame, true); } else { // Chatfenster - gameChat = AddChatCtrl(ID_GAME_CHAT, DrawPoint(20, 320), Extent(360, 218), TextureColor::Grey, NormalFont); + gameChat = AddChatCtrl(ID_chatGame, DrawPoint(20, 320), Extent(360, 218), TextureColor::Grey, NormalFont); } // Edit für Chatfenster - AddEdit(ID_CHAT_INPUT, DrawPoint(20, 540), Extent(360, 22), TextureColor::Grey, NormalFont); + AddEdit(ID_edtChatMsg, DrawPoint(20, 540), Extent(360, 22), TextureColor::Grey, NormalFont); } // "Spiel starten" @@ -283,9 +283,9 @@ dskGameLobby::dskGameLobby(ServerType serverType, std::shared_ptr gam { for(unsigned i = 0; i < gameLobby_->getNumPlayers(); i++) { - DrawPoint rowPos = GetCtrl(ID_PLAYER_GROUP_START + i)->GetCtrl(1)->GetPos(); - ctrlButton* bt = AddTextButton(ID_SWAP_BUTTON + i, DrawPoint(5, 0), Extent(22, 22), TextureColor::Red1, - _("-"), NormalFont); + DrawPoint rowPos = GetCtrl(ID_groupPlayerStart + i)->GetCtrl(1)->GetPos(); + ctrlButton* bt = + AddTextButton(ID_btnSwap + i, DrawPoint(5, 0), Extent(22, 22), TextureColor::Red1, _("-"), NormalFont); bt->SetPos(DrawPoint(bt->GetPos().x, rowPos.y)); } } @@ -353,9 +353,9 @@ void dskGameLobby::UpdatePlayerRow(const unsigned row) TextureColor tc = (row & 1 ? TextureColor::Grey : TextureColor::Green2); // Alle Controls erstmal zerstören (die ganze Gruppe) - DeleteCtrl(ID_PLAYER_GROUP_START + row); + DeleteCtrl(ID_groupPlayerStart + row); // und neu erzeugen - ctrlGroup* group = AddGroup(ID_PLAYER_GROUP_START + row); + ctrlGroup* group = AddGroup(ID_groupPlayerStart + row); std::string name; // Name @@ -380,11 +380,11 @@ void dskGameLobby::UpdatePlayerRow(const unsigned row) // Spielername, beim Hosts Spielerbuttons, aber nich beim ihm selber, er kann sich ja nich selber kicken! if(gameLobby_->isHost() && !player.isHost && (!lua || lua->IsChangeAllowed("playerState"))) - group->AddTextButton(ID_PLAYER_ROW_NAME, DrawPoint(30, cy), Extent(200, 22), tc, name, NormalFont); + group->AddTextButton(ID_btPlayerRowName, DrawPoint(30, cy), Extent(200, 22), tc, name, NormalFont); else - group->AddTextDeepening(ID_PLAYER_ROW_NAME, DrawPoint(30, cy), Extent(200, 22), tc, name, NormalFont, + group->AddTextDeepening(ID_btPlayerRowName, DrawPoint(30, cy), Extent(200, 22), tc, name, NormalFont, COLOR_YELLOW); - auto* text = group->GetCtrl(ID_PLAYER_ROW_NAME); + auto* text = group->GetCtrl(ID_btPlayerRowName); // Is das der Host? Dann farblich markieren if(player.isHost) @@ -415,40 +415,40 @@ void dskGameLobby::UpdatePlayerRow(const unsigned row) } if(allowNationChange) - group->AddTextButton(ID_PLAYER_ROW_NATION, DrawPoint(240, cy), Extent(90, 22), tc, + group->AddTextButton(ID_btPlayerRowNation, DrawPoint(240, cy), Extent(90, 22), tc, _(NationNames[Nation::Romans]), NormalFont); else - group->AddTextDeepening(ID_PLAYER_ROW_NATION, DrawPoint(240, cy), Extent(90, 22), tc, + group->AddTextDeepening(ID_btPlayerRowNation, DrawPoint(240, cy), Extent(90, 22), tc, _(NationNames[Nation::Romans]), NormalFont, COLOR_YELLOW); const auto& portrait = Portraits[player.portraitIndex]; - group->AddImageButton(ID_PLAYER_ROW_PORTRAIT, DrawPoint(335, cy), Extent(34, 22), tc, + group->AddImageButton(ID_btPlayerRowPortrait, DrawPoint(335, cy), Extent(34, 22), tc, LOADER.GetImageN(portrait.resourceId, portrait.resourceIndex), _(portrait.name)); if(allowColorChange) - group->AddColorButton(ID_PLAYER_ROW_COLOR, DrawPoint(375, cy), Extent(30, 22), tc, 0); + group->AddColorButton(ID_btPlayerRowColor, DrawPoint(375, cy), Extent(30, 22), tc, 0); else - group->AddColorDeepening(ID_PLAYER_ROW_COLOR, DrawPoint(375, cy), Extent(30, 22), tc, 0); + group->AddColorDeepening(ID_btPlayerRowColor, DrawPoint(375, cy), Extent(30, 22), tc, 0); if(allowTeamChange) - group->AddTextButton(ID_PLAYER_ROW_TEAM, DrawPoint(415, cy), Extent(50, 22), tc, _("-"), NormalFont); + group->AddTextButton(ID_btPlayerRowTeam, DrawPoint(415, cy), Extent(50, 22), tc, _("-"), NormalFont); else - group->AddTextDeepening(ID_PLAYER_ROW_TEAM, DrawPoint(415, cy), Extent(50, 22), tc, _("-"), NormalFont, + group->AddTextDeepening(ID_btPlayerRowTeam, DrawPoint(415, cy), Extent(50, 22), tc, _("-"), NormalFont, COLOR_YELLOW); // Bereit (nicht bei KIs und Host) // if(player.ps == PlayerState::Occupied && !player.isHost) - group->AddCheckBox(ID_PLAYER_ROW_READY, DrawPoint(475, cy), Extent(22, 22), tc, "", nullptr, + group->AddCheckBox(ID_cbPlayerRowReady, DrawPoint(475, cy), Extent(22, 22), tc, "", nullptr, (localPlayerId_ != row)); // Ping ( "%d" ) - ctrlVarDeepening* ping = group->AddVarDeepening(ID_PLAYER_ROW_PING, DrawPoint(505, cy), Extent(50, 22), tc, + ctrlVarDeepening* ping = group->AddVarDeepening(ID_dpPlayerRowPing, DrawPoint(505, cy), Extent(50, 22), tc, _("%d"), NormalFont, COLOR_YELLOW, 1, &player.ping); //-V111 // Verschieben (nur bei Savegames und beim Host!) if(gameLobby_->isSavegame() && player.ps == PlayerState::Occupied) { - ctrlComboBox* combo = group->AddComboBox(ID_PLAYER_ROW_PAST_PLAYER, DrawPoint(560, cy), Extent(160, 22), tc, + ctrlComboBox* combo = group->AddComboBox(ID_cbPlayerRowPastPlayer, DrawPoint(560, cy), Extent(160, 22), tc, NormalFont, 150, !gameLobby_->isHost()); // Mit den alten Namen füllen @@ -486,23 +486,23 @@ void dskGameLobby::Msg_PaintBefore() Desktop::Msg_PaintBefore(); // Chatfenster Fokus geben if(!IsSinglePlayer()) - GetCtrl(ID_CHAT_INPUT)->SetFocus(); + GetCtrl(ID_edtChatMsg)->SetFocus(); } void dskGameLobby::Msg_Group_ButtonClick(const unsigned group_id, const unsigned ctrl_id) { - unsigned playerId = group_id - ID_PLAYER_GROUP_START; + unsigned playerId = group_id - ID_groupPlayerStart; switch(ctrl_id) { - case ID_PLAYER_ROW_NAME: + case ID_btPlayerRowName: { if(gameLobby_->isHost()) lobbyHostController->TogglePlayerState(playerId); } break; - case ID_PLAYER_ROW_NATION: + case ID_btPlayerRowNation: { SetPlayerReady(playerId, false); @@ -519,7 +519,7 @@ void dskGameLobby::Msg_Group_ButtonClick(const unsigned group_id, const unsigned } break; - case ID_PLAYER_ROW_PORTRAIT: + case ID_btPlayerRowPortrait: { SetPlayerReady(playerId, false); @@ -536,7 +536,7 @@ void dskGameLobby::Msg_Group_ButtonClick(const unsigned group_id, const unsigned } break; - case ID_PLAYER_ROW_COLOR: + case ID_btPlayerRowColor: { SetPlayerReady(playerId, false); @@ -574,7 +574,7 @@ void dskGameLobby::Msg_Group_ButtonClick(const unsigned group_id, const unsigned } break; - case ID_PLAYER_ROW_TEAM: + case ID_btPlayerRowTeam: { SetPlayerReady(playerId, false); @@ -595,7 +595,7 @@ void dskGameLobby::Msg_Group_ButtonClick(const unsigned group_id, const unsigned void dskGameLobby::Msg_Group_CheckboxChange(const unsigned group_id, const unsigned /*ctrl_id*/, const bool checked) { - unsigned playerId = group_id - ID_PLAYER_GROUP_START; + unsigned playerId = group_id - ID_groupPlayerStart; // Bereit if(playerId < MAX_PLAYERS) @@ -608,7 +608,7 @@ void dskGameLobby::Msg_Group_ComboSelectItem(const unsigned group_id, const unsi if(!gameLobby_->isHost()) return; // Swap players - const unsigned playerId = group_id - ID_PLAYER_GROUP_START; + const unsigned playerId = group_id - ID_groupPlayerStart; int player2 = -1; for(unsigned i = 0, playerCtr = 0; i < gameLobby_->getNumPlayers(); ++i) @@ -640,9 +640,9 @@ void dskGameLobby::GoBack() void dskGameLobby::Msg_ButtonClick(const unsigned ctrl_id) { - if(ctrl_id >= ID_SWAP_BUTTON && ctrl_id < ID_SWAP_BUTTON + MAX_PLAYERS) + if(ctrl_id >= ID_btnSwap && ctrl_id < ID_btnSwap + MAX_PLAYERS) { - unsigned targetPlayer = ctrl_id - ID_SWAP_BUTTON; + unsigned targetPlayer = ctrl_id - ID_btnSwap; if(targetPlayer != localPlayerId_ && gameLobby_->isHost()) lobbyHostController->SwapPlayers(localPlayerId_, targetPlayer); return; @@ -701,7 +701,7 @@ void dskGameLobby::Msg_ButtonClick(const unsigned ctrl_id) void dskGameLobby::Msg_EditEnter(const unsigned ctrl_id) { - if(ctrl_id != ID_CHAT_INPUT) + if(ctrl_id != ID_edtChatMsg) return; auto* edit = GetCtrl(ctrl_id); const std::string msg = edit->GetText(); @@ -760,8 +760,8 @@ void dskGameLobby::FlashGameChat() { if(!gameChat->IsVisible()) { - auto* tab = GetCtrl(ID_CHAT_TAB); - auto* bt = tab->GetCtrl(TAB_GAMECHAT); + auto* tab = GetCtrl(ID_optChatTab); + auto* bt = tab->GetCtrl(ID_btChatGame); if(!localChatTabAnimId) localChatTabAnimId = tab->GetAnimationManager().addAnimation(new BlinkButtonAnim(bt)); } @@ -850,13 +850,13 @@ void dskGameLobby::Msg_CheckboxChange(const unsigned ctrl_id, const bool /*check void dskGameLobby::Msg_OptionGroupChange(const unsigned ctrl_id, const unsigned selection) { - if(ctrl_id == ID_CHAT_TAB) + if(ctrl_id == ID_optChatTab) { - gameChat->SetVisible(selection == TAB_GAMECHAT); - lobbyChat->SetVisible(selection == TAB_LOBBYCHAT); - auto* tab = GetCtrl(ID_CHAT_TAB); + gameChat->SetVisible(selection == ID_btChatGame); + lobbyChat->SetVisible(selection == ID_btChatLobby); + auto* tab = GetCtrl(ID_optChatTab); tab->GetCtrl(selection)->SetTexture(TextureColor::Green2); - if(selection == TAB_GAMECHAT) + if(selection == ID_btChatGame) { tab->GetAnimationManager().finishAnimation(localChatTabAnimId, false); localChatTabAnimId = 0; @@ -897,12 +897,12 @@ void dskGameLobby::ChangeTeam(const unsigned player, const Team team) { constexpr helpers::EnumArray teams = {"-", "?", "1", "2", "3", "4", "1-2", "1-3", "1-4"}; - GetCtrl(ID_PLAYER_GROUP_START + player)->GetCtrl(ID_PLAYER_ROW_TEAM)->SetText(teams[team]); + GetCtrl(ID_groupPlayerStart + player)->GetCtrl(ID_btPlayerRowTeam)->SetText(teams[team]); } void dskGameLobby::ChangeReady(const unsigned player, const bool ready) { - auto* check = GetCtrl(ID_PLAYER_GROUP_START + player)->GetCtrl(ID_PLAYER_ROW_READY); + auto* check = GetCtrl(ID_groupPlayerStart + player)->GetCtrl(ID_cbPlayerRowReady); if(check) check->setChecked(ready); @@ -918,15 +918,15 @@ void dskGameLobby::ChangeReady(const unsigned player, const bool ready) void dskGameLobby::ChangeNation(const unsigned player, const Nation nation) { - GetCtrl(ID_PLAYER_GROUP_START + player) - ->GetCtrl(ID_PLAYER_ROW_NATION) + GetCtrl(ID_groupPlayerStart + player) + ->GetCtrl(ID_btPlayerRowNation) ->SetText(_(NationNames[nation])); } void dskGameLobby::ChangePortrait(const unsigned player, const unsigned portraitIndex) { const auto& portrait = Portraits[portraitIndex]; - auto* ctrl = GetCtrl(ID_PLAYER_GROUP_START + player)->GetCtrl(ID_PLAYER_ROW_PORTRAIT); + auto* ctrl = GetCtrl(ID_groupPlayerStart + player)->GetCtrl(ID_btPlayerRowPortrait); ctrl->SetImage(LOADER.GetImageN(portrait.resourceId, portrait.resourceIndex)); ctrl->SetTooltip(_(portrait.name)); } @@ -942,14 +942,14 @@ void dskGameLobby::ChangePing(unsigned playerId) color = COLOR_YELLOW; // und setzen - GetCtrl(ID_PLAYER_GROUP_START + playerId) - ->GetCtrl(ID_PLAYER_ROW_PING) + GetCtrl(ID_groupPlayerStart + playerId) + ->GetCtrl(ID_dpPlayerRowPing) ->SetTextColor(color); } void dskGameLobby::ChangeColor(const unsigned player, const unsigned color) { - GetCtrl(ID_PLAYER_GROUP_START + player)->GetCtrl(ID_PLAYER_ROW_COLOR)->SetColor(color); + GetCtrl(ID_groupPlayerStart + player)->GetCtrl(ID_btPlayerRowColor)->SetColor(color); // Minimap-Startfarbe ändern if(GetCtrl(70)) @@ -1078,8 +1078,8 @@ void dskGameLobby::LC_Chat(const std::string& player, const std::string& text) lobbyChat->AddMessage("", player, ctrlChat::CalcUniqueColor(player), text, COLOR_YELLOW); if(!lobbyChat->IsVisible()) { - auto* tab = GetCtrl(ID_CHAT_TAB); - auto* bt = tab->GetCtrl(TAB_LOBBYCHAT); + auto* tab = GetCtrl(ID_optChatTab); + auto* bt = tab->GetCtrl(ID_btChatLobby); if(!lobbyChatTabAnimId) lobbyChatTabAnimId = tab->GetAnimationManager().addAnimation(new BlinkButtonAnim(bt)); } diff --git a/libs/s25main/desktops/dskOptions.cpp b/libs/s25main/desktops/dskOptions.cpp index 07c625888..3e0c746fb 100644 --- a/libs/s25main/desktops/dskOptions.cpp +++ b/libs/s25main/desktops/dskOptions.cpp @@ -36,82 +36,82 @@ enum { - ID_BACK_BUTTON = 0, - ID_OPTIONS_LABEL = 1, - ID_OPTIONS_GROUP = 10, - ID_COMMON_BUTTON = 11, - ID_GRAPHICS_BUTTON = 12, - ID_SOUND_MUSIC_BUTTON = 13, - ID_ADDONS_BUTTON = 14, - ID_GROUP_COMMON = 21, - ID_GROUP_GRAPHICS = 22, - ID_GROUP_SOUND = 23, - - ID_COMMON_NAME_LABEL = 30, - ID_COMMON_NAME_EDIT = 31, - ID_COMMON_LANGUAGE_LABEL = 32, - ID_COMMON_LANGUAGE_COMBO = 33, - ID_COMMON_KEY_LAYOUT_LABEL = 34, - ID_COMMON_KEY_LAYOUT_BUTTON = 35, - ID_COMMON_PROXY_LABEL = 36, - ID_COMMON_PROXY_EDIT_ADDRESS = 37, - ID_COMMON_PROXY_EDIT_PORT = 371, - ID_COMMON_PROXY_TYPE_LABEL = 38, - ID_COMMON_PROXY_TYPE_COMBO = 39, - ID_COMMON_LOCAL_PORT_LABEL = 40, - ID_COMMON_LOCAL_PORT_EDIT = 41, - ID_COMMON_DEBUG_DATA_LABEL = 70, - ID_COMMON_DEBUG_DATA_GROUP = 71, - ID_COMMON_DEBUG_DATA_ON = 72, - ID_COMMON_DEBUG_DATA_OFF = 73, - ID_COMMON_PORTRAIT_LABEL = 78, - ID_COMMON_PORTRAIT_BUTTON = 79, - ID_COMMON_PORTRAIT_COMBO = 81, - ID_COMMON_IPV6_LABEL = 300, - ID_COMMON_IPV6_GROUP = 301, - ID_COMMON_IPV6_BUTTON_ON = 302, - ID_COMMON_IPV6_BUTTON_OFF = 303, - ID_COMMON_UPNP_LABEL = 9999, - ID_COMMON_UPNP_GROUP = 9998, - ID_COMMON_UPNP_ON = 10001, - ID_COMMON_UPNP_OFF = 10002, - ID_COMMON_SMART_CURSOR_LABEL = 10100, - ID_COMMON_SMART_CURSOR_GROUP = 10101, - ID_COMMON_SMART_CURSOR_ON = 10102, - ID_COMMON_SMART_CURSOR_OFF = 10103, - - ID_GRAPHICS_RESOLUTION_LABEL = 40, - ID_GRAPHICS_RESOLUTION_COMBO = 41, - ID_GRAPHICS_MODE_LABEL = 46, - ID_GRAPHICS_MODE_GROUP = 47, - ID_GRAPHICS_MODE_FULLSCREEN = 48, - ID_GRAPHICS_MODE_WINDOWED = 49, - ID_GRAPHICS_VSYNC_LABEL = 50, - ID_GRAPHICS_VSYNC_COMBO = 51, - ID_GRAPHICS_VBO_LABEL = 54, - ID_GRAPHICS_VBO_GROUP = 55, - ID_GRAPHICS_VBO_ON = 56, - ID_GRAPHICS_VBO_OFF = 57, - ID_GRAPHICS_DRIVER_LABEL = 58, - ID_GRAPHICS_DRIVER_COMBO = 59, - ID_GRAPHICS_OPTIMIZED_TEXTURES_LABEL = 74, - ID_GRAPHICS_OPTIMIZED_TEXTURES_GROUP = 75, - ID_GRAPHICS_OPTIMIZED_TEXTURES_ON = 76, - ID_GRAPHICS_OPTIMIZED_TEXTURES_OFF = 77, - - ID_SOUND_DRIVER_LABEL = 60, - ID_SOUND_DRIVER_COMBO = 61, - ID_SOUND_MUSIC_LABEL = 62, - ID_SOUND_MUSIC_GROUP = 63, - ID_SOUND_MUSIC_ON = 64, - ID_SOUND_MUSIC_OFF = 65, - ID_SOUND_MUSIC_VOLUME = 72, - ID_SOUND_EFFECTS_LABEL = 66, - ID_SOUND_EFFECTS_GROUP = 67, - ID_SOUND_EFFECTS_ON = 68, - ID_SOUND_EFFECTS_OFF = 69, - ID_SOUND_EFFECTS_VOLUME = 70, - ID_SOUND_MUSIC_PLAYER = 71, + ID_btBack = 0, + ID_txtOptions = 1, + ID_optOptions = 10, + ID_btCommon = 11, + ID_btGraphics = 12, + ID_btSoundMusic = 13, + ID_btAddons = 14, + ID_groupCommon = 21, + ID_groupGraphics = 22, + ID_groupSound = 23, + + ID_txtCommonName = 30, + ID_edtCommonName = 31, + ID_txtCommonLanguage = 32, + ID_cbCommonLanguage = 33, + ID_txtCommonKeyLayout = 34, + ID_btCommonKeyLayout = 35, + ID_txtCommonProxy = 36, + ID_edtCommonProxyAddress = 37, + ID_edtCommonProxyPort = 371, + ID_txtCommonProxyType = 38, + ID_cbCommonProxyType = 39, + ID_txtCommonLocalPort = 40, + ID_edtCommonLocalPort = 41, + ID_txtCommonDebugData = 70, + ID_optCommonDebugData = 71, + ID_btCommonDebugDataOn = 72, + ID_btCommonDebugDataOff = 73, + ID_txtCommonPortrait = 78, + ID_btCommonPortrait = 79, + ID_cbCommonPortrait = 81, + ID_txtCommonIpv6 = 300, + ID_optCommonIpv6 = 301, + ID_btCommonIpv6On = 302, + ID_btCommonIpv6Off = 303, + ID_txtCommonUpnp = 9999, + ID_optCommonUpnp = 9998, + ID_btCommonUpnpOn = 10001, + ID_btCommonUpnpOff = 10002, + ID_txtCommonSmartCursor = 10100, + ID_optCommonSmartCursor = 10101, + ID_btCommonSmartCursorOn = 10102, + ID_btCommonSmartCursorOff = 10103, + + ID_txtGraphicsResolution = 40, + ID_cbGraphicsResolution = 41, + ID_txtGraphicsMode = 46, + ID_optGraphicsMode = 47, + ID_btGraphicsModeFullscreen = 48, + ID_btGraphicsModeWindowed = 49, + ID_txtGraphicsVsync = 50, + ID_cbGraphicsVsync = 51, + ID_txtGraphicsVbo = 54, + ID_optGraphicsVbo = 55, + ID_btGraphicsVboOn = 56, + ID_btGraphicsVboOff = 57, + ID_txtGraphicsDriver = 58, + ID_cbGraphicsDriver = 59, + ID_txtGraphicsOptimizedTextures = 74, + ID_optGraphicsOptimizedTextures = 75, + ID_btGraphicsOptimizedTexturesOn = 76, + ID_btGraphicsOptimizedTexturesOff = 77, + + ID_txtSoundDriver = 60, + ID_cbSoundDriver = 61, + ID_txtSoundMusic = 62, + ID_optSoundMusic = 63, + ID_btSoundMusicOn = 64, + ID_btSoundMusicOff = 65, + ID_pgSoundMusicVolume = 72, + ID_txtSoundEffects = 66, + ID_optSoundEffects = 67, + ID_btSoundEffectsOn = 68, + ID_SoundEffectsOff = 69, + ID_pgSoundEffectsVolume = 70, + ID_btSoundMusicPlayer = 71, }; static VideoMode getAspectRatio(const VideoMode& vm) @@ -136,54 +136,43 @@ static VideoMode getAspectRatio(const VideoMode& vm) dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) { - // Back - AddTextButton(ID_BACK_BUTTON, DrawPoint(300, 550), Extent(200, 22), TextureColor::Red1, _("Back"), NormalFont); + AddTextButton(ID_btBack, DrawPoint(300, 550), Extent(200, 22), TextureColor::Red1, _("Back"), NormalFont); - // "Options" - AddText(ID_OPTIONS_LABEL, DrawPoint(400, 10), _("Options"), COLOR_YELLOW, FontStyle::CENTER, LargeFont); + AddText(ID_txtOptions, DrawPoint(400, 10), _("Options"), COLOR_YELLOW, FontStyle::CENTER, LargeFont); - ctrlOptionGroup* optiongroup = AddOptionGroup(ID_OPTIONS_GROUP, GroupSelectType::Check); + ctrlOptionGroup* optiongroup = AddOptionGroup(ID_optOptions, GroupSelectType::Check); - AddTextButton(ID_ADDONS_BUTTON, DrawPoint(520, 550), Extent(200, 22), TextureColor::Green2, _("Addons"), - NormalFont); + AddTextButton(ID_btAddons, DrawPoint(520, 550), Extent(200, 22), TextureColor::Green2, _("Addons"), NormalFont); - // "Common" - optiongroup->AddTextButton(ID_COMMON_BUTTON, DrawPoint(80, 510), Extent(200, 22), TextureColor::Green2, _("Common"), + optiongroup->AddTextButton(ID_btCommon, DrawPoint(80, 510), Extent(200, 22), TextureColor::Green2, _("Common"), NormalFont); - // "Graphics" - optiongroup->AddTextButton(ID_GRAPHICS_BUTTON, DrawPoint(300, 510), Extent(200, 22), TextureColor::Green2, - _("Graphics"), NormalFont); - // "Sound" - optiongroup->AddTextButton(ID_SOUND_MUSIC_BUTTON, DrawPoint(520, 510), Extent(200, 22), TextureColor::Green2, + optiongroup->AddTextButton(ID_btGraphics, DrawPoint(300, 510), Extent(200, 22), TextureColor::Green2, _("Graphics"), + NormalFont); + optiongroup->AddTextButton(ID_btSoundMusic, DrawPoint(520, 510), Extent(200, 22), TextureColor::Green2, _("Sound/Music"), NormalFont); - ctrlGroup* groupCommon = AddGroup(ID_GROUP_COMMON); - ctrlGroup* groupGraphics = AddGroup(ID_GROUP_GRAPHICS); - ctrlGroup* groupSound = AddGroup(ID_GROUP_SOUND); + ctrlGroup* groupCommon = AddGroup(ID_groupCommon); + ctrlGroup* groupGraphics = AddGroup(ID_groupGraphics); + ctrlGroup* groupSound = AddGroup(ID_groupSound); ctrlComboBox* combo; // Common // { - // "Name" int offsY = 80; - groupCommon->AddText(ID_COMMON_NAME_LABEL, DrawPoint(80, offsY), _("Name in Game:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonName, DrawPoint(80, offsY), _("Name in Game:"), COLOR_YELLOW, FontStyle{}, NormalFont); - ctrlEdit* name = groupCommon->AddEdit(ID_COMMON_NAME_EDIT, DrawPoint(280, offsY - 5), Extent(190, 22), + ctrlEdit* name = groupCommon->AddEdit(ID_edtCommonName, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, NormalFont, 15); name->SetText(SETTINGS.lobby.name); - // Portrait display next to name const auto& currentPortrait = Portraits[SETTINGS.lobby.portraitIndex]; - groupCommon->AddImageButton(ID_COMMON_PORTRAIT_BUTTON, DrawPoint(500, offsY - 5), Extent(40, 54), - TextureColor::Grey, + groupCommon->AddImageButton(ID_btCommonPortrait, DrawPoint(500, offsY - 5), Extent(40, 54), TextureColor::Grey, LOADER.GetImageN(currentPortrait.resourceId, currentPortrait.resourceIndex)); - - // Portrait dropdown offsY += 30; - groupCommon->AddText(ID_COMMON_PORTRAIT_LABEL, DrawPoint(80, offsY), _("Portrait:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonPortrait, DrawPoint(80, offsY), _("Portrait:"), COLOR_YELLOW, FontStyle{}, NormalFont); - combo = groupCommon->AddComboBox(ID_COMMON_PORTRAIT_COMBO, DrawPoint(280, offsY - 5), Extent(190, 20), + combo = groupCommon->AddComboBox(ID_cbCommonPortrait, DrawPoint(280, offsY - 5), Extent(190, 20), TextureColor::Grey, NormalFont, 100); for(unsigned i = 0; i < Portraits.size(); ++i) @@ -195,11 +184,10 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) } } - // "Language" offsY += 40; - groupCommon->AddText(ID_COMMON_LANGUAGE_LABEL, DrawPoint(80, offsY), _("Language:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonLanguage, DrawPoint(80, offsY), _("Language:"), COLOR_YELLOW, FontStyle{}, NormalFont); - combo = groupCommon->AddComboBox(ID_COMMON_LANGUAGE_COMBO, DrawPoint(280, offsY - 5), Extent(190, 20), + combo = groupCommon->AddComboBox(ID_cbCommonLanguage, DrawPoint(280, offsY - 5), Extent(190, 20), TextureColor::Grey, NormalFont, 100); bool isAnySelected = false; @@ -217,53 +205,47 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) if(!isAnySelected) combo->SetSelection(0); - // Keyboard layout offsY += 40; - groupCommon->AddText(ID_COMMON_KEY_LAYOUT_LABEL, DrawPoint(80, offsY), _("Keyboard layout:"), COLOR_YELLOW, - FontStyle{}, NormalFont); - groupCommon->AddTextButton(ID_COMMON_KEY_LAYOUT_BUTTON, DrawPoint(280, offsY - 5), Extent(120, 22), - TextureColor::Grey, _("Readme"), NormalFont); + groupCommon->AddText(ID_txtCommonKeyLayout, DrawPoint(80, offsY), _("Keyboard layout:"), COLOR_YELLOW, FontStyle{}, + NormalFont); + groupCommon->AddTextButton(ID_btCommonKeyLayout, DrawPoint(280, offsY - 5), Extent(120, 22), TextureColor::Grey, + _("Readme"), NormalFont); offsY += 40; - groupCommon->AddText(ID_COMMON_LOCAL_PORT_LABEL, DrawPoint(80, offsY), _("Local Port:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonLocalPort, DrawPoint(80, offsY), _("Local Port:"), COLOR_YELLOW, FontStyle{}, NormalFont); - ctrlEdit* edtPort = groupCommon->AddEdit(ID_COMMON_LOCAL_PORT_EDIT, DrawPoint(280, offsY - 5), Extent(190, 22), + ctrlEdit* edtPort = groupCommon->AddEdit(ID_edtCommonLocalPort, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, NormalFont, 15); edtPort->SetNumberOnly(true); edtPort->SetText(SETTINGS.server.localPort); - // IPv4/6 offsY += 40; - groupCommon->AddText(ID_COMMON_IPV6_LABEL, DrawPoint(80, offsY), _("Use IPv6:"), COLOR_YELLOW, FontStyle{}, - NormalFont); + groupCommon->AddText(ID_txtCommonIpv6, DrawPoint(80, offsY), _("Use IPv6:"), COLOR_YELLOW, FontStyle{}, NormalFont); - ctrlOptionGroup* ipv6 = groupCommon->AddOptionGroup(ID_COMMON_IPV6_GROUP, GroupSelectType::Check); - ipv6->AddTextButton(ID_COMMON_IPV6_BUTTON_ON, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, - _("IPv6"), NormalFont); - ipv6->AddTextButton(ID_COMMON_IPV6_BUTTON_OFF, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, - _("IPv4"), NormalFont); - ipv6->SetSelection((SETTINGS.server.ipv6 ? ID_COMMON_IPV6_BUTTON_ON : ID_COMMON_IPV6_BUTTON_OFF)); + ctrlOptionGroup* ipv6 = groupCommon->AddOptionGroup(ID_optCommonIpv6, GroupSelectType::Check); + ipv6->AddTextButton(ID_btCommonIpv6On, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, _("IPv6"), + NormalFont); + ipv6->AddTextButton(ID_btCommonIpv6Off, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("IPv4"), + NormalFont); + ipv6->SetSelection((SETTINGS.server.ipv6 ? ID_btCommonIpv6On : ID_btCommonIpv6Off)); - // ipv6-feld ggf (de-)aktivieren - ipv6->GetCtrl(ID_COMMON_IPV6_BUTTON_ON)->SetEnabled(SETTINGS.proxy.type != ProxyType::Socks5); //-V807 + ipv6->GetCtrl(ID_btCommonIpv6On)->SetEnabled(SETTINGS.proxy.type != ProxyType::Socks5); //-V807 - // Proxyserver offsY += 50; - groupCommon->AddText(ID_COMMON_PROXY_LABEL, DrawPoint(80, offsY), _("Proxyserver:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonProxy, DrawPoint(80, offsY), _("Proxyserver:"), COLOR_YELLOW, FontStyle{}, NormalFont); - ctrlEdit* proxy = groupCommon->AddEdit(ID_COMMON_PROXY_EDIT_ADDRESS, DrawPoint(280, offsY - 5), Extent(190, 22), + ctrlEdit* proxy = groupCommon->AddEdit(ID_edtCommonProxyAddress, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, NormalFont); proxy->SetText(SETTINGS.proxy.hostname); - proxy = groupCommon->AddEdit(ID_COMMON_PROXY_EDIT_PORT, DrawPoint(480, offsY - 5), Extent(50, 22), - TextureColor::Grey, NormalFont, 5); + proxy = groupCommon->AddEdit(ID_edtCommonProxyPort, DrawPoint(480, offsY - 5), Extent(50, 22), TextureColor::Grey, + NormalFont, 5); proxy->SetNumberOnly(true); proxy->SetText(SETTINGS.proxy.port); - // Proxytyp offsY += 30; - groupCommon->AddText(ID_COMMON_PROXY_TYPE_LABEL, DrawPoint(80, offsY), _("Proxytyp:"), COLOR_YELLOW, FontStyle{}, + groupCommon->AddText(ID_txtCommonProxyType, DrawPoint(80, offsY), _("Proxytyp:"), COLOR_YELLOW, FontStyle{}, NormalFont); - combo = groupCommon->AddComboBox(ID_COMMON_PROXY_TYPE_COMBO, DrawPoint(280, offsY - 5), Extent(390, 20), + combo = groupCommon->AddComboBox(ID_cbCommonProxyType, DrawPoint(280, offsY - 5), Extent(390, 20), TextureColor::Grey, NormalFont, 100); combo->AddString(_("No Proxy")); combo->AddString(_("Socks v4")); @@ -279,77 +261,69 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) } offsY += 50; - groupCommon->AddText(ID_COMMON_DEBUG_DATA_LABEL, DrawPoint(80, offsY), _("Submit debug data:"), COLOR_YELLOW, + groupCommon->AddText(ID_txtCommonDebugData, DrawPoint(80, offsY), _("Submit debug data:"), COLOR_YELLOW, FontStyle{}, NormalFont); - optiongroup = groupCommon->AddOptionGroup(ID_COMMON_DEBUG_DATA_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_COMMON_DEBUG_DATA_ON, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, + optiongroup = groupCommon->AddOptionGroup(ID_optCommonDebugData, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btCommonDebugDataOn, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, _("On"), NormalFont); - optiongroup->AddTextButton(ID_COMMON_DEBUG_DATA_OFF, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, + optiongroup->AddTextButton(ID_btCommonDebugDataOff, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont); optiongroup->SetSelection( - ((SETTINGS.global.submit_debug_data == 1) ? ID_COMMON_DEBUG_DATA_ON : ID_COMMON_DEBUG_DATA_OFF)); //-V807 + ((SETTINGS.global.submit_debug_data == 1) ? ID_btCommonDebugDataOn : ID_btCommonDebugDataOff)); //-V807 - // qx:upnp switch offsY += 30; - groupCommon->AddText(ID_COMMON_UPNP_LABEL, DrawPoint(80, offsY), _("Use UPnP"), COLOR_YELLOW, FontStyle{}, - NormalFont); - ctrlOptionGroup* upnp = groupCommon->AddOptionGroup(ID_COMMON_UPNP_GROUP, GroupSelectType::Check); - upnp->AddTextButton(ID_COMMON_UPNP_OFF, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("Off"), + groupCommon->AddText(ID_txtCommonUpnp, DrawPoint(80, offsY), _("Use UPnP"), COLOR_YELLOW, FontStyle{}, NormalFont); + ctrlOptionGroup* upnp = groupCommon->AddOptionGroup(ID_optCommonUpnp, GroupSelectType::Check); + upnp->AddTextButton(ID_btCommonUpnpOff, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont); - upnp->AddTextButton(ID_COMMON_UPNP_ON, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, _("On"), + upnp->AddTextButton(ID_btCommonUpnpOn, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, _("On"), NormalFont); - upnp->SetSelection((SETTINGS.global.use_upnp == 1) ? ID_COMMON_UPNP_ON : ID_COMMON_UPNP_OFF); + upnp->SetSelection((SETTINGS.global.use_upnp == 1) ? ID_btCommonUpnpOn : ID_btCommonUpnpOff); offsY += 30; - groupCommon->AddText(ID_COMMON_SMART_CURSOR_LABEL, DrawPoint(80, offsY), _("Smart Cursor"), COLOR_YELLOW, - FontStyle{}, NormalFont); - ctrlOptionGroup* smartCursor = groupCommon->AddOptionGroup(ID_COMMON_SMART_CURSOR_GROUP, GroupSelectType::Check); + groupCommon->AddText(ID_txtCommonSmartCursor, DrawPoint(80, offsY), _("Smart Cursor"), COLOR_YELLOW, FontStyle{}, + NormalFont); + ctrlOptionGroup* smartCursor = groupCommon->AddOptionGroup(ID_optCommonSmartCursor, GroupSelectType::Check); smartCursor->AddTextButton( - ID_COMMON_SMART_CURSOR_OFF, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont, + ID_btCommonSmartCursorOff, DrawPoint(280, offsY - 5), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont, _("Don't move cursor automatically\nUseful e.g. for split-screen / dual-mice multiplayer (see wiki)")); - smartCursor->AddTextButton(ID_COMMON_SMART_CURSOR_ON, DrawPoint(480, offsY - 5), Extent(190, 22), - TextureColor::Grey, _("On"), NormalFont, + smartCursor->AddTextButton(ID_btCommonSmartCursorOn, DrawPoint(480, offsY - 5), Extent(190, 22), TextureColor::Grey, + _("On"), NormalFont, _("Place cursor on default button for new dialogs / action windows (default)")); - smartCursor->SetSelection(SETTINGS.global.smartCursor ? ID_COMMON_SMART_CURSOR_ON : ID_COMMON_SMART_CURSOR_OFF); + smartCursor->SetSelection(SETTINGS.global.smartCursor ? ID_btCommonSmartCursorOn : ID_btCommonSmartCursorOff); // } - // "Fullscreen resolution" - groupGraphics->AddText(ID_GRAPHICS_RESOLUTION_LABEL, DrawPoint(80, 80), _("Fullscreen resolution:"), COLOR_YELLOW, + groupGraphics->AddText(ID_txtGraphicsResolution, DrawPoint(80, 80), _("Fullscreen resolution:"), COLOR_YELLOW, FontStyle{}, NormalFont); - groupGraphics->AddComboBox(ID_GRAPHICS_RESOLUTION_COMBO, DrawPoint(280, 75), Extent(190, 22), TextureColor::Grey, + groupGraphics->AddComboBox(ID_cbGraphicsResolution, DrawPoint(280, 75), Extent(190, 22), TextureColor::Grey, NormalFont, 150); - // "Mode" - groupGraphics->AddText(ID_GRAPHICS_MODE_LABEL, DrawPoint(80, 130), _("Mode:"), COLOR_YELLOW, FontStyle{}, - NormalFont); - optiongroup = groupGraphics->AddOptionGroup(ID_GRAPHICS_MODE_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_GRAPHICS_MODE_FULLSCREEN, DrawPoint(480, 125), Extent(190, 22), TextureColor::Grey, + groupGraphics->AddText(ID_txtGraphicsMode, DrawPoint(80, 130), _("Mode:"), COLOR_YELLOW, FontStyle{}, NormalFont); + optiongroup = groupGraphics->AddOptionGroup(ID_optGraphicsMode, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btGraphicsModeFullscreen, DrawPoint(480, 125), Extent(190, 22), TextureColor::Grey, _("Fullscreen"), NormalFont); - optiongroup->AddTextButton(ID_GRAPHICS_MODE_WINDOWED, DrawPoint(280, 125), Extent(190, 22), TextureColor::Grey, + optiongroup->AddTextButton(ID_btGraphicsModeWindowed, DrawPoint(280, 125), Extent(190, 22), TextureColor::Grey, _("Windowed"), NormalFont); - // "VSync" - groupGraphics->AddText(ID_GRAPHICS_VSYNC_LABEL, DrawPoint(80, 180), _("Limit Framerate:"), COLOR_YELLOW, - FontStyle{}, NormalFont); - groupGraphics->AddComboBox(ID_GRAPHICS_VSYNC_COMBO, DrawPoint(280, 175), Extent(390, 22), TextureColor::Grey, - NormalFont, 150); + groupGraphics->AddText(ID_txtGraphicsVsync, DrawPoint(80, 180), _("Limit Framerate:"), COLOR_YELLOW, FontStyle{}, + NormalFont); + groupGraphics->AddComboBox(ID_cbGraphicsVsync, DrawPoint(280, 175), Extent(390, 22), TextureColor::Grey, NormalFont, + 150); - // "VBO" - groupGraphics->AddText(ID_GRAPHICS_VBO_LABEL, DrawPoint(80, 230), _("Vertex Buffer Objects:"), COLOR_YELLOW, + groupGraphics->AddText(ID_txtGraphicsVbo, DrawPoint(80, 230), _("Vertex Buffer Objects:"), COLOR_YELLOW, FontStyle{}, NormalFont); - optiongroup = groupGraphics->AddOptionGroup(ID_GRAPHICS_VBO_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_GRAPHICS_VBO_ON, DrawPoint(280, 225), Extent(190, 22), TextureColor::Grey, _("On"), + optiongroup = groupGraphics->AddOptionGroup(ID_optGraphicsVbo, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btGraphicsVboOn, DrawPoint(280, 225), Extent(190, 22), TextureColor::Grey, _("On"), NormalFont); - optiongroup->AddTextButton(ID_GRAPHICS_VBO_OFF, DrawPoint(480, 225), Extent(190, 22), TextureColor::Grey, _("Off"), + optiongroup->AddTextButton(ID_btGraphicsVboOff, DrawPoint(480, 225), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont); - // "Graphics Driver" - groupGraphics->AddText(ID_GRAPHICS_DRIVER_LABEL, DrawPoint(80, 275), _("Graphics Driver"), COLOR_YELLOW, - FontStyle{}, NormalFont); - combo = groupGraphics->AddComboBox(ID_GRAPHICS_DRIVER_COMBO, DrawPoint(280, 275), Extent(390, 20), - TextureColor::Grey, NormalFont, 100); + groupGraphics->AddText(ID_txtGraphicsDriver, DrawPoint(80, 275), _("Graphics Driver"), COLOR_YELLOW, FontStyle{}, + NormalFont); + combo = groupGraphics->AddComboBox(ID_cbGraphicsDriver, DrawPoint(280, 275), Extent(390, 20), TextureColor::Grey, + NormalFont, 100); const auto video_drivers = drivers::DriverWrapper::LoadDriverList(drivers::DriverType::Video); @@ -360,18 +334,16 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) combo->SetSelection(combo->GetNumItems() - 1); } - groupGraphics->AddText(ID_GRAPHICS_OPTIMIZED_TEXTURES_LABEL, DrawPoint(80, 320), _("Optimized Textures:"), - COLOR_YELLOW, FontStyle{}, NormalFont); - optiongroup = groupGraphics->AddOptionGroup(ID_GRAPHICS_OPTIMIZED_TEXTURES_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_GRAPHICS_OPTIMIZED_TEXTURES_ON, DrawPoint(280, 315), Extent(190, 22), + groupGraphics->AddText(ID_txtGraphicsOptimizedTextures, DrawPoint(80, 320), _("Optimized Textures:"), COLOR_YELLOW, + FontStyle{}, NormalFont); + optiongroup = groupGraphics->AddOptionGroup(ID_optGraphicsOptimizedTextures, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btGraphicsOptimizedTexturesOn, DrawPoint(280, 315), Extent(190, 22), TextureColor::Grey, _("On"), NormalFont); - optiongroup->AddTextButton(ID_GRAPHICS_OPTIMIZED_TEXTURES_OFF, DrawPoint(480, 315), Extent(190, 22), + optiongroup->AddTextButton(ID_btGraphicsOptimizedTexturesOff, DrawPoint(480, 315), Extent(190, 22), TextureColor::Grey, _("Off"), NormalFont); - // "Sounddriver" - groupSound->AddText(ID_SOUND_DRIVER_LABEL, DrawPoint(80, 230), _("Sounddriver"), COLOR_YELLOW, FontStyle{}, - NormalFont); - combo = groupSound->AddComboBox(ID_SOUND_DRIVER_COMBO, DrawPoint(280, 225), Extent(390, 20), TextureColor::Grey, + groupSound->AddText(ID_txtSoundDriver, DrawPoint(80, 230), _("Sounddriver"), COLOR_YELLOW, FontStyle{}, NormalFont); + combo = groupSound->AddComboBox(ID_cbSoundDriver, DrawPoint(280, 225), Extent(390, 20), TextureColor::Grey, NormalFont, 100); const auto audio_drivers = drivers::DriverWrapper::LoadDriverList(drivers::DriverType::Audio); @@ -383,38 +355,33 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) combo->SetSelection(combo->GetNumItems() - 1); } - // Music - groupSound->AddText(ID_SOUND_MUSIC_LABEL, DrawPoint(80, 80), _("Music"), COLOR_YELLOW, FontStyle{}, NormalFont); - optiongroup = groupSound->AddOptionGroup(ID_SOUND_MUSIC_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_SOUND_MUSIC_ON, DrawPoint(280, 75), Extent(90, 22), TextureColor::Grey, _("On"), + groupSound->AddText(ID_txtSoundMusic, DrawPoint(80, 80), _("Music"), COLOR_YELLOW, FontStyle{}, NormalFont); + optiongroup = groupSound->AddOptionGroup(ID_optSoundMusic, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btSoundMusicOn, DrawPoint(280, 75), Extent(90, 22), TextureColor::Grey, _("On"), NormalFont); - optiongroup->AddTextButton(ID_SOUND_MUSIC_OFF, DrawPoint(380, 75), Extent(90, 22), TextureColor::Grey, _("Off"), + optiongroup->AddTextButton(ID_btSoundMusicOff, DrawPoint(380, 75), Extent(90, 22), TextureColor::Grey, _("Off"), NormalFont); - ctrlProgress* Mvolume = groupSound->AddProgress(ID_SOUND_MUSIC_VOLUME, DrawPoint(480, 75), Extent(190, 22), + ctrlProgress* Mvolume = groupSound->AddProgress(ID_pgSoundMusicVolume, DrawPoint(480, 75), Extent(190, 22), TextureColor::Grey, 139, 138, 100); Mvolume->SetPosition((SETTINGS.sound.musicVolume * 100) / 255); //-V807 - // Effects - groupSound->AddText(ID_SOUND_EFFECTS_LABEL, DrawPoint(80, 130), _("Effects"), COLOR_YELLOW, FontStyle{}, - NormalFont); - optiongroup = groupSound->AddOptionGroup(ID_SOUND_EFFECTS_GROUP, GroupSelectType::Check); - optiongroup->AddTextButton(ID_SOUND_EFFECTS_ON, DrawPoint(280, 125), Extent(90, 22), TextureColor::Grey, _("On"), + groupSound->AddText(ID_txtSoundEffects, DrawPoint(80, 130), _("Effects"), COLOR_YELLOW, FontStyle{}, NormalFont); + optiongroup = groupSound->AddOptionGroup(ID_optSoundEffects, GroupSelectType::Check); + optiongroup->AddTextButton(ID_btSoundEffectsOn, DrawPoint(280, 125), Extent(90, 22), TextureColor::Grey, _("On"), NormalFont); - optiongroup->AddTextButton(ID_SOUND_EFFECTS_OFF, DrawPoint(380, 125), Extent(90, 22), TextureColor::Grey, _("Off"), + optiongroup->AddTextButton(ID_SoundEffectsOff, DrawPoint(380, 125), Extent(90, 22), TextureColor::Grey, _("Off"), NormalFont); - ctrlProgress* FXvolume = groupSound->AddProgress(ID_SOUND_EFFECTS_VOLUME, DrawPoint(480, 125), Extent(190, 22), + ctrlProgress* FXvolume = groupSound->AddProgress(ID_pgSoundEffectsVolume, DrawPoint(480, 125), Extent(190, 22), TextureColor::Grey, 139, 138, 100); FXvolume->SetPosition((SETTINGS.sound.effectsVolume * 100) / 255); - // Music player - groupSound->AddTextButton(ID_SOUND_MUSIC_PLAYER, DrawPoint(280, 175), Extent(190, 22), TextureColor::Grey, + groupSound->AddTextButton(ID_btSoundMusicPlayer, DrawPoint(280, 175), Extent(190, 22), TextureColor::Grey, _("Music player"), NormalFont); - // Activate "Common" - optiongroup = GetCtrl(ID_OPTIONS_GROUP); - optiongroup->SetSelection(ID_COMMON_BUTTON, true); + optiongroup = GetCtrl(ID_optOptions); + optiongroup->SetSelection(ID_btCommon, true); // Graphics // { @@ -422,7 +389,7 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) loadVideoModes(); // Und zu der Combobox hinzufügen - ctrlComboBox& cbVideoModes = *groupGraphics->GetCtrl(ID_GRAPHICS_RESOLUTION_COMBO); + ctrlComboBox& cbVideoModes = *groupGraphics->GetCtrl(ID_cbGraphicsResolution); for(const auto& videoMode : video_modes) { VideoMode ratio = getAspectRatio(videoMode); @@ -442,12 +409,12 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) } // "Vollbild" setting - optiongroup = groupGraphics->GetCtrl(ID_GRAPHICS_MODE_GROUP); + optiongroup = groupGraphics->GetCtrl(ID_optGraphicsMode); optiongroup->SetSelection( - (SETTINGS.video.fullscreen ? ID_GRAPHICS_MODE_FULLSCREEN : ID_GRAPHICS_MODE_WINDOWED)); //-V807 + (SETTINGS.video.fullscreen ? ID_btGraphicsModeFullscreen : ID_btGraphicsModeWindowed)); //-V807 // "Limit Framerate" füllen - auto* cbFrameRate = groupGraphics->GetCtrl(ID_GRAPHICS_VSYNC_COMBO); + auto* cbFrameRate = groupGraphics->GetCtrl(ID_cbGraphicsVsync); if(VIDEODRIVER.HasVSync()) cbFrameRate->AddString(_("Dynamic (Limits to display refresh rate, works with most drivers)")); for(int framerate : Settings::SCREEN_REFRESH_RATES) @@ -463,24 +430,24 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0)) cbFrameRate->SetSelection(0); // "VBO" setting - optiongroup = groupGraphics->GetCtrl(ID_GRAPHICS_VBO_GROUP); - optiongroup->SetSelection((SETTINGS.video.vbo ? ID_GRAPHICS_VBO_ON : ID_GRAPHICS_VBO_OFF)); + optiongroup = groupGraphics->GetCtrl(ID_optGraphicsVbo); + optiongroup->SetSelection((SETTINGS.video.vbo ? ID_btGraphicsVboOn : ID_btGraphicsVboOff)); - optiongroup = groupGraphics->GetCtrl(ID_GRAPHICS_OPTIMIZED_TEXTURES_GROUP); + optiongroup = groupGraphics->GetCtrl(ID_optGraphicsOptimizedTextures); optiongroup->SetSelection( - (SETTINGS.video.shared_textures ? ID_GRAPHICS_OPTIMIZED_TEXTURES_ON : ID_GRAPHICS_OPTIMIZED_TEXTURES_OFF)); + (SETTINGS.video.shared_textures ? ID_btGraphicsOptimizedTexturesOn : ID_btGraphicsOptimizedTexturesOff)); // } // Sound // { // "Music" setting - optiongroup = groupSound->GetCtrl(ID_SOUND_MUSIC_GROUP); - optiongroup->SetSelection((SETTINGS.sound.musicEnabled ? ID_SOUND_MUSIC_ON : ID_SOUND_MUSIC_OFF)); + optiongroup = groupSound->GetCtrl(ID_optSoundMusic); + optiongroup->SetSelection((SETTINGS.sound.musicEnabled ? ID_btSoundMusicOn : ID_btSoundMusicOff)); // "Effects" setting - optiongroup = groupSound->GetCtrl(ID_SOUND_EFFECTS_GROUP); - optiongroup->SetSelection((SETTINGS.sound.effectsEnabled ? ID_SOUND_EFFECTS_ON : ID_SOUND_EFFECTS_OFF)); + optiongroup = groupSound->GetCtrl(ID_optSoundEffects); + optiongroup->SetSelection((SETTINGS.sound.effectsEnabled ? ID_btSoundEffectsOn : ID_SoundEffectsOff)); // } @@ -499,13 +466,13 @@ void dskOptions::Msg_Group_ProgressChange(const unsigned /*group_id*/, const uns { switch(ctrl_id) { - case ID_SOUND_EFFECTS_VOLUME: + case ID_pgSoundEffectsVolume: { SETTINGS.sound.effectsVolume = static_cast((position * 255) / 100); AUDIODRIVER.SetMasterEffectVolume(SETTINGS.sound.effectsVolume); } break; - case ID_SOUND_MUSIC_PLAYER: + case ID_btSoundMusicPlayer: { SETTINGS.sound.musicVolume = static_cast((position * 255) / 100); AUDIODRIVER.SetMusicVolume(SETTINGS.sound.musicVolume); @@ -521,11 +488,11 @@ void dskOptions::Msg_Group_ComboSelectItem(const unsigned group_id, const unsign switch(ctrl_id) { - case ID_COMMON_PORTRAIT_COMBO: + case ID_cbCommonPortrait: SETTINGS.lobby.portraitIndex = selection; updatePortraitControls(); break; - case ID_COMMON_LANGUAGE_COMBO: + case ID_cbCommonLanguage: { // Language changed? std::string old_lang = SETTINGS.language.language; //-V807 @@ -534,7 +501,7 @@ void dskOptions::Msg_Group_ComboSelectItem(const unsigned group_id, const unsign WINDOWMANAGER.Switch(std::make_unique()); } break; - case ID_COMMON_PROXY_TYPE_COMBO: + case ID_cbCommonProxyType: switch(selection) { case 0: SETTINGS.proxy.type = ProxyType::None; break; @@ -545,24 +512,24 @@ void dskOptions::Msg_Group_ComboSelectItem(const unsigned group_id, const unsign // ipv6 gleich sichtbar deaktivieren if(SETTINGS.proxy.type == ProxyType::Socks4 && SETTINGS.server.ipv6) { - GetCtrl(ID_GROUP_COMMON) - ->GetCtrl(ID_COMMON_IPV6_GROUP) - ->SetSelection(ID_COMMON_IPV6_BUTTON_OFF); - GetCtrl(ID_GROUP_COMMON) - ->GetCtrl(ID_COMMON_IPV6_GROUP) - ->GetCtrl(ID_COMMON_IPV6_BUTTON_ON) + GetCtrl(ID_groupCommon) + ->GetCtrl(ID_optCommonIpv6) + ->SetSelection(ID_btCommonIpv6Off); + GetCtrl(ID_groupCommon) + ->GetCtrl(ID_optCommonIpv6) + ->GetCtrl(ID_btCommonIpv6On) ->SetEnabled(false); SETTINGS.server.ipv6 = false; } if(SETTINGS.proxy.type != ProxyType::Socks4) - GetCtrl(ID_GROUP_COMMON) - ->GetCtrl(ID_COMMON_IPV6_GROUP) - ->GetCtrl(ID_COMMON_IPV6_BUTTON_ON) + GetCtrl(ID_groupCommon) + ->GetCtrl(ID_optCommonIpv6) + ->GetCtrl(ID_btCommonIpv6On) ->SetEnabled(true); break; - case ID_COMMON_LOCAL_PORT_EDIT: SETTINGS.video.fullscreenSize = video_modes[selection]; break; - case ID_GRAPHICS_VSYNC_COMBO: + case ID_edtCommonLocalPort: SETTINGS.video.fullscreenSize = video_modes[selection]; break; + case ID_cbGraphicsVsync: if(VIDEODRIVER.HasVSync()) { if(selection == 0) @@ -574,8 +541,8 @@ void dskOptions::Msg_Group_ComboSelectItem(const unsigned group_id, const unsign VIDEODRIVER.setTargetFramerate(SETTINGS.video.vsync); break; - case ID_GRAPHICS_DRIVER_COMBO: SETTINGS.driver.video = combo->GetText(selection); break; - case ID_SOUND_DRIVER_COMBO: SETTINGS.driver.audio = combo->GetText(selection); break; + case ID_cbGraphicsDriver: SETTINGS.driver.video = combo->GetText(selection); break; + case ID_cbSoundDriver: SETTINGS.driver.audio = combo->GetText(selection); break; } } @@ -584,49 +551,49 @@ void dskOptions::Msg_Group_OptionGroupChange(const unsigned /*group_id*/, const { switch(ctrl_id) { - case ID_COMMON_IPV6_GROUP: + case ID_optCommonIpv6: { switch(selection) { - case ID_COMMON_IPV6_BUTTON_ON: SETTINGS.server.ipv6 = true; break; - case ID_COMMON_IPV6_BUTTON_OFF: SETTINGS.server.ipv6 = false; break; + case ID_btCommonIpv6On: SETTINGS.server.ipv6 = true; break; + case ID_btCommonIpv6Off: SETTINGS.server.ipv6 = false; break; } } break; - case ID_GRAPHICS_MODE_GROUP: + case ID_optGraphicsMode: { switch(selection) { - case ID_GRAPHICS_MODE_FULLSCREEN: SETTINGS.video.fullscreen = true; break; - case ID_GRAPHICS_MODE_WINDOWED: SETTINGS.video.fullscreen = false; break; + case ID_btGraphicsModeFullscreen: SETTINGS.video.fullscreen = true; break; + case ID_btGraphicsModeWindowed: SETTINGS.video.fullscreen = false; break; } } break; - case ID_GRAPHICS_VBO_GROUP: + case ID_optGraphicsVbo: { switch(selection) { - case ID_GRAPHICS_VBO_ON: SETTINGS.video.vbo = true; break; - case ID_GRAPHICS_VBO_OFF: SETTINGS.video.vbo = false; break; + case ID_btGraphicsVboOn: SETTINGS.video.vbo = true; break; + case ID_btGraphicsVboOff: SETTINGS.video.vbo = false; break; } } break; - case ID_GRAPHICS_OPTIMIZED_TEXTURES_GROUP: + case ID_optGraphicsOptimizedTextures: { switch(selection) { - case ID_GRAPHICS_OPTIMIZED_TEXTURES_ON: SETTINGS.video.shared_textures = true; break; - case ID_GRAPHICS_OPTIMIZED_TEXTURES_OFF: SETTINGS.video.shared_textures = false; break; + case ID_btGraphicsOptimizedTexturesOn: SETTINGS.video.shared_textures = true; break; + case ID_btGraphicsOptimizedTexturesOff: SETTINGS.video.shared_textures = false; break; } } break; - case ID_SOUND_MUSIC_GROUP: + case ID_optSoundMusic: { switch(selection) { - case ID_SOUND_MUSIC_ON: SETTINGS.sound.musicEnabled = true; break; - case ID_SOUND_MUSIC_OFF: SETTINGS.sound.musicEnabled = false; break; + case ID_btSoundMusicOn: SETTINGS.sound.musicEnabled = true; break; + case ID_btSoundMusicOff: SETTINGS.sound.musicEnabled = false; break; } if(SETTINGS.sound.musicEnabled) MUSICPLAYER.Play(); @@ -634,39 +601,39 @@ void dskOptions::Msg_Group_OptionGroupChange(const unsigned /*group_id*/, const MUSICPLAYER.Stop(); } break; - case ID_SOUND_EFFECTS_GROUP: + case ID_optSoundEffects: { switch(selection) { - case ID_SOUND_EFFECTS_ON: SETTINGS.sound.effectsEnabled = true; break; - case ID_SOUND_EFFECTS_OFF: SETTINGS.sound.effectsEnabled = false; break; + case ID_btSoundEffectsOn: SETTINGS.sound.effectsEnabled = true; break; + case ID_SoundEffectsOff: SETTINGS.sound.effectsEnabled = false; break; } } break; - case ID_COMMON_DEBUG_DATA_GROUP: + case ID_optCommonDebugData: { switch(selection) { - case ID_COMMON_DEBUG_DATA_ON: SETTINGS.global.submit_debug_data = 1; break; - case ID_COMMON_DEBUG_DATA_OFF: SETTINGS.global.submit_debug_data = 2; break; + case ID_btCommonDebugDataOn: SETTINGS.global.submit_debug_data = 1; break; + case ID_btCommonDebugDataOff: SETTINGS.global.submit_debug_data = 2; break; } } break; - case ID_COMMON_UPNP_GROUP: + case ID_optCommonUpnp: { switch(selection) { - case ID_COMMON_UPNP_ON: SETTINGS.global.use_upnp = 1; break; - case ID_COMMON_UPNP_OFF: SETTINGS.global.use_upnp = 0; break; + case ID_btCommonUpnpOn: SETTINGS.global.use_upnp = 1; break; + case ID_btCommonUpnpOff: SETTINGS.global.use_upnp = 0; break; } } break; - case ID_COMMON_SMART_CURSOR_GROUP: + case ID_optCommonSmartCursor: { switch(selection) { - case ID_COMMON_SMART_CURSOR_ON: SETTINGS.global.smartCursor = true; break; - case ID_COMMON_SMART_CURSOR_OFF: SETTINGS.global.smartCursor = false; break; + case ID_btCommonSmartCursorOn: SETTINGS.global.smartCursor = true; break; + case ID_btCommonSmartCursorOff: SETTINGS.global.smartCursor = false; break; } VIDEODRIVER.SetMouseWarping(SETTINGS.global.smartCursor); } @@ -678,11 +645,10 @@ void dskOptions::Msg_OptionGroupChange(const unsigned ctrl_id, const unsigned se { switch(ctrl_id) { - case ID_OPTIONS_GROUP: // Optionengruppen anzeigen + case ID_optOptions: // Optionengruppen anzeigen { - static const std::array buttons{ID_COMMON_BUTTON, ID_GRAPHICS_BUTTON, - ID_SOUND_MUSIC_BUTTON}; - static const std::array groups{ID_GROUP_COMMON, ID_GROUP_GRAPHICS, ID_GROUP_SOUND}; + static const std::array buttons{ID_btCommon, ID_btGraphics, ID_btSoundMusic}; + static const std::array groups{ID_groupCommon, ID_groupGraphics, ID_groupSound}; for(unsigned short i = 0; i < groups.size(); ++i) GetCtrl(groups[i])->SetVisible(selection == buttons[i]); } @@ -709,18 +675,18 @@ void dskOptions::Msg_ButtonClick(const unsigned ctrl_id) { switch(ctrl_id) { - case ID_BACK_BUTTON: + case ID_btBack: { - auto* groupCommon = GetCtrl(ID_GROUP_COMMON); + auto* groupCommon = GetCtrl(ID_groupCommon); // Name abspeichern - SETTINGS.lobby.name = groupCommon->GetCtrl(ID_COMMON_NAME_EDIT)->GetText(); - if(!validatePort(groupCommon->GetCtrl(ID_COMMON_LOCAL_PORT_EDIT)->GetText(), + SETTINGS.lobby.name = groupCommon->GetCtrl(ID_edtCommonName)->GetText(); + if(!validatePort(groupCommon->GetCtrl(ID_edtCommonLocalPort)->GetText(), SETTINGS.server.localPort)) return; - SETTINGS.proxy.hostname = groupCommon->GetCtrl(ID_COMMON_PROXY_EDIT_ADDRESS)->GetText(); - if(!validatePort(groupCommon->GetCtrl(ID_COMMON_PROXY_EDIT_PORT)->GetText(), SETTINGS.proxy.port)) + SETTINGS.proxy.hostname = groupCommon->GetCtrl(ID_edtCommonProxyAddress)->GetText(); + if(!validatePort(groupCommon->GetCtrl(ID_edtCommonProxyPort)->GetText(), SETTINGS.proxy.port)) return; SETTINGS.Save(); @@ -749,7 +715,7 @@ void dskOptions::Msg_ButtonClick(const unsigned ctrl_id) WINDOWMANAGER.Switch(std::make_unique()); } break; - case ID_ADDONS_BUTTON: WINDOWMANAGER.ToggleWindow(std::make_unique(ggs)); break; + case ID_btAddons: WINDOWMANAGER.ToggleWindow(std::make_unique(ggs)); break; } } @@ -758,12 +724,12 @@ void dskOptions::Msg_Group_ButtonClick(const unsigned /*group_id*/, const unsign switch(ctrl_id) { default: break; - case ID_COMMON_PORTRAIT_BUTTON: + case ID_btCommonPortrait: SETTINGS.lobby.portraitIndex = (SETTINGS.lobby.portraitIndex + 1) % Portraits.size(); updatePortraitControls(); break; - case ID_SOUND_MUSIC_PLAYER: WINDOWMANAGER.ToggleWindow(std::make_unique()); break; - case ID_COMMON_KEY_LAYOUT_BUTTON: + case ID_btSoundMusicPlayer: WINDOWMANAGER.ToggleWindow(std::make_unique()); break; + case ID_btCommonKeyLayout: WINDOWMANAGER.ToggleWindow(std::make_unique("keyboardlayout.txt", _("Keyboard layout"))); break; } @@ -818,12 +784,12 @@ void dskOptions::loadVideoModes() void dskOptions::updatePortraitControls() { const auto& newPortrait = Portraits[SETTINGS.lobby.portraitIndex]; - auto* groupCommon = GetCtrl(ID_GROUP_COMMON); + auto* groupCommon = GetCtrl(ID_groupCommon); - auto* portraitButton = groupCommon->GetCtrl(ID_COMMON_PORTRAIT_BUTTON); + auto* portraitButton = groupCommon->GetCtrl(ID_btCommonPortrait); auto* newPortraitTexture = LOADER.GetTextureN(newPortrait.resourceId, newPortrait.resourceIndex); portraitButton->SetImage(newPortraitTexture); - auto* portraitCombo = groupCommon->GetCtrl(ID_COMMON_PORTRAIT_COMBO); + auto* portraitCombo = groupCommon->GetCtrl(ID_cbCommonPortrait); portraitCombo->SetSelection(SETTINGS.lobby.portraitIndex); }