Skip to content

Commit

Permalink
wifetwirl refactor part 2
Browse files Browse the repository at this point in the history
move banner to wifetwirl and more of the same
  • Loading branch information
MinaciousGrace committed Nov 22, 2018
1 parent cce801a commit e0054b8
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 384 deletions.
Original file line number Diff line number Diff line change
@@ -1,62 +0,0 @@
local update = false
local t =
Def.ActorFrame {
BeginCommand = function(self)
self:queuecommand("Set")
end,
OffCommand = function(self)
self:bouncebegin(0.2):xy(-500, 0) -- visible(false)
end,
OnCommand = function(self)
self:bouncebegin(0.2):xy(0, 0)
end,
SetCommand = function(self)
self:finishtweening()
if getTabIndex() == 0 then
self:queuecommand("On")
update = true
else
self:queuecommand("Off")
update = false
end
end,
TabChangedMessageCommand = function(self)
self:queuecommand("Set")
end,
ChartPreviewOnMessageCommand = function(self)
self:visible(false)
end,
ChartPreviewOffMessageCommand = function(self)
self:visible(true)
end,
}

t[#t + 1] =
Def.Banner {
InitCommand = function(self)
self:x(10):y(61):halign(0):valign(0):scaletoclipped(
capWideScale(get43size(384), 384),
capWideScale(get43size(120), 120)
)
end,
SetMessageCommand = function(self)
if update then
local top = SCREENMAN:GetTopScreen()
if top:GetName() == "ScreenSelectMusic" or top:GetName() == "ScreenNetSelectMusic" then
local song = GAMESTATE:GetCurrentSong()
local group = top:GetMusicWheel():GetSelectedSection()
if song then
self:LoadFromSong(song)
elseif group then
self:LoadFromSongGroup(group)
end
end
end
self:scaletoclipped(capWideScale(get43size(384), 384), capWideScale(get43size(120), 120))
end,
CurrentSongChangedMessageCommand = function(self)
self:queuecommand("Set")
end
}

return t

0 comments on commit e0054b8

Please sign in to comment.