Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Mar 7, 2024
1 parent 134f263 commit 553c85c
Show file tree
Hide file tree
Showing 7 changed files with 1,606 additions and 1,576 deletions.
5 changes: 3 additions & 2 deletions OngekiFumenEditor/Base/OngekiObjects/BulletPallete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ public double CalculateToXGridTotalUnit(IBulletPalleteReferencable refObject, On
var randomOffset = 0;
if (RandomOffsetRange > 0)
{
var id = ((OngekiObjectBase)refObject).Id;
//不想用Random类,直接异或计算吧
var seed = (60045 * Id + 123) % 2147483648 * Id ^ Id;
var seed = Math.Abs((RandomSeed * id + 123) * id ^ id);
var r = RandomOffsetRange;
randomOffset = (-r) + (int)(seed % (r - (-r) + 1));
randomOffset = (-r) + (seed % (r - (-r) + 1));
}

return xGridTotalUnit + randomOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:OngekiFumenEditor.Modules.FumenMetaInfoBrowser.Views"
xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:res="clr-namespace:OngekiFumenEditor.Properties" xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup"
xmlns:res="clr-namespace:OngekiFumenEditor.Properties"
xmlns:s="clr-namespace:OngekiFumenEditor.Base.OngekiObjects.BulletPalleteEnums"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:valueconverters="clr-namespace:OngekiFumenEditor.Modules.FumenBulletPalleteListViewer.ValueConverters"
Expand Down Expand Up @@ -139,6 +140,14 @@
</GridViewColumn.CellTemplate>
</GridViewColumn>

<GridViewColumn Width="75" Header="{markup:Translate [RandomOffsetRange]}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RandomOffsetRange}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

<!--<GridViewColumn Width="80" Header="辅助线颜色">
<GridViewColumn.CellTemplate>
<DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ public void KeyboardAction_HideOrShow()

public void SwitchMode(bool isPreviewMode)
{
BulletPallete.RandomSeed = DateTime.Now.ToString().GetHashCode();

var tGrid = GetCurrentTGrid();
IsUserRequestHideEditorObject = isPreviewMode;
convertToY = IsDesignMode ?
Expand Down
11 changes: 10 additions & 1 deletion OngekiFumenEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 553c85c

Please sign in to comment.