Skip to content

Commit

Permalink
add enable for setting cut-direction and notes placement
Browse files Browse the repository at this point in the history
  • Loading branch information
tmokmss committed Oct 14, 2018
1 parent c30f235 commit 2ba0f15
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Osu2Saber/Model/Algorithm/ConvertAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Osu2Saber.Model.Algorithm
class ConvertAlgorithm
{
public static bool HandleHitSlider = false;
public static bool NoDirectionAndPlacement = false;

protected const float OsuScreenXMax = 512, OsuScreenYMax = 384;

Expand Down Expand Up @@ -126,10 +127,19 @@ void AddNote(int timeMs, float posx, float posy)
// just map notes position to BS screen
var line = (int)Math.Floor(x / (OsuScreenXMax + 1) * (double)Line.MaxNum);
var layer = (int)Math.Floor(y / (OsuScreenYMax + 1) * (double)Layer.MaxNum);

if (NoDirectionAndPlacement)
{
if (!isMania) return (0, 0);
layer = DetermineLayerMania(line);
return (line, layer);
}

if (isMania) layer = DetermineLayerMania(line);

layer = SlideLayer(line, layer, y);
return (line: line, layer: layer);

return (line, layer);
}

int beforeLayerLeft = 0, beforeLayerRight = 0;
Expand Down Expand Up @@ -270,6 +280,7 @@ protected int ConvertBeat(double timeBeat)
#region Process for cut direction
void SetCutDirection()
{
if (NoDirectionAndPlacement) return;
var n = Notes.Count;
if (n == 0) return;
var rightNotes = Notes.Where(note => note._type == (int)(NoteType.Blue)).ToList();
Expand Down
1 change: 1 addition & 0 deletions Osu2Saber/View/ConfigPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Label Content="Max." HorizontalAlignment="Left" Margin="10,65,0,0" VerticalAlignment="Top" Visibility="Hidden"/>
<CheckBox IsChecked="{Binding PreferHarder}" Content="Prefer harder maps" HorizontalAlignment="Left" Margin="10,103,0,0" VerticalAlignment="Top" ToolTip="Prioritize harder beatmaps when there're more than 5 beatmaps"/>
<CheckBox IsChecked="{Binding HandleHitSlider}" Content="Don't ignore Hit Slider" HorizontalAlignment="Left" Margin="10,134,0,0" VerticalAlignment="Top" ToolTip="By default, hit sliders are ignored because they make a map too difficult. However, some maps get better with them. Just try it!"/>
<CheckBox IsChecked="{Binding NoDirectionAndPlacement}" Content="No cut-direction &amp; scattared-placement" HorizontalAlignment="Left" Margin="10,164,0,0" VerticalAlignment="Top" ToolTip="For mappers, this option generates only notes without setting any cut direction or scattared placement"/>

</Grid>
</UserControl>
6 changes: 6 additions & 0 deletions Osu2Saber/ViewModel/ConfigPanelViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,11 @@ public bool HandleHitSlider
set { ConvertAlgorithm.HandleHitSlider = value; }
get => ConvertAlgorithm.HandleHitSlider;
}

public bool NoDirectionAndPlacement
{
set { ConvertAlgorithm.NoDirectionAndPlacement = value; }
get => ConvertAlgorithm.NoDirectionAndPlacement;
}
}
}

0 comments on commit 2ba0f15

Please sign in to comment.