Skip to content

Commit

Permalink
Add HideMods option to knockout settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wieku committed Nov 2, 2020
1 parent b5729cc commit 2eef5ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/dance/rcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (controller *ReplayController) SetBeatMap(beatMap *beatmap.BeatMap) {
counter := settings.Knockout.MaxPlayers

excludedMods := osuapi.ParseMods(settings.Knockout.ExcludeMods)
displayedMods := uint32(^osuapi.ParseMods(settings.Knockout.HideMods))

candidates := make([]*rplpa.Replay, 0)

Expand Down Expand Up @@ -183,7 +184,7 @@ func (controller *ReplayController) SetBeatMap(beatMap *beatmap.BeatMap) {

control.newHandling = replay.OsuVersion > 20190506 // This was when slider scoring was changed, so *I think* replay handling as well: https://osu.ppy.sh/home/changelog/cuttingedge/20190506

controller.replays = append(controller.replays, RpData{replay.Username + string(rune(unicode.MaxRune-i)), difficulty.Modifier(replay.Mods).String(), difficulty.Modifier(replay.Mods), 100, 0, int64(mxCombo), osu.NONE})
controller.replays = append(controller.replays, RpData{replay.Username + string(rune(unicode.MaxRune-i)), difficulty.Modifier(replay.Mods & displayedMods).String(), difficulty.Modifier(replay.Mods), 100, 0, int64(mxCombo), osu.NONE})
controller.controllers = append(controller.controllers, control)

log.Println("Expected score:", replay.Score)
Expand Down Expand Up @@ -336,6 +337,7 @@ func (controller *ReplayController) InitCursors() {

modifiers = append(modifiers, controller.replays[i].ModsV)
}

controller.ruleset = osu.NewOsuRuleset(controller.bMap, controller.cursors, modifiers)

//controller.Update(480000, 1)
Expand All @@ -361,7 +363,6 @@ func (controller *ReplayController) Update(time int64, delta float64) {
controller.ruleset.UpdateClickFor(controller.cursors[i], nTime)
controller.ruleset.UpdateNormalFor(controller.cursors[i], nTime)
controller.ruleset.UpdatePostFor(controller.cursors[i], nTime)

} else {
wasUpdated := false

Expand Down
3 changes: 3 additions & 0 deletions app/settings/knockout.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type knockout struct {
// Exclude plays which contain one of the mods set here
ExcludeMods string

// Hide specific mods from being displayed in overlay (like NF)
HideMods string

// Max players shown (excluding danser) on a map. Caps at 50.
MaxPlayers int

Expand Down

0 comments on commit 2eef5ba

Please sign in to comment.