Skip to content

Commit 47822b1

Browse files
allow docked scoreboard to remember its position
1 parent 6f9990f commit 47822b1

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ local ret = Def.ActorFrame{
7777
self:queuecommand("Set"):visible(false)
7878
self:GetChild("LocalScores"):visible(false)
7979
self:GetChild("ScoreDisplay"):xy(frameX,frameY):visible(false)
80+
81+
if FILTERMAN:oopsimlazylol() then -- set saved position and auto collapse
82+
nestedTab = 2
83+
self:GetChild("LocalScores"):visible(false)
84+
self:GetChild("ScoreDisplay"):xy(FILTERMAN:grabposx("Doot"),FILTERMAN:grabposy("Doot")):visible(true)
85+
self:playcommand("Collapse")
86+
end
8087
end,
8188
OffCommand=function(self)
8289
self:bouncebegin(0.2):xy(-500,0):diffusealpha(0) -- visible(false)

Themes/Til Death/BGAnimations/superscoreboard.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ local o = Def.ActorFrame{
146146
row2yoff = 1
147147
collapsed = true
148148
self:diffusealpha(0.8)
149+
150+
if FILTERMAN:grabposx("Doot") <= 10 or FILTERMAN:grabposy("Doot") <= 45 or FILTERMAN:grabposx("Doot") >= SCREEN_WIDTH - 60 or FILTERMAN:grabposy("Doot") >= SCREEN_HEIGHT - 45 then
151+
self:xy(10, 45)
152+
else
153+
self:xy(FILTERMAN:grabposx("Doot"),FILTERMAN:grabposy("Doot"))
154+
end
155+
156+
FILTERMAN:HelpImTrappedInAChineseFortuneCodingFactory(true)
149157
self:playcommand("Init")
150158
end,
151159
ExpandCommand=function(self)
@@ -172,6 +180,7 @@ local o = Def.ActorFrame{
172180
row2yoff = 1
173181
collapsed = false
174182
self:diffusealpha(1)
183+
FILTERMAN:HelpImTrappedInAChineseFortuneCodingFactory(false)
175184
self:playcommand("Init")
176185
end,
177186

@@ -189,6 +198,7 @@ local o = Def.ActorFrame{
189198
end,
190199
MouseRightClickMessageCommand=function(self)
191200
if isOver(self) and not collapsed then
201+
FILTERMAN:HelpImTrappedInAChineseFortuneCodingFactory(true)
192202
self:GetParent():GetParent():playcommand("Collapse")
193203
elseif isOver(self) then
194204
self:GetParent():GetParent():playcommand("Expand")
@@ -214,7 +224,10 @@ local o = Def.ActorFrame{
214224
self:diffusealpha(0.6):diffuse(color("#fafafa"))
215225
if INPUTFILTER:IsBeingPressed("Mouse 0", "Mouse") then
216226
self:diffusealpha(0):zoomto(400,400)
217-
self:GetParent():xy(INPUTFILTER:GetMouseX()-width/2, INPUTFILTER:GetMouseY() - self:GetY())
227+
local nx = INPUTFILTER:GetMouseX() - width/2
228+
local ny = INPUTFILTER:GetMouseY() - self:GetY()
229+
self:GetParent():xy(nx,ny)
230+
FILTERMAN:savepos("Doot", nx, ny)
218231
else
219232
self:zoomto(dwidth/2,pdh/2)
220233
end

src/FilterManager.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,29 @@ class LunaFilterManager : public Luna<FilterManager>
127127
lua_pushboolean(L, p->HighestSkillsetsOnly);
128128
return 1;
129129
}
130+
131+
static int HelpImTrappedInAChineseFortuneCodingFactory(T* p, lua_State* L) {
132+
p->galaxycollapsed = BArg(1);
133+
return 1;
134+
}
135+
static int oopsimlazylol(T* p, lua_State* L) {
136+
lua_pushboolean(L, p->galaxycollapsed);
137+
return 1;
138+
}
139+
static int grabposx(T* p, lua_State* L) {
140+
lua_pushnumber(L, p->watte[SArg(1)].first);
141+
return 1;
142+
}
143+
static int grabposy(T* p, lua_State* L) {
144+
lua_pushnumber(L, p->watte[SArg(1)].second);
145+
return 1;
146+
}
147+
static int savepos(T* p, lua_State* L) {
148+
p->watte[SArg(1)].first = IArg(2);
149+
p->watte[SArg(1)].second = IArg(3);
150+
return 1;
151+
}
152+
130153
LunaFilterManager() {
131154
ADD_METHOD(SetSSFilter);
132155
ADD_METHOD(GetSSFilter);
@@ -140,6 +163,11 @@ class LunaFilterManager : public Luna<FilterManager>
140163
ADD_METHOD(GetFilterMode);
141164
ADD_METHOD(ToggleHighestSkillsetsOnly);
142165
ADD_METHOD(GetHighestSkillsetsOnly);
166+
ADD_METHOD(HelpImTrappedInAChineseFortuneCodingFactory);
167+
ADD_METHOD(oopsimlazylol);
168+
ADD_METHOD(grabposx);
169+
ADD_METHOD(grabposy);
170+
ADD_METHOD(savepos);
143171
}
144172
};
145173

src/FilterManager.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define FilterManager_H
33
#include "GameConstantsAndTypes.h"
44
#include "PlayerNumber.h"
5+
#include <unordered_map>
56

67
class PlayerState;
78
class FilterManager {
@@ -21,6 +22,12 @@ class FilterManager {
2122
bool HighestSkillsetsOnly = false;
2223
bool AnyActiveFilter();
2324

25+
// not actually filter stuff! but this doesn't get enough love so i'm going to put it here until i make something for it -mina
26+
int miniboarddockx = 0;
27+
int miniboarddocky = 0;
28+
bool galaxycollapsed = false;
29+
unordered_map<string, pair<int, int>> watte;
30+
2431
//Lua
2532
void PushSelf(lua_State *L);
2633
};

0 commit comments

Comments
 (0)