Skip to content

Commit

Permalink
Merge pull request #28 from poco0317/master
Browse files Browse the repository at this point in the history
Prepare for v2.2.4 release - Compatibility with Etterna 0.69.1
  • Loading branch information
poco0317 authored May 29, 2020
2 parents 4544477 + 93ff7ac commit c8475be
Show file tree
Hide file tree
Showing 13 changed files with 302 additions and 123 deletions.
144 changes: 62 additions & 82 deletions BGAnimations/ScreenEvaluation decorations/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ local rate = getCurRate()
local judge = (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
local offsetIndex

local function clampJudge()
if judge < 4 then judge = 4 end
if judge > 9 then judge = 9 end
end
clampJudge()

-- Reset preview music starting point since song was finished.
GHETTOGAMESTATE:setLastPlayedSecond(0)

Expand All @@ -32,6 +38,17 @@ local offsetWidth2 = 0
local offsetHeight2 = 0
local offsetisLocal

local function getRescoreElements(pss, score)
local o = {}
o["dvt"] = dvt
o["totalHolds"] = pss:GetRadarPossible():GetValue("RadarCategory_Holds") + pss:GetRadarPossible():GetValue("RadarCategory_Rolls")
o["holdsHit"] = score:GetRadarValues():GetValue("RadarCategory_Holds") + score:GetRadarValues():GetValue("RadarCategory_Rolls")
o["holdsMissed"] = o["totalHolds"] - o["holdsHit"]
o["minesHit"] = pss:GetRadarPossible():GetValue("RadarCategory_Mines") - score:GetRadarValues():GetValue("RadarCategory_Mines")
o["totalTaps"] = totalTaps
return o
end

local function scroller(event)
if event.type == "InputEventType_FirstPress" then
if event.DeviceInput.button == "DeviceButton_mousewheel up" then
Expand Down Expand Up @@ -72,32 +89,19 @@ local function oldEvalStuff()
}
t[#t+1] = Def.ActorFrame {
OffsetPlotModificationMessageCommand = function(self, params)
local score = pss:GetHighScore()
local totalHolds =
pss:GetRadarPossible():GetValue("RadarCategory_Holds") + pss:GetRadarPossible():GetValue("RadarCategory_Rolls")
local holdsHit =
pss:GetRadarActual():GetValue("RadarCategory_Holds") + pss:GetRadarActual():GetValue("RadarCategory_Rolls")
local minesHit =
pss:GetRadarPossible():GetValue("RadarCategory_Mines") - pss:GetRadarActual():GetValue("RadarCategory_Mines")
if enabledCustomWindows then
if params.Name == "PrevJudge" then
judge = judge < 2 and #customWindows or judge - 1
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
rescoredPercentage = getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps)
elseif params.Name == "NextJudge" then
judge = judge == #customWindows and 1 or judge + 1
customWindow = timingWindowConfig:get_data()[customWindows[judge]]
rescoredPercentage = getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps)
end
elseif params.Name == "PrevJudge" and judge > 1 then
local rst = getRescoreElements(pss, pss:GetHighScore())
if params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
rescoredPercentage = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
clampJudge()
rescoredPercentage = getRescoredWife3Judge(3, judge, rst)
elseif params.Name == "NextJudge" and judge < 9 then
judge = judge + 1
rescoredPercentage = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
clampJudge()
rescoredPercentage = getRescoredWife3Judge(3, judge, rst)
end
if params.Name == "ResetJudge" then
judge = enabledCustomWindows and 0 or (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
judge = PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty()
clampJudge()
self:GetParent():playcommand("ResetJudge")
elseif params.Name ~= "ToggleHands" then
self:GetParent():playcommand("SetJudge", params)
Expand Down Expand Up @@ -267,21 +271,7 @@ local function oldEvalStuff()
end
end,
SetJudgeCommand = function(self, params)
if enabledCustomWindows then
if rescoredPercentage > 99 then
self:settextf(
"%05.4f%% (%s)",
rescoredPercentage,
customWindow.name
)
else
self:settextf(
"%05.2f%% (%s)",
rescoredPercentage,
customWindow.name
)
end
elseif params.Name == "PrevJudge" and judge >= 1 then
if params.Name == "PrevJudge" and judge >= 1 then
if rescoredPercentage > 99 then
self:settextf(
"%05.4f%% (%s)",
Expand Down Expand Up @@ -413,16 +403,10 @@ local function oldEvalStuff()

local tst = ms.JudgeScalers
local tso = tst[judge]
if enabledCustomWindows then
tso = 1
end
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
local middleCol = ncol / 2
local function recountCBs()
tso = tst[judge]
if enabledCustomWindows then
tso = 1
end
cbl = 0
cbr = 0
cbm = 0
Expand Down Expand Up @@ -781,14 +765,14 @@ local function oldEvalStuff()
end,
SetCommand = function(self)
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
self:settextf("%s - %s J4", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1))
self:settextf("%s - %s%d J4", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1), curScore:GetWifeVers())
else
self:settextf("%s - %s", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1))
self:settextf("%s - %s%d", THEME:GetString("ScreenEvaluation","CategoryScore"), getScoreTypeText(1), curScore:GetWifeVers())
end
end,
SetJudgeCommand = function(self)
local jdg = (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())
self:settextf("%s - %s J%d", THEME:GetString("ScreenEvaluation", "CategoryScore"), getScoreTypeText(1), jdg)
self:settextf("%s - %s3 J%d", THEME:GetString("ScreenEvaluation", "CategoryScore"), getScoreTypeText(1), jdg)
end,
ResetJudgeCommand = function(self)
self:playcommand("Set")
Expand Down Expand Up @@ -1040,11 +1024,7 @@ local function oldEvalStuff()
self:settext(pss:GetTapNoteScores(v))
end,
SetJudgeCommand = function(self)
if enabledCustomWindows then
self:settext(getRescoredCustomJudge(dvt, customWindow.judgeWindows, k))
else
self:settext(getRescoredJudge(dvt, judge, k))
end
self:settext(getRescoredJudge(dvt, judge, k))
end,
ResetJudgeCommand = function(self)
self:playcommand("Set")
Expand All @@ -1065,11 +1045,7 @@ local function oldEvalStuff()
self:settextf("(%.2f%%)",math.floor(percent*10000)/100)
end,
SetJudgeCommand = function(self)
if enabledCustomWindows then
self:settextf("(%.2f%%)", getRescoredCustomJudge(dvt, customWindow.judgeWindows, k) / totalTaps * 100)
else
self:settextf("(%.2f%%)", getRescoredJudge(dvt, judge, k) / totalTaps * 100)
end
self:settextf("(%.2f%%)", getRescoredJudge(dvt, judge, k) / totalTaps * 100)
end,
ResetJudgeCommand = function(self)
self:playcommand("Set")
Expand Down Expand Up @@ -2427,9 +2403,6 @@ local function newEvalStuff()

local tst = ms.JudgeScalers
local tso = tst[judge]
if enabledCustomWindows then
tso = 1
end
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
local middleCol = ncol / 2
local function recountCBs()
Expand Down Expand Up @@ -2534,13 +2507,8 @@ local function newEvalStuff()
percent = pss:GetPercentageOfTaps(thisJudgment) * 100
end,
SetJudgeCommand = function(self)
if enabledCustomWindows then
percent = getRescoredCustomJudge(dvt, customWindow.judgeWindows, i) / totalTaps * 100
count = getRescoredCustomJudge(dvt, customWindow.judgeWindows, i)
else
percent = getRescoredJudge(dvt, judge, i) / totalTaps * 100
count = getRescoredJudge(dvt, judge, i)
end
percent = getRescoredJudge(dvt, judge, i) / totalTaps * 100
count = getRescoredJudge(dvt, judge, i)
end,
ResetJudgeCommand = function(self)
count = pss:GetHighScore():GetTapNoteScore(thisJudgment)
Expand Down Expand Up @@ -2867,8 +2835,9 @@ local function newEvalStuff()
self:zoom(biggerTextScale)
self:maxwidth(frameWidth / 4 / biggerTextScale)
self:settext("")
self:playcommand("Begin")
end,
BeginCommand=function(self)
BeginCommand = function(self)
local wifeScore = pss:GetHighScore():GetWifeScore()
if wifeScore > 0.99 then
self:settextf("%.4f%%",math.floor((wifeScore)*1000000)/10000)
Expand All @@ -2877,26 +2846,40 @@ local function newEvalStuff()
end
end,
SetJudgeCommand = function(self, params)
if enabledCustomWindows then
if rescoredPercentage > 99 then
self:settextf("%05.4f%% (%s)", rescoredPercentage, customWindow.name)
else
self:settextf("%05.2f%% (%s)", rescoredPercentage, customWindow.name)
end
if rescoredPercentage > 99 then
self:settextf("%05.4f%%", rescoredPercentage)
else

if rescoredPercentage > 99 then
self:settextf("%05.4f%%", rescoredPercentage)
else
self:settextf("%05.2f%%", rescoredPercentage)
end
self:settextf("%05.2f%%", rescoredPercentage)
end
end,
ResetJudgeCommand = function(self)
self:playcommand("Begin")
end
},
LoadFont("Common Normal")..{
LoadFont("Common Normal") .. {
Name = "WifeVersion",
InitCommand = function(self)
self:halign(0)
self:y(upperDivider1Y + dividerHeight/2 + (frameHeight * gradeSectionReferenceRatio / 5 * 3.4))
self:zoom(smallerTextScale)
self:maxwidth(frameWidth / 4 / smallerTextScale)
self:settext("")
end,
PlaceCommand = function(self)
local xpos = 2 + self:GetParent():GetChild("WifePercent"):GetZoomedWidth() / 2
self:x(xpos)
end,
BeginCommand = function(self)
self:playcommand("Place")
local vers = pss:GetHighScore():GetWifeVers()
self:settextf("Wife%d", vers)
end,
SetJudgeCommand = function(self, params)
self:playcommand("Place")
self:settextf("Wife3")
end
},
LoadFont("Common Normal") .. {
Name = "Grade",
InitCommand = function(self)
self:halign(1)
Expand Down Expand Up @@ -2961,9 +2944,6 @@ local function newEvalStuff()
end,
SetJudgeCommand = function(self)
tso = tst[judge]
if enabledCustomWindows then
tso = 1
end
recountCBs()
self:queuecommand("Set")
end,
Expand Down
13 changes: 10 additions & 3 deletions BGAnimations/ScreenGroupInfo overlay/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ end
t[#t+1] = LoadActor("../_mouse", "ScreenGroupInfo")

t[#t+1] = LoadActor("../_frame")
--[[
local tab = TAB:new({"Difficulty Distribution"})

local tab = TAB:new({"Upload All Scores"})
t[#t+1] = tab:makeTabActors() .. {
OnCommand = function(self)
self:y(SCREEN_HEIGHT+tab.height/2)
Expand All @@ -205,9 +205,16 @@ t[#t+1] = tab:makeTabActors() .. {
self:y(SCREEN_HEIGHT+tab.height/2)
end,
TabPressedMessageCommand = function(self, params)
if params.name == "Upload All Scores" then
if DLMAN:IsLoggedIn() then
DLMAN:UploadScoresForPack(group)
else
SCREENMAN:SystemMessage("You must be logged in to use this.")
end
end
end
}
]]


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

Expand Down
52 changes: 51 additions & 1 deletion BGAnimations/ScreenMusicInfo overlay/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,53 @@ local function scoreList()
end,
}


-- upload replay data button
t[#t+1] = quadButton(3)..{
InitCommand = function (self)
self:xy(95/2+3 + 95 + 95,30)
self:zoomto(90,20)
self:diffuse(color(colorConfig:get_data().main.disabled))
end,
ShowScoreDetailMessageCommand = function(self, params)
if scoreList[params.scoreIndex]:HasReplayData() then
self:diffusealpha(0.8)
else
self:diffusealpha(0.2)
end
end,

MouseDownCommand = function(self)
if scoreList[scoreIndex]:HasReplayData() then
self:finishtweening()
self:diffusealpha(1)
self:smooth(0.3)
self:diffusealpha(0.8)
DLMAN:SendReplayDataForOldScore(scoreList[scoreIndex]:GetScoreKey())
SCREENMAN:SystemMessage("Attempting to Upload Replay Data")
end
end
}
t[#t+1] = LoadFont("Common Bold")..{
InitCommand = function(self)
self:xy(95/2+3 + 95 + 95,30)
self:zoom(0.4)
self:diffuse(color(colorConfig:get_data().selectMusic.TabContentText))
self:diffusealpha(0.4)
self:queuecommand('Set')
end,
SetCommand = function(self)
self:settext("Upload Replay")
end,
ShowScoreDetailMessageCommand = function(self, params)
if scoreList[params.scoreIndex]:HasReplayData() then
self:diffusealpha(1)
else
self:diffusealpha(0.4)
end
end,
}

t[#t+1] = Def.Quad{
InitCommand = function(self)
self:diffusealpha(0.2)
Expand Down Expand Up @@ -1130,7 +1177,7 @@ t[#t+1] = LoadActor("../_mouse", "ScreenMusicInfo")

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

local tab = TAB:new({"Manage Tags", "Preview", "Leaderboard", "", ""})
local tab = TAB:new({"Manage Tags", "Preview", "Leaderboard", "", "Upload All For Chart"})
t[#t+1] = tab:makeTabActors() .. {
OnCommand = function(self)
self:y(SCREEN_HEIGHT+tab.height/2)
Expand All @@ -1147,6 +1194,9 @@ t[#t+1] = tab:makeTabActors() .. {
SCREENMAN:AddNewScreenToTop("ScreenChartPreview")
elseif params.name == "Leaderboard" and DLMAN:IsLoggedIn() then
SCREENMAN:AddNewScreenToTop("ScreenChartLeaderboard")
elseif params.name == "Upload All Scores" and DLMAN:IsLoggedIn() then
SCREENMAN:SystemMessage("Attempting to upload all scores for this chart.")
DLMAN:UploadScoresForChart(steps:GetChartKey())
end
end
}
Expand Down
2 changes: 1 addition & 1 deletion BGAnimations/ScreenNetMusicInfo overlay/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ local function scoreList()
self:diffusealpha(0.2)
self:zoomto(scoreItemWidth, scoreItemHeight)
end,
MouseDownCommand = function(self params)
MouseDownCommand = function(self, params)
self:finishtweening()
self:diffusealpha(0.4)
self:smooth(0.3)
Expand Down
Loading

0 comments on commit c8475be

Please sign in to comment.