Skip to content

Commit

Permalink
added DisableIfNotesOnScreen option to settings menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniMacaroni committed May 11, 2020
1 parent 77f8398 commit 2d4a03d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
24 changes: 24 additions & 0 deletions TrickSaber/ViewControllers/MiscViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
using System.Collections.Generic;
using System.Linq;
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.Components;
using BeatSaberMarkupLanguage.ViewControllers;
using HMUI;
using UnityEngine;

namespace TrickSaber.ViewControllers
{
internal class MiscViewController : BSMLResourceViewController
{
[UIComponent("scrollable")] private Transform Scrollable;

[UIValue("SpinDirEnum-list")]
public List<object> SpinDirectionsList = Enum.GetNames(typeof(SpinDir)).ToList<object>();

Expand Down Expand Up @@ -65,11 +70,30 @@ public bool SlowmoDuringThrow
set => PluginConfig.Instance.SlowmoDuringThrow = value;
}

[UIValue("DisableIfNotesOnScreen-value")]
public bool DisableIfNotesOnScreen
{
get => PluginConfig.Instance.DisableIfNotesOnScreen;
set => PluginConfig.Instance.DisableIfNotesOnScreen = value;
}

[UIValue("EnableCutting-value")]
public bool EnableCutting
{
get => PluginConfig.Instance.EnableCuttingDuringTrick;
set => PluginConfig.Instance.EnableCuttingDuringTrick = value;
}

[UIAction("#post-parse")]
public void Setup()
{
var viewport = Scrollable.parent.parent as RectTransform;
var container = viewport.parent as RectTransform;

container.anchoredPosition = new Vector2(0, 0);
container.sizeDelta = new Vector2(-4, -4);

viewport.sizeDelta = new Vector2(90, 55);
}
}
}
13 changes: 4 additions & 9 deletions TrickSaber/Views/MiscView.bsml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<vertical child-control-height='false'>
<horizontal bg='panel-top' pad-left='10' pad-right='10' horizontal-fit='PreferredSize'>
<text text='Misc' align='Center' font-size='7'></text>
</horizontal>
<vertical ignore-layout='true' pad-top='14' spacing='0.7'
child-control-height='false' child-expand-height='false'>
<scrollable-settings-container id="scrollable" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='https://monkeymanboy.github.io/BSML-Docs/ https://raw.githubusercontent.com/monkeymanboy/BSML-Docs/gh-pages/BSMLSchema.xsd'>
<list-setting text='Thumbstick direction' value='ThumbDir-value' options='DirEnum-list' apply-on-change='true'
hover-hint='In which direction do I need to move the thumbstick to spin you saber' />
<checkbox-setting text='Is spin speed velocity dependent' value='IsSpeedVelocityDependent-value'
Expand All @@ -21,6 +16,6 @@
integer-only='false' apply-on-change='true' hover-hint='How fast does the saber return' />
<checkbox-setting text='Slowmo during throw' value='SlowmoDuringThrow-value' apply-on-change='true'
hover-hint='!DISABLES SCORE SUBMISSION!' />
<!--<checkbox-setting text='Hit blocks during trick' font-color='red' value='EnableCutting-value' apply-on-change='true' hover-hint='!DISABLES SCORE SUBMISSION!'/>-->
</vertical>
</vertical>
<checkbox-setting text='Disable if notes on screen' value='DisableIfNotesOnScreen-value' apply-on-change='true'
hover-hint='Automatically disable Tricksaber when notes are on screen and enable it when there are none' />
</scrollable-settings-container>

0 comments on commit 2d4a03d

Please sign in to comment.