- scriptified PickPlayerClass.

This commit is contained in:
Christoph Oelckers 2017-02-17 20:58:11 +01:00
parent b375657509
commit 6a2525b737
2 changed files with 26 additions and 8 deletions

View file

@ -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)

View file

@ -2,6 +2,7 @@
class PlayerMenu : ListMenu native
{
native int mRotation;
native int PlayerClassIndex;
native PlayerClass mPlayerClass;
native Array<int> PlayerColorSets;
native Array<int> PlayerSkins;
@ -30,6 +31,29 @@ 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();
}
//=============================================================================
//