1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Merge pull request #28 from peppy/general-fixes

Framework updates.
This commit is contained in:
Dean Herbert 2016-09-21 17:39:36 +09:00 committed by GitHub
commit edcc48c49b
4 changed files with 22 additions and 13 deletions

@ -1 +1 @@
Subproject commit 6e7fa7ebe564e9bca957ea26ff2bee6038c2bf67
Subproject commit 6357711a41aaaeecfb8a60c09c5d5cc3c01d1778

View File

@ -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)
@ -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
},
@ -587,9 +589,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();
}

View File

@ -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;

View File

@ -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<int>(OsuConfig.Width), Config.Get<int>(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<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
API = new APIAccess()
{
Username = Config.Get<string>(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;
}