Advertisement
Jousway

USW Noteskin.lua Version 2.5

Sep 15th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.99 KB | None | 0 0
  1. --Unlimited Stepman Works Noteskin.lua for SM 5.0.12
  2.  
  3. --I am the bone of my noteskin
  4. --Arrows are my body, and explosions are my blood
  5. --I have created over a thousand noteskins
  6. --Unknown to death
  7. --Nor known to life
  8. --Have withstood pain to create many noteskins
  9. --Yet these hands will never hold anything
  10. --So as I pray, Unlimited Stepman Works
  11.  
  12. local USWN = {};
  13.  
  14. --Defining on which direction the other directions should be bassed on
  15. --This will let us use less files which is quite handy to keep the noteskin directory nice
  16. --Do remember this will Redirect all the files of that Direction to the Direction its pointed to
  17. --If you only want some files to be redirected take a look at the "custom hold/roll per direction"
  18. USWN.ButtonRedir =
  19. {
  20.     Up = "Down",
  21.     Down = "Down",
  22.     Left = "Down",
  23.     Right = "Down",
  24.     UpLeft = "Down",
  25.     UpRight = "Down",
  26. };
  27.  
  28. -- Defined the parts to be rotated at which degree
  29. USWN.Rotate =
  30. {
  31.     Up = 180,
  32.     Down = 0,
  33.     Left = 90,
  34.     Right = -90,
  35.     UpLeft = 135,
  36.     UpRight = 225,
  37. };
  38.  
  39.  
  40. --Define elements that need to be redirected
  41. USWN.ElementRedir =
  42. {
  43.     ["Tap Fake"] = "Tap Note",
  44.     ["Roll Explosion"] = "Hold Explosion",
  45. };
  46.  
  47. -- Parts of noteskins which we want to rotate
  48. USWN.PartsToRotate =
  49. {
  50.     ["Receptor"] = true,
  51.     ["Tap Explosion Bright"] = true,
  52.     ["Tap Explosion Dim"] = true,
  53.     ["Tap Note"] = true,
  54.     ["Tap Fake"] = true,
  55.     ["Tap Addition"] = true,
  56.     ["Hold Explosion"] = true,
  57.     ["Hold Head Active"] = true,
  58.     ["Hold Head Inactive"] = true,
  59.     ["Roll Explosion"] = true,
  60.     ["Roll Head Active"] = true,
  61.     ["Roll Head Inactive"] = true,
  62. };
  63.  
  64. -- Parts that should be Redirected to _Blank.png
  65. -- you can add/remove stuff if you want
  66. USWN.Blank =
  67. {
  68.     ["Hold Topcap Active"] = true,
  69.     ["Hold Topcap Inactive"] = true,
  70.     ["Roll Topcap Active"] = true,
  71.     ["Roll Topcap Inactive"] = true,
  72.     ["Hold Tail Active"] = true,
  73.     ["Hold Tail Inactive"] = true,
  74.     ["Roll Tail Active"] = true,
  75.     ["Roll Tail Inactive"] = true,
  76. };
  77.  
  78. -- <
  79. --Between here we usally put all the commands the noteskin.lua needs to do, some are extern in other files
  80. --If you need help with lua go to http://dguzek.github.io/Lua-For-SM5/API/Lua.xml there are a bunch of codes there
  81. --Also check out common it has a load of lua codes in files there
  82. --Just play a bit with lua its not that hard if you understand coding
  83. --But SM can be an ass in some cases, and some codes jut wont work if you dont have the noteskin on FallbackNoteSkin=common in the metric.ini
  84. function USWN.Load()
  85.     local sButton = Var "Button";
  86.     local sElement = Var "Element";
  87.  
  88.     local Button = USWN.ButtonRedir[sButton] or sButton;   
  89.    
  90.     --Use diffrent Holds/Rolls for every direction
  91.     if ( not string.find(sElement, "Head") and
  92.     not string.find(sElement, "Explosion") ) and
  93.     ( string.find(sElement, "Hold") or
  94.     string.find(sElement, "Roll") ) then
  95.         Button = sButton;
  96.     end
  97.    
  98.     --UpLeft and UpRight should use UpLeft as Head
  99.     if string.find(sElement, "Head") and
  100.     ( sButton == "UpLeft" or
  101.     sButton == "UpRight" ) then
  102.         Button = "UpLeft";
  103.     end
  104.    
  105.     --Setting global element
  106.     local Element = USWN.ElementRedir[sElement] or sElement;
  107.    
  108.     --Returning first part of the code, The redirects, Second part is for commands
  109.     local t = LoadActor(NOTESKIN:GetPath(Button,Element));
  110.    
  111.     --Set blank redirects
  112.     if USWN.Blank[sElement] then
  113.         t = Def.Actor {};
  114.         --Check if element is sprite only
  115.         if Var "SpriteOnly" then
  116.             t = LoadActor(NOTESKIN:GetPath("","_blank"));
  117.         end
  118.     end
  119.    
  120.     if USWN.PartsToRotate[sElement] then
  121.         t.BaseRotationZ = USWN.Rotate[sButton] or nil;
  122.     end
  123.    
  124.     --Explosion should not be rotated, It calls other actors
  125.     --Setting so that UpLeft and UpRight Heads dont turn
  126.     if sElement == "Explosion" or ( string.find(sElement, "Head") and
  127.     ( sButton == "UpLeft" or
  128.     sButton == "UpRight" )) then
  129.         t.BaseRotationZ = nil;
  130.         --Flipping the UpRight head horizontal
  131.         if sButton == "UpRight" then
  132.             t.BaseRotationY = 180;
  133.         end
  134.     end
  135.        
  136.     return t;
  137. end
  138. -- >
  139.  
  140. -- dont forget to return cuz else it wont work ;>
  141. return USWN;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement