-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vision filter accessibility option (#889)
* Add option to disable vision filters * Remove DefaultVision in favor of the setting * Clean DeltaTab.xaml.cs
- Loading branch information
Showing
12 changed files
with
112 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<tabs:DeltaTab xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:tabs="clr-namespace:Content.Client.DeltaV.Options.UI.Tabs" | ||
xmlns:xNamespace="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:s="clr-namespace:Content.Client.Stylesheets"> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Vertical" Margin="8 8 8 8" VerticalExpand="True"> | ||
<Label Text="{Loc 'ui-options-general-forknotice'}" | ||
FontColorOverride="{xNamespace:Static s:StyleNano.ConcerningOrangeFore}" | ||
StyleClasses="LabelKeyText"/> | ||
<Label Text="{Loc 'ui-options-general-accessibility'}" | ||
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}" | ||
StyleClasses="LabelKeyText"/> | ||
<CheckBox Name="DisableFiltersCheckBox" Text="{Loc 'ui-options-no-filters'}" /> | ||
</BoxContainer> | ||
<controls:StripeBack HasBottomEdge="False" HasMargins="False"> | ||
<Button Name="ApplyButton" | ||
Text="{Loc 'ui-options-apply'}" | ||
TextAlign="Center" | ||
HorizontalAlignment="Right" /> | ||
</controls:StripeBack> | ||
</BoxContainer> | ||
</tabs:DeltaTab> |
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 Content.Shared.DeltaV.CCVars; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Configuration; | ||
|
||
namespace Content.Client.DeltaV.Options.UI.Tabs; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class DeltaTab : Control | ||
{ | ||
[Dependency] private readonly IConfigurationManager _cfg = default!; | ||
|
||
public DeltaTab() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
|
||
DisableFiltersCheckBox.OnToggled += OnCheckBoxToggled; | ||
DisableFiltersCheckBox.Pressed = _cfg.GetCVar(DCCVars.NoVisionFilters); | ||
|
||
ApplyButton.OnPressed += OnApplyButtonPressed; | ||
UpdateApplyButton(); | ||
} | ||
|
||
private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args) | ||
{ | ||
UpdateApplyButton(); | ||
} | ||
|
||
private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args) | ||
{ | ||
_cfg.SetCVar(DCCVars.NoVisionFilters, DisableFiltersCheckBox.Pressed); | ||
|
||
_cfg.SaveToFile(); | ||
UpdateApplyButton(); | ||
} | ||
|
||
private void UpdateApplyButton() | ||
{ | ||
var isNoVisionFiltersSame = DisableFiltersCheckBox.Pressed == _cfg.GetCVar(DCCVars.NoVisionFilters); | ||
|
||
ApplyButton.Disabled = isNoVisionFiltersSame; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
ui-options-tab-deltav = DeltaV | ||
ui-options-general-forknotice = Note: These settings are fork-specific and might not apply on other servers. | ||
ui-options-no-filters = Disable species vision filters |
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