From 835018cdf1ae3e838a7445e6d62bb69d4da37a24 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Sat, 11 Mar 2006 01:27:33 +0000 Subject: [PATCH] div0's anti-player patch, this puts up a notice suggesting that the user change their player name, and doesn't let them use other parts of the menu until they do so git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1153 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/menuqc/custom/joingame.qm | 7 +++++++ data/menuqc/custom/player.qm | 18 ++++++++++++++++++ data/menuqc/custom/visible.qm | 7 +++++++ 3 files changed, 32 insertions(+) diff --git a/data/menuqc/custom/joingame.qm b/data/menuqc/custom/joingame.qm index bafa7bd9a..ab32403c4 100644 --- a/data/menuqc/custom/joingame.qm +++ b/data/menuqc/custom/joingame.qm @@ -44,10 +44,17 @@ void() Nex_Action_RefreshSlist = HostCache_RefreshHostCache(); }; +void() Nex_Action_JumpToPlayerSetup; void() Nex_Action_JumpToJoinGame = { local entity lItem; + if(cvar_string("_cl_name") == "Player") + { + Nex_Action_JumpToPlayerSetup(); + return; + } + resethostcachemasks(); sethostcachesort( SLIST_FIELD_PING, false ); HostCache_RefreshHostCache(); diff --git a/data/menuqc/custom/player.qm b/data/menuqc/custom/player.qm index f4c734393..70024a41a 100644 --- a/data/menuqc/custom/player.qm +++ b/data/menuqc/custom/player.qm @@ -62,3 +62,21 @@ void() Nex_Action_Player_Apply = lItem = Menu_GetItem( "Data::Player" ); Raise_DataEvent( lItem, ITEM_DATA_SEND ); }; + +// jumps to Player setup +void() Nex_Action_JumpToPlayerSetup = +{ + local entity lItem; + lItem = Menu_GetItem( "Normal::Panel" ); + String_EntitySet( lItem, link, "Options" ); + + Raise_Update( lItem ); + Menu_UpdateRunFlags(); + Menu_JumpToWindow( lItem._link, false, false ); + + lItem = Menu_GetItem( "Options::Dummy::Panel::Player" ); + Nex_MakeOnlyVisible( lItem ); + Menu_JumpToWindow( lItem, false, false ); + + Nex_MessageBox( "Player setup", "Enter a player name first!", "OK", "", Util_NullFunction, Util_NullFunction); +}; diff --git a/data/menuqc/custom/visible.qm b/data/menuqc/custom/visible.qm index 3bf72c4a0..9afc22b48 100644 --- a/data/menuqc/custom/visible.qm +++ b/data/menuqc/custom/visible.qm @@ -55,10 +55,17 @@ void() Nex_Action_SetNormalPanelLink_Destroy = String_EntityFree( self, target ); }; +void() Nex_Action_JumpToPlayerSetup; void() Nex_Action_SetNormalPanelLink_Action = { local entity lItem; + if(self.target == "CreateGame" && cvar_string("_cl_name") == "Player") + { + Nex_Action_JumpToPlayerSetup(); + return; + } + lItem = Menu_GetItem( "Normal::Panel" ); String_EntitySet( lItem, link, self.target ); -- 2.39.2