Change name of option "Custom seed" to "Seed" and set its value to the generated seed

This commit is contained in:
Pasi4K5 2021-05-14 01:50:11 +02:00
parent a9d5211e81
commit ac04e8afa2
1 changed files with 4 additions and 7 deletions

View File

@ -33,8 +33,8 @@ public class OsuModRandom : ModRandom, IApplicableToBeatmap
private const byte border_distance_x = 192;
private const byte border_distance_y = 144;
[SettingSource("Custom seed", "Use a custom seed instead of a random one", SettingControlType = typeof(OsuModRandomSettingsControl))]
public Bindable<int?> CustomSeed { get; } = new Bindable<int?>
[SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(OsuModRandomSettingsControl))]
public Bindable<int?> Seed { get; } = new Bindable<int?>
{
Default = null,
Value = null
@ -45,12 +45,9 @@ public void ApplyToBeatmap(IBeatmap beatmap)
if (!(beatmap is OsuBeatmap osuBeatmap))
return;
var seed = RNG.Next();
Seed.Value ??= RNG.Next();
if (CustomSeed.Value != null)
seed = (int)CustomSeed.Value;
var rng = new Random(seed);
var rng = new Random((int)Seed.Value);
var prevObjectInfo = new HitObjectInfo
{