1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 10:07:36 +08:00
osu-lazer/osu.Game
Bartłomiej Dach 4c59ec1d94
Fix incorrect ternary state computation for bank toggles
Closes https://github.com/ppy/osu/issues/28741.

Regressed in a7b066f3ee.

The intent of the original change there was to ensure that addition
banks being set will put the ternary state toggles in indeterminate
state (to at least provide a visual indication that the selection does
not use a single bank). This would previously not be the case due to
the use of `.All()` in the original condition (a single object/node
was considered to have a bank enabled if and only if *all* samples
within it used it). However the attempt to fix that via switching
to `Any()` was not correct.

The logic used in the offending commit operates on extracted `Samples`
and `NodeSamples` from the selection, and would consider the ternary
toggle:

- fully off if none of the samples/node samples contained a sample with
  the given bank,
- indeterminate if the some of the samples/node samples contained a
  sample with the given bank,
- fully on if at least one sample from every samples/node samples
  contained a sample with the given bank.

This is a *two-tiered* process, as in first a *binary* on/off state is
extracted from each object's samples/node samples, and *then* a ternary
state is extracted from all objects/nodes. This is insufficient to
express the *desired* behaviour, which is that the toggle should be:

- fully off if *none of the individual samples in the selection* use
  the given bank,
- indeterminate if *at least one individual sample in the selection*
  uses the given bank,
- fully on if *all individual samples in the selection* use the given
  bank.

The second wording is flattened, and no longer tries to consider "nodes"
or "objects", it just looks at all of the samples in the selection
without concern as to whether they're from separate objects/nodes
or not.

To explain why this discrepancy caused the bug, consider a single object
with a `soft` normal bank and `drum` addition bank. Selecting the object
would cause a ternary button state update; as per the incorrect logic,
there were two samples on the object and each had its own separate
banks, so two ternary toggles would have their state set to `True`
(rather than the correct `Indeterminate`), thus triggering a bindable
feedback loop that would cause one of these banks to win and actually
overwrite the other.

Note that the addition indeterminate state computation *still* needs
to do the two-tiered process, because there it actually makes sense (for
a selection to have an addition fully on rather than indeterminate,
*every* object/node *must* contain that addition).
2024-07-05 09:27:21 +02:00
..
Audio Adjust AudioFilter to framework-side changes 2024-06-18 07:30:46 +02:00
Beatmaps Merge pull request #28619 from bdach/fix-tail-volume-not-saving 2024-07-03 16:13:18 +09:00
Collections Update framework 2024-05-23 01:21:12 +08:00
Configuration Move timeline toggle controls to "view" menu 2024-06-17 10:16:40 +02:00
Database Update HasFlag usages 2024-07-03 00:19:04 +09:00
Extensions Fix date failing to display on leaderboard for some scores with weird datetimes 2024-01-14 13:52:39 +01:00
Graphics Merge branch 'master' into grids-2 2024-07-03 10:57:05 +02:00
Input Implement quick exit hotkeys for editor test play 2024-07-02 14:34:36 +02:00
IO Update naming of enum fields in ObjType 2024-05-01 17:24:53 +03:00
IPC Handle osu:// scheme links via IPC in desktop game 2022-06-20 21:26:22 +02:00
Localisation Implement quick exit hotkeys for editor test play 2024-07-02 14:34:36 +02:00
Models Use native query to avoid huge overheads when cleaning up realm files 2024-01-09 15:37:29 +09:00
Online Merge pull request #28659 from bdach/daily-challenge/integration 2024-07-04 23:55:46 +09:00
Overlays Apply nullability to MusicController 2024-07-05 12:50:15 +09:00
Performance Expose high performance session state 2024-04-16 10:04:38 +08:00
Properties Make medal overlay respect overlay disable via activation mode 2024-02-20 16:31:31 +01:00
Replays Update HasFlag usages 2024-07-03 00:19:04 +09:00
Rulesets Merge branch 'master' into nodesample-inherit 2024-07-05 08:12:47 +02:00
Scoring Merge branch 'master' into negative-frame-handling 2024-05-29 13:14:59 +09:00
Screens Fix incorrect ternary state computation for bank toggles 2024-07-05 09:27:21 +02:00
Skinning Expand explanation in inline comment 2024-07-05 10:09:06 +09:00
Storyboards Update HasFlag usages 2024-07-03 00:19:04 +09:00
Tests Add client/server models for allowing clients to receive realtime playlist updates 2024-06-27 11:32:18 +02:00
Updater Warn about not using an official "deployed" build 2024-03-21 00:47:45 +09:00
Users Fix nullability inspection 2024-05-10 23:26:43 +08:00
Utils Fix code quality and null handling 2024-06-07 00:01:50 +08:00
.editorconfig Add localisation length hinting 2022-04-28 19:26:28 +09:00
FodyWeavers.xml More realm analytic disables 2023-07-20 17:51:33 +09:00
osu!.res And then everything became one 2017-09-19 16:06:58 +09:00
osu.Game.csproj Update framework 2024-07-03 00:15:34 +09:00
OsuGame.cs Merge branch 'master' into navigate-to-timestamp 2024-07-03 20:42:32 +09:00
OsuGameBase_Importing.cs Automated pass 2023-06-24 01:00:03 +09:00
OsuGameBase.cs Revert "Temporary rollback of framework / SDL3" 2024-05-22 16:29:39 +08:00
PerformFromMenuRunner.cs Partial everything 2022-11-27 00:00:27 +09:00