Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Counters+/ConfigModels/Counters/MissedConfigModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ internal class MissedConfigModel : ConfigModel

[UIValue(nameof(CountBadCuts))]
public virtual bool CountBadCuts { get; set; } = true;

[UIValue(nameof(CountChainNoteMisses))]
public virtual bool CountChainNoteMisses { get; set; } = true;

[UIValue(nameof(HideWhenNone))]
public virtual bool HideWhenNone { get; set; } = false;
}
}
31 changes: 29 additions & 2 deletions Counters+/Counters/MissedCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,47 @@ internal class MissedCounter : Counter<MissedConfigModel>, INoteEventHandler
{
private int notesMissed = 0;
private TMP_Text counter;
private TMP_Text label;

public override void CounterInit()
{
GenerateBasicText("Misses", out counter);
label = counter.transform.parent.GetComponentInChildren<TMP_Text>(true);
if (label == counter) label = null;

if (Settings.HideWhenNone && counter != null)
{
counter.enabled = false;
if (label != null) label.enabled = false;
}
}

public void OnNoteCut(NoteData data, NoteCutInfo info)
{
if (Settings.CountBadCuts && !info.allIsOK && data.colorType != ColorType.None) counter.text = (++notesMissed).ToString();
if (Settings.CountBadCuts && !info.allIsOK && data.colorType != ColorType.None)
{
UpdateMissCount();
}
}

public void OnNoteMiss(NoteData data)
{
if (data.colorType != ColorType.None && data.gameplayType != NoteData.GameplayType.BurstSliderElement) counter.text = (++notesMissed).ToString();
if (data.colorType != ColorType.None && (Settings.CountChainNoteMisses || data.gameplayType != NoteData.GameplayType.BurstSliderElement))
{
UpdateMissCount();
}
}

private void UpdateMissCount()
{
notesMissed++;
counter.text = notesMissed.ToString();

if (Settings.HideWhenNone)
{
if (!counter.enabled) counter.enabled = true;
if (label != null && !label.enabled) label.enabled = true;
}
}
}
}
4 changes: 2 additions & 2 deletions Counters+/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.11")]
[assembly: AssemblyFileVersion("2.3.11")]
[assembly: AssemblyVersion("2.3.12")]
[assembly: AssemblyFileVersion("2.3.12")]
2 changes: 2 additions & 0 deletions Counters+/UI/BSML/Config/Missed.bsml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<vertical spacing='1' horizontal-fit='PreferredSize'>
<checkbox-setting text='Include Bad Cuts' apply-on-change='true' value='CountBadCuts' hover-hint='Bad cuts count towards the Missed counter.'/>
<checkbox-setting text='Hidden Until First Miss' apply-on-change='true' value='HideWhenNone' hover-hint='Hide the counter until you have one miss'/>
<checkbox-setting text='Count Chain Links' apply-on-change='true' value='CountChainNoteMisses' hover-hint='Chain links count towards the Missed counter.'/>
</vertical>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace CountersPlus.UI.FlowCoordinators
public class CountersPlusSettingsFlowCoordinator : FlowCoordinator
{
public readonly Vector3 MAIN_SCREEN_OFFSET = new Vector3(0, -4, 0);


[Inject] public List<ConfigModel> AllConfigModels;
[Inject] private CanvasUtility canvasUtility;
Expand All @@ -43,7 +43,7 @@ public class CountersPlusSettingsFlowCoordinator : FlowCoordinator

protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling)
{

if (addedToHierarchy)
{
showBackButton = true;
Expand Down Expand Up @@ -73,7 +73,11 @@ public void DoSceneTransition(Action callback = null)
persistentScenes.Add("MenuCore");

var tutorialSceneSetup = MTHTutorialScenesSetup(ref menuTransitionsHelper); // Grab the scene transition setup data
tutorialSceneSetup.Init(playerDataModel.playerData.playerSpecificSettings);

// Provide the three arguments TutorialScenesTransitionSetupDataSO.Init expects:
var environmentsListModel = EnvironmentsListModel.CreateFromAddressables();
var gameplayAdditionalInformation = new GameplayAdditionalInformation();
tutorialSceneSetup.Init(playerDataModel.playerData.playerSpecificSettings, environmentsListModel, gameplayAdditionalInformation);

menuEnvironmentManager.ShowEnvironmentType(MenuEnvironmentManager.MenuEnvironmentType.None);

Expand Down
36 changes: 18 additions & 18 deletions Counters+/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/bsmg/BSIPA-MetadataFileSchema/master/Schema.json",
"id": "Counters+",
"name": "Counters+",
"author": "Caeden117",
"version": "2.3.11",
"description": "A suite of enhancements for Beat Saber's UI.",
"icon": "CountersPlus.UI.Images.Logo.png",
"gameVersion": "1.40.0",
"dependsOn": {
"BSIPA": "^4.3.5",
"BeatSaberMarkupLanguage": "^1.12.5",
"SiraUtil": "^3.1.14"
},
"features": {
"IPA.DefineFeature": {
"name": "CountersPlus.CustomCounter",
"type": "CountersPlus.Custom.CustomCounterFeature"
"$schema": "https://raw.githubusercontent.com/bsmg/BSIPA-MetadataFileSchema/master/Schema.json",
"id": "Counters+",
"name": "Counters+",
"author": "Caeden117",
"version": "2.3.12",
"description": "A suite of enhancements for Beat Saber's UI.",
"icon": "CountersPlus.UI.Images.Logo.png",
"gameVersion": "1.42.0",
"dependsOn": {
"BSIPA": "^4.3.7",
"BeatSaberMarkupLanguage": "^1.14.1",
"SiraUtil": "^3.3.1"
},
"features": {
"IPA.DefineFeature": {
"name": "CountersPlus.CustomCounter",
"type": "CountersPlus.Custom.CustomCounterFeature"
}
}
}
}