Skip to content

Commit c0c1333

Browse files
enable mirror if a chart is flagged as permamirror
1 parent 8791e91 commit c0c1333

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Themes/Til Death/BGAnimations/ScreenGameplay underlay/default.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
local modslevel = topscreen == "ScreenEditOptions" and "ModsLevel_Stage" or "ModsLevel_Preferred"
33
local playeroptions = GAMESTATE:GetPlayerState(PLAYER_1):GetPlayerOptions(modslevel)
44
playeroptions:Mini( 2 - playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ReceptorSize/50 )
5+
local profile = PROFILEMAN:GetProfile(PLAYER_1)
6+
if profile:IsCurrentChartPermamirror() then -- turn on mirror if song is flagged as perma mirror
7+
playeroptions:Mirror( true )
8+
end
59

610
local bgtype = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).BackgroundType
711
local songoptions = GAMESTATE:GetSongOptionsObject('ModsLevel_Preferred')

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ t[#t+1] = Def.Actor{
5757
alreadybroadcasted = true
5858
end,
5959
CurrentSongChangedMessageCommand=function(self)
60-
if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).OneShotMirror then -- This will disable mirror when switching songs if OneShotMirror is enabled
60+
-- This will disable mirror when switching songs if OneShotMirror is enabled or if permamirror is flagged on the chart (it is enabled if so in screengameplayunderlay/default)
61+
if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).OneShotMirror or profile:IsCurrentChartPermamirror() then
6162
local modslevel = topscreen == "ScreenEditOptions" and "ModsLevel_Stage" or "ModsLevel_Preferred"
6263
local playeroptions = GAMESTATE:GetPlayerState(PLAYER_1):GetPlayerOptions(modslevel)
6364
playeroptions:Mirror( false )

src/Profile.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ class LunaProfile : public Luna<Profile>
25122512
return 1;
25132513
}
25142514

2515-
DEFINE_METHOD(GetGUID, m_sGuid);
2515+
DEFINE_METHOD(GetGUID, m_sGuid);
25162516
static int GetAllGoals(T* p, lua_State *L) {
25172517
lua_newtable(L);
25182518
int idx = 0;
@@ -2525,7 +2525,7 @@ class LunaProfile : public Luna<Profile>
25252525
tsg.PushSelf(L);
25262526
lua_rawseti(L, -2, idx + 1);
25272527
idx++;
2528-
}
2528+
}
25292529
}
25302530
return 1;
25312531
}
@@ -2539,6 +2539,16 @@ class LunaProfile : public Luna<Profile>
25392539
return 1;
25402540
}
25412541

2542+
static int IsCurrentChartPermamirror(T* p, lua_State *L) {
2543+
bool o = false;
2544+
const string& cck = GAMESTATE->m_pCurSteps[PLAYER_1]->ChartKey;
2545+
FOREACH(string, p->PermaMirrorCharts, ck)
2546+
if (*ck == cck)
2547+
o = true;
2548+
2549+
lua_pushboolean(L, o);
2550+
return 1;
2551+
}
25422552
LunaProfile()
25432553
{
25442554
ADD_METHOD( AddScreenshot );
@@ -2584,6 +2594,7 @@ class LunaProfile : public Luna<Profile>
25842594
ADD_METHOD( GetAllGoals );
25852595
ADD_METHOD(GetIgnoreStepCountCalories);
25862596
ADD_METHOD(CalculateCaloriesFromHeartRate);
2597+
ADD_METHOD(IsCurrentChartPermamirror);
25872598
}
25882599
};
25892600

src/Profile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ class Profile
257257
int m_iNumStagesPassedByGrade[NUM_Grade];
258258

259259
// if anymore of these are added they should be enum'd to reduce copy pasta -mina
260+
// and also should be sets
260261
void AddToFavorites(const string& ck) { FavoritedCharts.emplace_back(ck); }
261262
void AddToPermaMirror(const string& ck) { PermaMirrorCharts.emplace_back(ck); }
262263
void RemoveFromFavorites(const string& ck);

0 commit comments

Comments
 (0)