Skip to content

Commit

Permalink
Receptors, next to opt row and small screen NSkin previews
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Mar 27, 2018
1 parent 1505d85 commit ebb62b2
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 26 deletions.
89 changes: 72 additions & 17 deletions Themes/Til Death/BGAnimations/ScreenPlayerOptions overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,78 @@ t[#t+1] = LoadFont("Common Large")..{
}

local NSPreviewSize = 0.5
local NSPreviewX = 30
local NSPreviewY = SCREEN_TOP+120
local NSPreviewX = 35
local NSPreviewY = 125
local NSPreviewXSpan = 35
local NSPreviewReceptorY = -30
local OptionRowHeight = 35
local NoteskinRow = 0

function NSkinPreviewWrapper(dir, ele)
return Def.ActorFrame{
InitCommand=function(self)
self:zoom(NSPreviewSize)
end;
LoadNSkinPreview("Get", dir, ele,PLAYER_1);
}
end
t[#t+1] = Def.ActorFrame{
InitCommand=function(self) self:xy(NSPreviewX,NSPreviewY, NSPreviewSize) end;
LoadNSkinPreview("Get", "Down", "Tap Note", NSPreviewSize);
}
t[#t+1] = Def.ActorFrame{
InitCommand=function(self) self:xy(NSPreviewX+NSPreviewXSpan*1,NSPreviewY, NSPreviewSize) end;
LoadNSkinPreview("Get", "Left", "Tap Note", NSPreviewSize);
}
t[#t+1] = Def.ActorFrame{
InitCommand=function(self) self:xy(NSPreviewX+NSPreviewXSpan*2,NSPreviewY, NSPreviewSize) end;
LoadNSkinPreview("Get", "Up", "Tap Note", NSPreviewSize);
}
t[#t+1] = Def.ActorFrame{
InitCommand=function(self) self:xy(NSPreviewX+NSPreviewXSpan*3,NSPreviewY, NSPreviewSize) end;
LoadNSkinPreview("Get", "Right", "Tap Note", NSPreviewSize);
}
OnCommand=function(self)
self:xy(NSPreviewX, NSPreviewY)
for i = 0,SCREENMAN:GetTopScreen():GetNumRows()-1 do
if SCREENMAN:GetTopScreen():GetOptionRow(i) and SCREENMAN:GetTopScreen():GetOptionRow(i):GetName() == "NoteSkins" then
NoteskinRow = i;
end
end
self:SetUpdateFunction(
function(self)
local row = SCREENMAN:GetTopScreen():GetCurrentRowIndex(PLAYER_1)
local pos =0
if row > 4 then
pos = NSPreviewY + NoteskinRow*OptionRowHeight-(SCREENMAN:GetTopScreen():GetCurrentRowIndex(PLAYER_1)-4)*OptionRowHeight
else
pos = NSPreviewY + NoteskinRow*OptionRowHeight
end
self:y(pos)
self:visible(NoteskinRow - row > -5 and NoteskinRow - row < 7)
end
)
end,
Def.ActorFrame{
NSkinPreviewWrapper("Down", "Tap Note");
};
Def.ActorFrame{
InitCommand=function(self) self:y(NSPreviewReceptorY) end;
NSkinPreviewWrapper("Down", "Receptor");
};
};
if IsUsingWideScreen() and GetScreenAspectRatio( ) > 1.7 then
t[#t][#(t[#t])+1] =
Def.ActorFrame{
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*1) end;
NSkinPreviewWrapper("Left", "Tap Note");
};
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*1):y(NSPreviewReceptorY) end;
NSkinPreviewWrapper("Left", "Receptor");
};
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*2) end;
NSkinPreviewWrapper("Up", "Tap Note");
};
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*2):y(NSPreviewReceptorY) end;
NSkinPreviewWrapper("Up", "Receptor");
};
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*3) end;
NSkinPreviewWrapper("Right", "Tap Note");
};
Def.ActorFrame{
InitCommand=function(self) self:x(NSPreviewXSpan*3):y(NSPreviewReceptorY) end;
NSkinPreviewWrapper("Right", "Receptor");
};
};
end
return t
11 changes: 2 additions & 9 deletions Themes/_fallback/Scripts/09 SimNSkinPreview.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function LoadNSkinPreview(Noteskin, Button, Element, Player, size)
function LoadNSkinPreview(Noteskin, Button, Element, Player)
if Noteskin == "Get" then
local t = Def.ActorFrame{
OnCommand=function(self)
Expand All @@ -11,9 +11,7 @@ function LoadNSkinPreview(Noteskin, Button, Element, Player, size)
InitCommand=function(self)
if n ~= GAMESTATE:GetPlayerState(Player):GetPlayerOptions("ModsLevel_Preferred"):NoteSkin() then
self:visible(false)
if size then self:zoom(size) end
end
if size then self:zoom(size) end
if Element == "Tap Note" then
local TexY = NOTESKIN:GetMetricFForNoteSkin("NoteDisplay","TapNoteNoteColorTextureCoordSpacingY",n)
local TexX = NOTESKIN:GetMetricFForNoteSkin("NoteDisplay","TapNoteAdditionTextureCoordOffsetX",n)
Expand All @@ -39,12 +37,7 @@ function LoadNSkinPreview(Noteskin, Button, Element, Player, size)
end
return t;
else
return Def.ActorFrame{
InitCommand=function(self)
if size then self:zoom(size) end
end;
NOTESKIN:LoadActorForNoteSkin(Button, Element, NOTESKIN:DoesNoteSkinExist(Noteskin) and Noteskin or "default");
}
return NOTESKIN:LoadActorForNoteSkin(Button, Element, NOTESKIN:DoesNoteSkinExist(Noteskin) and Noteskin or "default");
end
end

Expand Down

0 comments on commit ebb62b2

Please sign in to comment.