-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Bird, the Vulp and the Un-Cloneable (#1316)
* Vision filter accessibility option (#889) * Add option to disable vision filters * Remove DefaultVision in favor of the setting * Clean DeltaTab.xaml.cs * Fixing Vulps * Unclonable * Species vision fixes (#1150) Species vision fixes: no losing vision on nearby species vision haver getting gibbed, fix construction overlay * Update DCCVars.cs * Update OptionsMenu.xaml.cs * DeltaV * update * Update vulpkanin.yml --------- Co-authored-by: Debug <[email protected]> Co-authored-by: no <[email protected]>
- Loading branch information
1 parent
517a3d0
commit c89fbf7
Showing
33 changed files
with
301 additions
and
177 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.Abilities; | ||
|
||
namespace Content.Client.Nyanotrasen.Overlays; | ||
|
||
public sealed partial class DogVisionOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] IEntityManager _entityManager = default!; | ||
|
||
|
||
public override bool RequestScreenTexture => true; | ||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
private readonly ShaderInstance _dogVisionShader; | ||
|
||
public DogVisionOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_dogVisionShader = _prototypeManager.Index<ShaderPrototype>("DogVision").Instance().Duplicate(); | ||
} | ||
|
||
protected override bool BeforeDraw(in OverlayDrawArgs args) | ||
{ | ||
if (_playerManager.LocalEntity is not { Valid: true } player | ||
|| !_entityManager.HasComponent<DogVisionComponent>(player)) | ||
{ | ||
return false; | ||
} | ||
|
||
return base.BeforeDraw(in args); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture is null) | ||
return; | ||
|
||
_dogVisionShader.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
|
||
var worldHandle = args.WorldHandle; | ||
var viewport = args.WorldBounds; | ||
worldHandle.SetTransform(Matrix3.Identity); | ||
worldHandle.UseShader(_dogVisionShader); | ||
worldHandle.DrawRect(viewport, Color.White); | ||
worldHandle.UseShader(null); // important - as of writing, construction overlay breaks without 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
45 changes: 0 additions & 45 deletions
45
Content.Client/Nyanotrasen/Overlays/Overlays/DogVisionOverlay.cs
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
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
Oops, something went wrong.