示例#1
0
        private void stateChanged(object sender, EventArgs e)
        {
            if (!IsDisplayed || ignoreStateChanges)
            {
                return;
            }

            ModButton b = sender as ModButton;

            if (b == null)
            {
                return;
            }

            Mods oldMods = ModManager.ModStatus;

            foreach (Mods s in b.AvailableStates)
            {
                ModManager.ModStatus &= ~s;
            }

            ModManager.ModStatus |= b.State;

            ModManager.CheckForCurrentPlayMode(b.State);

            ignoreStateChanges = true;
            updateMods();
            ignoreStateChanges = false;

            if (BeatmapDifficultyCalculator.MaskRelevantMods(oldMods) != BeatmapDifficultyCalculator.MaskRelevantMods(ModManager.ModStatus))
            {
                ModManager.TriggerModsChanged();
            }
        }
示例#2
0
        private void updateMods()
        {
            ModManager.CheckForCurrentPlayMode();

            for (Mods m = (Mods)1; m < Mods.LastMod; m = (Mods)((int)m * 2))
            {
                bool active = ModManager.CheckActive(m);
                if (!active)
                {
                    //check we aren't obliterating an already-set mod on this button.
                    ModButton b = null;
                    if (Buttons.TryGetValue(m, out b) && b.State != Mods.None && !active && ModManager.CheckActive(b.State))
                    {
                        continue;
                    }
                }

                toggle(m, active, false);
            }

            UpdateMultiplier();
        }