From ccbdfbb823220d81351eeb8e4f4b67388ea08d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=8F=D0=B4=D1=8F=20=D0=96=D0=B5=D0=BD=D1=8F?= Date: Tue, 27 Oct 2020 20:23:20 +0300 Subject: [PATCH 1/3] Much more readable Call Vote menu and code --- src/game/client/components/menus_ingame.cpp | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index dc1ff9f57..d2580f07a 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -530,7 +530,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView) TotalShown++; } - UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue); + UiDoListboxStart(&s_VoteList, &List, 20.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue); int i = -1; for(CVoteOptionClient *pOption = m_pClient->m_pVoting->m_pFirst; pOption; pOption = pOption->m_pNext) @@ -542,7 +542,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView) CListboxItem Item = UiDoListboxNextItem(pOption); if(Item.m_Visible) - UI()->DoLabelScaled(&Item.m_Rect, pOption->m_aDescription, 16.0f, -1); + UI()->DoLabelScaled(&Item.m_Rect, pOption->m_aDescription, 14.0f, -1); if(NumVoteOptions < Total) aIndices[NumVoteOptions] = i; @@ -608,13 +608,22 @@ void CMenus::RenderServerControl(CUIRect MainView) static int s_ControlPage = 0; // render background - CUIRect Bottom, Extended, TabBar, Button; + CUIRect Bottom, RconExtension, TabBar, Button; MainView.HSplitTop(20.0f, &Bottom, &MainView); RenderTools()->DrawUIRect(&Bottom, ms_ColorTabbarActive, 0, 10.0f); MainView.HSplitTop(20.0f, &TabBar, &MainView); RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_B, 10.0f); MainView.Margin(10.0f, &MainView); - MainView.HSplitBottom(90.0f, &MainView, &Extended); + + if(Client()->RconAuthed()) + { + MainView.HSplitBottom(90.0f, &MainView, &RconExtension); + + // background + RconExtension.Margin(10.0f, &RconExtension); + RconExtension.HSplitTop(20.0f, &Bottom, &RconExtension); + RconExtension.HSplitTop(5.0f, 0, &RconExtension); + } // tab bar { @@ -722,14 +731,10 @@ void CMenus::RenderServerControl(CUIRect MainView) // extended features (only available when authed in rcon) if(Client()->RconAuthed()) { - // background - Extended.Margin(10.0f, &Extended); - Extended.HSplitTop(20.0f, &Bottom, &Extended); - Extended.HSplitTop(5.0f, 0, &Extended); - // force vote Bottom.VSplitLeft(5.0f, 0, &Bottom); Bottom.VSplitLeft(120.0f, &Button, &Bottom); + static int s_ForceVoteButton = 0; if(DoButton_Menu(&s_ForceVoteButton, Localize("Force vote"), 0, &Button)) { @@ -766,7 +771,7 @@ void CMenus::RenderServerControl(CUIRect MainView) m_pClient->m_pVoting->RemovevoteOption(m_CallvoteSelectedOption); // add vote - Extended.HSplitTop(20.0f, &Bottom, &Extended); + RconExtension.HSplitTop(20.0f, &Bottom, &RconExtension); Bottom.VSplitLeft(5.0f, 0, &Bottom); Bottom.VSplitLeft(250.0f, &Button, &Bottom); UI()->DoLabelScaled(&Button, Localize("Vote description:"), 14.0f, -1); @@ -776,7 +781,7 @@ void CMenus::RenderServerControl(CUIRect MainView) static char s_aVoteDescription[64] = {0}; static char s_aVoteCommand[512] = {0}; - Extended.HSplitTop(20.0f, &Bottom, &Extended); + RconExtension.HSplitTop(20.0f, &Bottom, &RconExtension); Bottom.VSplitRight(10.0f, &Bottom, 0); Bottom.VSplitRight(120.0f, &Bottom, &Button); static int s_AddVoteButton = 0; From 15f5ec9297909d11c4b0804925fc3cd0345a3d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=8F=D0=B4=D1=8F=20=D0=96=D0=B5=D0=BD=D1=8F?= Date: Tue, 27 Oct 2020 20:31:27 +0300 Subject: [PATCH 2/3] Tweaked call vote values --- src/game/client/components/menus_ingame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index d2580f07a..9c0f64d13 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -530,7 +530,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView) TotalShown++; } - UiDoListboxStart(&s_VoteList, &List, 20.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue); + UiDoListboxStart(&s_VoteList, &List, 19.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue); int i = -1; for(CVoteOptionClient *pOption = m_pClient->m_pVoting->m_pFirst; pOption; pOption = pOption->m_pNext) @@ -542,7 +542,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView) CListboxItem Item = UiDoListboxNextItem(pOption); if(Item.m_Visible) - UI()->DoLabelScaled(&Item.m_Rect, pOption->m_aDescription, 14.0f, -1); + UI()->DoLabelScaled(&Item.m_Rect, pOption->m_aDescription, 13.0f, -1); if(NumVoteOptions < Total) aIndices[NumVoteOptions] = i; From d681cc678767ef1218921255865acf6e941c1871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=8F=D0=B4=D1=8F=20=D0=96=D0=B5=D0=BD=D1=8F?= Date: Fri, 30 Oct 2020 06:40:15 +0300 Subject: [PATCH 3/3] Rcon Panel looks just like before in call vote --- src/game/client/components/menus_ingame.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 9c0f64d13..298dbd206 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -616,14 +616,7 @@ void CMenus::RenderServerControl(CUIRect MainView) MainView.Margin(10.0f, &MainView); if(Client()->RconAuthed()) - { MainView.HSplitBottom(90.0f, &MainView, &RconExtension); - - // background - RconExtension.Margin(10.0f, &RconExtension); - RconExtension.HSplitTop(20.0f, &Bottom, &RconExtension); - RconExtension.HSplitTop(5.0f, 0, &RconExtension); - } // tab bar { @@ -731,6 +724,11 @@ void CMenus::RenderServerControl(CUIRect MainView) // extended features (only available when authed in rcon) if(Client()->RconAuthed()) { + // background + RconExtension.Margin(10.0f, &RconExtension); + RconExtension.HSplitTop(20.0f, &Bottom, &RconExtension); + RconExtension.HSplitTop(5.0f, 0, &RconExtension); + // force vote Bottom.VSplitLeft(5.0f, 0, &Bottom); Bottom.VSplitLeft(120.0f, &Button, &Bottom);