1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-05 00:24:21 +08:00
Commit Graph

3 Commits

  • Fix changing combo colours in beatmap without custom samples opening new sample set popover (#36400)
    Reported [on reddit of all
    places](https://www.reddit.com/r/osugame/comments/1qhnfdn/every_time_i_make_an_adjustment_to_the_hitcircle/).
    
    The reason that this is happening is as follows:
    
    - Changing a combo colour raises `BeatmapSkinChanged`
    - `BeatmapSkinChanged` getting raised triggers the sample chooser
    dropdown to repopulate its items (as intended and correctly)
    - Setting items of a dropdown can also change its `Current.Value`,
    because the relevant logic attempts to ensure that `Current.Value` is
    valid in line with the new items
    - Therefore the `Current.Value` of the dropdown changes from `null` to
    sample set `-1` which corresponds to the "Add new..." item as it's the
    only item in the dropdown...
    - which is indistinguishable from the sequence of events that happens if
    the user manually opens the dropdown and clicks the "Add new..." item.
    
    This change sidesteps this entire car crash by just ensuring that even
    beatmaps without custom samples have at least set number 1 initialised
    (even if it's empty and has no samples). This means that the initial
    value of the dropdown is never `null`, and that every time that the
    value changes to the set `-1` it actually is due to user action.
    
    Should have known better than to play these dumb games.
  • Add way to add/remove custom beatmap samples to setup screen
    Among others, this features a scary-looking change wherein
    `WorkingBeatmap` now exposes a `RealmAccess` via
    `IStorageResourceProvider`. This is necessary to make
    `RealmBackedResourceStore` actually start firing callbacks when the
    edited beatmap's skin is modified by adding new samples to it.