Skip to content

Commit

Permalink
Add current Judge to OffsetPlot in SelectMusic & fix initial customwi…
Browse files Browse the repository at this point in the history
…ndow
  • Loading branch information
poco0317 committed Nov 24, 2019
1 parent ffa0381 commit ba71fbd
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions Themes/Til Death/BGAnimations/offsetplot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ local tso = tst[judge]
local enabledCustomWindows = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomEvaluationWindowTimings
judge = enabledCustomWindows and 0 or judge
local customWindowsData = timingWindowConfig:get_data()
local customWindows = customWindowsData.customWindows
local customWindow
local customWindows = timingWindowConfig:get_data().customWindows
local customWindow = timingWindowConfig:get_data()[customWindows[1]]

local plotWidth, plotHeight = 400, 120
local plotX, plotY = SCREEN_WIDTH - 9 - plotWidth / 2, SCREEN_HEIGHT - 56 - plotHeight / 2
Expand Down Expand Up @@ -116,10 +116,10 @@ local o =
if enabledCustomWindows then
if params.Name == "PrevJudge" then
judge = judge < 2 and #customWindows or judge - 1
customWindow = customWindowsData[customWindows[judge]]
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
elseif params.Name == "NextJudge" then
judge = judge == #customWindows and 1 or judge + 1
customWindow = customWindowsData[customWindows[judge]]
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
end
elseif params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
Expand Down Expand Up @@ -331,4 +331,37 @@ o[#o + 1] =
end
}

-- Text for current judge window
-- Only for SelectMusic (not Eval)
o[#o + 1] =
LoadFont("Common Normal") ..
{
Name = "JudgeText",
InitCommand = function(self)
self:valign(0):halign(0):zoom(0.4)
self:xy(-plotWidth/2, -plotHeight/2)
self:settext("")
end,
OnCommand = function(self)
local name = SCREENMAN:GetTopScreen():GetName()
if name == "ScreenScoreTabOffsetPlot" then
self:playcommand("Set")
else
self:visible(false)
end
end,
SetCommand = function(self)
if enabledCustomWindows then
jdgname = customWindow.name
else
jdgname = "J" .. judge
end
self:settextf("%s", jdgname)
end,
JudgeDisplayChangedMessageCommand = function(self)
self:playcommand("Set")
self:xy(-plotWidth / 2 + 5, -plotHeight / 2 + 15):zoom(textzoom):halign(0):valign(0)
end
}

return o

0 comments on commit ba71fbd

Please sign in to comment.