Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ret = ... or {}
- ret.Redir = function(sButton, sElement)
- -- To redirect files for Up to Down:
- -- if sButton == "Up" then sButton = "Down"; end
- return sButton, sElement;
- end
- ret.Rotate =
- {
- };
- ret.PartsToRotate =
- {
- };
- ret.Blank =
- {
- -- To blank tap notes:
- -- ["tap note"] = true,
- };
- local function func()
- local sButton = Var "Button";
- local sElement = Var "Element";
- if ret.Blank[sElement] then
- -- Return a blank element. If SpriteOnly is set,
- -- we need to return a sprite; otherwise just return
- -- a dummy actor.
- local t;
- if Var "SpriteOnly" then
- t = LoadActor( "_blank" );
- else
- t = Def.Actor {};
- end
- return t .. {
- cmd(visible,false);
- };
- end
- local sButtonToLoad, sElementToLoad = ret.Redir(sButton, sElement);
- assert( sButtonToLoad );
- assert( sElementToLoad );
- local sPath = NOTESKIN:GetPath( sButtonToLoad, sElementToLoad );
- local t = LoadActor( sPath );
- if ret.PartsToRotate[sElement] then
- t.BaseRotationZ = ret.Rotate[sButton];
- end
- local ThemeBoard = GetUserPrefB("UserPrefNotefieldBoardA");
- local NoteskinBoard = GetUserPrefB("UserPrefNotefieldBoardB");
- --Define brightness
- --there must be a other way but I'm a total noob haha
- local Bright80 = GetUserPrefB("UserPrefNotefieldBrightness80");
- local Bright60 = GetUserPrefB("UserPrefNotefieldBrightness60");
- local Bright40 = GetUserPrefB("UserPrefNotefieldBrightness40");
- local Bright20 = GetUserPrefB("UserPrefNotefieldBrightness20");
- local Brightness;
- if Bright80 then Brightness = 0.8
- elseif Bright60 then Brightness = 0.6
- elseif Bright40 then Brightness = 0.4
- elseif Bright20 then Brightness = 0.2
- else Brightness = 1
- end
- local BoardLocation;
- local BoardMetricDanceSingle;
- local BoardMetricDanceSolo;
- local BoardMetricPumpSingle;
- local BoardMetricPumpHalfDouble;
- local BoardMetricKeyboard7
- if ThemeBoard then
- BoardLocation = THEME:GetPathG( "_Note", "Board" );
- BoardMetricDanceSingle = THEME:GetMetric("NotefieldBoard", "DanceSingle");
- BoardMetricDanceSolo = THEME:GetMetric("NotefieldBoard", "DanceSolo");
- BoardMetricPumpSingle = THEME:GetMetric("NotefieldBoard", "PumpSingle");
- BoardMetricPumpHalfDouble = THEME:GetMetric("NotefieldBoard", "PumpHalfDouble");
- BoardMetricKeyboard7 = THEME:GetMetric("NotefieldBoard", "Keyboard7");
- elseif NoteskinBoard then
- BoardLocation = NOTESKIN:GetPath( "_Note", "Board" );
- BoardMetricDanceSingle = NOTESKIN:GetMetricA("NotefieldBoard", "DanceSingle");
- BoardMetricDanceSolo = NOTESKIN:GetMetricA("NotefieldBoard", "DanceSolo");
- BoardMetricPumpSingle = NOTESKIN:GetMetricA("NotefieldBoard", "PumpSingle");
- BoardMetricPumpHalfDouble = NOTESKIN:GetMetricA("NotefieldBoard", "PumpHalfDouble");
- BoardMetricKeyboard7 = NOTESKIN:GetMetricA("NotefieldBoard", "Keyboard7");
- end
- if NoteskinBoard or ThemeBoard then
- local t = Def.ActorFrame {};
- if GAMESTATE:GetCurrentGame():GetName() == "dance" then
- if GAMESTATE:GetCurrentStyle():GetName() == "single"
- or GAMESTATE:GetCurrentStyle():GetName() == "versus"
- or GAMESTATE:GetCurrentStyle():GetName() == "double"
- or GAMESTATE:GetCurrentStyle():GetName() == "couple" then
- if Var "Button" == "Left" and Var "Element" == "Receptor" then
- t[#t+1] = Def.ActorFrame {
- InitCommand=cmd(diffusealpha,Brightness;x,96;y,SCREEN_CENTER_Y);
- LoadActor( BoardLocation ) .. {
- InitCommand=BoardMetricDanceSingle;
- };
- };
- if sButtonToLoad == "Down" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,90);
- };
- elseif sButtonToLoad == "Right" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,180);
- };
- elseif sButtonToLoad == "Up" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-90);
- };
- else
- t[#t+1] = LoadActor( sPath );
- end
- return t;
- end
- end
- if GAMESTATE:GetCurrentStyle():GetName() == "solo" then
- if Var "Button" == "Left" and Var "Element" == "Receptor" then
- t[#t+1] = Def.ActorFrame {
- InitCommand=cmd(diffusealpha,Brightness;x,160;y,SCREEN_CENTER_Y);
- LoadActor( BoardLocation ) .. {
- InitCommand=BoardMetricDanceSolo;
- };
- };
- if sButtonToLoad == "Down" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,90);
- };
- elseif sButtonToLoad == "Right" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,180);
- };
- elseif sButtonToLoad == "Up" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-90);
- };
- elseif sButtonToLoad == "UpLeft" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-45);
- };
- elseif sButtonToLoad == "UpRight" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-135);
- };
- else
- t[#t+1] = LoadActor( sPath );
- end
- return t;
- end
- end
- end
- if GAMESTATE:GetCurrentGame():GetName() == "pump" then
- if GAMESTATE:GetCurrentStyle():GetName() == "single"
- or GAMESTATE:GetCurrentStyle():GetName() == "versus"
- or GAMESTATE:GetCurrentStyle():GetName() == "double"
- or GAMESTATE:GetCurrentStyle():GetName() == "couple"
- or GAMESTATE:GetCurrentStyle():GetName() == "routine" then
- if Var "Button" == "DownLeft" and Var "Element" == "Receptor" then
- t[#t+1] = Def.ActorFrame {
- InitCommand=cmd(diffusealpha,Brightness;x,128;y,SCREEN_CENTER_Y);
- LoadActor( BoardLocation ) .. {
- InitCommand=BoardMetricPumpSingle;
- };
- };
- if sButtonToLoad == "UpLeft" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-90);
- };
- elseif sButtonToLoad == "UpRight" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,180);
- };
- elseif sButtonToLoad == "DownRight" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,90);
- };
- else
- t[#t+1] = LoadActor( sPath );
- end
- return t;
- end
- end
- if GAMESTATE:GetCurrentStyle():GetName() == "halfdouble" then
- if Var "Button" == "DownLeft" and Var "Element" == "Receptor" then
- t[#t+1] = Def.ActorFrame {
- InitCommand=cmd(diffusealpha,Brightness;x,-32;y,SCREEN_CENTER_Y);
- LoadActor( BoardLocation ) .. {
- InitCommand=BoardMetricPumpHalfDouble;
- };
- };
- if sButtonToLoad == "UpLeft" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,-90);
- };
- elseif sButtonToLoad == "UpRight" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,180);
- };
- elseif sButtonToLoad == "DownRight" then
- t[#t+1] = LoadActor( sPath ) .. {
- InitCommand=cmd(rotationz,90);
- };
- else
- t[#t+1] = LoadActor( sPath );
- end
- return t;
- end
- end
- end
- if GAMESTATE:GetCurrentGame():GetName() == "kb7" then
- if Var "Button" == "Key1" and Var "Element" == "Receptor" then
- t[#t+1] = Def.ActorFrame {
- InitCommand=cmd(diffusealpha,Brightness;x,208;y,SCREEN_CENTER_Y);
- LoadActor( BoardLocation ) .. {
- InitCommand=BoardMetricKeyboard7;
- };
- };
- t[#t+1] = LoadActor( sPath );
- return t;
- end
- end
- end
- return t;
- end
- -- This is the only required function.
- ret.Load = func;
- -- Use this to override the game types' default Load() functions.
- ret.CommonLoad = func;
- return ret;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement