mirror of
https://github.com/ppy/osu
synced 2024-12-25 16:22:23 +00:00
Merge branch 'master' into replay
This commit is contained in:
commit
bc74f453aa
@ -1 +1 @@
|
||||
Subproject commit 169f0a758c6b565ee42832f99bf4b5303f4413a6
|
||||
Subproject commit 460a8ce5a4bcdb64d87725012cb18fbdb7c38f21
|
@ -19,8 +19,6 @@ namespace osu.Desktop
|
||||
{
|
||||
private VersionManager versionManager;
|
||||
|
||||
public override bool IsDeployedBuild => versionManager.IsDeployedBuild;
|
||||
|
||||
public OsuGameDesktop(string[] args = null)
|
||||
: base(args)
|
||||
{
|
||||
@ -46,7 +44,7 @@ namespace osu.Desktop
|
||||
if (desktopWindow != null)
|
||||
{
|
||||
desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
|
||||
desktopWindow.Title = @"osu!lazer";
|
||||
desktopWindow.Title = Name;
|
||||
|
||||
desktopWindow.DragEnter += dragEnter;
|
||||
desktopWindow.DragDrop += dragDrop;
|
||||
|
@ -19,6 +19,7 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using System.Net.Http;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game;
|
||||
|
||||
namespace osu.Desktop.Overlays
|
||||
{
|
||||
@ -27,16 +28,12 @@ namespace osu.Desktop.Overlays
|
||||
private UpdateManager updateManager;
|
||||
private NotificationManager notificationManager;
|
||||
|
||||
AssemblyName assembly = Assembly.GetEntryAssembly().GetName();
|
||||
|
||||
public bool IsDeployedBuild => assembly.Version.Major > 0;
|
||||
|
||||
protected override bool HideOnEscape => false;
|
||||
|
||||
public override bool HandleInput => false;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(NotificationManager notification, OsuColour colours, TextureStore textures)
|
||||
private void load(NotificationManager notification, OsuColour colours, TextureStore textures, OsuGameBase game)
|
||||
{
|
||||
notificationManager = notification;
|
||||
|
||||
@ -45,17 +42,6 @@ namespace osu.Desktop.Overlays
|
||||
Origin = Anchor.BottomCentre;
|
||||
Alpha = 0;
|
||||
|
||||
bool isDebug = false;
|
||||
Debug.Assert(isDebug = true);
|
||||
|
||||
string version;
|
||||
if (!IsDeployedBuild)
|
||||
{
|
||||
version = @"local " + (isDebug ? @"debug" : @"release");
|
||||
}
|
||||
else
|
||||
version = $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
@ -76,12 +62,12 @@ namespace osu.Desktop.Overlays
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Bold",
|
||||
Text = $@"osu!lazer"
|
||||
Text = game.Name
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Colour = isDebug ? colours.Red : Color4.White,
|
||||
Text = version
|
||||
Colour = game.IsDebug ? colours.Red : Color4.White,
|
||||
Text = game.Version
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -104,7 +90,7 @@ namespace osu.Desktop.Overlays
|
||||
}
|
||||
};
|
||||
|
||||
if (IsDeployedBuild)
|
||||
if (game.IsDeployedBuild)
|
||||
checkForUpdateAsync();
|
||||
}
|
||||
|
||||
@ -228,6 +214,7 @@ namespace osu.Desktop.Overlays
|
||||
new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.fa_upload,
|
||||
Colour = Color4.White,
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = Size.X,
|
||||
Colour = getColour(beatmap),
|
||||
Icon = FontAwesome.fa_circle
|
||||
@ -41,6 +42,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = Size.X,
|
||||
Colour = Color4.White,
|
||||
Icon = Ruleset.GetRuleset(beatmap.Mode).Icon
|
||||
|
@ -26,11 +26,6 @@ namespace osu.Game.Graphics
|
||||
Text = ((char)icon).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public TextAwesome()
|
||||
{
|
||||
Origin = Framework.Graphics.Anchor.Centre;
|
||||
}
|
||||
}
|
||||
|
||||
public enum FontAwesome
|
||||
|
@ -98,6 +98,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
icon = new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = 25,
|
||||
},
|
||||
}
|
||||
|
@ -34,8 +34,6 @@ namespace osu.Game
|
||||
{
|
||||
public class OsuGame : OsuGameBase
|
||||
{
|
||||
public virtual bool IsDeployedBuild => false;
|
||||
|
||||
public Toolbar Toolbar;
|
||||
|
||||
private ChatOverlay chat;
|
||||
@ -228,7 +226,7 @@ namespace osu.Game
|
||||
|
||||
private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
if (args.Repeat || intro == null) return false;
|
||||
|
||||
switch (args.Key)
|
||||
{
|
||||
|
@ -1,6 +1,9 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
@ -39,6 +42,38 @@ namespace osu.Game
|
||||
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName() { Version = new Version() };
|
||||
|
||||
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
|
||||
|
||||
public bool IsDebug
|
||||
{
|
||||
get
|
||||
{
|
||||
bool isDebug = false;
|
||||
// Debug.Assert conditions are only evaluated in debug mode
|
||||
Debug.Assert(isDebug = true);
|
||||
return isDebug;
|
||||
}
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsDeployedBuild)
|
||||
return @"local " + (IsDebug ? @"debug" : @"release");
|
||||
|
||||
var assembly = AssemblyName;
|
||||
return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
||||
}
|
||||
}
|
||||
|
||||
public OsuGameBase()
|
||||
{
|
||||
Name = @"osu!lazer";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
|
@ -176,6 +176,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.fa_times_circle,
|
||||
}
|
||||
};
|
||||
|
@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
iconDrawable = new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = icon,
|
||||
}
|
||||
});
|
||||
|
68
osu.Game/Overlays/Options/OptionsFooter.cs
Normal file
68
osu.Game/Overlays/Options/OptionsFooter.cs
Normal file
@ -0,0 +1,68 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Options
|
||||
{
|
||||
public class OptionsFooter : FillFlowContainer
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, OsuColour colours)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Direction = FillDirection.Vertical;
|
||||
Padding = new MarginPadding { Top = 20, Bottom = 30 };
|
||||
|
||||
var modes = new List<Drawable>();
|
||||
|
||||
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
|
||||
modes.Add(new TextAwesome
|
||||
{
|
||||
Icon = Ruleset.GetRuleset(m).Icon,
|
||||
Colour = Color4.Gray,
|
||||
});
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Direction = FillDirection.Full,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = modes,
|
||||
Spacing = new Vector2(5),
|
||||
Padding = new MarginPadding { Bottom = 10 },
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = game.Name,
|
||||
TextSize = 18,
|
||||
Font = @"Exo2.0-Bold",
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
TextSize = 14,
|
||||
Text = game.Version,
|
||||
Colour = game.IsDebug ? colours.Red : Color4.White,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -39,20 +39,6 @@ namespace osu.Game.Overlays.Options.Sections
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Run osu! updater",
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new[]
|
||||
{
|
||||
new OptionLabel
|
||||
{
|
||||
Text = "osu!lazer",
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,8 @@ namespace osu.Game.Overlays
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = sections,
|
||||
}
|
||||
},
|
||||
new OptionsFooter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ namespace osu.Game.Overlays
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.State = Visibility.Visible;
|
||||
|
||||
contentContainer.FadeIn(APPEAR_DURATION, EasingTypes.OutQuint);
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
|
||||
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
@ -144,7 +144,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
contentContainer.FadeOut(DISAPPEAR_DURATION, EasingTypes.In);
|
||||
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
|
||||
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
|
||||
|
||||
foreach (var w in wavesContainer.Children)
|
||||
|
@ -108,6 +108,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
Shadow = true,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = 30,
|
||||
Position = new Vector2(0, 0),
|
||||
Icon = symbol
|
||||
|
@ -209,12 +209,14 @@ namespace osu.Game.Screens.Select
|
||||
new TextAwesome
|
||||
{
|
||||
Icon = FontAwesome.fa_square,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = new Color4(68, 17, 136, 255),
|
||||
Rotation = 45
|
||||
},
|
||||
new TextAwesome
|
||||
{
|
||||
Icon = statistic.Icon,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = new Color4(255, 221, 85, 255),
|
||||
Scale = new Vector2(0.8f)
|
||||
},
|
||||
|
@ -443,8 +443,19 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
|
||||
switch (args.Key)
|
||||
{
|
||||
case Key.F1:
|
||||
modSelect.ToggleVisibility();
|
||||
return true;
|
||||
case Key.F2:
|
||||
carousel.SelectRandom();
|
||||
return true;
|
||||
case Key.F3:
|
||||
beatmapOptions.ToggleVisibility();
|
||||
return true;
|
||||
case Key.Enter:
|
||||
footer.StartButton.TriggerClick();
|
||||
return true;
|
||||
|
@ -132,6 +132,7 @@
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownHeader.cs" />
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownMenu.cs" />
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownMenuItem.cs" />
|
||||
<Compile Include="Overlays\Options\OptionsFooter.cs" />
|
||||
<Compile Include="Overlays\Options\Sections\DebugSection.cs" />
|
||||
<Compile Include="Overlays\Options\Sections\Debug\GCOptions.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarHomeButton.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user