Skip to content

Commit

Permalink
stuff n things
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 27, 2018
1 parent a5cf24e commit 09adcd9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Themes/Til Death/BGAnimations/ScreenScoreTabOffsetPlot overlay.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
-- if score is ever nil we done goofed way before this screen is ever loaded -mina
-- generalized code to reduce redundancy, load general code instead

local function input(event)
if event.DeviceInput.button == "DeviceButton_right mouse button" and event.type == "InputEventType_Release" then
SCREENMAN:GetTopScreen():Cancel()
end
return false
end

local t = Def.ActorFrame {
BeginCommand=function()
SCREENMAN:GetTopScreen():AddInputCallback(input)
end,
CodeMessageCommand=function(self,params)
if params.Name == "PlotCancel" or params.Name == "PlotExit" or params.Name == "PlotThickens" or params.Name == "PlotTwist" or params.Name == "StarPlot64" or params.Name == "SheriffOfPlottingham" then
SCREENMAN:GetTopScreen():Cancel() -- need this so we can leave
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ local ret = Def.ActorFrame{


local cheese
-- will eat any mousewheel inputs to scroll pages while mouse is over the background frame
-- eats only inputs that would scroll to a new score
local function input(event)
if cheese:GetVisible() and isOver(cheese:GetChild("FrameDisplay")) then
if event.DeviceInput.button == "DeviceButton_mousewheel up" and event.type == "InputEventType_FirstPress" then
moving = true
if nestedTab == 1 and rtTable and rtTable[rates[rateIndex]] ~= nil then
cheese:queuecommand("PrevScore")
return true
end
return true
elseif event.DeviceInput.button == "DeviceButton_mousewheel down" and event.type == "InputEventType_FirstPress" then
if nestedTab == 1 and rtTable ~= nil and rtTable[rates[rateIndex]] ~= nil then
cheese:queuecommand("NextScore")
return true
end
return true
elseif moving == true then
moving = false
end
Expand All @@ -152,7 +152,9 @@ end
local t = Def.ActorFrame {
Name="LocalScores",
InitCommand=function(self)
rtTable = nil
self:xy(frameX+offsetX,frameY+offsetY + headeroffY)
self:SetUpdateFunction(highlight)
cheese = self
end,
BeginCommand=function(self)
Expand All @@ -165,12 +167,12 @@ local t = Def.ActorFrame {
if rtTable ~= nil then
rates,rateIndex = getUsedRates(rtTable)
scoreIndex = 1
score = rtTable[rates[rateIndex]][scoreIndex]
setScoreForPlot(score)
self:queuecommand("Display")
else
self:queuecommand("Init")
end
else
self:queuecommand("Init")
end
end
end,
Expand Down Expand Up @@ -209,6 +211,10 @@ local t = Def.ActorFrame {
scoreIndex = ((scoreIndex-2)%(#rtTable[rates[rateIndex]]))+1
self:queuecommand("Display")
end,
DisplayCommand=function(self)
score = rtTable[rates[rateIndex]][scoreIndex]
setScoreForPlot(score)
end,

Def.Quad{
Name="FrameDisplay",
Expand Down Expand Up @@ -378,7 +384,7 @@ t[#t+1] = Def.Quad{
local function makeText(index)
return LoadFont("Common Normal")..{
InitCommand=function(self)
self:xy(frameWidth-offsetX- frameX,offsetY+15+(index*15)):zoom(fontScale):halign(1):settext("")
self:xy(frameWidth-offsetX- frameX,offsetY+15+(index*15)):zoom(fontScale+0.05):halign(1):settext("")
end,
DisplayCommand=function(self)
local count = 0
Expand All @@ -395,6 +401,16 @@ local function makeText(index)
else
self:settext("")
end
end,
HighlightCommand=function(self)
highlightIfOver(self)
end,
MouseLeftClickMessageCommand=function(self)
if nestedTab == 1 and isOver(self) then
rateIndex = index
scoreIndex = 1
self:GetParent():queuecommand("Display")
end
end
}
end
Expand Down

0 comments on commit 09adcd9

Please sign in to comment.