mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 18:32:55 +08:00
Merge remote-tracking branch 'upstream/master' into song-select-filtering
This commit is contained in:
commit
417933b7ec
@ -1 +1 @@
|
||||
Subproject commit f2eec2adf590d60e91dda77de6f11d757ad6055f
|
||||
Subproject commit 2f03fae533293bf255a942569c07396f853378f3
|
@ -18,7 +18,7 @@ namespace osu.Game.Modes.Catch
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Catch;
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => null;
|
||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount) => null;
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Modes.Mania
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Mania;
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => null;
|
||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount) => null;
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Modes.Osu
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
|
||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount) => new OsuScoreProcessor(hitObjectCount);
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Osu;
|
||||
}
|
||||
|
@ -1,11 +1,6 @@
|
||||
//Copyright (c) 2007-2016 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 System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Osu.Objects.Drawables;
|
||||
|
||||
@ -13,6 +8,11 @@ namespace osu.Game.Modes.Osu
|
||||
{
|
||||
class OsuScoreProcessor : ScoreProcessor
|
||||
{
|
||||
public OsuScoreProcessor(int hitObjectCount)
|
||||
: base(hitObjectCount)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateCalculations(JudgementInfo judgement)
|
||||
{
|
||||
if (judgement != null)
|
||||
@ -21,9 +21,11 @@ namespace osu.Game.Modes.Osu
|
||||
{
|
||||
case HitResult.Hit:
|
||||
Combo.Value++;
|
||||
Health.Value += 0.1f;
|
||||
break;
|
||||
case HitResult.Miss:
|
||||
Combo.Value = 0;
|
||||
Health.Value -= 0.2f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Modes.Taiko
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Taiko;
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => null;
|
||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount) => null;
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public enum FrameSync
|
||||
{
|
||||
VSync = 1,
|
||||
Limit120 = 0,
|
||||
Unlimited = 2,
|
||||
CompletelyUnlimited = 4,
|
||||
Custom = 5
|
||||
}
|
||||
}
|
@ -13,8 +13,7 @@ namespace osu.Game.Configuration
|
||||
protected override void InitialiseDefaults()
|
||||
{
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
Set(OsuConfig.Width, 1366, 640);
|
||||
Set(OsuConfig.Height, 768, 480);
|
||||
|
||||
Set(OsuConfig.MouseSpeed, 1.0);
|
||||
|
||||
Set(OsuConfig.Username, string.Empty);
|
||||
@ -25,10 +24,6 @@ namespace osu.Game.Configuration
|
||||
|
||||
Set(OsuConfig.BeatmapDirectory, @"Songs"); // TODO: use this
|
||||
|
||||
Set(OsuConfig.VolumeUniversal, 0.8, 0, 1);
|
||||
Set(OsuConfig.VolumeMusic, 1.0, 0, 1);
|
||||
Set(OsuConfig.VolumeEffect, 1.0, 0, 1);
|
||||
|
||||
Set(OsuConfig.AllowPublicInvites, true);
|
||||
Set(OsuConfig.AutoChatHide, true);
|
||||
Set(OsuConfig.AutomaticDownload, true);
|
||||
@ -56,7 +51,7 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.DisplayCityLocation, false);
|
||||
Set(OsuConfig.DistanceSpacingEnabled, true);
|
||||
Set(OsuConfig.EditorTip, 0);
|
||||
Set(OsuConfig.VideoEditor, Get<bool>(OsuConfig.Fullscreen));
|
||||
Set(OsuConfig.VideoEditor, true);
|
||||
Set(OsuConfig.EditorDefaultSkin, false);
|
||||
Set(OsuConfig.EditorSnakingSliders, true);
|
||||
Set(OsuConfig.EditorHitAnimations, false);
|
||||
@ -104,9 +99,7 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.EditorBeatDivisor, 1, 1, 16);
|
||||
Set(OsuConfig.EditorGridSize, 32, 4, 32);
|
||||
Set(OsuConfig.EditorGridSizeDesign, 32, 4, 32);
|
||||
Set(OsuConfig.HeightFullscreen, 9999, 240, 9999);
|
||||
Set(OsuConfig.CustomFrameLimit, 240, 240, 999);
|
||||
Set(OsuConfig.WidthFullscreen, 9999, 320, 9999);
|
||||
Set(OsuConfig.MsnIntegration, false);
|
||||
Set(OsuConfig.MyPcSucks, false);
|
||||
Set(OsuConfig.NotifyFriends, true);
|
||||
@ -142,7 +135,6 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.YahooIntegration, false);
|
||||
Set(OsuConfig.ForceFrameFlush, false);
|
||||
Set(OsuConfig.DetectPerformanceIssues, true);
|
||||
Set(OsuConfig.Fullscreen, true);
|
||||
Set(OsuConfig.MenuMusic, true);
|
||||
Set(OsuConfig.MenuVoice, true);
|
||||
Set(OsuConfig.MenuParallax, true);
|
||||
@ -163,10 +155,6 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.SaveUsername, true);
|
||||
//Set(OsuConfig.TreeSortMode, TreeGroupMode.Show_All);
|
||||
//Set(OsuConfig.TreeSortMode2, TreeSortMode.Title);
|
||||
Set(OsuConfig.Letterboxing, Get<bool>(OsuConfig.Fullscreen));
|
||||
Set(OsuConfig.LetterboxPositionX, 0, -100, 100);
|
||||
Set(OsuConfig.LetterboxPositionY, 0, -100, 100);
|
||||
Set(OsuConfig.FrameSync, FrameSync.Limit120);
|
||||
bool unicodeDefault = false;
|
||||
switch (Get<string>(OsuConfig.Language))
|
||||
{
|
||||
@ -202,9 +190,6 @@ namespace osu.Game.Configuration
|
||||
Token,
|
||||
// Imported from old osu:
|
||||
BeatmapDirectory,
|
||||
VolumeUniversal,
|
||||
VolumeEffect,
|
||||
VolumeMusic,
|
||||
AllowPublicInvites,
|
||||
AutoChatHide,
|
||||
AutomaticDownload,
|
||||
@ -281,11 +266,7 @@ namespace osu.Game.Configuration
|
||||
EditorBeatDivisor,
|
||||
EditorGridSize,
|
||||
EditorGridSizeDesign,
|
||||
Height,
|
||||
Width,
|
||||
HeightFullscreen,
|
||||
CustomFrameLimit,
|
||||
WidthFullscreen,
|
||||
MsnIntegration,
|
||||
MyPcSucks,
|
||||
NotifyFriends,
|
||||
@ -321,7 +302,6 @@ namespace osu.Game.Configuration
|
||||
YahooIntegration,
|
||||
ForceFrameFlush,
|
||||
DetectPerformanceIssues,
|
||||
Fullscreen,
|
||||
MenuMusic,
|
||||
MenuVoice,
|
||||
MenuParallax,
|
||||
@ -345,10 +325,6 @@ namespace osu.Game.Configuration
|
||||
SaveUsername,
|
||||
TreeSortMode,
|
||||
TreeSortMode2,
|
||||
Letterboxing,
|
||||
LetterboxPositionX,
|
||||
LetterboxPositionY,
|
||||
FrameSync,
|
||||
ShowUnicode,
|
||||
PermanentSongInfo,
|
||||
Ticker,
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
@ -35,14 +36,39 @@ namespace osu.Game.Database
|
||||
|
||||
if (connection == null)
|
||||
{
|
||||
connection = storage.GetDatabase(@"beatmaps");
|
||||
connection.CreateTable<BeatmapMetadata>();
|
||||
connection.CreateTable<BaseDifficulty>();
|
||||
connection.CreateTable<BeatmapSetInfo>();
|
||||
connection.CreateTable<BeatmapInfo>();
|
||||
try
|
||||
{
|
||||
connection = prepareConnection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(@"Failed to initialise the beatmap database! Trying again with a clean database...");
|
||||
storage.DeleteDatabase(@"beatmaps");
|
||||
connection = prepareConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SQLiteConnection prepareConnection()
|
||||
{
|
||||
var conn = storage.GetDatabase(@"beatmaps");
|
||||
|
||||
try
|
||||
{
|
||||
conn.CreateTable<BeatmapMetadata>();
|
||||
conn.CreateTable<BaseDifficulty>();
|
||||
conn.CreateTable<BeatmapSetInfo>();
|
||||
conn.CreateTable<BeatmapInfo>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
conn.Close();
|
||||
throw;
|
||||
}
|
||||
|
||||
return conn;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
foreach (var setInfo in Query<BeatmapSetInfo>())
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Modes
|
||||
|
||||
public abstract ScoreOverlay CreateScoreOverlay();
|
||||
|
||||
public abstract ScoreProcessor CreateScoreProcessor();
|
||||
public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount);
|
||||
|
||||
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
||||
|
||||
|
@ -15,5 +15,6 @@ namespace osu.Game.Modes
|
||||
public double Accuracy { get; set; }
|
||||
public double Combo { get; set; }
|
||||
public double MaxCombo { get; set; }
|
||||
public double Health { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -18,22 +18,30 @@ namespace osu.Game.Modes
|
||||
TotalScore = TotalScore,
|
||||
Combo = Combo,
|
||||
MaxCombo = HighestCombo,
|
||||
Accuracy = Accuracy
|
||||
Accuracy = Accuracy,
|
||||
Health = Health,
|
||||
};
|
||||
|
||||
public readonly BindableDouble TotalScore = new BindableDouble { MinValue = 0 };
|
||||
|
||||
public readonly BindableDouble Accuracy = new BindableDouble { MinValue = 0, MaxValue = 1 };
|
||||
|
||||
public readonly BindableDouble Health = new BindableDouble { MinValue = 0, MaxValue = 1 };
|
||||
|
||||
public readonly BindableInt Combo = new BindableInt();
|
||||
|
||||
public readonly BindableInt HighestCombo = new BindableInt();
|
||||
|
||||
public readonly List<JudgementInfo> Judgements = new List<JudgementInfo>();
|
||||
public readonly List<JudgementInfo> Judgements;
|
||||
|
||||
public ScoreProcessor()
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScoreProcessor"/> class.
|
||||
/// </summary>
|
||||
/// <param name="hitObjectCount">Number of HitObjects. It is used for specifying Judgements collection Capacity</param>
|
||||
public ScoreProcessor(int hitObjectCount = 0)
|
||||
{
|
||||
Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); };
|
||||
Judgements = new List<JudgementInfo>(hitObjectCount);
|
||||
}
|
||||
|
||||
public void AddJudgement(JudgementInfo judgement)
|
||||
|
43
osu.Game/Modes/UI/HealthDisplay.cs
Normal file
43
osu.Game/Modes/UI/HealthDisplay.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
public class HealthDisplay : Container
|
||||
{
|
||||
private Box background;
|
||||
private Box fill;
|
||||
|
||||
public HealthDisplay()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
background = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Gray,
|
||||
},
|
||||
fill = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.White,
|
||||
Scale = new Vector2(0, 1),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public double Current;
|
||||
|
||||
public void Set(double value)
|
||||
{
|
||||
Current = value;
|
||||
fill.ScaleTo(new Vector2((float)Current, 1), 200, EasingTypes.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,8 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Modes.Objects;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
@ -15,12 +17,19 @@ namespace osu.Game.Modes.UI
|
||||
public ComboCounter ComboCounter;
|
||||
public ScoreCounter ScoreCounter;
|
||||
public PercentageCounter AccuracyCounter;
|
||||
public HealthDisplay HealthDisplay;
|
||||
public Score Score { get; set; }
|
||||
|
||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||
protected abstract ComboCounter CreateComboCounter();
|
||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||
protected abstract ScoreCounter CreateScoreCounter();
|
||||
protected virtual HealthDisplay CreateHealthDisplay() => new HealthDisplay
|
||||
{
|
||||
Size = new Vector2(0.5f, 20),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Padding = new MarginPadding(5)
|
||||
};
|
||||
|
||||
public virtual void OnHit(HitObject h)
|
||||
{
|
||||
@ -44,6 +53,7 @@ namespace osu.Game.Modes.UI
|
||||
ComboCounter = CreateComboCounter(),
|
||||
ScoreCounter = CreateScoreCounter(),
|
||||
AccuracyCounter = CreateAccuracyCounter(),
|
||||
HealthDisplay = CreateHealthDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
@ -53,6 +63,7 @@ namespace osu.Game.Modes.UI
|
||||
processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); };
|
||||
processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); };
|
||||
processor.Combo.ValueChanged += delegate { ComboCounter?.Set((ulong)processor.Combo.Value); };
|
||||
processor.Health.ValueChanged += delegate { HealthDisplay?.Set(processor.Health.Value); };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,16 +2,12 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.Configuration;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Input;
|
||||
using OpenTK.Input;
|
||||
@ -25,7 +21,6 @@ using osu.Game.Modes;
|
||||
using osu.Game.Overlays.Toolbar;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -55,13 +50,6 @@ namespace osu.Game
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
public override void SetHost(BasicGameHost host)
|
||||
{
|
||||
base.SetHost(host);
|
||||
|
||||
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
|
||||
}
|
||||
|
||||
public void ToggleOptions() => options.ToggleVisibility();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -78,12 +66,7 @@ namespace osu.Game
|
||||
|
||||
Dependencies.Cache(this);
|
||||
|
||||
//attach our bindables to the audio subsystem.
|
||||
Audio.Volume.Weld(Config.GetBindable<double>(OsuConfig.VolumeUniversal));
|
||||
Audio.VolumeSample.Weld(Config.GetBindable<double>(OsuConfig.VolumeEffect));
|
||||
Audio.VolumeTrack.Weld(Config.GetBindable<double>(OsuConfig.VolumeMusic));
|
||||
|
||||
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||
PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -110,11 +93,9 @@ namespace osu.Game
|
||||
|
||||
(modeStack = new Intro()).Preload(this, d =>
|
||||
{
|
||||
mainContent.Add(d);
|
||||
|
||||
modeStack.ModePushed += modeAdded;
|
||||
modeStack.Exited += modeRemoved;
|
||||
modeStack.DisplayAsRoot();
|
||||
mainContent.Add(modeStack);
|
||||
});
|
||||
|
||||
//overlay elements
|
||||
@ -241,17 +222,5 @@ namespace osu.Game
|
||||
{
|
||||
modeChanged(newMode);
|
||||
}
|
||||
|
||||
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
||||
{
|
||||
if (!base.Invalidate(invalidation, source, shallPropagate)) return false;
|
||||
|
||||
if (Parent != null)
|
||||
{
|
||||
Config.Set(OsuConfig.Width, DrawSize.X);
|
||||
Config.Set(OsuConfig.Height, DrawSize.Y);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game
|
||||
{
|
||||
public class OsuGameBase : BaseGame, IOnlineComponent
|
||||
{
|
||||
internal OsuConfigManager Config;
|
||||
protected OsuConfigManager LocalConfig;
|
||||
|
||||
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
||||
|
||||
@ -40,7 +40,7 @@ namespace osu.Game
|
||||
private void load()
|
||||
{
|
||||
Dependencies.Cache(this);
|
||||
Dependencies.Cache(Config);
|
||||
Dependencies.Cache(LocalConfig);
|
||||
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
||||
Dependencies.Cache(new OsuColour());
|
||||
|
||||
@ -69,9 +69,9 @@ namespace osu.Game
|
||||
|
||||
Dependencies.Cache(API = new APIAccess
|
||||
{
|
||||
Username = Config.Get<string>(OsuConfig.Username),
|
||||
Password = Config.Get<string>(OsuConfig.Password),
|
||||
Token = Config.Get<string>(OsuConfig.Token)
|
||||
Username = LocalConfig.Get<string>(OsuConfig.Username),
|
||||
Password = LocalConfig.Get<string>(OsuConfig.Password),
|
||||
Token = LocalConfig.Get<string>(OsuConfig.Token)
|
||||
});
|
||||
|
||||
API.Register(this);
|
||||
@ -82,8 +82,8 @@ namespace osu.Game
|
||||
switch (state)
|
||||
{
|
||||
case APIState.Online:
|
||||
Config.Set(OsuConfig.Username, Config.Get<bool>(OsuConfig.SaveUsername) ? API.Username : string.Empty);
|
||||
Config.Set(OsuConfig.Password, Config.Get<bool>(OsuConfig.SavePassword) ? API.Password : string.Empty);
|
||||
LocalConfig.Set(OsuConfig.Username, LocalConfig.Get<bool>(OsuConfig.SaveUsername) ? API.Username : string.Empty);
|
||||
LocalConfig.Set(OsuConfig.Password, LocalConfig.Get<bool>(OsuConfig.SavePassword) ? API.Password : string.Empty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -103,8 +103,8 @@ namespace osu.Game
|
||||
|
||||
public override void SetHost(BasicGameHost host)
|
||||
{
|
||||
if (Config == null)
|
||||
Config = new OsuConfigManager(host.Storage);
|
||||
if (LocalConfig == null)
|
||||
LocalConfig = new OsuConfigManager(host.Storage);
|
||||
base.SetHost(host);
|
||||
}
|
||||
|
||||
@ -117,10 +117,10 @@ namespace osu.Game
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
//refresh token may have changed.
|
||||
if (Config != null && API != null)
|
||||
if (LocalConfig != null && API != null)
|
||||
{
|
||||
Config.Set(OsuConfig.Token, API.Token);
|
||||
Config.Save();
|
||||
LocalConfig.Set(OsuConfig.Token, API.Token);
|
||||
LocalConfig.Save();
|
||||
}
|
||||
|
||||
base.Dispose(isDisposing);
|
||||
|
@ -43,7 +43,6 @@ namespace osu.Game.Overlays
|
||||
private TrackManager trackManager;
|
||||
private Bindable<WorkingBeatmap> beatmapSource;
|
||||
private Bindable<bool> preferUnicode;
|
||||
private OsuConfigManager config;
|
||||
private WorkingBeatmap current;
|
||||
private BeatmapDatabase beatmaps;
|
||||
private BaseGame game;
|
||||
@ -87,9 +86,11 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase osuGame, BeatmapDatabase beatmaps, AudioManager audio,
|
||||
private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, AudioManager audio,
|
||||
TextureStore textures, OsuColour colours)
|
||||
{
|
||||
unicodeString = config.GetUnicodeString;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
title = new SpriteText
|
||||
@ -202,8 +203,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
this.beatmaps = beatmaps;
|
||||
trackManager = osuGame.Audio.Track;
|
||||
config = osuGame.Config;
|
||||
preferUnicode = osuGame.Config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
||||
|
||||
beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||
@ -324,8 +324,8 @@ namespace osu.Game.Overlays
|
||||
return;
|
||||
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = config.GetUnicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = config.GetUnicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
});
|
||||
|
||||
MusicControllerBackground newBackground;
|
||||
@ -354,6 +354,8 @@ namespace osu.Game.Overlays
|
||||
});
|
||||
}
|
||||
|
||||
private Func<string, string, string> unicodeString;
|
||||
|
||||
private void seek(float position)
|
||||
{
|
||||
current?.Track?.Seek(current.Track.Length * position);
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options.Graphics
|
||||
protected override string Header => "Layout";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(FrameworkConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -24,22 +24,22 @@ namespace osu.Game.Overlays.Options.Graphics
|
||||
new CheckBoxOption
|
||||
{
|
||||
LabelText = "Fullscreen mode",
|
||||
Bindable = config.GetBindable<bool>(OsuConfig.Fullscreen),
|
||||
Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
|
||||
},
|
||||
new CheckBoxOption
|
||||
{
|
||||
LabelText = "Letterboxing",
|
||||
Bindable = config.GetBindable<bool>(OsuConfig.Letterboxing),
|
||||
Bindable = config.GetBindable<bool>(FrameworkConfig.Letterboxing),
|
||||
},
|
||||
new SliderOption<int>
|
||||
{
|
||||
LabelText = "Horizontal position",
|
||||
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.LetterboxPositionX)
|
||||
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX)
|
||||
},
|
||||
new SliderOption<int>
|
||||
{
|
||||
LabelText = "Vertical position",
|
||||
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.LetterboxPositionY)
|
||||
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionY)
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Options.Graphics
|
||||
protected override string Header => "Renderer";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
|
||||
{
|
||||
// NOTE: Compatability mode omitted
|
||||
Children = new Drawable[]
|
||||
@ -24,22 +25,22 @@ namespace osu.Game.Overlays.Options.Graphics
|
||||
new DropdownOption<FrameSync>
|
||||
{
|
||||
LabelText = "Frame limiter",
|
||||
Bindable = config.GetBindable<FrameSync>(OsuConfig.FrameSync)
|
||||
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync)
|
||||
},
|
||||
new CheckBoxOption
|
||||
{
|
||||
LabelText = "Show FPS counter",
|
||||
Bindable = config.GetBindable<bool>(OsuConfig.FpsCounter),
|
||||
Bindable = osuConfig.GetBindable<bool>(OsuConfig.FpsCounter),
|
||||
},
|
||||
new CheckBoxOption
|
||||
{
|
||||
LabelText = "Reduce dropped frames",
|
||||
Bindable = config.GetBindable<bool>(OsuConfig.ForceFrameFlush),
|
||||
Bindable = osuConfig.GetBindable<bool>(OsuConfig.ForceFrameFlush),
|
||||
},
|
||||
new CheckBoxOption
|
||||
{
|
||||
LabelText = "Detect performance issues",
|
||||
Bindable = config.GetBindable<bool>(OsuConfig.DetectPerformanceIssues),
|
||||
Bindable = osuConfig.GetBindable<bool>(OsuConfig.DetectPerformanceIssues),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -65,9 +65,10 @@ namespace osu.Game.Screens.Menu
|
||||
bgm.Looping = true;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
protected override void OnEntering(GameMode last)
|
||||
{
|
||||
base.LoadComplete();
|
||||
base.OnEntering(last);
|
||||
|
||||
Scheduler.Add(delegate
|
||||
{
|
||||
welcome.Play();
|
||||
|
@ -48,9 +48,9 @@ namespace osu.Game.Screens.Play
|
||||
private Bindable<int> dimLevel;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game)
|
||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config)
|
||||
{
|
||||
dimLevel = game.Config.GetBindable<int>(OsuConfig.DimLevel);
|
||||
dimLevel = config.GetBindable<int>(OsuConfig.DimLevel);
|
||||
try
|
||||
{
|
||||
if (Beatmap == null)
|
||||
@ -92,7 +92,7 @@ namespace osu.Game.Screens.Play
|
||||
ruleset = Ruleset.GetRuleset(usablePlayMode);
|
||||
|
||||
var scoreOverlay = ruleset.CreateScoreOverlay();
|
||||
scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor());
|
||||
scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor(beatmap.HitObjects.Count));
|
||||
|
||||
hitRenderer = ruleset.CreateHitRendererWith(beatmap.HitObjects);
|
||||
|
||||
|
@ -70,6 +70,7 @@
|
||||
<Compile Include="Modes\Objects\HitObjectParser.cs" />
|
||||
<Compile Include="Modes\Score.cs" />
|
||||
<Compile Include="Modes\ScoreProcesssor.cs" />
|
||||
<Compile Include="Modes\UI\HealthDisplay.cs" />
|
||||
<Compile Include="Online\API\IOnlineComponent.cs" />
|
||||
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
|
||||
<Compile Include="Overlays\DragBar.cs" />
|
||||
@ -229,7 +230,6 @@
|
||||
<Compile Include="Configuration\ScoreMeterType.cs" />
|
||||
<Compile Include="Configuration\ReleaseStream.cs" />
|
||||
<Compile Include="Configuration\ScreenshotFormat.cs" />
|
||||
<Compile Include="Configuration\FrameSync.cs" />
|
||||
<Compile Include="Configuration\ConfineMouseMode.cs" />
|
||||
<Compile Include="Graphics\OsuColour.cs" />
|
||||
<Compile Include="Screens\Select\FilterControl.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user