-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
182 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using BeatSaberMarkupLanguage; | ||
using BeatSaberMarkupLanguage.MenuButtons; | ||
|
||
namespace SliceVisualizer.UI | ||
{ | ||
internal class SettingsUI | ||
{ | ||
public static SliceVisualizerFlowCoordinator? SliceVisualizerFlowCoordinator; | ||
public static bool Created; | ||
|
||
public static void CreateMenu() | ||
{ | ||
if (!Created) | ||
{ | ||
var menuButton = new MenuButton("SliceVisualizer", "Chase the perfect slice", ShowFlow); | ||
MenuButtons.instance.RegisterButton(menuButton); | ||
Created = true; | ||
} | ||
} | ||
|
||
public static void ShowFlow() | ||
{ | ||
if (SliceVisualizerFlowCoordinator == null) | ||
{ | ||
SliceVisualizerFlowCoordinator = BeatSaberUI.CreateFlowCoordinator<SliceVisualizerFlowCoordinator>(); | ||
} | ||
BeatSaberUI.MainFlowCoordinator.PresentFlowCoordinator(SliceVisualizerFlowCoordinator); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using BeatSaberMarkupLanguage; | ||
using HMUI; | ||
using SliceVisualizer.ViewControllers; | ||
|
||
namespace SliceVisualizer.UI | ||
{ | ||
internal class SliceVisualizerFlowCoordinator : FlowCoordinator | ||
{ | ||
private MainViewController? _mainViewController; | ||
// private BindingsViewController _bindingsViewController; | ||
// private MiscViewController _miscViewController; | ||
// private ThresholdViewController _thresholdViewController; | ||
|
||
public void Awake() | ||
{ | ||
if (!_mainViewController) | ||
{ | ||
_mainViewController = BeatSaberUI.CreateViewController<MainViewController>(); | ||
} | ||
} | ||
|
||
protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) | ||
{ | ||
try | ||
{ | ||
if (firstActivation) | ||
{ | ||
SetTitle("SliceVisualizer settings"); | ||
showBackButton = true; | ||
ProvideInitialViewControllers(_mainViewController); | ||
} | ||
_mainViewController?.Activated(); | ||
} | ||
catch (Exception e) | ||
{ | ||
Plugin.Log.Error(e); | ||
} | ||
} | ||
|
||
protected override void BackButtonWasPressed(ViewController topViewController) | ||
{ | ||
BeatSaberUI.MainFlowCoordinator.DismissFlowCoordinator(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using BeatSaberMarkupLanguage.Attributes; | ||
using BeatSaberMarkupLanguage.ViewControllers; | ||
using SliceVisualizer.Configuration; | ||
|
||
namespace SliceVisualizer.ViewControllers | ||
{ | ||
internal class MainViewController : BSMLResourceViewController | ||
{ | ||
public void Activated() | ||
{ | ||
NotifyPropertyChanged("EnabledValue"); | ||
} | ||
[UIValue("Enabled-value")] | ||
public bool EnabledValue | ||
{ | ||
get => PluginConfig.Instance.Enabled; | ||
set | ||
{ | ||
PluginConfig.Instance.Enabled = value; | ||
} | ||
} | ||
|
||
public override string ResourceName => "SliceVisualizer.Views.Main.bsml"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vertical child-control-height='false'> | ||
<horizontal horizontal-fit='PreferredSize' spacing='10'> | ||
<checkbox-setting | ||
preferred-width='60' | ||
text='Enabled' | ||
value='Enabled-value' | ||
apply-on-change='true' | ||
hover-hint='Enable SliceVisualizer' /> | ||
</horizontal> | ||
</vertical> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,11 @@ | |
"id": "SliceVisualizer", | ||
"name": "SliceVisualizer", | ||
"author": "Igor null <[email protected]>", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"description": "Shows your cut data to train your accuracy", | ||
"gameVersion": "1.13.2", | ||
"dependsOn": { | ||
"BeatSaberMarkupLanguage": "^1.4.5", | ||
"BSIPA": "^4.1.4", | ||
"SiraUtil": "^2.4.0" | ||
} | ||
|