mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:05:29 +08:00
Merge remote-tracking branch 'upstream/master' into ingame_options
This commit is contained in:
commit
0cb1df35e9
@ -1 +1 @@
|
|||||||
Subproject commit e5f0cf73c1e0bbcbd04194bf175d73af47fc850a
|
Subproject commit 925bbe42bab95078b9d33189205b5b1b76bf8e01
|
19
osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs
Normal file
19
osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseSkipButton : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Skip skip skippediskip";
|
||||||
|
|
||||||
|
public override void Reset()
|
||||||
|
{
|
||||||
|
base.Reset();
|
||||||
|
Add(new SkipButton(Clock.CurrentTime + 5000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,92 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 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.Testing;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Framework.Configuration;
|
|
||||||
using OpenTK;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
|
||||||
{
|
|
||||||
internal class TestCaseTooltip : TestCase
|
|
||||||
{
|
|
||||||
public override string Description => "tests tooltips on various elements";
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
OsuSliderBar<int> slider;
|
|
||||||
OsuSliderBar<double> sliderDouble;
|
|
||||||
|
|
||||||
const float width = 400;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(0, 10),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new TooltipTextContainer("text with a tooltip"),
|
|
||||||
new TooltipTextContainer("more text with another tooltip"),
|
|
||||||
new TooltipTextbox
|
|
||||||
{
|
|
||||||
Text = "a textbox with a tooltip",
|
|
||||||
Size = new Vector2(width,30),
|
|
||||||
},
|
|
||||||
slider = new OsuSliderBar<int>
|
|
||||||
{
|
|
||||||
Width = width,
|
|
||||||
},
|
|
||||||
sliderDouble = new OsuSliderBar<double>
|
|
||||||
{
|
|
||||||
Width = width,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
slider.Current.BindTo(new BindableInt(5)
|
|
||||||
{
|
|
||||||
MaxValue = 10,
|
|
||||||
MinValue = 0
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderDouble.Current.BindTo(new BindableDouble(0.5)
|
|
||||||
{
|
|
||||||
MaxValue = 1,
|
|
||||||
MinValue = 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TooltipTextContainer : Container, IHasTooltip
|
|
||||||
{
|
|
||||||
private readonly OsuSpriteText text;
|
|
||||||
|
|
||||||
public string TooltipText => text.Text;
|
|
||||||
|
|
||||||
public TooltipTextContainer(string tooltipText)
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
text = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = tooltipText,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TooltipTextbox : OsuTextBox, IHasTooltip
|
|
||||||
{
|
|
||||||
public string TooltipText => Text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,20 +3,18 @@
|
|||||||
|
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Play;
|
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
internal class TestCaseTwoLayerButton : TestCase
|
internal class TestCaseTwoLayerButton : TestCase
|
||||||
{
|
{
|
||||||
public override string Description => @"Back and skip and what not";
|
public override string Description => @"Mostly back button";
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
|
||||||
Add(new BackButton());
|
Add(new BackButton());
|
||||||
Add(new SkipButton(Clock.CurrentTime + 5000));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,12 +204,12 @@
|
|||||||
<Compile Include="Tests\TestCaseReplay.cs" />
|
<Compile Include="Tests\TestCaseReplay.cs" />
|
||||||
<Compile Include="Tests\TestCaseResults.cs" />
|
<Compile Include="Tests\TestCaseResults.cs" />
|
||||||
<Compile Include="Tests\TestCaseScoreCounter.cs" />
|
<Compile Include="Tests\TestCaseScoreCounter.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseSkipButton.cs" />
|
||||||
<Compile Include="Tests\TestCaseTabControl.cs" />
|
<Compile Include="Tests\TestCaseTabControl.cs" />
|
||||||
<Compile Include="Tests\TestCaseTaikoHitObjects.cs" />
|
<Compile Include="Tests\TestCaseTaikoHitObjects.cs" />
|
||||||
<Compile Include="Tests\TestCaseTaikoPlayfield.cs" />
|
<Compile Include="Tests\TestCaseTaikoPlayfield.cs" />
|
||||||
<Compile Include="Tests\TestCaseTextAwesome.cs" />
|
<Compile Include="Tests\TestCaseTextAwesome.cs" />
|
||||||
<Compile Include="Tests\TestCasePlaySongSelect.cs" />
|
<Compile Include="Tests\TestCasePlaySongSelect.cs" />
|
||||||
<Compile Include="Tests\TestCaseTooltip.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseTwoLayerButton.cs" />
|
<Compile Include="Tests\TestCaseTwoLayerButton.cs" />
|
||||||
<Compile Include="VisualTestGame.cs" />
|
<Compile Include="VisualTestGame.cs" />
|
||||||
<Compile Include="Platform\TestStorage.cs" />
|
<Compile Include="Platform\TestStorage.cs" />
|
||||||
|
@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
new CatchModEasy(),
|
new CatchModEasy(),
|
||||||
new CatchModNoFail(),
|
new CatchModNoFail(),
|
||||||
|
new MultiMod
|
||||||
|
{
|
||||||
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
new CatchModHalfTime(),
|
new CatchModHalfTime(),
|
||||||
|
new CatchModDaycore(),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
|
@ -32,6 +32,11 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CatchModDaycore : ModDaycore
|
||||||
|
{
|
||||||
|
public override double ScoreMultiplier => 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
public class CatchModDoubleTime : ModDoubleTime
|
public class CatchModDoubleTime : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.06;
|
public override double ScoreMultiplier => 1.06;
|
||||||
|
@ -27,7 +27,14 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
{
|
{
|
||||||
new ManiaModEasy(),
|
new ManiaModEasy(),
|
||||||
new ManiaModNoFail(),
|
new ManiaModNoFail(),
|
||||||
|
new MultiMod
|
||||||
|
{
|
||||||
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
new ManiaModHalfTime(),
|
new ManiaModHalfTime(),
|
||||||
|
new ManiaModDaycore(),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
|
@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ManiaModDaycore : ModDaycore
|
||||||
|
{
|
||||||
|
public override double ScoreMultiplier => 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
public class ManiaModDoubleTime : ModDoubleTime
|
public class ManiaModDoubleTime : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.0;
|
public override double ScoreMultiplier => 1.0;
|
||||||
|
@ -39,6 +39,11 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class OsuModDaycore : ModDaycore
|
||||||
|
{
|
||||||
|
public override double ScoreMultiplier => 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
public class OsuModDoubleTime : ModDoubleTime
|
public class OsuModDoubleTime : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
|
@ -46,7 +46,14 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
new OsuModEasy(),
|
new OsuModEasy(),
|
||||||
new OsuModNoFail(),
|
new OsuModNoFail(),
|
||||||
|
new MultiMod
|
||||||
|
{
|
||||||
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
new OsuModHalfTime(),
|
new OsuModHalfTime(),
|
||||||
|
new OsuModDaycore(),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
|
@ -37,6 +37,11 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TaikoModDaycore : ModDaycore
|
||||||
|
{
|
||||||
|
public override double ScoreMultiplier => 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
public class TaikoModDoubleTime : ModDoubleTime
|
public class TaikoModDoubleTime : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
|
@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
{
|
{
|
||||||
new TaikoModEasy(),
|
new TaikoModEasy(),
|
||||||
new TaikoModNoFail(),
|
new TaikoModNoFail(),
|
||||||
|
new MultiMod
|
||||||
|
{
|
||||||
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
new TaikoModHalfTime(),
|
new TaikoModHalfTime(),
|
||||||
|
new TaikoModDaycore(),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
Assert.IsTrue(File.Exists(temp));
|
Assert.IsTrue(File.Exists(temp));
|
||||||
|
|
||||||
var importer = new BeatmapIPCChannel(client);
|
var importer = new BeatmapIPCChannel(client);
|
||||||
if (!importer.ImportAsync(temp).Wait(5000))
|
if (!importer.ImportAsync(temp).Wait(10000))
|
||||||
Assert.Fail(@"IPC took too long to send");
|
Assert.Fail(@"IPC took too long to send");
|
||||||
|
|
||||||
ensureLoaded(host);
|
ensureLoaded(host);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
@ -31,6 +32,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private ConvertHitObjectParser parser;
|
private ConvertHitObjectParser parser;
|
||||||
|
|
||||||
|
private readonly Dictionary<string, string> variables = new Dictionary<string, string>();
|
||||||
|
|
||||||
private LegacySampleBank defaultSampleBank;
|
private LegacySampleBank defaultSampleBank;
|
||||||
private int defaultSampleVolume = 100;
|
private int defaultSampleVolume = 100;
|
||||||
|
|
||||||
@ -56,36 +59,39 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
TimingPoints,
|
TimingPoints,
|
||||||
Colours,
|
Colours,
|
||||||
HitObjects,
|
HitObjects,
|
||||||
|
Variables,
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleGeneral(Beatmap beatmap, string key, string val)
|
private void handleGeneral(Beatmap beatmap, string line)
|
||||||
{
|
{
|
||||||
|
var pair = splitKeyVal(line, ':');
|
||||||
|
|
||||||
var metadata = beatmap.BeatmapInfo.Metadata;
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
||||||
switch (key)
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
case @"AudioFilename":
|
case @"AudioFilename":
|
||||||
metadata.AudioFile = val;
|
metadata.AudioFile = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"AudioLeadIn":
|
case @"AudioLeadIn":
|
||||||
beatmap.BeatmapInfo.AudioLeadIn = int.Parse(val);
|
beatmap.BeatmapInfo.AudioLeadIn = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"PreviewTime":
|
case @"PreviewTime":
|
||||||
metadata.PreviewTime = int.Parse(val);
|
metadata.PreviewTime = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"Countdown":
|
case @"Countdown":
|
||||||
beatmap.BeatmapInfo.Countdown = int.Parse(val) == 1;
|
beatmap.BeatmapInfo.Countdown = int.Parse(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
case @"SampleSet":
|
case @"SampleSet":
|
||||||
defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), val);
|
defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"SampleVolume":
|
case @"SampleVolume":
|
||||||
defaultSampleVolume = int.Parse(val);
|
defaultSampleVolume = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"StackLeniency":
|
case @"StackLeniency":
|
||||||
beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
beatmap.BeatmapInfo.StackLeniency = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"Mode":
|
case @"Mode":
|
||||||
beatmap.BeatmapInfo.RulesetID = int.Parse(val);
|
beatmap.BeatmapInfo.RulesetID = int.Parse(pair.Value);
|
||||||
|
|
||||||
switch (beatmap.BeatmapInfo.RulesetID)
|
switch (beatmap.BeatmapInfo.RulesetID)
|
||||||
{
|
{
|
||||||
@ -104,107 +110,135 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case @"LetterboxInBreaks":
|
case @"LetterboxInBreaks":
|
||||||
beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1;
|
beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
case @"SpecialStyle":
|
case @"SpecialStyle":
|
||||||
beatmap.BeatmapInfo.SpecialStyle = int.Parse(val) == 1;
|
beatmap.BeatmapInfo.SpecialStyle = int.Parse(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
case @"WidescreenStoryboard":
|
case @"WidescreenStoryboard":
|
||||||
beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(val) == 1;
|
beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleEditor(Beatmap beatmap, string key, string val)
|
private void handleEditor(Beatmap beatmap, string line)
|
||||||
{
|
{
|
||||||
switch (key)
|
var pair = splitKeyVal(line, ':');
|
||||||
|
|
||||||
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
case @"Bookmarks":
|
case @"Bookmarks":
|
||||||
beatmap.BeatmapInfo.StoredBookmarks = val;
|
beatmap.BeatmapInfo.StoredBookmarks = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"DistanceSpacing":
|
case @"DistanceSpacing":
|
||||||
beatmap.BeatmapInfo.DistanceSpacing = double.Parse(val, NumberFormatInfo.InvariantInfo);
|
beatmap.BeatmapInfo.DistanceSpacing = double.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"BeatDivisor":
|
case @"BeatDivisor":
|
||||||
beatmap.BeatmapInfo.BeatDivisor = int.Parse(val);
|
beatmap.BeatmapInfo.BeatDivisor = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"GridSize":
|
case @"GridSize":
|
||||||
beatmap.BeatmapInfo.GridSize = int.Parse(val);
|
beatmap.BeatmapInfo.GridSize = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"TimelineZoom":
|
case @"TimelineZoom":
|
||||||
beatmap.BeatmapInfo.TimelineZoom = double.Parse(val, NumberFormatInfo.InvariantInfo);
|
beatmap.BeatmapInfo.TimelineZoom = double.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMetadata(Beatmap beatmap, string key, string val)
|
private void handleMetadata(Beatmap beatmap, string line)
|
||||||
{
|
{
|
||||||
|
var pair = splitKeyVal(line, ':');
|
||||||
|
|
||||||
var metadata = beatmap.BeatmapInfo.Metadata;
|
var metadata = beatmap.BeatmapInfo.Metadata;
|
||||||
switch (key)
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
case @"Title":
|
case @"Title":
|
||||||
metadata.Title = val;
|
metadata.Title = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"TitleUnicode":
|
case @"TitleUnicode":
|
||||||
metadata.TitleUnicode = val;
|
metadata.TitleUnicode = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Artist":
|
case @"Artist":
|
||||||
metadata.Artist = val;
|
metadata.Artist = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"ArtistUnicode":
|
case @"ArtistUnicode":
|
||||||
metadata.ArtistUnicode = val;
|
metadata.ArtistUnicode = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Creator":
|
case @"Creator":
|
||||||
metadata.Author = val;
|
metadata.Author = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Version":
|
case @"Version":
|
||||||
beatmap.BeatmapInfo.Version = val;
|
beatmap.BeatmapInfo.Version = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Source":
|
case @"Source":
|
||||||
beatmap.BeatmapInfo.Metadata.Source = val;
|
beatmap.BeatmapInfo.Metadata.Source = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Tags":
|
case @"Tags":
|
||||||
beatmap.BeatmapInfo.Metadata.Tags = val;
|
beatmap.BeatmapInfo.Metadata.Tags = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"BeatmapID":
|
case @"BeatmapID":
|
||||||
beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(val);
|
beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
case @"BeatmapSetID":
|
case @"BeatmapSetID":
|
||||||
beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(val);
|
beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(pair.Value);
|
||||||
metadata.OnlineBeatmapSetID = int.Parse(val);
|
metadata.OnlineBeatmapSetID = int.Parse(pair.Value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleDifficulty(Beatmap beatmap, string key, string val)
|
private void handleDifficulty(Beatmap beatmap, string line)
|
||||||
{
|
{
|
||||||
|
var pair = splitKeyVal(line, ':');
|
||||||
|
|
||||||
var difficulty = beatmap.BeatmapInfo.Difficulty;
|
var difficulty = beatmap.BeatmapInfo.Difficulty;
|
||||||
switch (key)
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
case @"HPDrainRate":
|
case @"HPDrainRate":
|
||||||
difficulty.DrainRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.DrainRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"CircleSize":
|
case @"CircleSize":
|
||||||
difficulty.CircleSize = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.CircleSize = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"OverallDifficulty":
|
case @"OverallDifficulty":
|
||||||
difficulty.OverallDifficulty = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.OverallDifficulty = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"ApproachRate":
|
case @"ApproachRate":
|
||||||
difficulty.ApproachRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.ApproachRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"SliderMultiplier":
|
case @"SliderMultiplier":
|
||||||
difficulty.SliderMultiplier = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.SliderMultiplier = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
case @"SliderTickRate":
|
case @"SliderTickRate":
|
||||||
difficulty.SliderTickRate = float.Parse(val, NumberFormatInfo.InvariantInfo);
|
difficulty.SliderTickRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleEvents(Beatmap beatmap, string val)
|
/// <summary>
|
||||||
|
/// Decodes any beatmap variables present in a line into their real values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="line">The line which may contains variables.</param>
|
||||||
|
private void decodeVariables(ref string line)
|
||||||
{
|
{
|
||||||
string[] split = val.Split(',');
|
while (line.IndexOf('$') >= 0)
|
||||||
|
{
|
||||||
|
string[] split = line.Split(',');
|
||||||
|
for (int i = 0; i < split.Length; i++)
|
||||||
|
{
|
||||||
|
var item = split[i];
|
||||||
|
if (item.StartsWith("$") && variables.ContainsKey(item))
|
||||||
|
split[i] = variables[item];
|
||||||
|
}
|
||||||
|
|
||||||
|
line = string.Join(",", split);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleEvents(Beatmap beatmap, string line)
|
||||||
|
{
|
||||||
|
decodeVariables(ref line);
|
||||||
|
|
||||||
|
string[] split = line.Split(',');
|
||||||
|
|
||||||
EventType type;
|
EventType type;
|
||||||
if (!Enum.TryParse(split[0], out type))
|
if (!Enum.TryParse(split[0], out type))
|
||||||
@ -236,9 +270,9 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleTimingPoints(Beatmap beatmap, string val)
|
private void handleTimingPoints(Beatmap beatmap, string line)
|
||||||
{
|
{
|
||||||
string[] split = val.Split(',');
|
string[] split = line.Split(',');
|
||||||
|
|
||||||
double time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo);
|
double time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo);
|
||||||
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
|
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
|
||||||
@ -321,12 +355,14 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours)
|
private void handleColours(Beatmap beatmap, string line, ref bool hasCustomColours)
|
||||||
{
|
{
|
||||||
string[] split = val.Split(',');
|
var pair = splitKeyVal(line, ':');
|
||||||
|
|
||||||
|
string[] split = pair.Value.Split(',');
|
||||||
|
|
||||||
if (split.Length != 3)
|
if (split.Length != 3)
|
||||||
throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}");
|
throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {pair.Value}");
|
||||||
|
|
||||||
byte r, g, b;
|
byte r, g, b;
|
||||||
if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b))
|
if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b))
|
||||||
@ -339,7 +375,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note: the combo index specified in the beatmap is discarded
|
// Note: the combo index specified in the beatmap is discarded
|
||||||
if (key.StartsWith(@"Combo"))
|
if (pair.Key.StartsWith(@"Combo"))
|
||||||
{
|
{
|
||||||
beatmap.ComboColors.Add(new Color4
|
beatmap.ComboColors.Add(new Color4
|
||||||
{
|
{
|
||||||
@ -351,6 +387,12 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleVariables(string line)
|
||||||
|
{
|
||||||
|
var pair = splitKeyVal(line, '=');
|
||||||
|
variables[pair.Key] = pair.Value;
|
||||||
|
}
|
||||||
|
|
||||||
protected override Beatmap ParseFile(StreamReader stream)
|
protected override Beatmap ParseFile(StreamReader stream)
|
||||||
{
|
{
|
||||||
return new LegacyBeatmap(base.ParseFile(stream));
|
return new LegacyBeatmap(base.ParseFile(stream));
|
||||||
@ -390,42 +432,39 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
string val = line, key = null;
|
|
||||||
if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects)
|
|
||||||
{
|
|
||||||
key = val.Remove(val.IndexOf(':')).Trim();
|
|
||||||
val = val.Substring(val.IndexOf(':') + 1).Trim();
|
|
||||||
}
|
|
||||||
switch (section)
|
switch (section)
|
||||||
{
|
{
|
||||||
case Section.General:
|
case Section.General:
|
||||||
handleGeneral(beatmap, key, val);
|
handleGeneral(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.Editor:
|
case Section.Editor:
|
||||||
handleEditor(beatmap, key, val);
|
handleEditor(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.Metadata:
|
case Section.Metadata:
|
||||||
handleMetadata(beatmap, key, val);
|
handleMetadata(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.Difficulty:
|
case Section.Difficulty:
|
||||||
handleDifficulty(beatmap, key, val);
|
handleDifficulty(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.Events:
|
case Section.Events:
|
||||||
handleEvents(beatmap, val);
|
handleEvents(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.TimingPoints:
|
case Section.TimingPoints:
|
||||||
handleTimingPoints(beatmap, val);
|
handleTimingPoints(beatmap, line);
|
||||||
break;
|
break;
|
||||||
case Section.Colours:
|
case Section.Colours:
|
||||||
handleColours(beatmap, key, val, ref hasCustomColours);
|
handleColours(beatmap, line, ref hasCustomColours);
|
||||||
break;
|
break;
|
||||||
case Section.HitObjects:
|
case Section.HitObjects:
|
||||||
var obj = parser.Parse(val);
|
var obj = parser.Parse(line);
|
||||||
|
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
beatmap.HitObjects.Add(obj);
|
beatmap.HitObjects.Add(obj);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case Section.Variables:
|
||||||
|
handleVariables(line);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,6 +472,15 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.Difficulty);
|
hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.Difficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private KeyValuePair<string, string> splitKeyVal(string line, char separator)
|
||||||
|
{
|
||||||
|
return new KeyValuePair<string, string>
|
||||||
|
(
|
||||||
|
line.Remove(line.IndexOf(separator)).Trim(),
|
||||||
|
line.Substring(line.IndexOf(separator) + 1).Trim()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
internal enum LegacySampleBank
|
internal enum LegacySampleBank
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
|
@ -20,6 +20,8 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10);
|
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10);
|
||||||
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10);
|
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10);
|
||||||
|
|
||||||
|
Set(OsuSetting.SelectionRandomType, SelectionRandomType.RandomPermutation);
|
||||||
|
|
||||||
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
|
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
|
||||||
|
|
||||||
// Online settings
|
// Online settings
|
||||||
@ -107,6 +109,7 @@ namespace osu.Game.Configuration
|
|||||||
SaveUsername,
|
SaveUsername,
|
||||||
DisplayStarsMinimum,
|
DisplayStarsMinimum,
|
||||||
DisplayStarsMaximum,
|
DisplayStarsMaximum,
|
||||||
|
SelectionRandomType,
|
||||||
SnakingInSliders,
|
SnakingInSliders,
|
||||||
SnakingOutSliders,
|
SnakingOutSliders,
|
||||||
ShowFpsDisplay,
|
ShowFpsDisplay,
|
||||||
|
15
osu.Game/Configuration/SelectionRandomType.cs
Normal file
15
osu.Game/Configuration/SelectionRandomType.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace osu.Game.Configuration
|
||||||
|
{
|
||||||
|
public enum SelectionRandomType
|
||||||
|
{
|
||||||
|
[Description("Never repeat")]
|
||||||
|
RandomPermutation,
|
||||||
|
[Description("Random")]
|
||||||
|
Random
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,6 @@ namespace osu.Game.Graphics.Containers
|
|||||||
public class ReverseDepthFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
public class ReverseDepthFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
||||||
{
|
{
|
||||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
||||||
protected override IEnumerable<T> FlowingChildren => base.FlowingChildren.Reverse();
|
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
private Container cursorContainer;
|
private Container cursorContainer;
|
||||||
private Bindable<double> cursorScale;
|
private Bindable<double> cursorScale;
|
||||||
|
private const float base_scale = 0.15f;
|
||||||
|
|
||||||
public Sprite AdditiveLayer;
|
public Sprite AdditiveLayer;
|
||||||
|
|
||||||
@ -108,17 +109,15 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
cursorContainer = new Container
|
cursorContainer = new Container
|
||||||
{
|
{
|
||||||
Size = new Vector2(32),
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
FillMode = FillMode.Fit,
|
|
||||||
Texture = textures.Get(@"Cursor/menu-cursor"),
|
Texture = textures.Get(@"Cursor/menu-cursor"),
|
||||||
},
|
},
|
||||||
AdditiveLayer = new Sprite
|
AdditiveLayer = new Sprite
|
||||||
{
|
{
|
||||||
FillMode = FillMode.Fit,
|
|
||||||
BlendingMode = BlendingMode.Additive,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Colour = colour.Pink,
|
Colour = colour.Pink,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
@ -129,7 +128,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
||||||
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale);
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
93
osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
Normal file
93
osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Cursor
|
||||||
|
{
|
||||||
|
public class OsuTooltipContainer : TooltipContainer
|
||||||
|
{
|
||||||
|
protected override Tooltip CreateTooltip() => new OsuTooltip();
|
||||||
|
|
||||||
|
public OsuTooltipContainer(CursorContainer cursor) : base(cursor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OsuTooltip : Tooltip
|
||||||
|
{
|
||||||
|
private readonly Box background;
|
||||||
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
|
public override string TooltipText
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == text.Text) return;
|
||||||
|
|
||||||
|
text.Text = value;
|
||||||
|
if (Alpha > 0)
|
||||||
|
{
|
||||||
|
AutoSizeDuration = 250;
|
||||||
|
background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
AutoSizeDuration = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private const float text_size = 16;
|
||||||
|
|
||||||
|
public OsuTooltip()
|
||||||
|
{
|
||||||
|
AutoSizeEasing = EasingTypes.OutQuint;
|
||||||
|
|
||||||
|
CornerRadius = 5;
|
||||||
|
Masking = true;
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Colour = Color4.Black.Opacity(40),
|
||||||
|
Radius = 5,
|
||||||
|
};
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
background = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0.9f,
|
||||||
|
},
|
||||||
|
text = new OsuSpriteText
|
||||||
|
{
|
||||||
|
TextSize = text_size,
|
||||||
|
Padding = new MarginPadding(5),
|
||||||
|
Font = @"Exo2.0-Regular",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colour)
|
||||||
|
{
|
||||||
|
background.Colour = colour.Gray3;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopIn()
|
||||||
|
{
|
||||||
|
FadeIn(500, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
using (BeginDelayedSequence(150))
|
||||||
|
FadeOut(500, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,157 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Cursor;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Input;
|
|
||||||
using osu.Framework.Threading;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
|
||||||
{
|
|
||||||
public class TooltipContainer : Container
|
|
||||||
{
|
|
||||||
private readonly CursorContainer cursor;
|
|
||||||
private readonly Tooltip tooltip;
|
|
||||||
|
|
||||||
private ScheduledDelegate findTooltipTask;
|
|
||||||
private UserInputManager inputManager;
|
|
||||||
|
|
||||||
private const int default_appear_delay = 220;
|
|
||||||
|
|
||||||
private IHasTooltip currentlyDisplayed;
|
|
||||||
|
|
||||||
public TooltipContainer(CursorContainer cursor)
|
|
||||||
{
|
|
||||||
this.cursor = cursor;
|
|
||||||
AlwaysPresent = true;
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
|
||||||
Add(tooltip = new Tooltip { Alpha = 0 });
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(UserInputManager input)
|
|
||||||
{
|
|
||||||
inputManager = input;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
if (tooltip.IsPresent)
|
|
||||||
{
|
|
||||||
if (currentlyDisplayed != null)
|
|
||||||
tooltip.TooltipText = currentlyDisplayed.TooltipText;
|
|
||||||
|
|
||||||
//update the position of the displayed tooltip.
|
|
||||||
tooltip.Position = ToLocalSpace(cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre) + new Vector2(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
|
|
||||||
{
|
|
||||||
updateTooltipState(state);
|
|
||||||
return base.OnMouseUp(state, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state)
|
|
||||||
{
|
|
||||||
updateTooltipState(state);
|
|
||||||
return base.OnMouseMove(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTooltipState(InputState state)
|
|
||||||
{
|
|
||||||
if (currentlyDisplayed?.Hovering != true)
|
|
||||||
{
|
|
||||||
if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed)
|
|
||||||
{
|
|
||||||
tooltip.Delay(150);
|
|
||||||
tooltip.FadeOut(500, EasingTypes.OutQuint);
|
|
||||||
currentlyDisplayed = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
findTooltipTask?.Cancel();
|
|
||||||
findTooltipTask = Scheduler.AddDelayed(delegate
|
|
||||||
{
|
|
||||||
var tooltipTarget = inputManager.HoveredDrawables.OfType<IHasTooltip>().FirstOrDefault();
|
|
||||||
|
|
||||||
if (tooltipTarget == null) return;
|
|
||||||
|
|
||||||
tooltip.TooltipText = tooltipTarget.TooltipText;
|
|
||||||
tooltip.FadeIn(500, EasingTypes.OutQuint);
|
|
||||||
|
|
||||||
currentlyDisplayed = tooltipTarget;
|
|
||||||
}, (1 - tooltip.Alpha) * default_appear_delay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Tooltip : Container
|
|
||||||
{
|
|
||||||
private readonly Box background;
|
|
||||||
private readonly OsuSpriteText text;
|
|
||||||
|
|
||||||
public string TooltipText
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == text.Text) return;
|
|
||||||
|
|
||||||
text.Text = value;
|
|
||||||
if (Alpha > 0)
|
|
||||||
{
|
|
||||||
AutoSizeDuration = 250;
|
|
||||||
background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
AutoSizeDuration = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool HandleInput => false;
|
|
||||||
|
|
||||||
private const float text_size = 16;
|
|
||||||
|
|
||||||
public Tooltip()
|
|
||||||
{
|
|
||||||
AutoSizeEasing = EasingTypes.OutQuint;
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
CornerRadius = 5;
|
|
||||||
Masking = true;
|
|
||||||
EdgeEffect = new EdgeEffect
|
|
||||||
{
|
|
||||||
Type = EdgeEffectType.Shadow,
|
|
||||||
Colour = Color4.Black.Opacity(40),
|
|
||||||
Radius = 5,
|
|
||||||
};
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
background = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0.9f,
|
|
||||||
},
|
|
||||||
text = new OsuSpriteText
|
|
||||||
{
|
|
||||||
TextSize = text_size,
|
|
||||||
Padding = new MarginPadding(5),
|
|
||||||
Font = @"Exo2.0-Regular",
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colour)
|
|
||||||
{
|
|
||||||
background.Colour = colour.Gray3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics
|
|
||||||
{
|
|
||||||
public interface IHasTooltip : IDrawable
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Tooltip that shows when hovering the drawable
|
|
||||||
/// </summary>
|
|
||||||
string TooltipText { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
},
|
},
|
||||||
new OsuSpriteText {
|
Label = new OsuSpriteText {
|
||||||
Text = text,
|
Text = text,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
@ -85,6 +85,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private Color4? accentColour;
|
private Color4? accentColour;
|
||||||
|
|
||||||
protected readonly TextAwesome Chevron;
|
protected readonly TextAwesome Chevron;
|
||||||
|
protected readonly OsuSpriteText Label;
|
||||||
|
|
||||||
protected override void FormatForeground(bool hover = false)
|
protected override void FormatForeground(bool hover = false)
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
|
@ -158,7 +158,7 @@ namespace osu.Game
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Cursor = new MenuCursor(),
|
Cursor = new MenuCursor(),
|
||||||
new TooltipContainer(Cursor) { Depth = -1 },
|
new OsuTooltipContainer(Cursor) { Depth = -1 },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
@ -43,11 +44,15 @@ namespace osu.Game.Overlays.Chat
|
|||||||
channel.NewMessagesArrived += newMessagesArrived;
|
channel.NewMessagesArrived += newMessagesArrived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
newMessagesArrived(Channel.Messages);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
newMessagesArrived(Channel.Messages);
|
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,13 +64,13 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
private void newMessagesArrived(IEnumerable<Message> newMessages)
|
private void newMessagesArrived(IEnumerable<Message> newMessages)
|
||||||
{
|
{
|
||||||
if (!IsLoaded) return;
|
|
||||||
|
|
||||||
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
||||||
|
|
||||||
//up to last Channel.MAX_HISTORY messages
|
//up to last Channel.MAX_HISTORY messages
|
||||||
flow.Add(displayMessages.Select(m => new ChatLine(m)));
|
flow.Add(displayMessages.Select(m => new ChatLine(m)));
|
||||||
|
|
||||||
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any())
|
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any())
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
|
|
||||||
|
@ -266,20 +266,30 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
if (channelTabs.ChannelSelectorActive) return;
|
if (channelTabs.ChannelSelectorActive) return;
|
||||||
|
|
||||||
if (currentChannel != null)
|
|
||||||
currentChannelContainer.Clear(false);
|
|
||||||
|
|
||||||
currentChannel = value;
|
currentChannel = value;
|
||||||
|
|
||||||
|
inputTextBox.Current.Disabled = currentChannel.ReadOnly;
|
||||||
|
channelTabs.Current.Value = value;
|
||||||
|
|
||||||
var loaded = loadedChannels.Find(d => d.Channel == value);
|
var loaded = loadedChannels.Find(d => d.Channel == value);
|
||||||
if (loaded == null)
|
if (loaded == null)
|
||||||
loadedChannels.Add(loaded = new DrawableChannel(currentChannel));
|
{
|
||||||
|
currentChannelContainer.FadeOut(500, EasingTypes.OutQuint);
|
||||||
inputTextBox.Current.Disabled = currentChannel.ReadOnly;
|
|
||||||
|
|
||||||
|
loaded = new DrawableChannel(currentChannel);
|
||||||
|
loadedChannels.Add(loaded);
|
||||||
|
LoadComponentAsync(loaded, l =>
|
||||||
|
{
|
||||||
|
currentChannelContainer.Clear(false);
|
||||||
|
currentChannelContainer.Add(l);
|
||||||
|
currentChannelContainer.FadeIn(500, EasingTypes.OutQuint);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentChannelContainer.Clear(false);
|
||||||
currentChannelContainer.Add(loaded);
|
currentChannelContainer.Add(loaded);
|
||||||
|
}
|
||||||
channelTabs.Current.Value = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Graphics;
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
LabelText = "up to",
|
LabelText = "up to",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum)
|
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum)
|
||||||
},
|
},
|
||||||
|
new SettingsEnumDropdown<SelectionRandomType>
|
||||||
|
{
|
||||||
|
LabelText = "Random beatmap selection",
|
||||||
|
Bindable = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,8 +345,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
{
|
{
|
||||||
public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
|
public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
|
||||||
{
|
{
|
||||||
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = UserDropdownHeader.LABEL_LEFT_MARGIN, Right = 5 };
|
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
|
||||||
Chevron.Margin = new MarginPadding { Left = 2, Right = 3 };
|
Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 };
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
osu.Game/Rulesets/Mods/ModDaycore.cs
Normal file
25
osu.Game/Rulesets/Mods/ModDaycore.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mods
|
||||||
|
{
|
||||||
|
public abstract class ModDaycore : ModHalfTime
|
||||||
|
{
|
||||||
|
public override string Name => "Daycore";
|
||||||
|
public override FontAwesome Icon => FontAwesome.fa_question;
|
||||||
|
public override string Description => "whoaaaaa";
|
||||||
|
|
||||||
|
public override void ApplyToClock(IAdjustableClock clock)
|
||||||
|
{
|
||||||
|
var pitchAdjust = clock as IHasPitchAdjust;
|
||||||
|
if (pitchAdjust != null)
|
||||||
|
pitchAdjust.PitchAdjust = 0.75;
|
||||||
|
else
|
||||||
|
base.ApplyToClock(clock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
|
|
||||||
public void ApplyToClock(IAdjustableClock clock)
|
public virtual void ApplyToClock(IAdjustableClock clock)
|
||||||
{
|
{
|
||||||
clock.Rate = 0.75;
|
clock.Rate = 0.75;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
@ -17,6 +18,7 @@ using System.Diagnostics;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -70,6 +72,9 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private readonly List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
private readonly List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
||||||
|
|
||||||
|
private Bindable<SelectionRandomType> randomType;
|
||||||
|
private readonly List<BeatmapGroup> seenGroups = new List<BeatmapGroup>();
|
||||||
|
|
||||||
private readonly List<Panel> panels = new List<Panel>();
|
private readonly List<Panel> panels = new List<Panel>();
|
||||||
|
|
||||||
private BeatmapGroup selectedGroup;
|
private BeatmapGroup selectedGroup;
|
||||||
@ -167,11 +172,26 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public void SelectRandom()
|
public void SelectRandom()
|
||||||
{
|
{
|
||||||
List<BeatmapGroup> visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden).ToList();
|
IEnumerable<BeatmapGroup> visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden);
|
||||||
if (visibleGroups.Count < 1)
|
if (!visibleGroups.Any())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)];
|
BeatmapGroup group;
|
||||||
|
if (randomType == SelectionRandomType.RandomPermutation)
|
||||||
|
{
|
||||||
|
IEnumerable<BeatmapGroup> notSeenGroups = visibleGroups.Except(seenGroups);
|
||||||
|
if (!notSeenGroups.Any())
|
||||||
|
{
|
||||||
|
seenGroups.Clear();
|
||||||
|
notSeenGroups = visibleGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
group = notSeenGroups.ElementAt(RNG.Next(notSeenGroups.Count()));
|
||||||
|
seenGroups.Add(group);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
group = visibleGroups.ElementAt(RNG.Next(visibleGroups.Count()));
|
||||||
|
|
||||||
BeatmapPanel panel = group.BeatmapPanels[RNG.Next(group.BeatmapPanels.Count)];
|
BeatmapPanel panel = group.BeatmapPanels[RNG.Next(group.BeatmapPanels.Count)];
|
||||||
|
|
||||||
selectGroup(group, panel);
|
selectGroup(group, panel);
|
||||||
@ -239,9 +259,10 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(BeatmapDatabase database)
|
private void load(BeatmapDatabase database, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.database = database;
|
this.database = database;
|
||||||
|
randomType = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addGroup(BeatmapGroup group)
|
private void addGroup(BeatmapGroup group)
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
|
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
|
||||||
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
|
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\IconButton.cs" />
|
<Compile Include="Graphics\UserInterface\IconButton.cs" />
|
||||||
|
<Compile Include="Configuration\SelectionRandomType.cs" />
|
||||||
<Compile Include="Online\API\Requests\PostMessageRequest.cs" />
|
<Compile Include="Online\API\Requests\PostMessageRequest.cs" />
|
||||||
<Compile Include="Online\Chat\ErrorMessage.cs" />
|
<Compile Include="Online\Chat\ErrorMessage.cs" />
|
||||||
<Compile Include="Overlays\Chat\ChatTabControl.cs" />
|
<Compile Include="Overlays\Chat\ChatTabControl.cs" />
|
||||||
@ -106,7 +107,6 @@
|
|||||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
||||||
<Compile Include="Graphics\Cursor\GameplayCursor.cs" />
|
<Compile Include="Graphics\Cursor\GameplayCursor.cs" />
|
||||||
<Compile Include="Graphics\IHasAccentColour.cs" />
|
<Compile Include="Graphics\IHasAccentColour.cs" />
|
||||||
<Compile Include="Graphics\IHasTooltip.cs" />
|
|
||||||
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
||||||
<Compile Include="Graphics\Transforms\TransformAccent.cs" />
|
<Compile Include="Graphics\Transforms\TransformAccent.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
||||||
@ -119,7 +119,7 @@
|
|||||||
<Compile Include="Graphics\UserInterface\OsuTextBox.cs" />
|
<Compile Include="Graphics\UserInterface\OsuTextBox.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\SimpleComboCounter.cs" />
|
<Compile Include="Graphics\UserInterface\SimpleComboCounter.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\TwoLayerButton.cs" />
|
<Compile Include="Graphics\UserInterface\TwoLayerButton.cs" />
|
||||||
<Compile Include="Graphics\Cursor\TooltipContainer.cs" />
|
<Compile Include="Graphics\Cursor\OsuTooltipContainer.cs" />
|
||||||
<Compile Include="Input\Handlers\ReplayInputHandler.cs" />
|
<Compile Include="Input\Handlers\ReplayInputHandler.cs" />
|
||||||
<Compile Include="IO\Legacy\ILegacySerializable.cs" />
|
<Compile Include="IO\Legacy\ILegacySerializable.cs" />
|
||||||
<Compile Include="IO\Legacy\SerializationReader.cs" />
|
<Compile Include="IO\Legacy\SerializationReader.cs" />
|
||||||
@ -127,6 +127,7 @@
|
|||||||
<Compile Include="IO\Serialization\IJsonSerializable.cs" />
|
<Compile Include="IO\Serialization\IJsonSerializable.cs" />
|
||||||
<Compile Include="IPC\ScoreIPCChannel.cs" />
|
<Compile Include="IPC\ScoreIPCChannel.cs" />
|
||||||
<Compile Include="Rulesets\BeatmapStatistic.cs" />
|
<Compile Include="Rulesets\BeatmapStatistic.cs" />
|
||||||
|
<Compile Include="Rulesets\Mods\ModDaycore.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHit.cs" />
|
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHit.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHitObjectParser.cs" />
|
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHitObjectParser.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertSlider.cs" />
|
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertSlider.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user