diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 18307a347..fdbd0914b 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2090,7 +2090,8 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket) void CClient::ResetMapDownload() { - if(m_pMapdownloadTask){ + if(m_pMapdownloadTask) + { delete m_pMapdownloadTask; m_pMapdownloadTask = NULL; } @@ -2120,7 +2121,8 @@ void CClient::FinishMapDownload() m_MapdownloadTotalsize = prev; SendMapRequest(); } - else{ + else + { if(m_MapdownloadFile) io_close(m_MapdownloadFile); ResetMapDownload(); @@ -3073,11 +3075,14 @@ void CClient::Con_Play(IConsole::IResult *pResult, void *pUserData) void CClient::Con_DemoPlay(IConsole::IResult *pResult, void *pUserData) { CClient *pSelf = (CClient *)pUserData; - if(pSelf->m_DemoPlayer.IsPlaying()){ - if(pSelf->m_DemoPlayer.BaseInfo()->m_Paused){ + if(pSelf->m_DemoPlayer.IsPlaying()) + { + if(pSelf->m_DemoPlayer.BaseInfo()->m_Paused) + { pSelf->m_DemoPlayer.Unpause(); } - else{ + else + { pSelf->m_DemoPlayer.Pause(); } } diff --git a/src/engine/client/fetcher.cpp b/src/engine/client/fetcher.cpp index 0336505b2..06c096707 100644 --- a/src/engine/client/fetcher.cpp +++ b/src/engine/client/fetcher.cpp @@ -108,7 +108,8 @@ void CFetcher::FetchFile(CFetchTask *pTask) IOHANDLE File = io_open(aPath, IOFLAG_WRITE); - if(!File){ + if(!File) + { dbg_msg("fetcher", "i/o error, cannot open file: %s", pTask->m_aDest); pTask->m_State = CFetchTask::STATE_ERROR; return; diff --git a/src/engine/client/updater.cpp b/src/engine/client/updater.cpp index dc598182d..9006c1464 100644 --- a/src/engine/client/updater.cpp +++ b/src/engine/client/updater.cpp @@ -211,8 +211,10 @@ void CUpdater::PerformUpdate() const char *aLastFile; aLastFile = ""; - for(map::reverse_iterator it = m_FileJobs.rbegin(); it != m_FileJobs.rend(); ++it){ - if(it->second){ + for(map::reverse_iterator it = m_FileJobs.rbegin(); it != m_FileJobs.rend(); ++it) + { + if(it->second) + { aLastFile = it->first.c_str(); break; } diff --git a/src/engine/shared/config.cpp b/src/engine/shared/config.cpp index 11f294762..22a7dd338 100644 --- a/src/engine/shared/config.cpp +++ b/src/engine/shared/config.cpp @@ -74,8 +74,8 @@ public: char aLineBuf[1024*2]; char aEscapeBuf[1024*2]; - #define MACRO_CONFIG_INT(Name,ScriptName,def,min,max,flags,desc) if((flags)&CFGFLAG_SAVE){ str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); WriteLine(aLineBuf); } - #define MACRO_CONFIG_STR(Name,ScriptName,len,def,flags,desc) if((flags)&CFGFLAG_SAVE){ EscapeParam(aEscapeBuf, g_Config.m_##Name, sizeof(aEscapeBuf)); str_format(aLineBuf, sizeof(aLineBuf), "%s \"%s\"", #ScriptName, aEscapeBuf); WriteLine(aLineBuf); } + #define MACRO_CONFIG_INT(Name,ScriptName,def,min,max,flags,desc) if((flags)&CFGFLAG_SAVE) { str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); WriteLine(aLineBuf); } + #define MACRO_CONFIG_STR(Name,ScriptName,len,def,flags,desc) if((flags)&CFGFLAG_SAVE) { EscapeParam(aEscapeBuf, g_Config.m_##Name, sizeof(aEscapeBuf)); str_format(aLineBuf, sizeof(aLineBuf), "%s \"%s\"", #ScriptName, aEscapeBuf); WriteLine(aLineBuf); } #include "config_variables.h" diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index a5db5f452..52c77081e 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -772,7 +772,8 @@ void CChat::OnRender() TextRender()->TextColor(0.7f, 0.7f, 1.0f, Blend); // blue else if(m_aLines[r].m_NameColor == TEAM_SPECTATORS) TextRender()->TextColor(0.75f, 0.5f, 0.75f, Blend); // spectator - else if(m_aLines[r].m_NameColor == 2){ + else if(m_aLines[r].m_NameColor == 2) + { vec3 rgb = HslToRgb(vec3(g_Config.m_ClMessageFriendHue / 255.0f, g_Config.m_ClMessageFriendSat / 255.0f, g_Config.m_ClMessageFriendLht / 255.0f)); TextRender()->TextColor(rgb.r, rgb.g, rgb.b, Blend); } diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 90811ae16..93a6ec35e 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1408,7 +1408,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("System message"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { vec3 HSL = RgbToHsl(vec3(1.0f, 1.0f, 0.5f)); // default values g_Config.m_ClMessageSystemHue = HSL.h; g_Config.m_ClMessageSystemSat = HSL.s; @@ -1459,12 +1460,13 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("Highlighted message"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ - vec3 HSL = RgbToHsl(vec3(1.0f, 0.5f, 0.5f)); // default values - g_Config.m_ClMessageHighlightHue = HSL.h; - g_Config.m_ClMessageHighlightSat = HSL.s; - g_Config.m_ClMessageHighlightLht = HSL.l; - } + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { + vec3 HSL = RgbToHsl(vec3(1.0f, 0.5f, 0.5f)); // default values + g_Config.m_ClMessageHighlightHue = HSL.h; + g_Config.m_ClMessageHighlightSat = HSL.s; + g_Config.m_ClMessageHighlightLht = HSL.l; + } } Right.HSplitTop(20.0f, &Button, &Right); Button.VSplitLeft(15.0f, 0, &Button); @@ -1516,7 +1518,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("Team message"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { vec3 HSL = RgbToHsl(vec3(0.65f, 1.0f, 0.65f)); // default values g_Config.m_ClMessageTeamHue = HSL.h; g_Config.m_ClMessageTeamSat = HSL.s; @@ -1568,10 +1571,11 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, "Friend message", 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ - g_Config.m_ClMessageFriendHue = 0; - g_Config.m_ClMessageFriendSat = 255; - g_Config.m_ClMessageFriendLht = 145; + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { + g_Config.m_ClMessageFriendHue = 0; + g_Config.m_ClMessageFriendSat = 255; + g_Config.m_ClMessageFriendLht = 145; } } @@ -1632,7 +1636,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("Normal message"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { vec3 HSL = RgbToHsl(vec3(1.0f, 1.0f, 1.0f)); // default values g_Config.m_ClMessageHue = HSL.h; g_Config.m_ClMessageSat = HSL.s; @@ -1688,7 +1693,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("Inner color"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { vec3 HSL = RgbToHsl(vec3(0.5f, 0.5f, 1.0f)); // default values g_Config.m_ClLaserInnerHue = HSL.h; g_Config.m_ClLaserInnerSat = HSL.s; @@ -1723,7 +1729,8 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) UI()->DoLabelScaled(&Label, Localize("Outline color"), 16.0f, -1); { static int s_DefaultButton = 0; - if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)){ + if (DoButton_Menu(&s_DefaultButton, Localize("Reset"), 0, &Button)) + { vec3 HSL = RgbToHsl(vec3(0.075f, 0.075f, 0.25f)); // default values g_Config.m_ClLaserOutlineHue = HSL.h; g_Config.m_ClLaserOutlineSat = HSL.s; @@ -2083,7 +2090,8 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView) } else if(State >= IUpdater::GETTING_MANIFEST && State < IUpdater::NEED_RESTART) str_format(aBuf, sizeof(aBuf), Localize("Updating...")); - else if(State == IUpdater::NEED_RESTART){ + else if(State == IUpdater::NEED_RESTART) + { str_format(aBuf, sizeof(aBuf), Localize("DDNet Client updated!")); m_NeedRestartUpdate = true; }