about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-11 01:06:44 +0200
committeroy <Tom_Adams@web.de>2010-10-11 01:06:44 +0200
commitb65a26fe93e54af74d6304e66ec5942ecf4c48e8 (patch)
treeaa64740d1b09c2744c5bfba5f99cddef702e60c6 /src/game/client/components
parent8557d3a022cf250628dc8a03bdc26efd0338bc5d (diff)
downloadzcatch-b65a26fe93e54af74d6304e66ec5942ecf4c48e8.tar.gz
zcatch-b65a26fe93e54af74d6304e66ec5942ecf4c48e8.zip
fixed last commits
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/menus_ingame.cpp11
-rw-r--r--src/game/client/components/voting.cpp13
-rw-r--r--src/game/client/components/voting.h4
3 files changed, 16 insertions, 12 deletions
diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp
index 972b1f59..236a25dc 100644
--- a/src/game/client/components/menus_ingame.cpp
+++ b/src/game/client/components/menus_ingame.cpp
@@ -425,13 +425,13 @@ void CMenus::RenderServerControl(CUIRect MainView)
 		if(s_ControlPage == 1)
 		{
 			CUIRect Reason;
-			Bottom.VSplitRight(140.0f, &Bottom, &Reason);
-			Bottom.VSplitRight(200.0f, &Bottom, &Reason);
+			Bottom.VSplitRight(40.0f, &Bottom, 0);
+			Bottom.VSplitRight(160.0f, &Bottom, &Reason);
+			Reason.HSplitTop(5.0f, 0, &Reason);
 			const char *pLabel = Localize("Reason:");
 			UI()->DoLabel(&Reason, pLabel, 14.0f, -1);
 			float w = TextRender()->TextWidth(0, 14.0f, pLabel, -1);
-			Reason.VSplitLeft(w, 0, &Reason);
-			Reason.VSplitLeft(10.0f, 0, &Reason);
+			Reason.VSplitLeft(w+10.0f, 0, &Reason);
 			static float s_Offset = 0.0f;
 			DoEditBox(&m_aCallvoteReason, &Reason, m_aCallvoteReason, sizeof(m_aCallvoteReason), 14.0f, &s_Offset, false, CUI::CORNER_ALL);
 		}
@@ -453,7 +453,8 @@ void CMenus::RenderServerControl(CUIRect MainView)
 					if(m_CallvoteSelectedPlayer >= 0 && m_CallvoteSelectedPlayer < MAX_CLIENTS &&
 						m_pClient->m_Snap.m_paPlayerInfos[m_CallvoteSelectedPlayer])
 					{
-						m_pClient->m_pVoting->ForcevoteKick(m_CallvoteSelectedPlayer);
+						m_pClient->m_pVoting->ForcevoteKick(m_CallvoteSelectedPlayer, m_aCallvoteReason);
+						m_aCallvoteReason[0] = 0;
 						SetActive(false);
 					}
 				}
diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp
index c5e6a56c..8a98e1b0 100644
--- a/src/game/client/components/voting.cpp
+++ b/src/game/client/components/voting.cpp
@@ -29,7 +29,7 @@ void CVoting::Callvote(const char *pType, const char *pValue)
 	Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
 }
 
-void CVoting::CallvoteKick(int ClientId, char *pReason)
+void CVoting::CallvoteKick(int ClientId, const char *pReason)
 {
 	char aBuf[32];
 	if(pReason[0])
@@ -55,11 +55,14 @@ void CVoting::CallvoteOption(int OptionId)
 	}
 }
 
-void CVoting::ForcevoteKick(int ClientId)
+void CVoting::ForcevoteKick(int ClientId, const char *pReason)
 {
-	char Buf[32];
-	str_format(Buf, sizeof(Buf), "kick %d", ClientId);
-	Client()->Rcon(Buf);
+	char aBuf[32];
+	if(pReason[0])
+		str_format(aBuf, sizeof(aBuf), "kick %d \"%s\"", ClientId, pReason);
+	else
+		str_format(aBuf, sizeof(aBuf), "kick %d", ClientId);
+	Client()->Rcon(aBuf);
 }
 
 void CVoting::ForcevoteOption(int OptionId)
diff --git a/src/game/client/components/voting.h b/src/game/client/components/voting.h
index 1fc2aa53..ff982640 100644
--- a/src/game/client/components/voting.h
+++ b/src/game/client/components/voting.h
@@ -39,9 +39,9 @@ public:
 	
 	void RenderBars(CUIRect Bars, bool Text);
 	
-	void CallvoteKick(int ClientId, char *pReason);
+	void CallvoteKick(int ClientId, const char *pReason);
 	void CallvoteOption(int Option);
-	void ForcevoteKick(int ClientId);
+	void ForcevoteKick(int ClientId, const char *pReason);
 	void ForcevoteOption(int Option);
 	
 	void Vote(int v); // -1 = no, 1 = yes