From b9de26aa268f2686c1a08b2848e99923223de172 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 20 Sep 2016 14:41:55 +0900 Subject: [PATCH 1/3] Framework updates. --- osu-framework | 2 +- osu.Game/GameModes/Menu/ButtonSystem.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu-framework b/osu-framework index 6e7fa7ebe5..0ca3fe2b5d 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6e7fa7ebe564e9bca957ea26ff2bee6038c2bf67 +Subproject commit 0ca3fe2b5d20f9aa71ef8a65cd9a676d5d3035e3 diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 32bbff5480..75fec4bdbf 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -181,6 +181,8 @@ namespace osu.Game.GameModes.Menu MenuState state; + public override bool HandleInput => state != MenuState.Exit; + public MenuState State { get @@ -239,8 +241,6 @@ namespace osu.Game.GameModes.Menu b.State = Button.ButtonState.Expanded; break; case MenuState.Exit: - HandleInput = false; - buttonArea.FadeOut(200); foreach (Button b in buttonsTopLevel) @@ -587,9 +587,10 @@ namespace osu.Game.GameModes.Menu //box.FlashColour(ColourHelper.Lighten2(colour, 0.7f), 200); } + public override bool HandleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; + protected override void Update() { - HandleInput = state != ButtonState.Exploded && box.Scale.X >= 0.8f; iconText.Alpha = MathHelper.Clamp((box.Scale.X - 0.5f) / 0.3f, 0, 1); base.Update(); } From b2e7f290f21372a1664e166f42be86a29d3bffa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 20 Sep 2016 16:26:07 +0900 Subject: [PATCH 2/3] Fix window size. --- osu.Game/OsuGame.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 315150a2cd..b1aeaa0a2d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; +using osu.Framework.OS; namespace osu.Game { @@ -24,6 +25,13 @@ namespace osu.Game internal APIAccess API; + public override void SetHost(BasicGameHost host) + { + base.SetHost(host); + + host.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); + } + public override void Load() { base.Load(); @@ -31,8 +39,6 @@ namespace osu.Game //this completely overrides the framework default. will need to change once we make a proper FontStore. Fonts = new TextureStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular")) { ScaleAdjust = 0.01f }; - Parent.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); - API = new APIAccess() { Username = Config.Get(OsuConfig.Username), @@ -73,8 +79,8 @@ namespace osu.Game if (Parent != null) { - Parent.Width = Config.Set(OsuConfig.Width, ActualSize.X).Value; - Parent.Height = Config.Set(OsuConfig.Height, ActualSize.Y).Value; + Config.Set(OsuConfig.Width, ActualSize.X); + Config.Set(OsuConfig.Height, ActualSize.Y); } return true; } From 997c6f45f62473faaa3bfb7a711ca6ac4f96bc9c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Sep 2016 17:37:33 +0900 Subject: [PATCH 3/3] Update framework again. --- osu-framework | 2 +- osu.Game/GameModes/Menu/ButtonSystem.cs | 10 ++++++---- osu.Game/Online/API/OAuth.cs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/osu-framework b/osu-framework index 0ca3fe2b5d..6357711a41 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0ca3fe2b5d20f9aa71ef8a65cd9a676d5d3035e3 +Subproject commit 6357711a41aaaeecfb8a60c09c5d5cc3c01d1778 diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 75fec4bdbf..24ccba839a 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -298,14 +298,16 @@ namespace osu.Game.GameModes.Menu { Children = new Drawable[] { - logo = new Sprite(Game.Textures.Get(@"menu-osu")) + logo = new Sprite() { - Anchor = Anchor.Centre, + Texture = Game.Textures.Get(@"menu-osu"), + Anchor = Anchor.Centre, Origin = Anchor.Centre }, - ripple = new Sprite(Game.Textures.Get(@"menu-osu")) + ripple = new Sprite() { - Anchor = Anchor.Centre, + Texture = Game.Textures.Get(@"menu-osu"), + Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0.4f }, diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index bbd33c0b95..3358fac0e8 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -65,7 +65,7 @@ namespace osu.Game.Online.API Token = req.ResponseObject; return true; } - catch (Exception e) + catch { //todo: potentially only kill the refresh token on certain exception types. Token = null;