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 @@ -508,6 +508,23 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, SetFOV)
508
508
return 0 ;
509
509
}
510
510
511
+ DEFINE_ACTION_FUNCTION (_PlayerInfo, SetSkin)
512
+ {
513
+ PARAM_SELF_STRUCT_PROLOGUE (player_t );
514
+ PARAM_INT (skinIndex);
515
+ if (skinIndex >= 0 && skinIndex < Skins.size ())
516
+ {
517
+ // commented code - cvar_set calls this automatically, along with saving the skin selection.
518
+ // self->userinfo.SkinNumChanged(skinIndex);
519
+ cvar_set (" skin" , Skins[skinIndex].Name .GetChars ());
520
+ ACTION_RETURN_INT (self->userinfo .GetSkin ());
521
+ }
522
+ else
523
+ {
524
+ ACTION_RETURN_INT (-1 );
525
+ }
526
+ }
527
+
511
528
// ===========================================================================
512
529
//
513
530
// EnumColorsets
@@ -760,6 +777,12 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, GetSkin)
760
777
ACTION_RETURN_INT (self->userinfo .GetSkin ());
761
778
}
762
779
780
+ DEFINE_ACTION_FUNCTION (_PlayerInfo, GetSkinCount)
781
+ {
782
+ PARAM_SELF_STRUCT_PROLOGUE (player_t );
783
+ ACTION_RETURN_INT (Skins.size ());
784
+ }
785
+
763
786
DEFINE_ACTION_FUNCTION (_PlayerInfo, GetGender)
764
787
{
765
788
PARAM_SELF_STRUCT_PROLOGUE (player_t );
Original file line number Diff line number Diff line change @@ -2863,6 +2863,7 @@ struct PlayerInfo native play // self is what internally is known as player_t
2863
2863
native clearscope int GetColorSet() const ;
2864
2864
native clearscope int GetPlayerClassNum() const ;
2865
2865
native clearscope int GetSkin() const ;
2866
+ native clearscope int GetSkinCount() const ;
2866
2867
native clearscope bool GetNeverSwitch() const ;
2867
2868
native clearscope int GetGender() const ;
2868
2869
native clearscope int GetTeam() const ;
@@ -2874,6 +2875,7 @@ struct PlayerInfo native play // self is what internally is known as player_t
2874
2875
native bool GetFViewBob() const ;
2875
2876
native double GetStillBob() const ;
2876
2877
native void SetFOV(float fov);
2878
+ native int SetSkin(int skinIndex);
2877
2879
native clearscope bool GetClassicFlight() const ;
2878
2880
native void SendPitchLimits();
2879
2881
native clearscope bool HasWeaponsInSlot(int slot) const ;
You can’t perform that action at this time.
0 commit comments