mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Added toggling mods with keys
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
@ -98,6 +99,7 @@ namespace osu.Game
|
||||
Buttons = new ModButton[]
|
||||
{
|
||||
relaxButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.Z,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -105,6 +107,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
autopilotButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.X,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -112,6 +115,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
targetPracticeButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.C,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -119,6 +123,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
spunOutButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.V,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -126,6 +131,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
autoplayCinemaButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.B,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -141,6 +147,7 @@ namespace osu.Game
|
||||
Buttons = new ModButton[]
|
||||
{
|
||||
relaxButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.Z,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -148,6 +155,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
autoplayCinemaButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.X,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -162,6 +170,7 @@ namespace osu.Game
|
||||
Buttons = new ModButton[]
|
||||
{
|
||||
keyButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.Z,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -177,6 +186,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
coopButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.X,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -184,6 +194,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
randomButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.C,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
@ -191,6 +202,7 @@ namespace osu.Game
|
||||
},
|
||||
},
|
||||
autoplayCinemaButton = new ModButton
|
||||
{
|
||||
ToggleKey = Key.V,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
@ -29,6 +30,7 @@ namespace osu.Game
|
||||
{
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.A,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModHardRock(),
|
||||
@ -36,6 +38,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.S,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModSuddenDeath(),
|
||||
@ -44,6 +47,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.D,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModDoubleTime(),
|
||||
@ -52,6 +56,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.F,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModHidden(),
|
||||
@ -59,6 +64,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.G,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModFlashlight(),
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
@ -27,6 +28,7 @@ namespace osu.Game
|
||||
{
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.Q,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModEasy(),
|
||||
@ -34,6 +36,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.W,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModNoFail(),
|
||||
@ -41,6 +44,7 @@ namespace osu.Game
|
||||
},
|
||||
new ModButton
|
||||
{
|
||||
ToggleKey = Key.E,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new ModHalfTime(),
|
||||
|
@ -27,6 +27,7 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
return icons[icons.Length - 1];
|
||||
}
|
||||
}
|
||||
private SpriteText text;
|
||||
private Container iconsContainer;
|
||||
private AudioSample sampleOn, sampleOff;
|
||||
@ -216,6 +217,17 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(Framework.Input.InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Key == ToggleKey)
|
||||
{
|
||||
SelectNext();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user