mirror of
https://github.com/ppy/osu.git
synced 2025-03-04 04:02:59 +08:00
Merge branch 'refs/heads/master' into more-sound-effects
This commit is contained in:
commit
ef8793ff24
@ -19,13 +19,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
private TextAwesome icon;
|
private TextAwesome icon;
|
||||||
|
|
||||||
private Container leftContainer;
|
|
||||||
private Container rightContainer;
|
|
||||||
|
|
||||||
private Box leftBox;
|
private Box leftBox;
|
||||||
private Box rightBox;
|
private Box rightBox;
|
||||||
|
|
||||||
private const double transform_time = 300.0;
|
private const double transform_time = 600;
|
||||||
private const int pulse_length = 250;
|
private const int pulse_length = 250;
|
||||||
|
|
||||||
private const float shear = 0.1f;
|
private const float shear = 0.1f;
|
||||||
@ -40,7 +37,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
leftContainer = new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Width = 0.4f,
|
Width = 0.4f,
|
||||||
@ -60,7 +57,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rightContainer = new Container
|
new Container
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -88,10 +85,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos)
|
public override bool Contains(Vector2 screenSpacePos) => leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos);
|
||||||
{
|
|
||||||
return leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,7 @@ using osu.Game.Graphics.UserInterface.Volume;
|
|||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Modes;
|
using osu.Game.Modes;
|
||||||
using osu.Game.Overlays.Toolbar;
|
using osu.Game.Overlays.Toolbar;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
@ -154,11 +155,19 @@ namespace osu.Game
|
|||||||
|
|
||||||
private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args)
|
private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
|
if (args.Repeat) return false;
|
||||||
|
|
||||||
switch (args.Key)
|
switch (args.Key)
|
||||||
{
|
{
|
||||||
case Key.F8:
|
case Key.F8:
|
||||||
chat.ToggleVisibility();
|
chat.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
|
case Key.PageUp:
|
||||||
|
case Key.PageDown:
|
||||||
|
var rate = ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate * (args.Key == Key.PageUp ? 1.1f : 0.9f);
|
||||||
|
((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate = rate;
|
||||||
|
Logger.Log($@"Adjusting game clock to {rate}", LoggingTarget.Debug);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.Keyboard.ControlPressed)
|
if (state.Keyboard.ControlPressed)
|
||||||
|
@ -155,7 +155,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private void onExit()
|
private void onExit()
|
||||||
{
|
{
|
||||||
State = MenuState.Exit;
|
|
||||||
OnExit?.Invoke();
|
OnExit?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
MainMenu mainMenu;
|
MainMenu mainMenu;
|
||||||
private AudioSample welcome;
|
private AudioSample welcome;
|
||||||
|
private AudioSample seeya;
|
||||||
private AudioTrack bgm;
|
private AudioTrack bgm;
|
||||||
|
|
||||||
internal override bool ShowOverlays => (ParentGameMode as OsuGameMode)?.ShowOverlays ?? false;
|
internal override bool ShowOverlays => (ParentGameMode as OsuGameMode)?.ShowOverlays ?? false;
|
||||||
@ -58,6 +59,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
welcome = audio.Sample.Get(@"welcome");
|
welcome = audio.Sample.Get(@"welcome");
|
||||||
|
seeya = audio.Sample.Get(@"seeya");
|
||||||
|
|
||||||
bgm = audio.Track.Get(@"circles");
|
bgm = audio.Track.Get(@"circles");
|
||||||
bgm.Looping = true;
|
bgm.Looping = true;
|
||||||
@ -106,8 +108,15 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
protected override void OnResuming(GameMode last)
|
protected override void OnResuming(GameMode last)
|
||||||
{
|
{
|
||||||
//we are just an intro. if we are resumed, we just want to exit after a short delay (to allow the last mode to transition out).
|
//we also handle the exit transition.
|
||||||
Scheduler.AddDelayed(Exit, 600);
|
seeya.Play();
|
||||||
|
|
||||||
|
double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100;
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(Exit, fadeOutTime);
|
||||||
|
|
||||||
|
//don't want to fade out completely else we will stop running updates and shit will hit the fan.
|
||||||
|
Game.FadeTo(0.01f, fadeOutTime);
|
||||||
|
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.GameModes;
|
using osu.Framework.GameModes;
|
||||||
using osu.Framework.GameModes.Testing;
|
using osu.Framework.GameModes.Testing;
|
||||||
@ -49,7 +50,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
OnSolo = delegate { Push(new PlaySongSelect()); },
|
OnSolo = delegate { Push(new PlaySongSelect()); },
|
||||||
OnMulti = delegate { Push(new Lobby()); },
|
OnMulti = delegate { Push(new Lobby()); },
|
||||||
OnTest = delegate { Push(new TestBrowser()); },
|
OnTest = delegate { Push(new TestBrowser()); },
|
||||||
OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); },
|
OnExit = delegate { Exit(); },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,5 +94,12 @@ namespace osu.Game.Screens.Menu
|
|||||||
Content.FadeIn(length, EasingTypes.OutQuint);
|
Content.FadeIn(length, EasingTypes.OutQuint);
|
||||||
Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint);
|
Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnExiting(GameMode next)
|
||||||
|
{
|
||||||
|
buttons.State = MenuState.Exit;
|
||||||
|
Content.FadeOut(ButtonSystem.EXIT_DELAY);
|
||||||
|
return base.OnExiting(next);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user