Skip to content

Commit

Permalink
Fix Autoplay EX Score display
Browse files Browse the repository at this point in the history
  • Loading branch information
teejusb committed Jun 3, 2022
1 parent abea874 commit ffc5b3e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions BGAnimations/ScreenGameplay overlay/TrackExScoreJudgments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ return Def.Actor{
end,
JudgmentMessageCommand=function(self, params)
if params.Player ~= player then return end

if IsAutoplay(player) then return end

local count_updated = false
if params.HoldNoteScore then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ for index, window in ipairs(TNS.Types) do
if params.Player ~= player then return end
if params.HoldNoteScore then return end
if not params.TapNoteScore then return end
if IsAutoplay(player) then return end

local incremented = false

Expand Down
6 changes: 5 additions & 1 deletion Graphics/Player judgment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ return Def.ActorFrame{
if ToEnumShortString(param.TapNoteScore) == "W1" then
if mods.ShowFaPlusWindow then
-- If this W1 judgment fell outside of the FA+ window, show the white window
if not IsW0Judgment(param, player) then
--
-- Treat Autoplay specially. The TNS might be out of the range, but
-- it's a nicer experience to always just display the top window graphic regardless.
-- This technically causes a discrepency on the histogram, but it's likely okay.
if not IsW0Judgment(param, player) and not IsAutoplay(player) then
frame = 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion Scripts/SL-CustomScores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function WriteScores()
end

-- Don't store scores for guest profiles or autoplay
if PROFILEMAN:IsPersistentProfile(player) and GAMESTATE:IsSideJoined(player) and not IsAutoplay(player) then
if PROFILEMAN:IsPersistentProfile(player) and GAMESTATE:IsSideJoined(player) and IsHumanPlayer(player) then
local profileSlot = {
[PLAYER_1] = "ProfileSlot_Player1",
[PLAYER_2] = "ProfileSlot_Player2"
Expand Down
4 changes: 2 additions & 2 deletions Scripts/SL-Helpers-GrooveStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ ValidForGrooveStats = function(player)
-- only FailTypes "Immediate" and "ImmediateContinue" are valid for GrooveStats
valid[11] = (po:FailSetting() == "FailType_Immediate" or po:FailSetting() == "FailType_ImmediateContinue")

-- AutoPlay is not allowed
valid[12] = not IsAutoplay(player)
-- AutoPlay/AutoplayCPU is not allowed
valid[12] = IsHumanPlayer(player)

-- ------------------------------------------
-- return the entire table so that we can let the player know which settings,
Expand Down
9 changes: 7 additions & 2 deletions Scripts/SL-Helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,14 @@ GetComboFonts = function()
end


-- -----------------------------------------------------------------------
IsHumanPlayer = function(player)
return GAMESTATE:GetPlayerState(player):GetPlayerController() == "PlayerController_Human"
end

-- -----------------------------------------------------------------------
IsAutoplay = function(player)
return GAMESTATE:GetPlayerState(player):GetPlayerController() ~= "PlayerController_Human"
return GAMESTATE:GetPlayerState(player):GetPlayerController() == "PlayerController_Autoplay"
end

-- -----------------------------------------------------------------------
Expand Down Expand Up @@ -793,4 +798,4 @@ HasTurnMod = function(player)
end

return false
end
end

0 comments on commit ffc5b3e

Please sign in to comment.