Skip to content

Commit aec1145

Browse files
committed
Fix Chart Preview position when swapping between Reverse & Upscroll
1 parent 1c4d595 commit aec1145

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,5 +988,5 @@ t[#t + 1] =
988988
}
989989
}
990990

991-
t[#t + 1] = LoadActor("../_chartpreview.lua")
991+
t[#t + 1] = LoadActorWithParams("../_chartpreview.lua", {yPos = prevY, yPosReverse = prevrevY})
992992
return t

Themes/Til Death/BGAnimations/_chartpreview.lua

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ local hidth = 40
99
local yeet
1010
local cd
1111

12+
local yPos = Var("yPos")
13+
local yPosReverse = Var("yPosReverse")
14+
if not yPos then yPos = 55 end
15+
if not yPosReverse then yPosReverse = 208 end
16+
1217
local translated_info = {
1318
Paused = THEME:GetString("ChartPreview", "Paused")
1419
}
@@ -35,7 +40,7 @@ local function setUpPreviewNoteField()
3540
yeet:x(wodth/2)
3641
memehamstermax:SortByDrawOrder()
3742
MESSAGEMAN:Broadcast("NoteFieldVisible")
38-
end
43+
end
3944

4045
local t = Def.ActorFrame {
4146
Name = "ChartPreview",
@@ -75,6 +80,16 @@ local t = Def.ActorFrame {
7580
cd:GetChild("cdbg"):diffusealpha(0) -- we want to use our position background for draw order stuff -mina
7681
cd:queuecommand("GraphUpdate") -- first graph will be empty if we dont force this on initial creation
7782
end,
83+
OptionsScreenClosedMessageCommand = function(self)
84+
local rev = GAMESTATE:GetPlayerState(PLAYER_1):GetCurrentPlayerOptions():UsingReverse()
85+
if self:GetChild("NoteField") ~= nil then
86+
if not rev then
87+
self:GetChild("NoteField"):y(yPos * 1.5)
88+
else
89+
self:GetChild("NoteField"):y(yPos * 1.5 + yPosReverse)
90+
end
91+
end
92+
end,
7893
Def.Quad {
7994
Name = "BG",
8095
InitCommand = function(self)

0 commit comments

Comments
 (0)