mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Fix mod overlay and footer not updating multiplayer on settings change
This commit is contained in:
@ -222,6 +222,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
globalAvailableMods.BindTo(game.AvailableMods);
|
globalAvailableMods.BindTo(game.AvailableMods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ModSettingChangeTracker? modSettingChangeTracker;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
// this is called before base call so that the mod state is populated early, and the transition in `PopIn()` can play out properly.
|
// this is called before base call so that the mod state is populated early, and the transition in `PopIn()` can play out properly.
|
||||||
@ -238,9 +240,14 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
SelectedMods.BindValueChanged(val =>
|
SelectedMods.BindValueChanged(val =>
|
||||||
{
|
{
|
||||||
|
modSettingChangeTracker?.Dispose();
|
||||||
|
|
||||||
updateMultiplier();
|
updateMultiplier();
|
||||||
updateCustomisation(val);
|
updateCustomisation(val);
|
||||||
updateFromExternalSelection();
|
updateFromExternalSelection();
|
||||||
|
|
||||||
|
modSettingChangeTracker = new ModSettingChangeTracker(val.NewValue);
|
||||||
|
modSettingChangeTracker.SettingChanged += _ => updateMultiplier();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
customisationVisible.BindValueChanged(_ => updateCustomisationVisualState(), true);
|
customisationVisible.BindValueChanged(_ => updateCustomisationVisualState(), true);
|
||||||
|
@ -9,9 +9,11 @@ using osu.Game.Screens.Play.HUD;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -61,11 +63,22 @@ namespace osu.Game.Screens.Select
|
|||||||
Hotkey = GlobalAction.ToggleModSelection;
|
Hotkey = GlobalAction.ToggleModSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CanBeNull]
|
||||||
|
private ModSettingChangeTracker modSettingChangeTracker;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Current.BindValueChanged(_ => updateMultiplierText(), true);
|
Current.BindValueChanged(mods =>
|
||||||
|
{
|
||||||
|
modSettingChangeTracker?.Dispose();
|
||||||
|
|
||||||
|
updateMultiplierText();
|
||||||
|
|
||||||
|
modSettingChangeTracker = new ModSettingChangeTracker(mods.NewValue);
|
||||||
|
modSettingChangeTracker.SettingChanged += _ => updateMultiplierText();
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMultiplierText() => Schedule(() =>
|
private void updateMultiplierText() => Schedule(() =>
|
||||||
|
Reference in New Issue
Block a user