about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-04-06 11:41:40 +0200
committeroy <Tom_Adams@web.de>2011-04-06 11:41:40 +0200
commitebca7929751bf74fb6d32b271d5467c5497316e5 (patch)
tree3d9dea4b8aaf36ee26a46b0640ed8ae9041b9449 /src/game/client
parent9b97eb282aabfacf5175f5e0974fada07632f2e8 (diff)
downloadzcatch-ebca7929751bf74fb6d32b271d5467c5497316e5.tar.gz
zcatch-ebca7929751bf74fb6d32b271d5467c5497316e5.zip
improved call vote tab. Closes #573
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/components/menus.cpp11
-rw-r--r--src/game/client/components/menus.h1
-rw-r--r--src/game/client/components/menus_ingame.cpp63
3 files changed, 20 insertions, 55 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index b33a5add..d8ddb276 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -123,17 +123,6 @@ int CMenus::DoButton_MenuTab(const void *pID, const char *pText, int Checked, co
 	return UI()->DoButtonLogic(pID, pText, Checked, pRect);
 }
 
-int CMenus::DoButton_PageMenu(const void *pID, const char *pText, int Checked, bool Active, const CUIRect *pRect, int Corners)
-{
-	if(Active)
-		RenderTools()->DrawUIRect(pRect, vec4(1,1,1,0.5f)*ButtonColorMul(pID), Corners, 10.0f);
-	else
-		RenderTools()->DrawUIRect(pRect, vec4(0.0f, 0.0f, 0.0f, 0.25f), Corners, 10.0f);
-	UI()->DoLabel(pRect, pText, pRect->h*ms_FontmodHeight, 0);
-	
-	return UI()->DoButtonLogic(pID, pText, Checked, pRect);
-}
-
 int CMenus::DoButton_GridHeader(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
 //void CMenus::ui_draw_grid_header(const void *id, const char *text, int checked, const CUIRect *r, const void *extra)
 {
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h
index 3c712f5d..758bcd3d 100644
--- a/src/game/client/components/menus.h
+++ b/src/game/client/components/menus.h
@@ -41,7 +41,6 @@ class CMenus : public CComponent
 	int DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners);
 	int DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
 	int DoButton_MenuTab(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Corners);
-	int DoButton_PageMenu(const void *pID, const char *pText, int Checked, bool Active, const CUIRect *pRect, int Corners);
 
 	int DoButton_CheckBox_Common(const void *pID, const char *pText, const char *pBoxText, const CUIRect *pRect);
 	int DoButton_CheckBox(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp
index fbde9a0b..d3e9933f 100644
--- a/src/game/client/components/menus_ingame.cpp
+++ b/src/game/client/components/menus_ingame.cpp
@@ -387,53 +387,30 @@ void CMenus::RenderServerControl(CUIRect MainView)
 	static int s_ControlPage = 0;
 	
 	// render background
-	RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_B|CUI::CORNER_TL, 10.0f);
-	MainView.HSplitTop(10.0f, 0, &MainView);
-	
-	// page menu
-	CUIRect PageMenu, Button;
-	MainView.HSplitBottom(60.0f, &MainView, &PageMenu);
-	PageMenu.Margin(10.0f, &PageMenu);
-	RenderTools()->DrawUIRect(&PageMenu, vec4(1.0f, 1.0f, 1.0f,0.25f), CUI::CORNER_ALL, 10.0f);
-	PageMenu.Margin(10.0f, &PageMenu);
-
-	PageMenu.VSplitLeft(50.0f, 0, &PageMenu);
-	PageMenu.VSplitLeft(120.0f, &Button, &PageMenu);
-	static int s_PrevButton = 0;
-	if(DoButton_PageMenu(&s_PrevButton, Localize("Prev"), 0, s_ControlPage>0, &Button, CUI::CORNER_L))
-	{
-		if(s_ControlPage > 0)
-		{
-			m_CallvoteSelectedPlayer = -1;
-			m_CallvoteSelectedOption = -1;
-			--s_ControlPage;
-		}
-	}
-	
-	PageMenu.VSplitRight(50.0f, &PageMenu, 0);
-	PageMenu.VSplitRight(120.0f, &PageMenu, &Button);
-	static int s_NextButton = 0;
-	if(DoButton_PageMenu(&s_NextButton, Localize("Next"), 0, s_ControlPage<2, &Button, CUI::CORNER_R))
+	CUIRect Bottom, Extended, TabBar, Button;
+	MainView.HSplitBottom(20.0f, &MainView, &TabBar);
+	RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_T, 10.0f);
+	MainView.Margin(10.0f, &MainView);
+	MainView.HSplitBottom(90.0f, &MainView, &Extended);
+
+	// tab bar
 	{
-		if(s_ControlPage < 2)
-		{
-			m_CallvoteSelectedPlayer = -1;
-			m_CallvoteSelectedOption = -1;
-			++s_ControlPage;
-		}
+		TabBar.VSplitLeft(TabBar.w/3, &Button, &TabBar);
+		static int s_Button0 = 0;
+		if(DoButton_MenuTab(&s_Button0, Localize("Change settings"), s_ControlPage == 0, &Button, CUI::CORNER_BL))
+			s_ControlPage = 0;
+
+		TabBar.VSplitMid(&Button, &TabBar);
+		static int s_Button1 = 0;
+		if(DoButton_MenuTab(&s_Button1, Localize("Kick player"), s_ControlPage == 1, &Button, 0))
+			s_ControlPage = 1;
+
+		static int s_Button2 = 0;
+		if(DoButton_MenuTab(&s_Button2, Localize("Move player to spectators"), s_ControlPage == 2, &TabBar, CUI::CORNER_BR))
+			s_ControlPage = 2;
 	}
-	
-	RenderTools()->DrawUIRect(&PageMenu, vec4(1.0f, 1.0f, 1.0f, 0.5f), 0, 10.0f);
-	char aBuf[64];
-	str_format(aBuf, sizeof(aBuf), Localize("Page %d of %d"), s_ControlPage+1, 3);
-	UI()->DoLabelScaled(&PageMenu, aBuf, PageMenu.h*ms_FontmodHeight, 0);
 
 	// render page
-	CUIRect Bottom, Extended;
-	MainView.VMargin(10.0f, &MainView);
-	RenderTools()->DrawUIRect(&MainView, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 10.0f);
-	MainView.HSplitBottom(90.0f, &MainView, &Extended);
-	MainView.Margin(10.0f, &MainView);
 	MainView.HSplitBottom(ms_ButtonHeight + 5*2, &MainView, &Bottom);
 	Bottom.HMargin(5.0f, &Bottom);