Skip to content

Commit

Permalink
Merge pull request #29 from poco0317/master
Browse files Browse the repository at this point in the history
Prepare for v2.2.5 release - Compatibility with Etterna 0.70.1
  • Loading branch information
poco0317 authored Jul 10, 2020
2 parents c8475be + 40a789d commit 5adf1bf
Show file tree
Hide file tree
Showing 12 changed files with 245 additions and 26 deletions.
12 changes: 12 additions & 0 deletions BGAnimations/ScreenGameplay overlay/WifeJudgmentSpotting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ local function arbitraryErrorBarValue(value)
wscale = errorBarFrameWidth / 180
end

local function spaceNotefieldCols(inc)
if inc == nil then inc = 0 end
local hCols = math.floor(#noteColumns/2)
for i, col in ipairs(noteColumns) do
col:addx((i-hCols-1) * inc)
end
end

--[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Wife deviance tracker. Basically half the point of the theme.**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -193,6 +201,9 @@ local t =
Movable.DeviceButton_t.element = noteColumns
Movable.DeviceButton_r.condition = true
Movable.DeviceButton_t.condition = true
Movable.DeviceButton_f.condition = true
Movable.DeviceButton_f.DeviceButton_up.arbitraryFunction = spaceNotefieldCols
Movable.DeviceButton_f.DeviceButton_down.arbitraryFunction = spaceNotefieldCols
end

if lifebar ~= nil then
Expand All @@ -205,6 +216,7 @@ local t =
actor:zoomtowidth(MovableValues.NotefieldWidth)
actor:zoomtoheight(MovableValues.NotefieldHeight)
end
spaceNotefieldCols(MovableValues.NotefieldSpacing)
end,
DoneLoadingNextSongMessageCommand = function(self)
-- put notefield y pos back on doneloadingnextsong because playlist courses reset this for w.e reason -mina
Expand Down
9 changes: 4 additions & 5 deletions BGAnimations/ScreenGameplay overlay/lanecover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ local cover
local laneColor = color(colorConfig:get_data().gameplay.LaneCover)

local cols = GAMESTATE:GetCurrentStyle():ColumnsPerPlayer()
local evencols = cols - cols%2
local allowedCustomization = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay

local isCentered = ((cols >= 6) or PREFSMAN:GetPreference("Center1Player")) and GAMESTATE:GetNumPlayersEnabled() == 1
-- load from prefs later
local width = 64 * cols * MovableValues.NotefieldWidth
local nfspace = MovableValues.NotefieldSpacing and MovableValues.NotefieldSpacing or 0
local width = 64 * cols * MovableValues.NotefieldWidth + nfspace * (evencols)
local padding = 8
local styleType = ToEnumShortString(GAMESTATE:GetCurrentStyle():GetStyleType())

Expand All @@ -25,7 +27,7 @@ end
local heightP1 = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).LaneCoverHeight

local P1X =
SCREEN_CENTER_X + MovableValues.NotefieldX
SCREEN_CENTER_X + MovableValues.NotefieldX + (cols % 2 == 0 and -nfspace / 2 or 0)

if not isCentered then
P1X = THEME:GetMetric("ScreenGameplay", string.format("PlayerP1%sX", styleType))
Expand Down Expand Up @@ -175,7 +177,6 @@ if enabledP1 then
end
end,
UpdateCommand = function(self)
P1X = SCREEN_CENTER_X + MovableValues.NotefieldX
if isReverseP1 then
self:xy(P1X, SCREEN_TOP):zoomto((width + padding) * getNoteFieldScale(PLAYER_1), heightP1):valign(0):diffuse(
laneColor
Expand Down Expand Up @@ -247,8 +248,6 @@ local function Update(self)
end
self:SetUpdateRate(5)
if enabledP1 then
P1X = SCREEN_CENTER_X + MovableValues.NotefieldX

if moveDownP1 then
if isReverseP1 then
heightP1 = math.min(SCREEN_BOTTOM, math.max(0, heightP1 + 0.1))
Expand Down
1 change: 1 addition & 0 deletions BGAnimations/ScreenGameplay overlay/messagebox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ return Def.ActorFrame {
"a: Leaderboard Position",
"s: Leaderboard Size",
"d: Leaderboard Spacing",
"f: Notefield Column Spacing",
--"h: Replay Buttons Spacing",
"j: Player Info Position",
"k: Player Info Size",
Expand Down
91 changes: 82 additions & 9 deletions BGAnimations/ScreenPlayerProfile decorations/infobox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local scoreSSRItemWidth = capWideScale(50,80)
local scoreSSRItemHeight = 35
local maxPages = 10
local curPage = 1
local recentscores = false

local function movePage(n)
if GHETTOGAMESTATE:getOnlineStatus() == "Online" then
Expand Down Expand Up @@ -175,6 +176,57 @@ t[#t+1] = LoadFont("Common Bold")..{
LogOutMessageCommand = function(self) self:playcommand("Set") end
}

-- toggle recent scores button
t[#t+1] = quadButton(3)..{
InitCommand = function (self)
self:xy(scoreItemX + 45,30)
self:zoomto(90,20)
self:diffuse(color(colorConfig:get_data().main.disabled))
self:queuecommand("Set")
end,
SetCommand = function(self)
if not recentscores then
self:diffusealpha(0.8)
else
self:diffusealpha(0.4)
end
end,
MouseDownCommand = function(self)
if GHETTOGAMESTATE:getOnlineStatus() == "Online" then
return
end
recentscores = not recentscores
MESSAGEMAN:Broadcast("RecentScoresToggled")
MESSAGEMAN:Broadcast("UpdateRanking", {SSRType = "Overall"})
end,
RecentScoresToggledMessageCommand = function(self)
self:playcommand("Set")
end
}
t[#t+1] = LoadFont("Common Bold")..{
InitCommand = function(self)
self:xy(scoreItemX + 45,30)
self:zoom(0.4)
self:maxwidth(90 / 0.4)
self:diffuse(color(colorConfig:get_data().selectMusic.TabContentText))
self:settext("Recent Scores")
self:queuecommand('Set')
end,
SetCommand = function(self)
if GHETTOGAMESTATE:getOnlineStatus() == "Online" then
return
end
if not recentscores then
self:diffusealpha(1)
else
self:diffusealpha(0.4)
end
end,
LoginMessageCommand = function(self) self:playcommand("Set") end,
LogOutMessageCommand = function(self) self:playcommand("Set") end,
RecentScoresToggledMessageCommand = function(self) self:playcommand("Set") end
}

-- score upload progress bar
-- background
local uploadbarwidth = 90
Expand Down Expand Up @@ -277,8 +329,13 @@ local function scoreSSRTypes(i)
end

local function scoreListItem(i)
local skillset = SkillSets[1]
local ths = SCOREMAN:GetTopSSRHighScore(i, SkillSets[1])
local skillset = SkillSets[1]
local ths = nil
if recentscores then
ths = SCOREMAN:GetRecentScoreForGame(i)
else
ths = SCOREMAN:GetTopSSRHighScoreForGame(i, SkillSets[1])
end

if ths == nil then
return
Expand Down Expand Up @@ -314,9 +371,14 @@ local function scoreListItem(i)
self:visible(true)
end
else
SCOREMAN:SortSSRs(params.SSRType)
skillset = params.SSRType
ths = SCOREMAN:GetTopSSRHighScore(index, params.SSRType)
if recentscores then
SCOREMAN:SortRecentScoresForGame()
ths = SCOREMAN:GetRecentScoreForGame(index)
else
SCOREMAN:SortSSRsForGame(params.SSRType)
ths = SCOREMAN:GetTopSSRHighScoreForGame(index, params.SSRType)
end
chartKey = ths:GetChartKey()
song = SONGMAN:GetSongByChartKey(chartKey)
steps = SONGMAN:GetStepsByChartKey(chartKey)
Expand All @@ -336,10 +398,16 @@ local function scoreListItem(i)
end,
LogOutMessageCommand = function(self)
index = (curPage-1)*maxScoreItems+i

GHETTOGAMESTATE:setOnlineStatus("Local")
SCOREMAN:SortSSRs("Overall")
if recentscores then
SCOREMAN:SortRecentScoresForGame()
ths = SCOREMAN:GetRecentScoreForGame(index)
else
SCOREMAN:SortSSRsForGame("Overall")
ths = SCOREMAN:GetTopSSRHighScore(index, "Overall")
end
skillset = "Overall"
ths = SCOREMAN:GetTopSSRHighScore(index, "Overall")
chartKey = ths:GetChartKey()
song = SONGMAN:GetSongByChartKey(chartKey)
steps = SONGMAN:GetStepsByChartKey(chartKey)
Expand All @@ -358,9 +426,14 @@ local function scoreListItem(i)
self:visible(true)
end
else
SCOREMAN:SortSSRs("Overall")
if recentscores then
SCOREMAN:SortRecentScoresForGame()
ths = SCOREMAN:GetRecentScoreForGame(index)
else
SCOREMAN:SortSSRsForGame("Overall")
ths = SCOREMAN:GetTopSSRHighScore(index, "Overall")
end
skillset = "Overall"
ths = SCOREMAN:GetTopSSRHighScore(i, "Overall")
chartKey = ths:GetChartKey()
song = SONGMAN:GetSongByChartKey(chartKey)
steps = SONGMAN:GetStepsByChartKey(chartKey)
Expand Down Expand Up @@ -729,7 +802,7 @@ local function songDisplay()
return t
end

SCOREMAN:SortSSRs(SkillSets[1])
SCOREMAN:SortSSRsForGame(SkillSets[1])

for i=1, #SkillSets do
t[#t+1] = scoreSSRTypes(i)
Expand Down
7 changes: 6 additions & 1 deletion Graphics/Notefield board.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ local function ScreenFilter()
PlayerStateSetCommand = function(self,param)
local pn = param.PlayerNumber
local style = GAMESTATE:GetCurrentStyle(pn)
local width = style:GetWidth(pn) + 8
local cols = style:ColumnsPerPlayer()
local evenCols = cols - cols%2
local width = style:GetWidth(pn) + 8 + (MovableValues.NotefieldSpacing and MovableValues.NotefieldSpacing or 0) * evenCols
local filterColor = color(colorConfig:get_data().gameplay.ScreenFilter)
local filterAlpha = playerConfig:get_data(pn_to_profile_slot(pn)).ScreenFilter
if filterAlpha == 0 then
Expand All @@ -18,6 +20,7 @@ local function ScreenFilter()
end
self:visible(true)
self:SetWidth(width)
self:addx(cols % 2 == 0 and -(MovableValues.NotefieldSpacing and MovableValues.NotefieldSpacing or 0) / 2 or 0)
self:SetHeight(SCREEN_HEIGHT*4096)
self:diffuse(filterColor)
self:diffusealpha(filterAlpha)
Expand All @@ -34,6 +37,7 @@ local function LaneHighlight()
local width = style:GetWidth(PLAYER_1)
local cols = style:ColumnsPerPlayer()
local colWidth = width/cols
local hCols = math.floor(cols / 2)
local reverse = GAMESTATE:GetPlayerState(PLAYER_1):GetCurrentPlayerOptions():UsingReverse()
local receptor = reverse and THEME:GetMetric("Player", "ReceptorArrowsYStandard") or THEME:GetMetric("Player", "ReceptorArrowsYReverse")
local border = 4
Expand All @@ -48,6 +52,7 @@ local function LaneHighlight()
self:SetHeight(SCREEN_HEIGHT)
self:diffusealpha(alpha)
self:xy((i-(cols/2)-(1/2))*colWidth,-receptor)
self:addx((i - hCols - 1) * (MovableValues.NotefieldSpacing and MovableValues.NotefieldSpacing or 0))
self:fadebottom(0.6):fadetop(0.6)
self:visible(false)
end,
Expand Down
91 changes: 91 additions & 0 deletions Graphics/OffsetGraph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,30 @@ local function setOffsetVerts(vt, x, y, c, alpha)
vt[#vt + 1] = {{x + dotWidth/2, y - dotWidth/2, 0}, c}
vt[#vt + 1] = {{x - dotWidth/2, y - dotWidth/2, 0}, c}
end

-- convert a plot x position to a noterow
local function convertXToRow(x)
local output = x
output = output / setWidth


if output < 0 then output = 0 end
if output > 1 then output = 1 end

-- the 48 here is how many noterows there are per beat
-- this is a const defined in the game
-- and i sure hope it doesnt ever change
local td = GAMESTATE:GetCurrentSteps():GetTimingData()
local row = td:GetBeatFromElapsedTime(output * finalSecond) * 48

return row
end
-----

local function HighlightUpdaterThing(self)
self:GetChild("Background"):queuecommand("Highlight")
end

local baralpha = 0.4

local t = Def.ActorFrame{
Expand All @@ -63,6 +85,15 @@ local t = Def.ActorFrame{
self:playcommand("Update", params) end
)
end,
OnCommand = function(self)
local name = SCREENMAN:GetTopScreen():GetName()
if name == "ScreenEvaluationNormal" or name == "ScreenNetEvaluation" then
local allowHovering = not SCREENMAN:GetTopScreen():ScoreUsedInvalidModifier()
if allowHovering then
self:SetUpdateFunction(HighlightUpdaterThing)
end
end
end,
OffsetPlotModificationMessageCommand = function(self, params)
if params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
Expand Down Expand Up @@ -116,6 +147,38 @@ t[#t+1] = Def.Quad{
ntt = params.ntt
columns = params.columns
self:zoomto(params.width, params.height)
end,
HighlightCommand = function(self)
local bar = self:GetParent():GetChild("PosBar")
local txt = self:GetParent():GetChild("PosText")
local bg = self:GetParent():GetChild("PosBG")
if isOver(self) then
local xpos = INPUTFILTER:GetMouseX() - self:GetParent():GetX()
bar:visible(true)
txt:visible(true)
bg:visible(true)
bar:x(xpos)
txt:x(xpos - 2)
bg:x(xpos)
bg:zoomto(txt:GetZoomedWidth() + 4, txt:GetZoomedHeight() + 4)
local row = convertXToRow(xpos)
local judgments = SCREENMAN:GetTopScreen():GetReplaySnapshotJudgmentsForNoterow(row)
local wifescore = SCREENMAN:GetTopScreen():GetReplaySnapshotWifePercentForNoterow(row) * 100
local marvCount = judgments[10]
local perfCount = judgments[9]
local greatCount = judgments[8]
local goodCount = judgments[7]
local badCount = judgments[6]
local missCount = judgments[5]

--txt:settextf("x %f\nrow %f\nbeat %f\nfinalsecond %f", xpos, row, row/48, finalSecond)
-- The odd formatting here is in case we want to add translation support.
txt:settextf("%f%%\n%s: %d\n%s: %d\n%s: %d\n%s: %d\n%s: %d\n%s: %d", wifescore, "Marvelous", marvCount, "Perfect", perfCount, "Great", greatCount, "Good", goodCount, "Bad", badCount, "Miss", missCount)
else
bar:visible(false)
txt:visible(false)
bg:visible(false)
end
end
}

Expand Down Expand Up @@ -186,6 +249,19 @@ for i = 1, #fantabars do
}
end

t[#t+1] = Def.Quad {
Name = "PosBar",
InitCommand = function(self)
self:visible(false)
self:zoomto(2, setHeight):diffuse(color("0.5,0.5,0.5,1"))
self:valign(0)
end,
UpdateCommand = function(self, params)
params = checkParams(params)
self:zoomto(2, params.height)
end
}

-- Late ms text
t[#t+1] = LoadFont("Common Normal")..{
InitCommand=function(self)
Expand Down Expand Up @@ -313,6 +389,21 @@ t[#t+1] = Def.ActorMultiVertex{
end
}

t[#t+1] = Def.Quad {
Name = "PosBG",
InitCommand = function(self)
self:valign(1):halign(1):zoomto(30,30):diffuse(color(".1,.1,.1,.45"))
self:visible(false)
end
}

t[#t+1] = LoadFont("Common Normal") .. {
Name = "PosText",
InitCommand = function(self)
self:valign(1):halign(1):zoom(0.4)
end
}




Expand Down
Loading

0 comments on commit 5adf1bf

Please sign in to comment.