From 10355851ca45e399942065c265f4faed5ad2baf8 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 29 Sep 2020 00:19:03 +0200 Subject: [PATCH 1/2] Need to send info when updating skin in text field As reported by abcqwerty on Discord --- src/game/client/components/menus.h | 1 + src/game/client/components/menus_settings.cpp | 43 ++++++++----------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index ab734a370..f940ac90f 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -388,6 +388,7 @@ protected: void RenderSettings(CUIRect MainView); void RenderSettingsCustom(CUIRect MainView); + void SetNeedSendInfo(); void SetActive(bool Active); IGraphics::CTextureHandle m_TextureBlob; diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 1eb11caf3..43b92a200 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -318,6 +318,14 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) } } +void CMenus::SetNeedSendInfo() +{ + if(m_Dummy) + m_NeedSendDummyinfo = true; + else + m_NeedSendinfo = true; +} + void CMenus::RenderSettingsPlayer(CUIRect MainView) { CUIRect Button, Label, Dummy; @@ -346,10 +354,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) static float s_OffsetName = 0.0f; if(DoEditBox(pName, &Button, pName, sizeof(g_Config.m_PlayerName), 14.0f, &s_OffsetName, false, CUI::CORNER_ALL, pNameFallback)) { - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } // player clan @@ -363,10 +368,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) static float s_OffsetClan = 0.0f; if(DoEditBox(pClan, &Button, pClan, sizeof(g_Config.m_PlayerClan), 14.0f, &s_OffsetClan)) { - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } if(DoButton_CheckBox(&m_Dummy, Localize("Dummy settings"), m_Dummy, &Dummy)) @@ -414,10 +416,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) if(OldSelected != NewSelected) { *pCountry = m_pClient->m_pCountryFlags->GetByIndex(NewSelected)->m_CountryCode; - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } } @@ -533,7 +532,10 @@ void CMenus::RenderSettingsTee(CUIRect MainView) //UI()->DoLabelScaled(&Label, Skin, 14.0f, -1, 150.0f); static float s_OffsetSkin = 0.0f; static int s_ClearButton = 0; - DoClearableEditBox(Skin, &s_ClearButton, &Label, Skin, sizeof(g_Config.m_ClPlayerSkin), 14.0f, &s_OffsetSkin, false, CUI::CORNER_ALL, "default"); + if(DoClearableEditBox(Skin, &s_ClearButton, &Label, Skin, sizeof(g_Config.m_ClPlayerSkin), 14.0f, &s_OffsetSkin, false, CUI::CORNER_ALL, "default")) + { + SetNeedSendInfo(); + } // custom color selector MainView.HSplitTop(20.0f, 0, &MainView); @@ -542,10 +544,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) if(DoButton_CheckBox(&ColorBody, Localize("Custom colors"), *UseCustomColor, &Button)) { *UseCustomColor = *UseCustomColor ? 0 : 1; - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } MainView.HSplitTop(5.0f, 0, &MainView); @@ -572,10 +571,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) if(PrevColor != *paColors[i]) { - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } } } @@ -652,10 +648,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) if(OldSelected != NewSelected) { mem_copy(Skin, s_paSkinList[NewSelected]->m_aName, sizeof(g_Config.m_ClPlayerSkin)); - if(m_Dummy) - m_NeedSendDummyinfo = true; - else - m_NeedSendinfo = true; + SetNeedSendInfo(); } // render quick search From 94d0c1b95bae362928269446db4ed39dfb17d3f2 Mon Sep 17 00:00:00 2001 From: def Date: Mon, 28 Sep 2020 20:11:02 +0200 Subject: [PATCH 2/2] Update swedish translations (by cur.ie) --- data/languages/swedish.txt | 47 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/data/languages/swedish.txt b/data/languages/swedish.txt index 05a4244e9..63decf420 100644 --- a/data/languages/swedish.txt +++ b/data/languages/swedish.txt @@ -5,6 +5,7 @@ # Martin Pola 2011-04-02 11:17:09 # Kottizen 2011-07-02 00:34:54 # 3edcxzaq1 2020-06-25 00:00:00 +# cur.ie 2020-09-28 00:00:00 ##### /authors ##### ##### translated strings ##### @@ -1177,71 +1178,71 @@ Show others (own team only) == Visa andra (eget lag endast) The width or height of texture %s is not divisible by 16, which might cause visual bugs. -== +== Bredden eller höjden av texturen %s är ej delbar med 16, och kan därav skapa visuella buggar. Warning -== +== Varning Use k key to kill (restart), q to pause and watch other players. See settings for other key binds. -== +== Använd knappen k för att dö (starta om), q för att pausa och se andra spelare. Se inställnignar för andra knappbindningar. Country / Region -== +== Land / Region Speed -== +== Hastighet Search: -== +== Sök: Exclude: -== +== Exkludera: Search servers: -== +== Sök servrar: %d of %d servers -== +== %d av %d servrar. %d of %d server -== +== %d av %d server %d players -== +== %d spelare %d player -== +== %d spelare Skip the main menu -== +== Skippa till huvudmenyn Download skins -== +== Ladda ner skins Client message -== +== Klientmeddelande https://wiki.ddnet.tw/ -== +== https://wiki.ddnet.tw/ Website -== +== Hemsida Settings -== +== Inställningar Stop server -== +== Stoppa servern Run server -== +== Kör servern Server executable not found, can't run server -== +== Server exekveringsfil hittades ej, kan ej starta servern Editor -== +== Editor [Start menu] Play -== +== Spela