Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ITS A HACKJOB!
- -- I cant theme for shit -Jousway
- -- I used some code from other themes, mostly the default theme, so massive respect to the creators
- local t = Def.ActorFrame {
- OnCommand=function(self) self:sleep(0.1) self:queuecommand("Fix") end;
- CurrentSongChangedMessageCommand=function(self) self:sleep(0.0000001) self:queuecommand("Fix") self:sleep(0.0000001) self:queuecommand("Fix") end;
- CurrentStepsP1ChangedMessageCommand=function(self) self:sleep(0.0000001) self:queuecommand("Fix") end;
- CurrentStepsP2ChangedMessageCommand=function(self) self:sleep(0.0000001) self:queuecommand("Fix") end;
- FixCommand=function(self) ScreenSelectMusicUpdate(self) end;
- --CDTitle Resizer/Container
- Def.ActorFrame{
- Name="Container";
- OnCommand=cmd(x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y);
- --main background
- Def.Quad{
- InitCommand=cmd(y,-84;zoomto,294,295;diffuse,color("0.5,0.5,0.5,0.5"));
- };
- --banner and title container
- Def.Quad{
- InitCommand=cmd(y,-155;zoomto,289,150;diffuse,color("0,0,0,0.5"));
- };
- --Banner Background
- Def.Quad{
- InitCommand=cmd(y,-160;zoomto,284,89;diffuse,color("0,0,0,0.5"););
- };
- --No Banner Text
- LoadFont("Common Normal") .. {
- Text="No Banner";
- InitCommand=cmd(y,-160;diffuse,color("1,1,1,0.5"));
- };
- --Load Banner
- Def.Sprite {
- Name="Banner";
- InitCommand=cmd(y,-160);
- };
- --Song Title above Banner
- LoadFont("Common Normal") .. {
- Name="title";
- InitCommand=cmd(y,-218;zoom,0.6;maxwidth,460);
- };
- --CDTitle Background
- Def.Quad{
- InitCommand=cmd(y,-45;x,102;zoomto,85,65;diffuse,color("0,0,0,0.5"););
- };
- --Load CDTitle
- Def.Sprite {
- Name="CDTitle";
- InitCommand=cmd(y,-45;x,102);
- };
- --NPS Calculator/Display
- LoadFont("Common Normal") .. {
- Text="NPS";
- InitCommand=cmd(x,70;y,-98;zoom,0.75;diffuse,1,1,1,1);
- };
- LoadFont("Common Normal") .. {
- Name="P1NPS";
- InitCommand=cmd(;y,-98;zoom,0.75;diffuse,color("#ef403d"));
- };
- LoadFont("Common Normal") .. {
- Name="P2NPS";
- InitCommand=cmd(y,-98;zoom,0.75;diffuse,color("#0089cf"));
- };
- --BPM
- LoadFont("Common Normal") .. {
- Text="BPM";
- InitCommand=cmd(x,-25;y,-98;zoom,0.75;diffuse,1,1,1,1);
- };
- LoadFont("Common Normal") .. {
- Name="BPM";
- InitCommand=cmd(x,25;y,-98;zoom,0.75;diffuse,color("#0089cf"));
- };
- --Song Length
- LoadFont("Common Normal") .. {
- Name="length";
- InitCommand=cmd(x,-95;y,-98;zoom,0.75;diffuse,color("#ef403d"));
- };
- LoadFont("Common Normal") .. {
- Name="test";
- InitCommand=cmd();
- };
- --difficulty selector
- Def.Quad{
- Name="p2curB";
- InitCommand=cmd(y,-28;diffuse,color("#0089cfaa"));
- };
- LoadFont("Common Normal") .. {
- Name="p2curT";
- Text="P2";
- InitCommand=cmd(y,-28;zoom,0.8;diffuse,color("0,0,0,0.8"));
- };
- Def.Quad{
- Name="p1curB";
- InitCommand=cmd(y,-28;diffuse,color("#ef403daa"));
- };
- LoadFont("Common Normal") .. {
- Name="p1curT";
- Text="P1";
- InitCommand=cmd(y,-28;zoom,0.8;diffuse,color("0,0,0,0.8"));
- };
- LoadActor( THEME:GetPathG("ScreenSelectMusic","DifficultyDisplay") ) .. {
- };
- --song stats panel
- Def.Quad{
- InitCommand=cmd(y,25;x,-73;zoomto,143,70;diffuse,color("0,0,0,0.5"));
- };
- LoadFont("Common Normal") .. {
- Name="p1SP";
- Text="Press Start";
- InitCommand=cmd(y,25;x,-73;zoom,0.7;diffuse,color("1,1,1,0.5"));
- };
- LoadActor( THEME:GetPathG("PaneDisplay","p1") ) .. {
- InitCommand=cmd(x,-80;y,30;zoom,0.36);
- };
- Def.Quad{
- InitCommand=cmd(y,25;x,73;zoomto,143,70;diffuse,color("0,0,0,0.5"));
- };
- LoadFont("Common Normal") .. {
- Name="p2SP";
- Text="Press Start";
- InitCommand=cmd(y,25;x,73;zoom,0.7;diffuse,color("1,1,1,0.5"));
- };
- LoadActor( THEME:GetPathG("PaneDisplay","p2") ) .. {
- InitCommand=cmd(x,66;y,30;zoom,0.36);
- };
- };
- };
- function ScreenSelectMusicUpdate(self)
- local song = GAMESTATE:GetCurrentSong();
- --load of code just to load group banner
- local musicwheel = SCREENMAN:GetTopScreen():GetMusicWheel();
- local selection = musicwheel:GetSelectedSection();
- local gbanner = SONGMAN:GetSongGroupBannerPath(selection);
- --cdtitle and banner
- local cdtitle = self:GetChild("Container"):GetChild("CDTitle");
- local banner = self:GetChild("Container"):GetChild("Banner");
- local cdheight = cdtitle:GetHeight();
- local cdwidth = cdtitle:GetWidth();
- local brheight = banner:GetHeight();
- local brwidth = banner:GetWidth();
- if song then
- local songmil = "00";
- songsec = song:MusicLengthSeconds()%60;
- songmin = math.floor(song:MusicLengthSeconds()/60);
- for c in string.gmatch(songsec,"%d+%p(%d%d)") do
- songmil = c;
- end;
- length = string.format("%02d:%02d", songmin, songsec)..":"..songmil;
- title = song:GetDisplayMainTitle();
- if song:HasCDTitle() then
- cdtitle:visible(true);
- cdtitle:Load(song:GetCDTitlePath());
- else
- cdtitle:visible(false);
- end;
- if song:HasBanner() then
- banner:visible(true);
- banner:Load(song:GetBannerPath());
- else
- banner:visible(false);
- end;
- else
- if gbanner ~= "" then
- banner:visible(true);
- banner:Load(gbanner);
- else
- banner:visible(false);
- end;
- cdtitle:visible(false);
- title = "";
- length = "00:00";
- end;
- self:GetChild("Container"):GetChild("title"):settext(title);
- self:GetChild("Container"):GetChild("length"):settext(length);
- if cdheight >= 60 and cdwidth >= 80 then
- if cdheight*(80/60) >= cdwidth then
- cdtitle:zoom(60/cdheight);
- else
- cdtitle:zoom(80/cdwidth);
- end;
- elseif cdheight >= 60 then
- cdtitle:zoom(60/cdheight);
- elseif cdwidth >= 80 then
- cdtitle:zoom(80/cdwidth);
- else
- cdtitle:zoom(1);
- end;
- if brheight >= 89 and brwidth >= 284 then
- if brheight*(284/89) >= brwidth then
- banner:zoom(88/brheight);
- else
- banner:zoom(284/brwidth);
- end;
- elseif brheight >= 89 then
- banner:zoom(89/brheight);
- elseif brwidth >= 284 then
- banner:zoom(284/brwidth);
- elseif brwidth/3.22 >= brheight then
- banner:zoom(284/brwidth);
- else
- banner:zoom(89/brheight);
- end;
- --nps
- local P1NPS = self:GetChild("Container"):GetChild("P1NPS");
- local P2NPS = self:GetChild("Container"):GetChild("P2NPS");
- local difloc = {
- Beginner = 32*0.40,
- Easy = 32*1.46,
- Medium = 32*2.52,
- Hard = 32*3.58,
- Challenge = 32*4.64,
- Edit = 32*5.70,
- };
- p1curB = self:GetChild("Container"):GetChild("p1curB");
- p1CurT = self:GetChild("Container"):GetChild("p1curT");
- p2curB = self:GetChild("Container"):GetChild("p2curB");
- p2CurT = self:GetChild("Container"):GetChild("p2curT");
- p1SP = self:GetChild("Container"):GetChild("p1SP");
- p2SP = self:GetChild("Container"):GetChild("p2SP");
- local function Radar(pn,cat)
- local GetRadar = GAMESTATE:GetCurrentSteps(pn):GetRadarValues(pn);
- return GetRadar:GetValue(cat);
- end;
- --all this just to do difficulty, sadly this only works in sm5 beta 4, so beta 3 users need to update :<
- if GAMESTATE:IsHumanPlayer(PLAYER_1) then
- if song then
- local ChartLenghtInSec = song:GetStepsSeconds();
- local P1Taps = Radar(PLAYER_1,'RadarCategory_TapsAndHolds')+Radar(PLAYER_1,'RadarCategory_Jumps')+Radar(PLAYER_1,'RadarCategory_Hands');
- P1NPS:settext(string.format("%0.0f",P1Taps/ChartLenghtInSec));
- else
- P1NPS:settext("0");
- end;
- if GAMESTATE:GetCurrentSteps(PLAYER_1) then
- local p1d = ToEnumShortString(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty());
- if song then
- p1curB:visible(true);
- p1CurT:visible(true);
- else
- p1curB:visible(false);
- p1CurT:visible(false);
- end;
- p1curB:x(-142+difloc[p1d]);
- p1CurT:x(-142+difloc[p1d]);
- else
- p1curB:visible(false);
- p1CurT:visible(false);
- end;
- P2NPS:x(130);
- p1SP:visible(false);
- else
- P2NPS:x(115);
- p1curB:visible(false);
- p1CurT:visible(false);
- p1SP:visible(true);
- end;
- if GAMESTATE:IsHumanPlayer(PLAYER_2) then
- if song then
- local ChartLenghtInSec = song:GetStepsSeconds();
- local P2Taps = Radar(PLAYER_2,'RadarCategory_TapsAndHolds')+Radar(PLAYER_2,'RadarCategory_Jumps')+Radar(PLAYER_2,'RadarCategory_Hands');
- P2NPS:settext(string.format("%0.0f",P2Taps/ChartLenghtInSec));
- else
- P2NPS:settext("0");
- end;
- if GAMESTATE:GetCurrentSteps(PLAYER_2) then
- local p2d = ToEnumShortString(GAMESTATE:GetCurrentSteps(PLAYER_2):GetDifficulty());
- if song then
- p2curB:visible(true);
- p2CurT:visible(true);
- else
- p2curB:visible(false);
- p2CurT:visible(false);
- end;
- p2curB:x(-142+difloc[p2d]);
- p2CurT:x(-142+difloc[p2d]);
- else
- p2curB:visible(false);
- p2CurT:visible(false);
- end;
- P1NPS:x(105);
- p2SP:visible(false);
- else
- P1NPS:x(115);
- p2curB:visible(false);
- p2CurT:visible(false);
- p2SP:visible(true);
- end;
- if GAMESTATE:IsHumanPlayer(PLAYER_1) and GAMESTATE:IsHumanPlayer(PLAYER_2) then
- local p1d = ToEnumShortString(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty());
- local p2d = ToEnumShortString(GAMESTATE:GetCurrentSteps(PLAYER_2):GetDifficulty());
- if p1d == p2d then
- p1curB:zoomto(30,15);
- p1CurT:zoomy(0.5);
- p2curB:zoomto(30,15);
- p2CurT:zoomy(0.5);
- p1curB:y(-36);
- p1CurT:y(-36);
- p2curB:y(-20);
- p2CurT:y(-20);
- else
- p1curB:zoomto(30,30);
- p1CurT:zoomy(1);
- p2curB:zoomto(30,30);
- p2CurT:zoomy(1);
- p1curB:y(-28);
- p1CurT:y(-28);
- p2curB:y(-28);
- p2CurT:y(-28);
- end;
- else
- p1curB:zoomto(30,30);
- p1CurT:zoomy(1);
- p2curB:zoomto(30,30);
- p2CurT:zoomy(1);
- end;--]]
- end;
- local function Update(self)
- local song = GAMESTATE:GetCurrentSong();
- if song then
- bpm = string.format("%03.0f",GAMESTATE:GetSongBPS()*60);
- else
- bpm = "000";
- end;
- self:GetChild("Container"):GetChild("BPM"):settext(bpm);
- end;
- t.InitCommand=cmd(SetUpdateFunction,Update);
- return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement