Skip to content

[Skin Expansion] Initial R_InitSkins tweaks and GetSkinInfo ACS function

Barrels O' Fun requested to merge topic/default/skins-expansion-1 into branch/default

Part 1 in Splitting this up into smaller commits.

  • R_InitSkins tweaks such as making 'key' an FString instead of a char array, and SKININFO parameters spaced apart and commented between each in the code to improve readability.
  • szColor in sprites.h renamed to color
  • Duplicate names are now checked within the skin's class's skin list instead of every skin.
  • You can no longer name a skin "skin" followed by a number (e.g skin2, skin32, etc.)
  • 'color' parameter now uses V_GetColor and stores an integer.
  • 'scale' parameter can now set x and y values separately using a comma.
  • New SKININFO param - colorrange which overrides the classes own unless the class uses 0,0 which usually signifies that there is no color translating for that class.
  • GetSkinInfo(int skinIndex, int type, string key[, int index]);
    • For int type:

      • GETSKININFO_STRING (0) returns a string or "" if null.
      • GETSKININFO_INT (1) returns an integer or -1 if null.
      • GETSKININFO_FLOAT (2) returns a float as a fixed number (i.e 1.0 = 65536) or -1 if null.
      • GETSKININFO_EXISTS (3) is a boolean to see if the key[index] exists for the given skin index. Useful for conditional statements.
    • Custom Values are supported, which can be a single parameter or an array.

      customparam = "Something"
      customarray = "Stuff", "More Stuff" 
    • They can also be put into a group using square brackets.

      paramgroup = [
      key1 = "value1"
      key2 = "value2-a", "value2-b"
      ]
    • Parameter groups are formatted as such: "paramgroup:key1" in string key, which also means colon (:) can't be used in custom parameter names.

  • GetPlayerSkin now returns the skin index instead of the name in order to be interfaced with GetSkinInfo.

Merge request reports

Loading