Skip to content

Commit c8475be

Browse files
authored
Merge pull request #28 from poco0317/master
Prepare for v2.2.4 release - Compatibility with Etterna 0.69.1
2 parents 4544477 + 93ff7ac commit c8475be

File tree

13 files changed

+302
-123
lines changed

13 files changed

+302
-123
lines changed

BGAnimations/ScreenEvaluation decorations/default.lua

Lines changed: 62 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ local rate = getCurRate()
1313
local judge = (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
1414
local offsetIndex
1515

16+
local function clampJudge()
17+
if judge < 4 then judge = 4 end
18+
if judge > 9 then judge = 9 end
19+
end
20+
clampJudge()
21+
1622
-- Reset preview music starting point since song was finished.
1723
GHETTOGAMESTATE:setLastPlayedSecond(0)
1824

@@ -32,6 +38,17 @@ local offsetWidth2 = 0
3238
local offsetHeight2 = 0
3339
local offsetisLocal
3440

41+
local function getRescoreElements(pss, score)
42+
local o = {}
43+
o["dvt"] = dvt
44+
o["totalHolds"] = pss:GetRadarPossible():GetValue("RadarCategory_Holds") + pss:GetRadarPossible():GetValue("RadarCategory_Rolls")
45+
o["holdsHit"] = score:GetRadarValues():GetValue("RadarCategory_Holds") + score:GetRadarValues():GetValue("RadarCategory_Rolls")
46+
o["holdsMissed"] = o["totalHolds"] - o["holdsHit"]
47+
o["minesHit"] = pss:GetRadarPossible():GetValue("RadarCategory_Mines") - score:GetRadarValues():GetValue("RadarCategory_Mines")
48+
o["totalTaps"] = totalTaps
49+
return o
50+
end
51+
3552
local function scroller(event)
3653
if event.type == "InputEventType_FirstPress" then
3754
if event.DeviceInput.button == "DeviceButton_mousewheel up" then
@@ -72,32 +89,19 @@ local function oldEvalStuff()
7289
}
7390
t[#t+1] = Def.ActorFrame {
7491
OffsetPlotModificationMessageCommand = function(self, params)
75-
local score = pss:GetHighScore()
76-
local totalHolds =
77-
pss:GetRadarPossible():GetValue("RadarCategory_Holds") + pss:GetRadarPossible():GetValue("RadarCategory_Rolls")
78-
local holdsHit =
79-
pss:GetRadarActual():GetValue("RadarCategory_Holds") + pss:GetRadarActual():GetValue("RadarCategory_Rolls")
80-
local minesHit =
81-
pss:GetRadarPossible():GetValue("RadarCategory_Mines") - pss:GetRadarActual():GetValue("RadarCategory_Mines")
82-
if enabledCustomWindows then
83-
if params.Name == "PrevJudge" then
84-
judge = judge < 2 and #customWindows or judge - 1
85-
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
86-
rescoredPercentage = getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps)
87-
elseif params.Name == "NextJudge" then
88-
judge = judge == #customWindows and 1 or judge + 1
89-
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
90-
rescoredPercentage = getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps)
91-
end
92-
elseif params.Name == "PrevJudge" and judge > 1 then
92+
local rst = getRescoreElements(pss, pss:GetHighScore())
93+
if params.Name == "PrevJudge" and judge > 1 then
9394
judge = judge - 1
94-
rescoredPercentage = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
95+
clampJudge()
96+
rescoredPercentage = getRescoredWife3Judge(3, judge, rst)
9597
elseif params.Name == "NextJudge" and judge < 9 then
9698
judge = judge + 1
97-
rescoredPercentage = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
99+
clampJudge()
100+
rescoredPercentage = getRescoredWife3Judge(3, judge, rst)
98101
end
99102
if params.Name == "ResetJudge" then
100-
judge = enabledCustomWindows and 0 or (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
103+
judge = PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty()
104+
clampJudge()
101105
self:GetParent():playcommand("ResetJudge")
102106
elseif params.Name ~= "ToggleHands" then
103107
self:GetParent():playcommand("SetJudge", params)
@@ -267,21 +271,7 @@ local function oldEvalStuff()
267271
end
268272
end,
269273
SetJudgeCommand = function(self, params)
270-
if enabledCustomWindows then
271-
if rescoredPercentage > 99 then
272-
self:settextf(
273-
"%05.4f%% (%s)",
274-
rescoredPercentage,
275-
customWindow.name
276-
)
277-
else
278-
self:settextf(
279-
"%05.2f%% (%s)",
280-
rescoredPercentage,
281-
customWindow.name
282-
)
283-
end
284-
elseif params.Name == "PrevJudge" and judge >= 1 then
274+
if params.Name == "PrevJudge" and judge >= 1 then
285275
if rescoredPercentage > 99 then
286276
self:settextf(
287277
"%05.4f%% (%s)",
@@ -413,16 +403,10 @@ local function oldEvalStuff()
413403

414404
local tst = ms.JudgeScalers
415405
local tso = tst[judge]
416-
if enabledCustomWindows then
417-
tso = 1
418-
end
419406
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
420407
local middleCol = ncol / 2
421408
local function recountCBs()
422409
tso = tst[judge]
423-
if enabledCustomWindows then
424-
tso = 1
425-
end
426410
cbl = 0
427411
cbr = 0
428412
cbm = 0
@@ -781,14 +765,14 @@ local function oldEvalStuff()
781765
end,
782766
SetCommand = function(self)
783767
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
784-
self:settextf("%s - %s J4", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1))
768+
self:settextf("%s - %s%d J4", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1), curScore:GetWifeVers())
785769
else
786-
self:settextf("%s - %s", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1))
770+
self:settextf("%s - %s%d", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1), curScore:GetWifeVers())
787771
end
788772
end,
789773
SetJudgeCommand = function(self)
790774
local jdg = (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
791-
self:settextf("%s - %s J%d", THEME:GetString("ScreenEvaluation", "CategoryScore"), getScoreTypeText(1), jdg)
775+
self:settextf("%s - %s3 J%d", THEME:GetString("ScreenEvaluation", "CategoryScore"), getScoreTypeText(1), jdg)
792776
end,
793777
ResetJudgeCommand = function(self)
794778
self:playcommand("Set")
@@ -1040,11 +1024,7 @@ local function oldEvalStuff()
10401024
self:settext(pss:GetTapNoteScores(v))
10411025
end,
10421026
SetJudgeCommand = function(self)
1043-
if enabledCustomWindows then
1044-
self:settext(getRescoredCustomJudge(dvt, customWindow.judgeWindows, k))
1045-
else
1046-
self:settext(getRescoredJudge(dvt, judge, k))
1047-
end
1027+
self:settext(getRescoredJudge(dvt, judge, k))
10481028
end,
10491029
ResetJudgeCommand = function(self)
10501030
self:playcommand("Set")
@@ -1065,11 +1045,7 @@ local function oldEvalStuff()
10651045
self:settextf("(%.2f%%)",math.floor(percent*10000)/100)
10661046
end,
10671047
SetJudgeCommand = function(self)
1068-
if enabledCustomWindows then
1069-
self:settextf("(%.2f%%)", getRescoredCustomJudge(dvt, customWindow.judgeWindows, k) / totalTaps * 100)
1070-
else
1071-
self:settextf("(%.2f%%)", getRescoredJudge(dvt, judge, k) / totalTaps * 100)
1072-
end
1048+
self:settextf("(%.2f%%)", getRescoredJudge(dvt, judge, k) / totalTaps * 100)
10731049
end,
10741050
ResetJudgeCommand = function(self)
10751051
self:playcommand("Set")
@@ -2427,9 +2403,6 @@ local function newEvalStuff()
24272403

24282404
local tst = ms.JudgeScalers
24292405
local tso = tst[judge]
2430-
if enabledCustomWindows then
2431-
tso = 1
2432-
end
24332406
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
24342407
local middleCol = ncol / 2
24352408
local function recountCBs()
@@ -2534,13 +2507,8 @@ local function newEvalStuff()
25342507
percent = pss:GetPercentageOfTaps(thisJudgment) * 100
25352508
end,
25362509
SetJudgeCommand = function(self)
2537-
if enabledCustomWindows then
2538-
percent = getRescoredCustomJudge(dvt, customWindow.judgeWindows, i) / totalTaps * 100
2539-
count = getRescoredCustomJudge(dvt, customWindow.judgeWindows, i)
2540-
else
2541-
percent = getRescoredJudge(dvt, judge, i) / totalTaps * 100
2542-
count = getRescoredJudge(dvt, judge, i)
2543-
end
2510+
percent = getRescoredJudge(dvt, judge, i) / totalTaps * 100
2511+
count = getRescoredJudge(dvt, judge, i)
25442512
end,
25452513
ResetJudgeCommand = function(self)
25462514
count = pss:GetHighScore():GetTapNoteScore(thisJudgment)
@@ -2867,8 +2835,9 @@ local function newEvalStuff()
28672835
self:zoom(biggerTextScale)
28682836
self:maxwidth(frameWidth / 4 / biggerTextScale)
28692837
self:settext("")
2838+
self:playcommand("Begin")
28702839
end,
2871-
BeginCommand=function(self)
2840+
BeginCommand = function(self)
28722841
local wifeScore = pss:GetHighScore():GetWifeScore()
28732842
if wifeScore > 0.99 then
28742843
self:settextf("%.4f%%",math.floor((wifeScore)*1000000)/10000)
@@ -2877,26 +2846,40 @@ local function newEvalStuff()
28772846
end
28782847
end,
28792848
SetJudgeCommand = function(self, params)
2880-
if enabledCustomWindows then
2881-
if rescoredPercentage > 99 then
2882-
self:settextf("%05.4f%% (%s)", rescoredPercentage, customWindow.name)
2883-
else
2884-
self:settextf("%05.2f%% (%s)", rescoredPercentage, customWindow.name)
2885-
end
2849+
if rescoredPercentage > 99 then
2850+
self:settextf("%05.4f%%", rescoredPercentage)
28862851
else
2887-
2888-
if rescoredPercentage > 99 then
2889-
self:settextf("%05.4f%%", rescoredPercentage)
2890-
else
2891-
self:settextf("%05.2f%%", rescoredPercentage)
2892-
end
2852+
self:settextf("%05.2f%%", rescoredPercentage)
28932853
end
28942854
end,
28952855
ResetJudgeCommand = function(self)
28962856
self:playcommand("Begin")
28972857
end
28982858
},
2899-
LoadFont("Common Normal")..{
2859+
LoadFont("Common Normal") .. {
2860+
Name = "WifeVersion",
2861+
InitCommand = function(self)
2862+
self:halign(0)
2863+
self:y(upperDivider1Y + dividerHeight/2 + (frameHeight * gradeSectionReferenceRatio / 5 * 3.4))
2864+
self:zoom(smallerTextScale)
2865+
self:maxwidth(frameWidth / 4 / smallerTextScale)
2866+
self:settext("")
2867+
end,
2868+
PlaceCommand = function(self)
2869+
local xpos = 2 + self:GetParent():GetChild("WifePercent"):GetZoomedWidth() / 2
2870+
self:x(xpos)
2871+
end,
2872+
BeginCommand = function(self)
2873+
self:playcommand("Place")
2874+
local vers = pss:GetHighScore():GetWifeVers()
2875+
self:settextf("Wife%d", vers)
2876+
end,
2877+
SetJudgeCommand = function(self, params)
2878+
self:playcommand("Place")
2879+
self:settextf("Wife3")
2880+
end
2881+
},
2882+
LoadFont("Common Normal") .. {
29002883
Name = "Grade",
29012884
InitCommand = function(self)
29022885
self:halign(1)
@@ -2961,9 +2944,6 @@ local function newEvalStuff()
29612944
end,
29622945
SetJudgeCommand = function(self)
29632946
tso = tst[judge]
2964-
if enabledCustomWindows then
2965-
tso = 1
2966-
end
29672947
recountCBs()
29682948
self:queuecommand("Set")
29692949
end,

BGAnimations/ScreenGroupInfo overlay/default.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ end
193193
t[#t+1] = LoadActor("../_mouse", "ScreenGroupInfo")
194194

195195
t[#t+1] = LoadActor("../_frame")
196-
--[[
197-
local tab = TAB:new({"Difficulty Distribution"})
196+
197+
local tab = TAB:new({"Upload All Scores"})
198198
t[#t+1] = tab:makeTabActors() .. {
199199
OnCommand = function(self)
200200
self:y(SCREEN_HEIGHT+tab.height/2)
@@ -205,9 +205,16 @@ t[#t+1] = tab:makeTabActors() .. {
205205
self:y(SCREEN_HEIGHT+tab.height/2)
206206
end,
207207
TabPressedMessageCommand = function(self, params)
208+
if params.name == "Upload All Scores" then
209+
if DLMAN:IsLoggedIn() then
210+
DLMAN:UploadScoresForPack(group)
211+
else
212+
SCREENMAN:SystemMessage("You must be logged in to use this.")
213+
end
214+
end
208215
end
209216
}
210-
]]
217+
211218

212219
t[#t+1] = LoadActor("../_cursor")
213220

BGAnimations/ScreenMusicInfo overlay/default.lua

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,53 @@ local function scoreList()
10061006
end,
10071007
}
10081008

1009+
1010+
-- upload replay data button
1011+
t[#t+1] = quadButton(3)..{
1012+
InitCommand = function (self)
1013+
self:xy(95/2+3 + 95 + 95,30)
1014+
self:zoomto(90,20)
1015+
self:diffuse(color(colorConfig:get_data().main.disabled))
1016+
end,
1017+
ShowScoreDetailMessageCommand = function(self, params)
1018+
if scoreList[params.scoreIndex]:HasReplayData() then
1019+
self:diffusealpha(0.8)
1020+
else
1021+
self:diffusealpha(0.2)
1022+
end
1023+
end,
1024+
1025+
MouseDownCommand = function(self)
1026+
if scoreList[scoreIndex]:HasReplayData() then
1027+
self:finishtweening()
1028+
self:diffusealpha(1)
1029+
self:smooth(0.3)
1030+
self:diffusealpha(0.8)
1031+
DLMAN:SendReplayDataForOldScore(scoreList[scoreIndex]:GetScoreKey())
1032+
SCREENMAN:SystemMessage("Attempting to Upload Replay Data")
1033+
end
1034+
end
1035+
}
1036+
t[#t+1] = LoadFont("Common Bold")..{
1037+
InitCommand = function(self)
1038+
self:xy(95/2+3 + 95 + 95,30)
1039+
self:zoom(0.4)
1040+
self:diffuse(color(colorConfig:get_data().selectMusic.TabContentText))
1041+
self:diffusealpha(0.4)
1042+
self:queuecommand('Set')
1043+
end,
1044+
SetCommand = function(self)
1045+
self:settext("Upload Replay")
1046+
end,
1047+
ShowScoreDetailMessageCommand = function(self, params)
1048+
if scoreList[params.scoreIndex]:HasReplayData() then
1049+
self:diffusealpha(1)
1050+
else
1051+
self:diffusealpha(0.4)
1052+
end
1053+
end,
1054+
}
1055+
10091056
t[#t+1] = Def.Quad{
10101057
InitCommand = function(self)
10111058
self:diffusealpha(0.2)
@@ -1130,7 +1177,7 @@ t[#t+1] = LoadActor("../_mouse", "ScreenMusicInfo")
11301177

11311178
t[#t+1] = LoadActor("../_frame")
11321179

1133-
local tab = TAB:new({"Manage Tags", "Preview", "Leaderboard", "", ""})
1180+
local tab = TAB:new({"Manage Tags", "Preview", "Leaderboard", "", "Upload All For Chart"})
11341181
t[#t+1] = tab:makeTabActors() .. {
11351182
OnCommand = function(self)
11361183
self:y(SCREEN_HEIGHT+tab.height/2)
@@ -1147,6 +1194,9 @@ t[#t+1] = tab:makeTabActors() .. {
11471194
SCREENMAN:AddNewScreenToTop("ScreenChartPreview")
11481195
elseif params.name == "Leaderboard" and DLMAN:IsLoggedIn() then
11491196
SCREENMAN:AddNewScreenToTop("ScreenChartLeaderboard")
1197+
elseif params.name == "Upload All Scores" and DLMAN:IsLoggedIn() then
1198+
SCREENMAN:SystemMessage("Attempting to upload all scores for this chart.")
1199+
DLMAN:UploadScoresForChart(steps:GetChartKey())
11501200
end
11511201
end
11521202
}

BGAnimations/ScreenNetMusicInfo overlay/default.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ local function scoreList()
753753
self:diffusealpha(0.2)
754754
self:zoomto(scoreItemWidth, scoreItemHeight)
755755
end,
756-
MouseDownCommand = function(self params)
756+
MouseDownCommand = function(self, params)
757757
self:finishtweening()
758758
self:diffusealpha(0.4)
759759
self:smooth(0.3)

0 commit comments

Comments
 (0)