1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Merge pull request #39 from peppy/general-fixes

General fixes
This commit is contained in:
Thomas Müller 2016-09-29 16:50:12 +02:00 committed by GitHub
commit 8470961c2a
15 changed files with 93 additions and 26 deletions

@ -1 +1 @@
Subproject commit 05c40c281741f81ea09f05fce9a1b22c7589dc8e
Subproject commit 3f68cf9d03d47d07d4c804027f45d32432e08ee6

@ -1 +1 @@
Subproject commit 5cc6e0a311145a9871fb90d0d91226f3858bdce4
Subproject commit fd4a3dd5223af6eb1c261af070b4220c9ff9ec2d

View File

@ -0,0 +1,21 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.GameModes.Testing;
using osu.Game.GameModes.Menu;
namespace osu.Desktop.Tests
{
class TestCaseMenuButtonSystem : TestCase
{
public override string Name => @"ButtonSystem";
public override string Description => @"Main menu button system";
public override void Reset()
{
base.Reset();
Add(new ButtonSystem());
}
}
}

View File

@ -151,6 +151,7 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Tests\TestCaseKeyCounter.cs" />
<Compile Include="Tests\TestCaseMenuButtonSystem.cs" />
<Compile Include="Tests\TestCaseTextAwesome.cs" />
<Compile Include="VisualTestGame.cs" />
</ItemGroup>

View File

@ -11,7 +11,6 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using OpenTK;
@ -20,7 +19,7 @@ using OpenTK.Input;
namespace osu.Game.GameModes.Menu
{
internal class ButtonSystem : OsuLargeComponent
public class ButtonSystem : OsuLargeComponent
{
private FlowContainerWithOrigin buttonFlow;
@ -291,7 +290,6 @@ namespace osu.Game.GameModes.Menu
Sprite ripple;
Children = new Drawable[]
{
logoBounceContainer = new AutoSizeContainer

View File

@ -12,7 +12,7 @@ namespace osu.Game.GameModes.Menu
{
public override string Name => @"Main Menu";
private AudioTrackBass bgm;
//private AudioTrackBass bgm;
public override void Load()
{

View File

@ -1,19 +1,12 @@
//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.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
class OsuComponent : AutoSizeContainer
{
public new OsuGame Game => base.Game as OsuGame;
public new OsuGameBase Game => base.Game as OsuGameBase;
}
}

View File

@ -1,17 +1,12 @@
//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.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers
{
class OsuLargeComponent : LargeContainer
public class OsuLargeComponent : LargeContainer
{
public new OsuGame Game => base.Game as OsuGame;
public new OsuGameBase Game => base.Game as OsuGameBase;
}
}

View File

@ -0,0 +1,53 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
namespace osu.Game.Graphics.Cursor
{
class OsuCursorContainer : CursorContainer
{
protected override Drawable CreateCursor() => new OsuCursor();
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
ActiveCursor.Scale = new OpenTK.Vector2(1);
ActiveCursor.ScaleTo(1.2f, 100, EasingTypes.OutQuad);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
if (!state.Mouse.HasMainButtonPressed)
ActiveCursor.ScaleTo(1, 200, EasingTypes.OutQuad);
return base.OnMouseUp(state, args);
}
class OsuCursor : AutoSizeContainer
{
public OsuCursor()
{
Origin = Anchor.Centre;
}
public override void Load()
{
base.Load();
Children = new Drawable[]
{
new Sprite
{
Texture = Game.Textures.Get(@"Cursor/cursor")
}
};
}
}
}
}

View File

@ -1,7 +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 osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK;
@ -9,6 +8,8 @@ namespace osu.Game.Graphics.Processing
{
class RatioAdjust : LargeContainer
{
public override bool Contains(Vector2 screenSpacePos) => true;
protected override void Update()
{
base.Update();

View File

@ -2,6 +2,7 @@
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Diagnostics;
using System.Security;
using osu.Framework.Extensions;
@ -35,6 +36,8 @@ namespace osu.Game.Online.API
internal string Get(Representation request = Representation.Raw)
{
Debug.Assert(representation == request);
switch (request)
{
default:

View File

@ -22,7 +22,7 @@ namespace osu.Game.Online.Chat
public List<Message> Messages = new List<Message>();
internal bool Joined;
//internal bool Joined;
[JsonConstructor]
public Channel()

View File

@ -21,10 +21,10 @@ namespace osu.Game.Online.Chat
public DateTime Timestamp;
[JsonProperty(@"content")]
internal string Content;
public string Content;
[JsonProperty(@"sender")]
internal string User;
public string User;
[JsonConstructor]
public Message()

View File

@ -4,6 +4,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Game.Configuration;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.Processing;
using osu.Game.Online.API;
@ -44,7 +45,7 @@ namespace osu.Game
{
Children = new Drawable[]
{
new CursorContainer()
new OsuCursorContainer()
}
}
});

View File

@ -51,6 +51,7 @@
<Compile Include="Graphics\Containers\OsuComponent.cs" />
<Compile Include="Graphics\Containers\OsuGameMode.cs" />
<Compile Include="Graphics\Containers\OsuLargeComponent.cs" />
<Compile Include="Graphics\Cursor\OsuCursorContainer.cs" />
<Compile Include="Graphics\Processing\RatioAdjust.cs" />
<Compile Include="Graphics\TextAwesome.cs" />
<Compile Include="Graphics\UserInterface\KeyCounter.cs" />