diff --git a/src/TrackerCouncil.Smz3.Data/Options/GeneralOptions.cs b/src/TrackerCouncil.Smz3.Data/Options/GeneralOptions.cs index fd36c0499..5ef033898 100644 --- a/src/TrackerCouncil.Smz3.Data/Options/GeneralOptions.cs +++ b/src/TrackerCouncil.Smz3.Data/Options/GeneralOptions.cs @@ -64,6 +64,7 @@ public class GeneralOptions : INotifyPropertyChanged public bool TrackerHintsEnabled { get; set; } public bool TrackerSpoilersEnabled { get; set; } + public bool TrackerTimerEnabled { get; set; } = true; public EmulatorConnectorType AutoTrackerDefaultConnectionType { get; set; } @@ -256,7 +257,8 @@ public bool Validate() GanonsTowerGuessingGameStyle = GanonsTowerGuessingGameStyle, SpeechRecognitionMode = SpeechRecognitionMode, PushToTalkKey = PushToTalkKey, - PushToTalkDevice = PushToTalkDevice + PushToTalkDevice = PushToTalkDevice, + TrackerTimerEnabled = TrackerTimerEnabled }; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) diff --git a/src/TrackerCouncil.Smz3.Data/Options/TrackerOptions.cs b/src/TrackerCouncil.Smz3.Data/Options/TrackerOptions.cs index d54cb801e..3f9e07adb 100644 --- a/src/TrackerCouncil.Smz3.Data/Options/TrackerOptions.cs +++ b/src/TrackerCouncil.Smz3.Data/Options/TrackerOptions.cs @@ -139,4 +139,9 @@ public record TrackerOptions /// Device to be used for push to talk mode /// public string PushToTalkDevice { get; set; } = "Default"; + + /// + /// Whether the timer should be displayed and timer voice lines should be enabled + /// + public bool TrackerTimerEnabled { get; set; } = true; } diff --git a/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowTrackerOptions.cs b/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowTrackerOptions.cs index 1fc5435a4..c5b91dd0b 100644 --- a/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowTrackerOptions.cs +++ b/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowTrackerOptions.cs @@ -72,5 +72,8 @@ public class OptionsWindowTrackerOptions [DynamicFormFieldCheckBox(checkBoxText: "Enable spoilers", groupName: "Bottom", platforms: DynamicFormPlatform.Windows)] public bool TrackerSpoilersEnabled { get; set; } = true; + [DynamicFormFieldCheckBox(checkBoxText: "Enable timer", groupName: "Bottom")] + public bool TrackerTimerEnabled { get; set; } = true; + public Dictionary AudioDevices { get; set; } = new(); } diff --git a/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowViewModel.cs b/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowViewModel.cs index cbf51f47d..1a8eb7686 100644 --- a/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowViewModel.cs +++ b/src/TrackerCouncil.Smz3.Data/ViewModels/OptionsWindowViewModel.cs @@ -53,6 +53,7 @@ public OptionsWindowViewModel(GeneralOptions options, Dictionary TrackerOptions.TrackerHintsEnabled = options.TrackerHintsEnabled; TrackerOptions.TrackerSpoilersEnabled = options.TrackerSpoilersEnabled; TrackerOptions.AudioDevices = audioInputDevices; + TrackerOptions.TrackerTimerEnabled = options.TrackerTimerEnabled; TwitchIntegration.TwitchUserName = options.TwitchUserName; TwitchIntegration.TwitchChannel = options.TwitchChannel; @@ -101,6 +102,7 @@ public void UpdateOptions(GeneralOptions options) options.AutoSaveLookAtEvents = TrackerOptions.AutoSaveLookAtEvents; options.TrackerHintsEnabled = TrackerOptions.TrackerHintsEnabled; options.TrackerSpoilersEnabled = TrackerOptions.TrackerSpoilersEnabled; + options.TrackerTimerEnabled = TrackerOptions.TrackerTimerEnabled; options.TwitchUserName = TwitchIntegration.TwitchUserName; options.TwitchChannel = TwitchIntegration.TwitchChannel; diff --git a/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MetaModule.cs b/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MetaModule.cs index 8ad91022c..5c7461ee8 100644 --- a/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MetaModule.cs +++ b/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MetaModule.cs @@ -201,20 +201,23 @@ public override void AddCommands() } }); - AddCommand("Pause timer", GetPauseTimerRule(), (_) => + if (TrackerBase.Options.TrackerTimerEnabled) { - TrackerBase.PauseTimer(); - }); + AddCommand("Pause timer", GetPauseTimerRule(), (_) => + { + TrackerBase.PauseTimer(); + }); - AddCommand("Start timer", GetResumeTimerRule(), (_) => - { - TrackerBase.StartTimer(); - }); + AddCommand("Start timer", GetResumeTimerRule(), (_) => + { + TrackerBase.StartTimer(); + }); - AddCommand("Reset timer", GetResetTimerRule(), (_) => - { - TrackerBase.ResetTimer(); - }); + AddCommand("Reset timer", GetResetTimerRule(), (_) => + { + TrackerBase.ResetTimer(); + }); + } AddCommand("Mute", GetMuteRule(), (_) => { diff --git a/src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs b/src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs index cc88da576..26e775cef 100644 --- a/src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs +++ b/src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs @@ -61,6 +61,7 @@ public TrackerWindowViewModel GetViewModel(TrackerWindow parent) _model.Background = new SolidColorBrush(Color.FromArgb(bytes[0], bytes[1], bytes[2], bytes[3])); _model.OpenTrackWindow = Options.GeneralOptions.DisplayMsuTrackWindow; _model.AddShadows = Options.GeneralOptions.TrackerShadows; + _model.DisplayTimer = Options.GeneralOptions.TrackerTimerEnabled; LocationViewModel.KeyImage = uiService.GetSpritePath("Items", "key.png", out _); RegionViewModel.ChestImage = uiService.GetSpritePath("Items", "chest.png", out _); diff --git a/src/TrackerCouncil.Smz3.UI/ViewModels/TrackerWindowViewModel.cs b/src/TrackerCouncil.Smz3.UI/ViewModels/TrackerWindowViewModel.cs index 47b325677..d411f7df6 100644 --- a/src/TrackerCouncil.Smz3.UI/ViewModels/TrackerWindowViewModel.cs +++ b/src/TrackerCouncil.Smz3.UI/ViewModels/TrackerWindowViewModel.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Avalonia.Media; using AvaloniaControls.Models; @@ -46,7 +47,7 @@ public class TrackerWindowViewModel : ViewModelBase [ReactiveLinkedProperties(nameof(StatusBarBackground), nameof(StatusBarBorder))] public bool IsInGoMode { get; set; } - [Reactive] public bool ShowSpeechRecognition { get; set; } = true; + public bool ShowSpeechRecognition => OperatingSystem.IsWindows(); [Reactive] public string SpeechConfidence { get; set; } = "Voice Disabled"; @@ -55,6 +56,7 @@ public class TrackerWindowViewModel : ViewModelBase [Reactive] [ReactiveLinkedProperties(nameof(SpeechToolTip), nameof(SpeechIcon))] public bool VoiceEnabled { get; set; } + public bool DisplayTimer { get; set; } public string SpeechToolTip => VoiceEnabled ? "Confidence of last recognized voice command. Double click to disable voice recognition." : "Voice recognition disabled. Double click to attempt to enable voice recognition."; diff --git a/src/TrackerCouncil.Smz3.UI/Views/TrackerWindow.axaml b/src/TrackerCouncil.Smz3.UI/Views/TrackerWindow.axaml index 7c63f492b..a20f7ea66 100644 --- a/src/TrackerCouncil.Smz3.UI/Views/TrackerWindow.axaml +++ b/src/TrackerCouncil.Smz3.UI/Views/TrackerWindow.axaml @@ -57,6 +57,8 @@ PointerPressed="TimeTextBlock_OnPointerPressed" ToolTip.Tip="Elapsed time. Right click to pause/resume. Double click to reset." Background="Transparent" + Margin="0 0 10 0" + IsVisible="{Binding DisplayTimer}" > - +