Skip to content

Commit

Permalink
make boxy thing change the scorey dot dot thingies with the clickies
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 29, 2020
1 parent 1b4c50e commit 5d4d6d2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function scoreBoard(pn, position)

local t =
Def.ActorFrame {
Name = "BLah",
BeginCommand = function(self)
if position == 1 then
self:x(SCREEN_WIDTH - (frameX * 2) - frameWidth)
Expand All @@ -200,6 +201,13 @@ function scoreBoard(pn, position)
judge2 = judge
end
end,
ChangeScoreCommand = function(self, params)
if params.score then
score = params.score
end

MESSAGEMAN:Broadcast("ScoreChanged")
end,
UpdateNetEvalStatsMessageCommand = function(self)
local s = SCREENMAN:GetTopScreen():GetHighScore()
if s then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ local function scoreitem(pn, index, scoreIndex, drawindex)
end,
BeginCommand = function(self)
self:visible(GAMESTATE:IsHumanPlayer(pn) and equals)

-- it was once asked if anything had been hacked so hard as some thing that had been hacked really hard.. but yes.. this is
-- hackered... even hardered.... force the offset plot to update if the index in the scoreboard list matches the currently
-- displayed score.. this is because the offset plot was previously using pss to get its info and the way the current system
-- is setup this is the most direct way to actually get the pointer to the score being displayed
if equals then
self:GetParent():GetParent():GetParent():GetChild("OffsetPlot"):playcommand("SetFromScore", {score = hsTable[index]})
end
end
},
--Quad that will act as the bounding box for mouse rollover/click stuff.
Expand All @@ -167,6 +175,12 @@ local function scoreitem(pn, index, scoreIndex, drawindex)
self:xy(framex, framey + (drawindex * spacing) - 4):zoomto(frameWidth*2, 30):halign(0):valign(0):diffuse(
getMainColor("highlight")
):diffusealpha(0)
end,
LeftClickMessageCommand = function(self)
if isOver(self) then
self:GetParent():GetParent():GetParent():GetChild("BLah"):playcommand("ChangeScore", {score = hsTable[index]})
self:GetParent():GetParent():GetParent():GetChild("OffsetPlot"):playcommand("SetFromScore", {score = hsTable[index]})
end
end
},
--ClearType lamps
Expand Down
17 changes: 16 additions & 1 deletion Themes/Til Death/BGAnimations/offsetplot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ end

local o =
Def.ActorFrame {
Name = "OffsetPlot",
OnCommand = function(self)
self:xy(plotX, plotY)

-- being explicit about the logic since atm these are the only 2 cases we handle
local name = SCREENMAN:GetTopScreen():GetName()
if name == "ScreenNetEvaluation" then -- moving away from grabbing anything in pss, dont want to mess with net stuff atm
Expand Down Expand Up @@ -141,6 +141,21 @@ local o =

MESSAGEMAN:Broadcast("JudgeDisplayChanged") -- prim really handled all this much more elegantly
end,
SetFromScoreCommand = function(self, params)
if params.score then
local score = params.score
dvt = score:GetOffsetVector()
nrt = score:GetNoteRowVector()
ctt = score:GetTrackVector()
ntt = score:GetTapNoteTypeVector()

for i = 1, #nrt do
wuab[i] = td:GetElapsedTimeFromNoteRow(nrt[i])
end

MESSAGEMAN:Broadcast("JudgeDisplayChanged")
end
end,
CodeMessageCommand = function(self, params)
if params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
Expand Down

0 comments on commit 5d4d6d2

Please sign in to comment.