Skip to content

Commit 202aa58

Browse files
authored
Merge pull request #2977 from ikemen-engine/fix7
fix: victory music, esc options fade, results screen parsing
2 parents 9cfb3c6 + 3612ec8 commit 202aa58

5 files changed

Lines changed: 256 additions & 132 deletions

File tree

external/script/options.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ function options.f_createMenu(tbl, bool_main)
14341434
playBgm({source = "motif.title", interrupt = true})
14351435
main.close = false
14361436
break
1437-
elseif esc() or main.f_input(main.t_players, motif.option_info.menu.cancel.key) then
1437+
elseif (esc() or main.f_input(main.t_players, motif.option_info.menu.cancel.key)) and not main.fadeActive then
14381438
sndPlay(motif.Snd, motif.option_info.cancel.snd[1], motif.option_info.cancel.snd[2])
14391439
if bool_main then
14401440
if options.modified then

src/bytecode.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ const (
659659
OC_ex_ikemenversion
660660
OC_ex_incustomanim
661661
OC_ex_incustomstate
662-
OC_ex_indialogue
663662
OC_ex_isassertedchar
664663
OC_ex_isassertedglobal
665664
OC_ex_ishost

src/hiscore_rank.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,30 @@ func tallyRun() runTally {
8181
}
8282

8383
func modeCleared(mode string, matches int) bool {
84-
switch mode {
85-
case "survival", "survivalcoop", "netplaysurvivalcoop":
86-
// P1 wins OR reached configured rounds to win
84+
// Survival-like: P1 wins OR reached configured rounds-to-win.
85+
modeLower := strings.ToLower(mode)
86+
if strings.Contains(modeLower, "survival") {
8787
if sys.winnerTeam() == 1 {
8888
return true
8989
}
90-
rtw := int(sys.motif.SurvivalResultsScreen.RoundsToWin)
91-
return matches >= rtw && rtw > 0
92-
default:
93-
// Arcade / Timeattack / TeamCoop etc.
94-
return sys.winnerTeam() == 1
90+
// Pull rounds-to-win from the unified ResultsScreen map.
91+
// Prefer the exact mode entry; if not present, fall back to plain "survival"
92+
// so modes like "survivalcoop"/"netplaysurvivalcoop" can reuse [Survival Results Screen].
93+
rs, _ := sys.motif.wi.findResultsScreenForMode(&sys.motif, modeLower)
94+
if rs == nil {
95+
rs, _ = sys.motif.wi.findResultsScreenForMode(&sys.motif, "survival")
96+
}
97+
if rs != nil {
98+
rtw := int(rs.RoundsToWin)
99+
return matches >= rtw && rtw > 0
100+
}
101+
102+
// No results screen config available -> can't use rounds-to-win rule.
103+
return false
95104
}
105+
106+
// Arcade / Timeattack / TeamCoop etc.
107+
return sys.winnerTeam() == 1
96108
}
97109

98110
func rankingTypeFor(mode string) (string, bool) {

0 commit comments

Comments
 (0)