Skip to content

Commit

Permalink
Merge branch 'master' into listening-post-map-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Feb 23, 2024
2 parents 6689915 + da049f7 commit 96ea3cb
Show file tree
Hide file tree
Showing 26 changed files with 253 additions and 65 deletions.
23 changes: 23 additions & 0 deletions Content.Client/DeltaV/Options/UI/Tabs/DeltaTab.xaml
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>
46 changes: 46 additions & 0 deletions Content.Client/DeltaV/Options/UI/Tabs/DeltaTab.xaml.cs
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;
}
}
16 changes: 15 additions & 1 deletion Content.Client/DeltaV/Overlays/UltraVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using Content.Shared.Abilities;
using Content.Shared.DeltaV.CCVars;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;

namespace Content.Client.DeltaV.Overlays;

public sealed partial class UltraVisionSystem : EntitySystem
{
[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

private UltraVisionOverlay _overlay = default!;

Expand All @@ -16,16 +19,27 @@ public override void Initialize()
SubscribeLocalEvent<UltraVisionComponent, ComponentInit>(OnUltraVisionInit);
SubscribeLocalEvent<UltraVisionComponent, ComponentShutdown>(OnUltraVisionShutdown);

Subs.CVar(_cfg, DCCVars.NoVisionFilters, OnNoVisionFiltersChanged);

_overlay = new();
}

private void OnUltraVisionInit(EntityUid uid, UltraVisionComponent component, ComponentInit args)
{
_overlayMan.AddOverlay(_overlay);
if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

private void OnUltraVisionShutdown(EntityUid uid, UltraVisionComponent component, ComponentShutdown args)
{
_overlayMan.RemoveOverlay(_overlay);
}

private void OnNoVisionFiltersChanged(bool enabled)
{
if (enabled)
_overlayMan.RemoveOverlay(_overlay);
else
_overlayMan.AddOverlay(_overlay);
}
}
16 changes: 15 additions & 1 deletion Content.Client/Nyanotrasen/Overlays/DogVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using Content.Shared.Abilities;
using Content.Shared.DeltaV.CCVars;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;

namespace Content.Client.Nyanotrasen.Overlays;

public sealed partial class DogVisionSystem : EntitySystem
{
[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

private DogVisionOverlay _overlay = default!;

Expand All @@ -16,16 +19,27 @@ public override void Initialize()
SubscribeLocalEvent<DogVisionComponent, ComponentInit>(OnDogVisionInit);
SubscribeLocalEvent<DogVisionComponent, ComponentShutdown>(OnDogVisionShutdown);

Subs.CVar(_cfg, DCCVars.NoVisionFilters, OnNoVisionFiltersChanged);

_overlay = new();
}

private void OnDogVisionInit(EntityUid uid, DogVisionComponent component, ComponentInit args)
{
_overlayMan.AddOverlay(_overlay);
if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

private void OnDogVisionShutdown(EntityUid uid, DogVisionComponent component, ComponentShutdown args)
{
_overlayMan.RemoveOverlay(_overlay);
}

private void OnNoVisionFiltersChanged(bool enabled)
{
if (enabled)
_overlayMan.RemoveOverlay(_overlay);
else
_overlayMan.AddOverlay(_overlay);
}
}
2 changes: 2 additions & 0 deletions Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs"
xmlns:dtabs="clr-namespace:Content.Client.DeltaV.Options.UI.Tabs"
Title="{Loc 'ui-options-title'}"
MinSize="800 450">
<TabContainer Name="Tabs" Access="Public">
Expand All @@ -8,5 +9,6 @@
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
<tabs:NetworkTab Name="NetworkTab" />
<dtabs:DeltaTab Name="DeltaTab" />
</TabContainer>
</DefaultWindow>
1 change: 1 addition & 0 deletions Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public OptionsMenu()
Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls"));
Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio"));
Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-network"));
Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-deltav")); // DeltaV specific settings

UpdateTabs();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public FixedPoint2 GetWasteVolume(EntityUid uid, DeepFryerComponent component)
/// </summary>
public FixedPoint2 GetOilPurity(EntityUid uid, DeepFryerComponent component)
{
if (component.Solution.Volume == 0) return 0;
return GetOilVolume(uid, component) / component.Solution.Volume;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ private void OnInvisInit(EntityUid uid, PsionicallyInvisibleComponent component,
_visibilitySystem.AddLayer(uid, visibility, (int) VisibilityFlags.PsionicInvisibility, false);
_visibilitySystem.RemoveLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibilitySystem.RefreshVisibility(uid, visibility);

SetCanSeePsionicInvisiblity(uid, true);
}


Expand All @@ -99,8 +97,6 @@ private void OnInvisShutdown(EntityUid uid, PsionicallyInvisibleComponent compon
_visibilitySystem.AddLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibilitySystem.RefreshVisibility(uid, visibility);
}
if (HasComp<PotentialPsionicComponent>(uid) && !HasComp<PsionicInsulationComponent>(uid))
SetCanSeePsionicInvisiblity(uid, false);
}

private void OnEyeInit(EntityUid uid, EyeComponent component, ComponentInit args)
Expand Down Expand Up @@ -129,7 +125,7 @@ public void SetCanSeePsionicInvisiblity(EntityUid uid, bool set)
{
if (EntityManager.TryGetComponent(uid, out EyeComponent? eye))
{
//_eye.SetVisibilityMask(uid, eye.VisibilityMask & (int) VisibilityFlags.PsionicInvisibility, eye);
_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~ (int) VisibilityFlags.PsionicInvisibility, eye);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/Nyanotrasen/Research/Oracle/OracleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public sealed partial class OracleComponent : Component
[DataField("barkTime")]
public TimeSpan BarkTime = TimeSpan.FromMinutes(1);

[DataField("rejectAccumulator")]
public float RejectAccumulator;

[DataField("rejectTime")]
public TimeSpan RejectTime = TimeSpan.FromSeconds(5);

[ViewVariables(VVAccess.ReadWrite)]
public EntityPrototype DesiredPrototype = default!;

Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Nyanotrasen/Research/Oracle/OracleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public override void Update(float frameTime)
{
oracle.Accumulator += frameTime;
oracle.BarkAccumulator += frameTime;
oracle.RejectAccumulator += frameTime;
if (oracle.BarkAccumulator >= oracle.BarkTime.TotalSeconds)
{
oracle.BarkAccumulator = 0;
Expand Down Expand Up @@ -120,8 +121,12 @@ private void OnInteractUsing(EntityUid uid, OracleComponent component, InteractU

if (!validItem)
{
if (!HasComp<RefillableSolutionComponent>(args.Used))
if (!HasComp<RefillableSolutionComponent>(args.Used) &&
component.RejectAccumulator >= component.RejectTime.TotalSeconds)
{
component.RejectAccumulator = 0;
_chat.TrySendInGameICMessage(uid, _random.Pick(component.RejectMessages), InGameICChatType.Speak, true);
}
return;
}

Expand Down Expand Up @@ -186,6 +191,7 @@ private void NextItem(OracleComponent component)
{
component.Accumulator = 0;
component.BarkAccumulator = 0;
component.RejectAccumulator = 0;
var protoString = GetDesiredItem(component);
if (_prototypeManager.TryIndex<EntityPrototype>(protoString, out var proto))
component.DesiredPrototype = proto;
Expand Down
8 changes: 0 additions & 8 deletions Content.Shared/DeltaV/Abilities/DefaultVisionComponent.cs

This file was deleted.

20 changes: 0 additions & 20 deletions Content.Shared/DeltaV/Abilities/DefaultVisionSystem.cs

This file was deleted.

6 changes: 6 additions & 0 deletions Content.Shared/DeltaV/CCVars/DCCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ public sealed class DCCVars
/// </summary>
public static readonly CVarDef<bool> RoundEndPacifist =
CVarDef.Create("game.round_end_pacifist", false, CVar.SERVERONLY);

/// <summary>
/// Disables all vision filters for species like Vulpkanin or Harpies. There are good reasons someone might want to disable these.
/// </summary>
public static readonly CVarDef<bool> NoVisionFilters =
CVarDef.Create("accessibility.no_vision_filters", false, CVar.CLIENTONLY | CVar.ARCHIVE);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed partial class PsionicRegenerationPowerComponent : Component
public float UseDelay = 8f;
[DataField("soundUse")]

public SoundSpecifier SoundUse = new SoundPathSpecifier("/Audio/Nyanotrasen/heartbeat_fast.ogg");
public SoundSpecifier SoundUse = new SoundPathSpecifier("/Audio/Nyanotrasen/Psionics/heartbeat_fast.ogg");

[DataField("psionicRegenerationActionId",
customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/Nyanotrasen/Psionics/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["heartbeat_fast.ogg"]
license: "CC0-1.0"
copyright: "Taken from greyseraphim via freesound.org"
source: "https://freesound.org/people/greyseraphim/sounds/21409/"
Binary file not shown.
10 changes: 10 additions & 0 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1690,3 +1690,13 @@ Entries:
maintenance.
id: 251
time: '2024-02-21T01:15:08.0000000+00:00'
- author: DebugOk
changes:
- type: Add
message: >-
Added a new accessibility setting to globally disable species vision
filters
- type: Remove
message: The DefaultVision trait has been removed
id: 252
time: '2024-02-23T18:36:18.0000000+00:00'
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/deltav/escape-menu/options-menu.ftl
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
3 changes: 0 additions & 3 deletions Resources/Locale/en-US/deltav/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ trait-deuteranopia-name = Deuteranopia
trait-deuteranopia-desc = Whether through custom bionic eyes, random mutation,
or being a Vulpkanin, you have red–green colour blindness.
trait-defaultvision-name = Normal Vision
trait-defaultvision-desc = You lack any vision variation from the norm for a non-human species.
trait-uncloneable-name = Uncloneable
trait-uncloneable-desc = Cannot be cloned
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
- id: ClothingOuterArmorCaptainCarapace
- id: NukeDisk
- id: PinpointerNuclear
- id: CaptainIDCard
# - id: CaptainIDCard # Delta V - Replaced by spare ID system. The funny biscuit that I cant even eat.
- id: WeaponDisabler
- id: CommsComputerCircuitboard
- id: ClothingHeadsetAltCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
parent: ClothingBackpackSatchelLeather
id: ClothingBackpackMafiaFilled
suffix: Filled, Mafia
# components:
# - type: StorageFill
# contents:
# - id: BoxSurvival
# amount: 1
# - id: ClothingOuterArmorBasic
# amount: 1
## - id: WeaponSubMachineGunTypewriter # That dont fit >:(
## amount: 1
# - id: WeaponPistolViperWood
# amount: 1
## - id: MagazinePistol # Ammo is too expensive nowadays (it causes test fails)
## amount: 1
## - id: BaseBallBat # THIS BAT IS TOO DAMN BIG!
## amount: 1
components:
- type: StorageFill
contents:
- id: BoxSurvival
- id: WeaponSubMachineGunTypewriter
- id: WeaponPistolViperWood
- id: MagazinePistol
- id: BaseBallBat

- type: entity
noSpawn: true
Expand Down
Loading

0 comments on commit 96ea3cb

Please sign in to comment.