File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
wadsrc/static/zscript/actors/player Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,23 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, SetFOV)
520
520
return 0 ;
521
521
}
522
522
523
+ DEFINE_ACTION_FUNCTION (_PlayerInfo, SetSkin)
524
+ {
525
+ PARAM_SELF_STRUCT_PROLOGUE (player_t );
526
+ PARAM_INT (skinIndex);
527
+ if (skinIndex >= 0 && skinIndex < Skins.size ())
528
+ {
529
+ // commented code - cvar_set calls this automatically, along with saving the skin selection.
530
+ // self->userinfo.SkinNumChanged(skinIndex);
531
+ cvar_set (" skin" , Skins[skinIndex].Name .GetChars ());
532
+ ACTION_RETURN_INT (self->userinfo .GetSkin ());
533
+ }
534
+ else
535
+ {
536
+ ACTION_RETURN_INT (-1 );
537
+ }
538
+ }
539
+
523
540
// ===========================================================================
524
541
//
525
542
// EnumColorsets
@@ -773,6 +790,12 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, GetSkin)
773
790
ACTION_RETURN_INT (self->userinfo .GetSkin ());
774
791
}
775
792
793
+ DEFINE_ACTION_FUNCTION (_PlayerInfo, GetSkinCount)
794
+ {
795
+ PARAM_SELF_STRUCT_PROLOGUE (player_t );
796
+ ACTION_RETURN_INT (Skins.size ());
797
+ }
798
+
776
799
DEFINE_ACTION_FUNCTION (_PlayerInfo, GetGender)
777
800
{
778
801
PARAM_SELF_STRUCT_PROLOGUE (player_t );
Original file line number Diff line number Diff line change @@ -2867,6 +2867,7 @@ struct PlayerInfo native play // self is what internally is known as player_t
2867
2867
native clearscope int GetColorSet() const ;
2868
2868
native clearscope int GetPlayerClassNum() const ;
2869
2869
native clearscope int GetSkin() const ;
2870
+ native clearscope int GetSkinCount() const ;
2870
2871
native clearscope bool GetNeverSwitch() const ;
2871
2872
native clearscope int GetGender() const ;
2872
2873
native clearscope int GetTeam() const ;
@@ -2878,6 +2879,7 @@ struct PlayerInfo native play // self is what internally is known as player_t
2878
2879
native bool GetFViewBob() const ;
2879
2880
native double GetStillBob() const ;
2880
2881
native void SetFOV(float fov);
2882
+ native int SetSkin(int skinIndex);
2881
2883
native clearscope bool GetClassicFlight() const ;
2882
2884
native void SendPitchLimits();
2883
2885
native clearscope bool HasWeaponsInSlot(int slot) const ;
You can’t perform that action at this time.
0 commit comments