mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Remove seed from the ScorePanel and "Paste" button
This commit is contained in:
parent
946abfbb83
commit
a9d5211e81
@ -2,12 +2,10 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
@ -52,8 +50,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
if (CustomSeed.Value != null)
|
||||
seed = (int)CustomSeed.Value;
|
||||
|
||||
Seed = seed;
|
||||
|
||||
var rng = new Random(seed);
|
||||
|
||||
var prevObjectInfo = new HitObjectInfo
|
||||
@ -244,9 +240,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
private sealed class SeedControl : CompositeDrawable, IHasCurrentValue<int?>
|
||||
{
|
||||
[Resolved]
|
||||
private GameHost host { get; set; }
|
||||
|
||||
private readonly BindableWithCurrent<int?> current = new BindableWithCurrent<int?>();
|
||||
|
||||
public Bindable<int?> Current
|
||||
@ -289,14 +282,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
CommitOnFocusLost = true
|
||||
},
|
||||
null,
|
||||
new TriangleButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 1,
|
||||
Text = "Paste",
|
||||
Action = () => seedNumberBox.Text = host.GetClipboard().GetText()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,5 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override ModType Type => ModType.Conversion;
|
||||
public override IconUsage? Icon => OsuIcon.Dice;
|
||||
public override double ScoreMultiplier => 1;
|
||||
public int? Seed { get; protected set; }
|
||||
}
|
||||
}
|
||||
|
@ -88,24 +88,6 @@ namespace osu.Game.Scoring
|
||||
}
|
||||
}
|
||||
|
||||
public bool ContainsModOfType<T>(out T mod)
|
||||
{
|
||||
if (mods != null)
|
||||
{
|
||||
foreach (var currentMod in mods)
|
||||
{
|
||||
if (!(currentMod is T modOfType))
|
||||
continue;
|
||||
|
||||
mod = modOfType;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
mod = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Used for API serialisation/deserialisation.
|
||||
[JsonProperty("mods")]
|
||||
[NotMapped]
|
||||
|
@ -7,13 +7,11 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
@ -57,9 +55,6 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
Padding = new MarginPadding(padding);
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private GameHost host { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapDifficultyCache beatmapDifficultyCache)
|
||||
{
|
||||
@ -229,47 +224,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
}
|
||||
}
|
||||
}
|
||||
}.With(t =>
|
||||
{
|
||||
if (!score.ContainsModOfType<ModRandom>(out var mod) || mod.Seed == null)
|
||||
return;
|
||||
|
||||
t.Add(new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Content = new[]
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Margin = new MarginPadding
|
||||
{
|
||||
Top = 3f,
|
||||
Right = 5f
|
||||
},
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Medium),
|
||||
Text = $"Seed: {mod.Seed}"
|
||||
},
|
||||
new TriangleButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 1.2f,
|
||||
Width = 0.5f,
|
||||
Text = "Copy",
|
||||
Action = () => host.GetClipboard().SetText(mod.Seed.ToString())
|
||||
}
|
||||
}
|
||||
},
|
||||
RowDimensions = new[]
|
||||
{
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
new OsuSpriteText
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking.Contracted;
|
||||
using osu.Game.Screens.Ranking.Expanded;
|
||||
@ -207,12 +206,7 @@ namespace osu.Game.Screens.Ranking
|
||||
switch (state)
|
||||
{
|
||||
case PanelState.Expanded:
|
||||
var height = expanded_height;
|
||||
|
||||
if (Score.ContainsModOfType<ModRandom>(out var mod) && mod.Seed != null)
|
||||
height += 20f;
|
||||
|
||||
Size = new Vector2(EXPANDED_WIDTH, height);
|
||||
Size = new Vector2(EXPANDED_WIDTH, expanded_height);
|
||||
|
||||
topLayerBackground.FadeColour(expanded_top_layer_colour, resize_duration, Easing.OutQuint);
|
||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
|
||||
|
Loading…
Reference in New Issue
Block a user