Advertisement
Jousway

midi-note noteskin.lua

May 12th, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.83 KB | None | 0 0
  1. -- Haggen Daze
  2.  
  3. local ret = ... or {};
  4.  
  5. ret.RedirTable =
  6. {
  7.     Up = "Down",
  8.     Down = "Down",
  9.     Left = "Down",
  10.     Right = "Down",
  11.     UpLeft = "Down",
  12.     UpRight = "Down",
  13. };
  14.  
  15. local OldRedir = ret.Redir;
  16. ret.Redir = function(sButton, sElement)
  17.     -- sButton, sElement = OldRedir(sButton, sElement);
  18.  
  19.     -- Instead of separate hold heads, use the tap note graphics.
  20.     if sElement == "Hold Head Active" or
  21.        sElement == "Roll Head Active"
  22.     then
  23.         sElement = "Hold Head Active";
  24.     end
  25.    
  26.     -- Test
  27.     if sElement == "Hold Head Inactive" or
  28.        sElement == "Roll Head Inactive"
  29.     then
  30.         sElement = "Hold Head Inactive";
  31.     end
  32.    
  33.     if sElement == "Tap Fake"
  34.     then
  35.         sElement = "Tap Note";
  36.     end
  37.    
  38.     sButton = ret.RedirTable[sButton];
  39.  
  40.     return sButton, sElement;
  41. end
  42.  
  43. -- local OldRedir = ret.Redir;
  44. -- ret.Redir = function(sButton, sElement)
  45.     -- sButton = ret.RedirTable[sButton];
  46.     -- return sButton, sElement;
  47. -- end
  48.  
  49. -- To have separate graphics for each hold part:
  50. local OldRedir = ret.Redir;
  51. ret.Redir = function(sButton, sElement)
  52.     -- Redirect non-hold, non-roll parts.
  53.     if string.find(sElement, "hold") or string.find(sElement, "roll") then
  54.         return sButton, sElement;
  55.     end
  56.     return OldRedir(sButton, sElement);
  57. end
  58.  
  59. --[[
  60. local OldFunc = ret.Load;
  61. function ret.Load()
  62.     local t = OldFunc();
  63.  
  64.     -- The main "Explosion" part just loads other actors; don't rotate
  65.     -- it.  The "Hold Explosion" part should not be rotated.
  66.     if Var "Element" == "Explosion" or
  67.        Var "Element" == "Roll Explosion" then
  68.         t.BaseRotationZ = nil;
  69.     end
  70.     return t;
  71. end
  72. ]]
  73.  
  74. local OldFunc = ret.Load;
  75. function ret.Load()
  76.     local t = OldFunc();
  77.  
  78.     --Explosion should not be rotated; it calls other actors.
  79.     if Var "Element" == "Explosion" then
  80.         t.BaseRotationZ = nil;
  81.     end
  82.     return t;
  83. end
  84.  
  85. ret.PartsToRotate =
  86. {
  87.     ["Receptor"] = true,
  88.     ["Go Receptor"] = true,
  89.     ["Ready Receptor"] = true,
  90.     ["Tap Explosion Bright"] = true,
  91.     ["Tap Explosion Dim"] = true,
  92.     ["Tap Note"] = true,
  93.     ["Tap Fake"] = true,
  94.     ["Tap Lift"] = true,
  95.     ["Hold Head Active"] = true,
  96.     ["Hold Head Inactive"] = true,
  97.     ["Roll Head Active"] = true,
  98.     ["Roll Head Inactive"] = true,
  99.     ["Hold Explosion"] = true,
  100.     ["Roll Explosion"] = true,
  101. };
  102. ret.Rotate =
  103. {
  104.     Up = 180,
  105.     Down = 0,
  106.     Left = 90,
  107.     Right = -90,
  108.     UpLeft = 135,
  109.     UpRight = 225,
  110. };
  111.  
  112. --
  113. -- If a derived skin wants to have separate UpLeft graphics,
  114. -- use this:
  115. --
  116. -- ret.RedirTable.UpLeft = "UpLeft";
  117. -- ret.RedirTable.UpRight = "UpLeft";
  118. -- ret.Rotate.UpLeft = 0;
  119. -- ret.Rotate.UpRight = 90;
  120. --
  121. ret.Blank =
  122. {
  123.     ["Hold Topcap Active"] = true,
  124.     ["Hold Topcap Inactive"] = true,
  125.     ["Roll Topcap Active"] = true,
  126.     ["Roll Topcap Inactive"] = true,
  127.     ["Hold Tail Active"] = true,
  128.     ["Hold Tail Inactive"] = true,
  129.     ["Roll Tail Active"] = true,
  130.     ["Roll Tail Inactive"] = true,
  131.     ["Roll Explosion"] = true,
  132. };
  133.  
  134. return ret;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement