Skip to content

Commit a630a55

Browse files
authored
Merge pull request #3516 from ikemen-engine/fix1
fix: differences between netplay and replay menus
2 parents 979cb9f + 233ee1f commit a630a55

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

external/script/main.lua

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,15 @@ else
15131513
main.background = 'titlebgdef'
15141514
end
15151515

1516+
local function enterSyncedNetplayMenu()
1517+
main.f_clearShuffleTables()
1518+
math.randomseed(getRandom())
1519+
main.f_menuSnap(motif[main.group])
1520+
main.f_menuItemBgAnimReset(motif[main.group])
1521+
main.f_fadeReset('fadein', motif[main.group])
1522+
main.menu.submenu.server.loop()
1523+
end
1524+
15161525
function main.f_default()
15171526
main.aiRamp = false --if AI ramping should be active
15181527
main.charparam = { --which select.def charparam should be used
@@ -1881,12 +1890,7 @@ main.t_itemname = {
18811890
sndPlay(motif.Snd, doneSnd[1], doneSnd[2])
18821891
if main.f_connect(gameOption('Netplay.IP.' .. t[item].displayname), t[item].displayname) then
18831892
if synchronize() then
1884-
main.f_clearShuffleTables()
1885-
math.randomseed(getRandom())
1886-
main.f_menuSnap(motif[main.group])
1887-
main.f_menuItemBgAnimReset(motif[main.group])
1888-
main.f_fadeReset('fadein', motif[main.group])
1889-
main.menu.submenu.server.loop()
1893+
enterSyncedNetplayMenu()
18901894
end
18911895
replayStop()
18921896
exitNetPlay()
@@ -1901,12 +1905,7 @@ main.t_itemname = {
19011905
sndPlay(motif.Snd, doneSnd[1], doneSnd[2])
19021906
if main.f_connect("", gameOption('Netplay.ListenPort')) then
19031907
if synchronize() then
1904-
main.f_clearShuffleTables()
1905-
math.randomseed(getRandom())
1906-
main.f_menuSnap(motif[main.group])
1907-
main.f_menuItemBgAnimReset(motif[main.group])
1908-
main.f_fadeReset('fadein', motif[main.group])
1909-
main.menu.submenu.server.loop()
1908+
enterSyncedNetplayMenu()
19101909
end
19111910
replayStop()
19121911
exitNetPlay()
@@ -2766,9 +2765,7 @@ function main.f_replay()
27662765
elseif getInput(-1, motif[main.group].menu.done.key) then
27672766
sndPlay(motif.Snd, motif[main.group].cursor.done.snd.default[1], motif[main.group].cursor.done.snd.default[2])
27682767
if enterReplay(t[item].itemname) and synchronize() then
2769-
main.f_clearShuffleTables()
2770-
math.randomseed(getRandom())
2771-
main.menu.submenu.server.loop()
2768+
enterSyncedNetplayMenu()
27722769
end
27732770
replayStop()
27742771
exitNetPlay()

0 commit comments

Comments
 (0)