mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Merge branch 'master' into fix-slider-tracking-outside-follow-circle
This commit is contained in:
commit
aebda8b032
@ -17,8 +17,8 @@ namespace osu.Desktop.Deploy
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private const string nuget_path = @"packages\NuGet.CommandLine.3.5.0\tools\NuGet.exe";
|
||||
private const string squirrel_path = @"packages\squirrel.windows.1.5.2\tools\Squirrel.exe";
|
||||
private const string nuget_path = @"packages\NuGet.CommandLine.4.1.0\tools\NuGet.exe";
|
||||
private const string squirrel_path = @"packages\squirrel.windows.1.7.5\tools\Squirrel.exe";
|
||||
private const string msbuild_path = @"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe";
|
||||
|
||||
public static string StagingFolder = ConfigurationManager.AppSettings["StagingFolder"];
|
||||
|
@ -2,12 +2,8 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Screens.Play;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
|
||||
namespace osu.Desktop.Tests.Visual
|
||||
@ -41,38 +37,5 @@ namespace osu.Desktop.Tests.Visual
|
||||
|
||||
Add(kc);
|
||||
}
|
||||
private class TestSliderBar<T> : SliderBar<T> where T : struct
|
||||
{
|
||||
public Color4 Color
|
||||
{
|
||||
get { return Box.Colour; }
|
||||
set { Box.Colour = value; }
|
||||
}
|
||||
|
||||
public Color4 SelectionColor
|
||||
{
|
||||
get { return SelectionBox.Colour; }
|
||||
set { SelectionBox.Colour = value; }
|
||||
}
|
||||
|
||||
protected readonly Box SelectionBox;
|
||||
protected readonly Box Box;
|
||||
|
||||
public TestSliderBar()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Box = new Box { RelativeSizeAxes = Axes.Both },
|
||||
SelectionBox = new Box { RelativeSizeAxes = Axes.Both }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void UpdateValue(float value)
|
||||
{
|
||||
SelectionBox.ScaleTo(
|
||||
new Vector2(value, 1),
|
||||
300, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,8 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Input.Bindings;
|
||||
using OpenTK.Input;
|
||||
using KeyboardState = osu.Framework.Input.KeyboardState;
|
||||
using MouseState = osu.Framework.Input.MouseState;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
@ -16,22 +11,6 @@ namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
public OsuInputManager(RulesetInfo ruleset) : base(ruleset, 0, SimultaneousBindingMode.Unique)
|
||||
{
|
||||
|
||||
}
|
||||
protected override void TransformState(InputState state)
|
||||
{
|
||||
base.TransformState(state);
|
||||
|
||||
var mouse = state.Mouse as MouseState;
|
||||
var keyboard = state.Keyboard as KeyboardState;
|
||||
|
||||
if (mouse != null && keyboard != null)
|
||||
{
|
||||
if (mouse.IsPressed(MouseButton.Left))
|
||||
keyboard.Keys = keyboard.Keys.Concat(new[] { Key.LastKey + 1 });
|
||||
if (mouse.IsPressed(MouseButton.Right))
|
||||
keyboard.Keys = keyboard.Keys.Concat(new[] { Key.LastKey + 2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,19 +44,31 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
List<Bar> bars = Children.ToList();
|
||||
foreach (var bar in value.Select((length, index) => new { Value = length, Bar = bars.Count > index ? bars[index] : null }))
|
||||
{
|
||||
float length = MaxValue ?? value.Max();
|
||||
if (length != 0)
|
||||
length = bar.Value / length;
|
||||
|
||||
float size = value.Count();
|
||||
if (size != 0)
|
||||
size = 1.0f / size;
|
||||
|
||||
if (bar.Bar != null)
|
||||
{
|
||||
bar.Bar.Length = bar.Value / (MaxValue ?? value.Max());
|
||||
bar.Bar.Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, 1.0f / value.Count()) : new Vector2(1.0f / value.Count(), 1);
|
||||
bar.Bar.Length = length;
|
||||
bar.Bar.Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, size) : new Vector2(size, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Add(new Bar
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, 1.0f / value.Count()) : new Vector2(1.0f / value.Count(), 1),
|
||||
Length = bar.Value / (MaxValue ?? value.Max()),
|
||||
Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, size) : new Vector2(size, 1),
|
||||
Length = length,
|
||||
Direction = Direction,
|
||||
});
|
||||
}
|
||||
}
|
||||
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
|
||||
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Input
|
||||
public KeyBindingStore(SQLiteConnection connection, RulesetStore rulesets, Storage storage = null)
|
||||
: base(connection, storage)
|
||||
{
|
||||
foreach (var info in rulesets.Query<RulesetInfo>())
|
||||
foreach (var info in rulesets.AllRulesets)
|
||||
{
|
||||
var ruleset = info.CreateInstance();
|
||||
foreach (var variant in ruleset.AvailableVariants)
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
AddSection(new GlobalKeyBindingsSection(global, "Global"));
|
||||
|
||||
foreach (var ruleset in rulesets.Query<RulesetInfo>())
|
||||
foreach (var ruleset in rulesets.AllRulesets)
|
||||
AddSection(new RulesetBindingsSection(ruleset));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user