Skip to content

Commit

Permalink
upstream merge 15/11 (#2205)
Browse files Browse the repository at this point in the history
* Hotfix add debug info to traitor activation (#33119)

* Add debug messages to traitor activation

* more debug

* change ShowHealthBars and ShowHealthIcons to use protoId (#32355)

use protoId

* Combat and survival knife storage/inhand sprites (#33111)

* Adds storage sprites for combat knife and survival knife. Replaces inhand sprites.

* Fixes meta.json copyright

* Delete conveyor_old.rsi (#33102)

* Fix broken computer white shadows (#33103)

fix broken computer white shadows

* Bugfix: Wielding now uses identity system. (#33134)

Make wielding system use identity

* Automatic changelog update

* Collapsible ghost roles menu (#32717)

* Make ghost roles collapsible

* Save `BodyVisible` state of each `Collapsible` box

* Make ghost role collapsible only when group has more than 1 role

* Make it a little prettier

* Make only ghost role buttons collapsible

* Apply requested changes

* Typo

* Small cleanup

* Store in list, instead of iterating

* Make unique ids more unique

* Move it out of the cycle

* Make _collapsibleBoxes into dictionary and use key instead of Collapsible boxes names

Added TODO. So after the problem will be fixed in `GhostRolesEui`, it should be mirrored and fixed here too.

* Put TODO in GhostRolesEui. I guess Issue must be made for this

* Use HashSet instead of Dictionary as suggested. Invert the HashSet, so being present means it uncollapsed

I decided to invert HashSet to _uncollapsedStates, because players surely will have more collapsed buttons than opened, so we optimise memory usage a little bit.

* Remove extra space from ghost roles window

* Add buttons stretching. Size 3:1

* Automatic changelog update

* Added Popup for the Ligneous plant mutation when using hands. (#33136)

* Added Popup for the Ligneous plant mutation when using hands.

There was some confusion for players with the Ligneous mutation which makes the plant harvestable only with sharp tools. Adding a popup with the message "The plant is too tough." to give them a hint to use something other than just their hands.

I decided to only put the message when attempting to harvest using hands, as the intent is clear that the player just wanted to harvest, but wasn't able to. Using any other tools like a crowbar or a screwdriver will not trigger the popup.

* Update Resources/Locale/en-US/botany/components/plant-holder-component.ftl

Co-authored-by: SlamBamActionman <[email protected]>

---------

Co-authored-by: SlamBamActionman <[email protected]>

* Automatic changelog update

* fix: Remove duplicate light blue towel from misc loadout (#33145)

remove duplicate towel from misc loadout

* Made the SpeciesChange mutation no longer transfer with Sterile Swabs. (#33126)

Made the SpeciesChange mutation no longer persist.

There was an issue where swabbing a mutated plant species: I.e Blood Tomato to a regular Tomato sapling would transfer the species mutation. It would not actually get the effect, which is probably why it went under the radar. This change makes it so that the SpeciesChange mutation cannot be transferred via swabbing.

* make emergency lights (de)constructable (#32945)

* add an emergency light node to the LightFixture construction graph
* add a recipe entry to the construction menu for emergency light
* make emergency light entity at the emergency light node on the graph
* Make emergency light destroy to 1 steel and 1 glass shard to match
  the construction recipe

Co-authored-by: BooleanBuckeye <[email protected]>

* Automatic changelog update

* Fix: Web Clothing Butcher Issues (#33121)

* Make boot web cost equal to one cloth

* Make boots and coat butcher into web

* Remove unneeded default

* Automatic changelog update

* Add Silicon Law cues to Every method a Silicon can have their laws change  (#32887)

* Silicon Law Sound cue refactor

- Added CueEntityMind to Silicon Law system to more uniformally
send sounds to minds

- Switch all previous MindPlaySound to instead call to the new method

* Change SiliconLawEui to cue the mind

* CR: TryGetComponent and Change the Documentation

- Remove GetComponentOrNull for  _entityManager.TryGetComponent

- Change SiliconLawProviderComponent.LawUploadSound to be more general
rather than just referencing lawboards

* Update Content.Server/Silicons/Laws/SiliconLawEui.cs

* Update Content.Shared/Silicons/Laws/Components/SiliconLawProviderComponent.cs

* Silicon-law-cue-refactor - CR:

- Roll the cuing into NotifyLawsChanged via an optional variable for the
cue

- Modify "SetLaws" to take in an optional soundProvider for the cue

- modify Emagged, Ion, Eui and SetLaws to instead send the sound cue via
NotifyLawsChanged

---------

Co-authored-by: slarticodefast <[email protected]>

* Automatic changelog update

* Fix DisplayVotes doing nothing for a vote (#33170)

* Automatic changelog update

* Hunger and thirst huds fix (#32832)

* Hunger and thirst huds fix

* delete poor caching

* Automatic changelog update

* Don't show Reinforcement codewords on round end (#33181)

Don't show unused codeword sets

* Automatic changelog update

* fix artifact debug assert (#33171)

* fix artifact debug assert

* do the same for EffectBigIron

* 1 tab less

* Fix AI in Intelicard can see through walls (#33177)

setdrawfov added

* Automatic changelog update

* remove wanted list cartridge from captain PDA (#33084)

remove wanted list from captain PDA

* Automatic changelog update

* make admeme mouse eternally hungry and thirsty by increasing decay rate (#33153)

* make admeme mouse eternally hungry and thirsty by increasing decay rate

* no starving slowdown, fix unnecessary declarations

* REVERTUS DELETUS

* Rework the Flare Gun & add a Security Shell Gun. (#32829)

* Rework flaregun and add security shell gun

* Make flare gun twice as likely to appear in emergency lockers

* Security shell gun can now fire lethal shells like the flare gun used to be able to.

* Rebalance the sec shell gun material cost to primarily be steel instead of plastic

* Define the ShellShotgunLight tag in tags.yml

* Leave the no lethal shells for normal flareguns to a different PR.

* Move a comment to re-run checks.

* Bye bye lethal shells from plastic guns.

* Fix weird whitespace issue.

* Make the sec shell gun inherit the normal flare gun.

* Remove the rack verb and update the sec shell gun description

* Remove the ability to fire lethals from flare guns, pending blowing up the gun

---------

Co-authored-by: SlamBamActionman <[email protected]>

* Automatic changelog update

* Changes to "Burst" firemode; Drozd, WT550 and C20-r (#31292)

* Initial commit

* Change burst fire variable to be a set value rather than a multiplier

* Automatic changelog update

* AI can now speak once more. (#33196)

Yippee

* Fixes Lambordeere bolt buttons not being connected (#33065)

* fix

* oops, used savemap instead of savegrid

* Automatic changelog update

* Fix research disk crash (#33205)

* Fix reserach disk crash

* remove extra whitespace

* removed args.handled where args are not handled

* Fix cursed mask bug (#33014)

* One line fix

* Removed redundant using

* Allocation improvement

* pass Actor to cartridge messages (#33210)

* pass Actor to cartridge messages

* NonSerialized gaming

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>

* cham projector fixes/rewrite (#27111)

* cant disguise to thing in a container

* copy cigarette visualiser

* prevent aghost throwing an error

* make disguises die in space

* fuck it rewrite it to not use polymorph

* fix action troll

* oop

* add vebr

* add access to the components

* 2/3

* fix

* relay damage from disguise to user

* fix integrity

* :trollface:

* :trollface:

* m

* kill integrity

* fix a bug

* review

* remove them from component

* relay flash effect to the disguise

* fix icon being weird

* change method since multiple systems cant handle same network event

* :trollface:

* actually network Disguise real

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>

* Stable Merge (#33218)

* dark green jumpsuit recolor, casual green jumpsuits added (#31710)

* green

* fix material arbitrage

* lighter

* Automatic changelog update

* Add a Walking alert (#32954)

* Initial commit

* Review feedback changes

* ProtoId

* TempCommit

* First attempt to have client alerts

* Review changes

* The Jumpsuit Re-Detailening (#33096)

* jumpsuit detailening

* jumpskirt stuff

* meta.json

* update meta.json

* meta.json fix fix

* meta.json fix fix fix

* Intellicards now have a doAfter. (#33198)

* init

* cleanup

* Oops! Forgot something

* addressing changes

* guh

* guh 2.0

* some cleanup

* all bless the intellicard

* Yippee

* small locale thing

* changes + small bugfix

---------

Co-authored-by: slarticodefast <[email protected]>

* Automatic changelog update

* Removed bola stam damage (#32989)

* tweak: weather command tooltip (#33130)

clear weather tip

* Automatic changelog update

* Goliath rebalance (#31492)

Update asteroid.yml

* Fix vape use without check if doafter cancelled (#33245)

vape small fix

* HOTFIX: Fix Security Shell Gun being uncraftable. (#33247)

* Sec Shell Gun Craftability Hotfix

* Capital Fix

* Make the Flare Gun & Security Shell Gun be unbolted by default. (#33248)

* Automatic changelog update

* BUGFIX: Fix APEs being able to be turned on without power (#32493)

Add a check to see the APC is powered before turning the emitter on.

* Automatic changelog update

* Separate CCVars into separate files

* improve BiomeDunGen (#33113)

* improve BiomeDunGen

* forgot lol

* Update DungeonJob.PostGenBiome.cs

* Update DungeonJob.PostGenBiome.cs

* Make Droppers Respect Closed/Sealed Containers (#33011)

* Make droppers respect closed/sealed

* Combine nested

* Optimize conditions a bit

* Automatic changelog update

* Allow editing angle of the fired projectile (#33254)

Add Angle datafield to `ProjectileComponent`. It allows to change the angle of the fired projectile

* Fix unban/editing role bans placed in groups. (#30659)

* On editing a roleban, get all the bans with the same time.

* forgoten newline

* Update to check for player ID too.

* Automatic changelog update

* Adds new sprites for shotgun shell boxes (#33176)

* Adds new sprites for shotgun shell boxes

* Adds second set of mag visuals for slug and uranium casings

* Fixes yaml that I messed up

* Changes credit to new username before merging happens

* Added the ability to microwave inert flesh anomaly cores to turn into an anomalous meat mass (#33223)

* First round of anomaly core functionalities added

* Added sliceTime to anom meat mass and cooked version

* Adds SmokeOnUse component, system and shared system, adds new functions to inert electrical anom core

* Added more functions

* Final touches to branch

* Cleaning up some of the metadata for sprites and component definitions

* PR_Changes_v2_rev.0_Final_FINALFORREALTHISTIME.yml

* Lol jk these goddamn tests why me

* Quick updates based on feedback

* more changes to improve

* additional fixes and edits

* Changed tech core functionality

* added magboot functionality to grav core

* fixed issue with bluespace core sizing

* Reverting changes per request

* extra file to be deleted

* File cleanup

* Update chemicals.ftl

* Update cores.yml

* Update cores.yml

* Update meta.json

* Update chemicals.yml

* Update Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml

Co-authored-by: chromiumboy <[email protected]>

* Update meal_recipes.yml

* Update cores.yml

---------

Co-authored-by: august-sun <[email protected]>
Co-authored-by: chromiumboy <[email protected]>

* Automatic changelog update

* Window sprite tweaks (#33282)

* add

* yes

* Automatic changelog update

* tag:with toolshed command (#31751)

* Automatic changelog update

* Ethereal Jaunt Spell for Wizard & Jaunt ECS (#33201)

* Act

* Adds Jaunt ECS and related prototypes

* Adds jaunt sounds

* Adds enter and exit sound support to polymorphs

* Updates jaunt description

* Adds jaunt action sprite and changes jaunt polymorph to use it

* Adds Jaunt and upgrade to the wizard grimoire

* Makes base mob jaunt parent off of incorporeal and basemob, adds blue ghost sprite for ethereal jaunt

* Update Resources/Locale/en-US/store/spellbook-catalog.ftl

Co-authored-by: slarticodefast <[email protected]>

* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml

Co-authored-by: slarticodefast <[email protected]>

* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml

Co-authored-by: slarticodefast <[email protected]>

* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml

Co-authored-by: slarticodefast <[email protected]>

* Update Content.Shared/Polymorph/PolymorphPrototype.cs

Co-authored-by: slarticodefast <[email protected]>

* Update Content.Shared/Polymorph/PolymorphPrototype.cs

Co-authored-by: slarticodefast <[email protected]>

* removes meta changes

* removes other meta changes

* adds context menu and a description to basemobjaunt

* comments for jaunt component and adds on component shutdown method

* Update Content.Shared/Jaunt/JauntComponent.cs

* Update Content.Shared/Jaunt/JauntComponent.cs

* Update Content.Shared/Jaunt/JauntComponent.cs

* Update Resources/Prototypes/Catalog/spellbook_catalog.yml

---------

Co-authored-by: lzk <[email protected]>
Co-authored-by: slarticodefast <[email protected]>

* Automatic changelog update

* Update Label workflows to use new labels (#33310)

* Update labeler.yml

* Update labeler-needsreview.yml

* Update labeler-staging.yml

* Update labeler-stable.yml

* Update labeler-untriaged.yml

* Create labeler-size.yml

* Update labeler-size.yml

* Update labeler-size.yml

* Update conflict-labeler.yml

* Rename conflict-labeler.yml to labeler-conflict.yml

* Fix mime broken vow alert (#33303)

Swap VowAlert and VowBrokenAlert on lines 149 and 150 so that the proper alerts are cleared and shown

* Automatic changelog update

* Borg type switching. (#32586)

* Borg type switching.

This allows borgs (new spawn or constructed) to select their chassis type on creation, like in SS13. This removes the need for the many different chassis types, and means round-start borgs can actually play the game immediately instead of waiting for science to unlock everything.

New borgs have an additional action that allows them to select their type. This opens a nice window with basic information about the borgs and a select button. Once a type has been selected it is permanent for that borg chassis.

These borg types also immediately start the borg with specific modules, so they do not need to be printed. Additional modules can still be inserted for upgrades, though this is now less critical. The built-in modules cannot be removed, but are shown in the UI.

The modules that each borg type starts with:

* Generic: tools
* Engineering: advanced tools, construction, RCD, cable
* Salvage: Grappling gun, appraisal, mining
* Janitor: cleaning, light replacer
* Medical: treatment
* Service: music, service, clowning

Specialized borgs have 3 additional module slots available on top of the ones listed above, generic borgs have 5.

Borg types are specified in a new BorgTypePrototype. These prototypes specify all information about the borg type. It is assigned to the borg entity through a mix of client side, server, and shared code. Some of the involved components were made networked, others are just ensured they're set on both sides of the wire.

The most gnarly change is the inventory template prototype, which needs to change purely to modify the borg hat offset. I managed to bodge this in with an API that *probably* won't explode for specifically for this use case, but it's still not the most clean of API designs.

Parts for specific borg chassis have been removed (so much deleted YAML) and specialized borg modules that are in the base set of a type have been removed from the exosuit fab as there's no point to printing those.

The ability to "downgrade" a borg so it can select a new chassis, like in SS13, is something that would be nice, but was not high enough priority for me to block the feature on. I did keep it in mind with some of the code, so it may be possible in the future.

There is no fancy animation when selecting borg types like in SS13, because I didn't think it was high priority, and it would add a lot of complex code.

* Fix sandbox failure due to collection expression.

* Module tweak

Fix salvage borg modules still having research/lathe recipes

Engie borg has regular tool module, not advanced.

* Fix inventory system breakage

* Fix migrations

Some things were missing

* Guidebook rewordings & review

* MinWidth on confirm selection button

* Automatic changelog update

* change labeler sizes to powers of 2

* Note expiry time is now relative instead of using timestamps (#33262)

* Add the stuff

* Loc fix

* fixes

* Change

* Automatic changelog update

* Prevent Digiboard recycling (#33315)

* add `HighRiskItem` tag

* Correct tags

Co-authored-by: slarticodefast <[email protected]>

---------

Co-authored-by: slarticodefast <[email protected]>

* Automatic changelog update

* Command external airlocks (#33333)

add

* remove our now duplicate command airlocks

* New ruin variant (#33332)

add

* :trollface:

* cvar gaming

* fix yml linter

* CONFLICT LABELER CONFLICT!!!

* real

* fix

* change secborg thing so it doesnt log errors

---------

Signed-off-by: deltanedas <[email protected]>
Co-authored-by: Errant <[email protected]>
Co-authored-by: Milon <[email protected]>
Co-authored-by: RiceMar1244 <[email protected]>
Co-authored-by: Flareguy <[email protected]>
Co-authored-by: Plykiya <[email protected]>
Co-authored-by: PJBot <[email protected]>
Co-authored-by: MilenVolf <[email protected]>
Co-authored-by: Tr1bute <[email protected]>
Co-authored-by: SlamBamActionman <[email protected]>
Co-authored-by: Michael Krebs <[email protected]>
Co-authored-by: Boolean-Buckeye <[email protected]>
Co-authored-by: BooleanBuckeye <[email protected]>
Co-authored-by: Preston Smith <[email protected]>
Co-authored-by: Zachary Higgs <[email protected]>
Co-authored-by: slarticodefast <[email protected]>
Co-authored-by: DrSmugleaf <[email protected]>
Co-authored-by: Kirus59 <[email protected]>
Co-authored-by: Baptr0b0t <[email protected]>
Co-authored-by: BramvanZijp <[email protected]>
Co-authored-by: SlamBamActionman <[email protected]>
Co-authored-by: ScarKy0 <[email protected]>
Co-authored-by: PopGamer46 <[email protected]>
Co-authored-by: SolStar <[email protected]>
Co-authored-by: FN <[email protected]>
Co-authored-by: Jezithyr <[email protected]>
Co-authored-by: Boaz1111 <[email protected]>
Co-authored-by: Armok <[email protected]>
Co-authored-by: IProduceWidgets <[email protected]>
Co-authored-by: Shaddap1 <[email protected]>
Co-authored-by: leonidussaks <[email protected]>
Co-authored-by: Andrew Montagne <[email protected]>
Co-authored-by: Simon <[email protected]>
Co-authored-by: Ed <[email protected]>
Co-authored-by: Repo <[email protected]>
Co-authored-by: SpaceRox1244 <[email protected]>
Co-authored-by: August Sun <[email protected]>
Co-authored-by: august-sun <[email protected]>
Co-authored-by: chromiumboy <[email protected]>
Co-authored-by: Ubaser <[email protected]>
Co-authored-by: dffdff2423 <[email protected]>
Co-authored-by: keronshb <[email protected]>
Co-authored-by: lzk <[email protected]>
Co-authored-by: CheddaCheez <[email protected]>
Co-authored-by: Pieter-Jan Briers <[email protected]>
Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: beck-thompson <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 447 changed files with 8,712 additions and 5,259 deletions.
File renamed without changes.
21 changes: 21 additions & 0 deletions .github/workflows/labeler-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Labels: Size"
on: pull_request_target
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
# Custom size configuration
# DeltaV: changed to powers of 4
sizes: >
{
"0": "XS",
"16": "S",
"64": "M",
"256": "L",
"1024": "XL"
}
2 changes: 2 additions & 0 deletions .github/workflows/labeler-untriaged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
add_label:
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Administration/UI/Notes/NoteEdit.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" />
<HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}"
Visible="False" HorizontalExpand="True" />
<OptionButton Name="ExpiryLengthDropdown" Visible="False" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<OptionButton Name="TypeOption" HorizontalAlignment="Center" />
Expand Down
53 changes: 50 additions & 3 deletions Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ public sealed partial class NoteEdit : FancyWindow
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IClientConsoleHost _console = default!;

private enum Multipliers
{
Minutes,
Hours,
Days,
Weeks,
Months,
Years,
Centuries
}

public event Action<int, NoteType, string, NoteSeverity?, bool, DateTime?>? SubmitPressed;

public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool canEdit)
Expand All @@ -31,6 +42,20 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c

ResetSubmitButton();

// It's weird to use minutes as the IDs, but it works and makes sense kind of :)
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-minutes"), (int) Multipliers.Minutes);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-hours"), (int) Multipliers.Hours);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-days"), (int) Multipliers.Days);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-weeks"), (int) Multipliers.Weeks);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-months"), (int) Multipliers.Months);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-years"), (int) Multipliers.Years);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-centuries"), (int) Multipliers.Centuries);
ExpiryLengthDropdown.OnItemSelected += OnLengthChanged;

ExpiryLengthDropdown.SelectId((int) Multipliers.Weeks);

ExpiryLineEdit.OnTextChanged += OnTextChanged;

TypeOption.AddItem(Loc.GetString("admin-note-editor-type-note"), (int) NoteType.Note);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-message"), (int) NoteType.Message);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-watchlist"), (int) NoteType.Watchlist);
Expand Down Expand Up @@ -172,8 +197,9 @@ private void UpdatePermanentCheckboxFields()
{
ExpiryLabel.Visible = !PermanentCheckBox.Pressed;
ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed;
ExpiryLengthDropdown.Visible = !PermanentCheckBox.Pressed;

ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? 1.ToString() : string.Empty;
}

private void OnSecretPressed(BaseButton.ButtonEventArgs _)
Expand All @@ -187,6 +213,16 @@ private void OnSeverityChanged(OptionButton.ItemSelectedEventArgs args)
SeverityOption.SelectId(args.Id);
}

private void OnLengthChanged(OptionButton.ItemSelectedEventArgs args)
{
ExpiryLengthDropdown.SelectId(args.Id);
}

private void OnTextChanged(HistoryLineEdit.LineEditEventArgs args)
{
ParseExpiryTime();
}

private void OnSubmitButtonPressed(BaseButton.ButtonEventArgs args)
{
if (!ParseExpiryTime())
Expand Down Expand Up @@ -263,13 +299,24 @@ private bool ParseExpiryTime()
return true;
}

if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !DateTime.TryParse(ExpiryLineEdit.Text, out var result) || DateTime.UtcNow > result)
if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !uint.TryParse(ExpiryLineEdit.Text, out var inputInt))
{
ExpiryLineEdit.ModulateSelfOverride = Color.Red;
return false;
}

ExpiryTime = result.ToUniversalTime();
var mult = ExpiryLengthDropdown.SelectedId switch
{
(int) Multipliers.Minutes => TimeSpan.FromMinutes(1).TotalMinutes,
(int) Multipliers.Hours => TimeSpan.FromHours(1).TotalMinutes,
(int) Multipliers.Days => TimeSpan.FromDays(1).TotalMinutes,
(int) Multipliers.Weeks => TimeSpan.FromDays(7).TotalMinutes,
(int) Multipliers.Months => TimeSpan.FromDays(30).TotalMinutes,
(int) Multipliers.Years => TimeSpan.FromDays(365).TotalMinutes,
(int) Multipliers.Centuries => TimeSpan.FromDays(36525).TotalMinutes,
_ => throw new ArgumentOutOfRangeException(nameof(ExpiryLengthDropdown.SelectedId), "Multiplier out of range :(")
};
ExpiryTime = DateTime.UtcNow.AddMinutes(inputInt * mult);
ExpiryLineEdit.ModulateSelfOverride = null;
return true;
}
Expand Down
15 changes: 10 additions & 5 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Alert;
using JetBrains.Annotations;
using Robust.Client.Player;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

Expand All @@ -24,8 +25,7 @@ public override void Initialize()

SubscribeLocalEvent<AlertsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<AlertsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

SubscribeLocalEvent<AlertsComponent, AfterAutoHandleStateEvent>(ClientAlertsHandleState);
SubscribeLocalEvent<AlertsComponent, ComponentHandleState>(OnHandleState);
}
protected override void LoadPrototypes()
{
Expand All @@ -47,17 +47,22 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
}
}

protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
private void OnHandleState(Entity<AlertsComponent> alerts, ref ComponentHandleState args)
{
if (args.Current is not AlertComponentState cast)
return;

alerts.Comp.Alerts = cast.Alerts;

UpdateHud(alerts);
}

protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
{
UpdateHud(alerts);
}

private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
{
UpdateHud(alerts);
}
Expand Down
24 changes: 19 additions & 5 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<ClothingComponent, GetEquipmentVisualsEvent>(OnGetVisuals);
SubscribeLocalEvent<ClothingComponent, InventoryTemplateUpdated>(OnInventoryTemplateUpdated);

SubscribeLocalEvent<InventoryComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<SpriteComponent, DidUnequipEvent>(OnDidUnequip);
Expand All @@ -70,11 +71,7 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
if (args.Sprite == null)
return;

var enumerator = _inventorySystem.GetSlotEnumerator((uid, component));
while (enumerator.NextItem(out var item, out var slot))
{
RenderEquipment(uid, item, slot.Name, component);
}
UpdateAllSlots(uid, component);

// No clothing equipped -> make sure the layer is hidden, though this should already be handled by on-unequip.
if (args.Sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var layer))
Expand All @@ -84,6 +81,23 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
}
}

private void OnInventoryTemplateUpdated(Entity<ClothingComponent> ent, ref InventoryTemplateUpdated args)
{
UpdateAllSlots(ent.Owner, clothing: ent.Comp);
}

private void UpdateAllSlots(
EntityUid uid,
InventoryComponent? inventoryComponent = null,
ClothingComponent? clothing = null)
{
var enumerator = _inventorySystem.GetSlotEnumerator((uid, inventoryComponent));
while (enumerator.NextItem(out var item, out var slot))
{
RenderEquipment(uid, item, slot.Name, inventoryComponent, clothingComponent: clothing);
}
}

private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVisualsEvent args)
{
if (!TryComp(args.Equipee, out InventoryComponent? inventory))
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Commands/ShowHealthBarsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Content.Shared.Damage.Prototypes;
using Content.Shared.Overlays;
using Robust.Client.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
using System.Linq;

namespace Content.Client.Commands;
Expand Down Expand Up @@ -34,7 +36,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var showHealthBarsComponent = new ShowHealthBarsComponent
{
DamageContainers = args.ToList(),
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
HealthStatusIcon = null,
NetSyncEnabled = false
};
Expand Down
10 changes: 10 additions & 0 deletions Content.Client/Effects/ColorFlashEffectSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
continue;
}

var targetEv = new GetFlashEffectTargetEvent(ent);
RaiseLocalEvent(ent, ref targetEv);
ent = targetEv.Target;

EnsureComp<ColorFlashEffectComponent>(ent, out comp);
comp.NetSyncEnabled = false;
comp.Color = sprite.Color;
Expand All @@ -132,3 +136,9 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
}
}
}

/// <summary>
/// Raised on an entity to change the target for a color flash effect.
/// </summary>
[ByRefEvent]
public record struct GetFlashEffectTargetEvent(EntityUid Target);
16 changes: 15 additions & 1 deletion Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,23 @@ public void UIInventoryAltActivateItem(string slot, EntityUid uid)
EntityManager.RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
}

protected override void UpdateInventoryTemplate(Entity<InventoryComponent> ent)
{
base.UpdateInventoryTemplate(ent);

if (TryComp(ent, out InventorySlotsComponent? inventorySlots))
{
foreach (var slot in ent.Comp.Slots)
{
if (inventorySlots.SlotData.TryGetValue(slot.Name, out var slotData))
slotData.SlotDef = slot;
}
}
}

public sealed class SlotData
{
public readonly SlotDefinition SlotDef;
public SlotDefinition SlotDef;
public EntityUid? HeldEntity => Container?.ContainedEntity;
public bool Blocked;
public bool Highlighted;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Overlays/EquipmentHudSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
{
[Dependency] private readonly IPlayerManager _player = default!;

[ViewVariables]
protected bool IsActive;
protected virtual SlotFlags TargetSlots => ~SlotFlags.POCKET;

Expand Down Expand Up @@ -102,7 +103,7 @@ protected virtual void OnRefreshComponentHud(EntityUid uid, T component, Refresh
args.Components.Add(component);
}

private void RefreshOverlay(EntityUid uid)
protected void RefreshOverlay(EntityUid uid)
{
if (uid != _player.LocalSession?.AttachedEntity)
return;
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Overlays/ShowHealthBarsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ShowHealthBarsComponent, AfterAutoHandleStateEvent>(OnHandleState);

_overlay = new(EntityManager, _prototype);
}

private void OnHandleState(Entity<ShowHealthBarsComponent> ent, ref AfterAutoHandleStateEvent args)
{
RefreshOverlay(ent);
}

protected override void UpdateInternal(RefreshEquipmentHudEvent<ShowHealthBarsComponent> component)
{
base.UpdateInternal(component);
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Overlays/ShowHealthIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo
{
[Dependency] private readonly IPrototypeManager _prototypeMan = default!;

[ViewVariables]
public HashSet<string> DamageContainers = new();

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<DamageableComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
SubscribeLocalEvent<ShowHealthIconsComponent, AfterAutoHandleStateEvent>(OnHandleState);
}

protected override void UpdateInternal(RefreshEquipmentHudEvent<ShowHealthIconsComponent> component)
Expand All @@ -43,6 +45,11 @@ protected override void DeactivateInternal()
DamageContainers.Clear();
}

private void OnHandleState(Entity<ShowHealthIconsComponent> ent, ref AfterAutoHandleStateEvent args)
{
RefreshOverlay(ent);
}

private void OnGetStatusIconsEvent(Entity<DamageableComponent> entity, ref GetStatusIconsEvent args)
{
if (!IsActive)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowThirstIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent component, ref
return;

if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype!);
ev.StatusIcons.Add(iconPrototype);
}
}
16 changes: 16 additions & 0 deletions Content.Client/Physics/Controllers/MoverController.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Content.Shared.Alert;
using Content.Shared.CCVar;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
using Robust.Client.Physics;
using Robust.Client.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components;
using Robust.Shared.Player;
using Robust.Shared.Timing;
Expand All @@ -14,6 +17,8 @@ public sealed class MoverController : SharedMoverController
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly AlertsSystem _alerts = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -135,4 +140,15 @@ protected override bool CanSound()
{
return _timing is { IsFirstTimePredicted: true, InSimulation: true };
}

public override void SetSprinting(Entity<InputMoverComponent> entity, ushort subTick, bool walking)
{
// Logger.Info($"[{_gameTiming.CurTick}/{subTick}] Sprint: {enabled}");
base.SetSprinting(entity, subTick, walking);

if (walking && _cfg.GetCVar(CCVars.ToggleWalk))
_alerts.ShowAlert(entity, WalkingAlert, showCooldown: false, autoRemove: false);
else
_alerts.ClearAlert(entity, WalkingAlert);
}
}
Loading

0 comments on commit 1b7830a

Please sign in to comment.