diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp index 03e84ecbf..daa18d57b 100644 --- a/src/menu/playermenu.cpp +++ b/src/menu/playermenu.cpp @@ -76,7 +76,6 @@ public: void UpdateColorsets(); void UpdateSkins(); void UpdateTranslation(); - void SendNewColor (int red, int green, int blue); void PlayerNameChanged(DMenuItemBase *li); void ColorSetChanged (DMenuItemBase *li); @@ -297,12 +296,6 @@ void DPlayerMenu::PickPlayerClass() // //============================================================================= -void DPlayerMenu::SendNewColor (int red, int green, int blue) -{ - players[consoleplayer].userinfo.ColorChanged(MAKERGB(red,green,blue)); - UpdateTranslation(); -} - DEFINE_ACTION_FUNCTION(DPlayerMenu, ColorChanged) { PARAM_SELF_PROLOGUE(DPlayerMenu); @@ -605,3 +598,4 @@ DEFINE_FIELD(DPlayerMenu, mRotation) DEFINE_FIELD_NAMED(DPlayerMenu, PlayerClass, mPlayerClass) DEFINE_FIELD(DPlayerMenu, PlayerColorSets) DEFINE_FIELD(DPlayerMenu, PlayerSkins) +DEFINE_FIELD(DPlayerMenu, PlayerClassIndex) diff --git a/wadsrc/static/zscript/menu/playermenu.txt b/wadsrc/static/zscript/menu/playermenu.txt index 4463bcea2..0ac5328a0 100644 --- a/wadsrc/static/zscript/menu/playermenu.txt +++ b/wadsrc/static/zscript/menu/playermenu.txt @@ -2,6 +2,7 @@ class PlayerMenu : ListMenu native { native int mRotation; + native int PlayerClassIndex; native PlayerClass mPlayerClass; native Array PlayerColorSets; native Array PlayerSkins; @@ -30,7 +31,30 @@ class PlayerMenu : ListMenu native UpdateTranslation(); } - + //============================================================================= + // + // + // + //============================================================================= + + protected void PickPlayerClass() + { + int pclass = 0; + // [GRB] Pick a class from player class list + if (PlayerClasses.Size () > 1) + { + pclass = players[consoleplayer].GetPlayerClassNum(); + + if (pclass < 0) + { + pclass = (MenuTime() >> 7) % PlayerClasses.Size (); + } + } + PlayerClassIndex = pclass; + mPlayerClass = PlayerClasses[PlayerClassIndex]; + UpdateTranslation(); + } + //============================================================================= // //