Skip to content

Commit

Permalink
Disable replay watching in multiplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Dec 1, 2018
1 parent e8f3cf4 commit 12e420a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 64 deletions.
124 changes: 63 additions & 61 deletions Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,31 +166,31 @@ local ret =
self:queuecommand("Set")
updateLeaderBoardForCurrentChart()
end,
CodeMessageCommand = function(self, params) -- this is intentionally bad to remind me to fix other things that are bad -mina
CodeMessageCommand = function(self, params) -- this is intentionally bad to remind me to fix other things that are bad -mina
if ((getTabIndex() == 2 and nestedTab == 2) and not collapsed) and DLMAN:GetCurrentRateFilter() then
local rate = getCurRateValue()
if params.Name == "PrevScore" and rate < 2.95 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate + 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate + 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate + 0.1)
MESSAGEMAN:Broadcast("CurrentRateChanged")
elseif params.Name == "NextScore" and rate > 0.75 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate - 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate - 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate - 0.1)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end
if params.Name == "PrevRate" and rate < 3 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate + 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate + 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate + 0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
elseif params.Name == "NextRate" and rate > 0.7 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate - 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate - 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate - 0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end
if params.Name == "PrevScore" and rate < 2.95 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate + 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate + 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate + 0.1)
MESSAGEMAN:Broadcast("CurrentRateChanged")
elseif params.Name == "NextScore" and rate > 0.75 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate - 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate - 0.1)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate - 0.1)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end
if params.Name == "PrevRate" and rate < 3 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate + 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate + 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate + 0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
elseif params.Name == "NextRate" and rate > 0.7 then
GAMESTATE:GetSongOptionsObject("ModsLevel_Preferred"):MusicRate(rate - 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate(rate - 0.05)
GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate(rate - 0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end
end
end,
CurrentRateChangedMessageCommand = function(self)
Expand Down Expand Up @@ -348,48 +348,45 @@ local l =
end
},
LoadFont("Common Normal") ..
{
Name = "Score",
InitCommand = function(self)
self:xy(55, 30):zoom(0.6):halign(0):settext("")
end,
DisplayCommand = function(self)
if score:GetWifeScore() == 0 then
self:settext("")
else
local overall = score:GetSkillsetSSR("Overall")
self:settextf("%.2f", overall):diffuse(byMSD(overall))
{
Name = "Score",
InitCommand = function(self)
self:xy(55, 30):zoom(0.6):halign(0):settext("")
end,
DisplayCommand = function(self)
if score:GetWifeScore() == 0 then
self:settext("")
else
local overall = score:GetSkillsetSSR("Overall")
self:settextf("%.2f", overall):diffuse(byMSD(overall))
end
end
end
},
},
LoadFont("Common Normal") ..
{
Name = "Score",
InitCommand = function(self)
self:xy(55, 43):zoom(0.5):halign(0):settext("")
end,
DisplayCommand = function(self)
if score:GetWifeScore() == 0 then
self:settext("")
else
self:settext(GAMESTATE:GetCurrentSteps(PLAYER_1):GetRelevantSkillsetsByMSDRank(getCurRateValue(), 1))
{
Name = "Score",
InitCommand = function(self)
self:xy(55, 43):zoom(0.5):halign(0):settext("")
end,
DisplayCommand = function(self)
if score:GetWifeScore() == 0 then
self:settext("")
else
self:settext(GAMESTATE:GetCurrentSteps(PLAYER_1):GetRelevantSkillsetsByMSDRank(getCurRateValue(), 1))
end
end
end
},

},
LoadFont("Common Normal") ..
{
Name = "ClearType",
InitCommand = function(self)
self:y(43):zoom(0.5):halign(0):settext("No Play"):diffuse(
color(colorConfig:get_data().clearType["NoPlay"])
)
end,
DisplayCommand = function(self)
self:settext(getClearTypeFromScore(pn, score, 0))
self:diffuse(getClearTypeFromScore(pn, score, 2))
end
},
{
Name = "ClearType",
InitCommand = function(self)
self:y(43):zoom(0.5):halign(0):settext("No Play"):diffuse(color(colorConfig:get_data().clearType["NoPlay"]))
end,
DisplayCommand = function(self)
self:settext(getClearTypeFromScore(pn, score, 0))
self:diffuse(getClearTypeFromScore(pn, score, 2))
end
},
LoadFont("Common Normal") ..
{
Name = "Combo",
Expand Down Expand Up @@ -609,6 +606,11 @@ l[#l + 1] =
InitCommand = function(self)
self:xy((frameWidth - offsetX - frameX) / 2, frameHeight - headeroffY - 30 - offsetY):zoom(0.5):settext("")
end,
BeginCommand = function(self)
if SCREENMAN:GetTopScreen():GetName() == "ScreenNetSelectMusic" then
self:x(-10):zoom(0.0000001):maxwidth(1)
end
end,
DisplayCommand = function(self)
if hasReplayData then
self:settext("View Replay")
Expand Down
13 changes: 10 additions & 3 deletions Themes/Til Death/BGAnimations/superscoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ local o =
SetFromLeaderboardCommand = function(self, lb)
scoretable = lb
ind = 0
self:playcommand("GetFilteredLeaderboard") -- we can move all the filter stuff to lua so we're not being dumb hurr hur -mina
self:playcommand("GetFilteredLeaderboard") -- we can move all the filter stuff to lua so we're not being dumb hurr hur -mina
self:playcommand("Update")
end,
UpdateCommand = function(self)
Expand Down Expand Up @@ -338,7 +338,7 @@ local function makeScoreDisplay(i)
CurrentSongChangedMessageCommand = function(self)
self:visible(false)
end,
UpdateCommand = function(self)
UpdateCommand = function(self)
hs = scoretable[(i + ind)]
if hs and i <= numscores then
self:visible(true)
Expand Down Expand Up @@ -470,7 +470,14 @@ local function makeScoreDisplay(i)
Name = "Replay" .. i,
InitCommand = function(self)
if not collapsed then
self:x(capWideScale(c3x + 52, c3x) ):zoom(tzoom - 0.05):halign(1):valign(0):maxwidth(width / 2 / tzoom):addy(row2yoff):diffuse(getMainColor("enabled"))
self:x(capWideScale(c3x + 52, c3x)):zoom(tzoom - 0.05):halign(1):valign(0):maxwidth(width / 2 / tzoom):addy(
row2yoff
):diffuse(getMainColor("enabled"))
end
end,
BeginCommand = function(self)
if SCREENMAN:GetTopScreen():GetName() == "ScreenNetSelectMusic" then
self:x(-10):zoom(0.0000001):maxwidth(1)
end
end,
DisplayCommand = function(self)
Expand Down

0 comments on commit 12e420a

Please sign in to comment.