Skip to content

Commit

Permalink
Use ReplaySnapshot wifescores in Replays
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Oct 10, 2019
1 parent f3cdf3d commit 9fffd27
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Themes/Til Death/Graphics/Player judgment/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ local t =
end
end,
JudgmentMessageCommand = function(self, param)
if param.HoldNoteScore then
if param.HoldNoteScore or param.FromReplay then
return
end
local iNumStates = c.Judgment:GetNumStates()
Expand Down
36 changes: 25 additions & 11 deletions src/Etterna/Screen/Gameplay/ScreenGameplayReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,20 +384,29 @@ ScreenGameplayReplay::ToggleReplayPause()
{
pss->m_iHoldNoteScores[hns] = rs.hns[hns];
}
PlayerState* ps = m_vPlayerInfo.GetPlayerState();
m_vPlayerInfo.m_pPlayer->curwifescore = rs.curwifescore;
m_vPlayerInfo.m_pPlayer->maxwifescore = rs.maxwifescore;

// Reset the wife/judge counter related visible stuff
FOREACH_ENUM(TapNoteScore, tns)
{
Message msg = Message("Judgment");
msg.SetParam("FromReplay", true);
msg.SetParam("Judgment", tns);
msg.SetParam("WifePercent", 0);
msg.SetParam("WifePercent",
100 * rs.curwifescore / rs.maxwifescore);
msg.SetParam("Player", 0);
msg.SetParam("TapNoteScore", tns);
msg.SetParam("FirstTrack", 0);
msg.SetParam("CurWifeScore", 0);
msg.SetParam("MaxWifeScore", 0);
msg.SetParam("WifeDifferential", 0);
msg.SetParam("TotalPercent", 0);
msg.SetParam("CurWifeScore", rs.curwifescore);
msg.SetParam("MaxWifeScore", rs.maxwifescore);
msg.SetParam("WifeDifferential",
rs.curwifescore -
rs.maxwifescore * ps->playertargetgoal);
msg.SetParam("TotalPercent",
100 * rs.curwifescore /
m_vPlayerInfo.m_pPlayer->totalwifescore);
msg.SetParam("Type", RString("Tap"));
msg.SetParam("Val", pss->m_iTapNoteScores[tns]);
MESSAGEMAN->Broadcast(msg);
Expand All @@ -407,15 +416,20 @@ ScreenGameplayReplay::ToggleReplayPause()
for (HoldNoteScore hns = HNS_LetGo; hns <= HNS_Held;
hns = static_cast<HoldNoteScore>(hns + 1)) {
Message msg = Message("Judgment");
msg.SetParam("FromReplay", true);
msg.SetParam("Player", 0);
msg.SetParam("MultiPlayer", 0);
msg.SetParam("WifePercent", 0);
msg.SetParam("Player", 0);
msg.SetParam("WifePercent",
100 * rs.curwifescore / rs.maxwifescore);
msg.SetParam("FirstTrack", 0);
msg.SetParam("CurWifeScore", 0);
msg.SetParam("MaxWifeScore", 0);
msg.SetParam("WifeDifferential", 0);
msg.SetParam("TotalPercent", 0);
msg.SetParam("CurWifeScore", rs.curwifescore);
msg.SetParam("MaxWifeScore", rs.maxwifescore);
msg.SetParam("WifeDifferential",
rs.curwifescore -
rs.maxwifescore * ps->playertargetgoal);
msg.SetParam("TotalPercent",
100 * rs.curwifescore /
m_vPlayerInfo.m_pPlayer->totalwifescore);
msg.SetParam("FirstTrack", 0);
msg.SetParam(
"NumTracks",
Expand Down

0 comments on commit 9fffd27

Please sign in to comment.