Commit Graph

18 Commits

Author SHA1 Message Date
Pieter-Jan Briers
0c97520276 Fix usages of TryIndex() (#39124)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-09-09 18:17:56 +02:00
Whatstone
a64fe298d0 Add Serializable, NetSerializable attributes to DecalPaintMode (#38921)
Serializable, Net" on DecalPaintMode
2025-07-10 23:43:56 -04:00
Whatstone
9ad99cfa64 Make more objects spray paintable (Reviving #31328) (#37341)
* PaintableAirlockComponent and AirlockGroupPrototype have been replaced

* Slightly redesigned SprayPainterSystem for greater versatility

* Added handling of changes to the appearance of doors and storages

* PaintableGroup prototypes have been created

* Generating tabs with styles in the UI

* Fix error with undiscovered layer

* Slight improvement

* Removed unnecessary property

* The category for `PaintableGroup` was allocated to a separate prototype so that the engine itself would check if the category existed

* Added canisters, but repainting doesn't work

* Added localization to styles

* Fix sprite changing

* Added the ability to paint canisters

* slight ui improvement

* Fix yamllinter errors

* Fix test

* The UI now remembers which tab was open

* Fix build (?)

* Rename

* Charges have been added to the spray painter

* Added a charge texture for the spray painter

* Now spray painter can paint decals

* Increased number of charges

* Spawning dummy objects has been replaced by PrototypeManager

* added a signature about the painting of the object

* fix

* Code commenting

* Fix upstream

* Update Content.Shared/SprayPainter/Components/SprayPainterAmmo.cs

Co-authored-by: pathetic meowmeow <uhhadd@gmail.com>

* review

* Now decals can only be painted if the corresponding tab in the menu is open.

* Fixed a bug with pipe and decal tabs not being remembered

* Update EntityStorageVisualizerSystem.cs

* record

* loc

* Cleanup

* Revert electrified visuals

* more cleanup, fix charges, del ammo4

* no empty file, remove meta component

* closet exceptions, storage visualizer fixes

* enable/disable decal through alt-verb

* Fix missed merge conflicts

* fix snap offset, button event handlers

* simpler order, fix snap loc string

* Remove PaintableViz.BaseRSI, no decal item, A-Z

* State-respecting UI, BUI updates, FTL fixes

* revert DecalPlacerWindow changes

* revert unwanted changes, cleanup function order

* Limit SprayPainterAmmo write access to AmmoSystem

* Remove PaintedSystem

* spray paint ammo lathe recipe, youtool listing

* category as a list, groups as subtabs

* Restore inhand copyright in meta.json

* empty spray painter, recipe produces an empty one

* allow alpha on spray painter decals

* add comments

* paintable wall lockers

* Restrict painting more objects

* Suggested event changes, event cleanup

* component comments, fix ammo inhands

* uncleanable decals, dirty styles on mapinit

* organize paintables, separate emergency/closet grp

* fix categories newline at EOF

* airlock group whitespace cleanup

* realphabetize

* Clean up EntityStorageViz merge conflict markers

* Apply requested changes

* Apply suggestions from sowelipililimute's review

Co-authored-by: pathetic meowmeow <uhhadd@gmail.com>

* betrayal most foul

* Remove members from EntityPaintedEvent

* No emerg. group, steelsec to secure, locker/closet

* Enable repainting the medical wall locker

* comments, no flags on PaintableVisuals

* Remove locked variants from closets/wall closets

* removable decals

* off value consistency

* can't paint away those bones

* fix precedence

* Remove AirlockDepartment, AirlockGroup protos

Both unused.

* whitelist consistency re: ammo component

* add standing emergency closet styles

* alphabetize the spray painter listings

---------

Co-authored-by: Ertanic <black.ikra.14@gmail.com>
Co-authored-by: Эдуард <36124833+Ertanic@users.noreply.github.com>
Co-authored-by: pathetic meowmeow <uhhadd@gmail.com>
2025-07-10 20:36:57 -04:00
Tayrtahn
c565b44965 Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814)
* The easy ones

* For certain values of easy

* Easy test

* Hair

* Fix sandbox violations

* Sort usings
2025-07-07 21:57:05 +02:00
Tayrtahn
86aa82f2b6 Cleanup: Remove redundant prototype name specifications (#35793)
* Remove redundant prototype name specifications

* These can stay
2025-03-19 19:30:31 +01:00
lzk
1cbc8c1dcc Allow to paint multiple airlocks (#34001)
* Allow to paint multiple airlocks

* oh right
2024-12-24 03:25:03 +01:00
Plykiya
190ceda02e Add BreakOnDropItem, update do afters, remove unnecessary declarations (#30361)
* Add BreakOnDropItem, update do afters, remove unnecessary declarations

* bola

* Changed my mind about the nuke

* gennies too

* Make the comments more clear.

* Sorry for the trailing commas

* Revert "Sorry for the trailing commas"

This reverts commit e60fd9a30977393df3344948e6d5c0ce035723cd.

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-08-08 13:39:46 +02:00
DrSmugleaf
5eae6335e1 Make remaining IPrototypes partial (#27157) 2024-04-20 17:48:38 +10:00
metalgearsloth
c91ed96853 Revert Paint (#26593)
* Revert "Fix build (#26258)"

This reverts commit 6de5fbfafb.

* Revert "Spray Paint (Review Ready) (#23003)"

This reverts commit e4d5e7f1ae.

# Conflicts:
#	Resources/Prototypes/Entities/Structures/Holographic/projections.yml
2024-03-31 16:12:52 +11:00
nikthechampiongr
362d56981f Simplify DoAfterArgs behavior for movement and distance checks (#25226)
* Merge BreakOnWeightlessMove and BreakOnMove. Provide different theshold for weightless movement.

* Adjust WeightlessMovementThresholds. Put a thing I forgot to put in the doafterargs.

* Make DoAfterArgs only use OnMove to determine whether to check for
movement and MoveThreshold to determine the threshold regardless of
weightlessness. Gave DistanceThreshold a default value which will always
be checked now.

* Fix issue introduced by merge.

* Use interaction system for determining whether a distance is within range

* Fix incorrect doafter args introduced by previous merge.
Forgor to commit these.

* Exorcise ghost.

The execution system should have been deleted when I merged previously.
For a reason I cannot comprehend it came back, but only the execution
system.

* Exorcise ghost Pt. 2

* Allow for movement check to be overriden in zero g and adjust doafter args where needed.

You can now override checking for movement in zero g with the BreakOnWeightlessMove bool. By default it will check.
The following doafters were made to ignore the movement check in zero g:
- Healing yourself with healing items,
- Removing embedded projectiles,
- Using tools like welders and crowbars

* Adjust distance for cuffing/uncuffing to work. Make injections not break on weightless movement.

* Fix evil incorrect and uneeded comments
2024-03-19 21:09:00 +11:00
brainfood1183
e4d5e7f1ae Spray Paint (Review Ready) (#23003)
* Spray Paint (Draft)

* paint colors, paints in maints loot, cargo crate of paints.

* fix

* remove paint (sort of)

* moved paintcleaner into own system

* Moved paint to server (had to unfortunately)

* doafter now breaks when moving away.

* cant paint mobstatecomp

* loads of fixes

* fixes

* fixes

* nopaintshadercomp

* fixes

* fix

* use locale for paint remove string

* remove nopaintshadercomponent and use blacklist

* remove enabled.true from visualizer

* paint doafter event.

* add verbs for paint and remove paint and icon for paint verb.

* fixes

* no longer replaces shader when shader exists.

* replace forloop with foreach, check shader before adding and removing.

* paint doafter now separate so no copy paste code

* Entities in sprayed targets item slots are also now correctly sprayed.

* fix

* fix

* fix airlock psray painter now removes painted before painting door.

* spray paints now use openablecomponent.

* fix

* fix damn accesstypes.

* fix

* fix
2024-03-18 15:29:48 -06:00
Pieter-Jan Briers
68ce53ae17 Random spontaneous cleanup PR (#25131)
* Use new Subs.CVar helper

Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.

This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.

* Fix a bunch of warnings

* More warning fixes

* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.

* Get rid of some more ISerializationHooks for enums

* And a little more

* Apply suggestions from code review

Co-authored-by: 0x6273 <0x40@keemail.me>

---------

Co-authored-by: 0x6273 <0x40@keemail.me>
2024-02-13 16:48:39 -05:00
deltanedas
58e28b5136 fix spray paint popup spam on invalid door (#24857)
fix popup spam on invalid door

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-02-02 15:53:46 +11:00
deltanedas
c49c78bafa spray painter rework (#23287)
* refactor and add Department to PaintableAirlock, move it to server dir since its in namespace

* add departments to doors, cleanup

* add style -> departments mapping

* AirlockDepartmentsPrototype

* update shared spray stuff to have department

* name file the same as the class name

* department optional

* refactor spray painter system + send department

* fixy

* client

* no need to rewrite ActivateableUi

* pro ops

* the reckoning

* hiss

* .

* :trollface:

* add standard atmos colors to palette

* Update Content.Shared/SprayPainter/SharedSprayPainterSystem.cs

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-02-02 09:30:46 +11:00
Magnus Larsen
9cd6e4dccd Fix clientside storage Whitelists (#24063)
* Fix outdated component name in assaultbelt whitelist

RangedMagazine was replaced with BallisticAmmoProvider in the Gun
refactor (#8301)

* Move FlashOnTrigger, SmokeOnTrigger, Flash components to Shared

* Move LightReplacerComponent to Shared

* Move Utensil, Mousetrap components to Shared

* Move SprayPainterComponent to Shared

The PaintableAirlock tag has also been removed, as it was unused &
unnecessary, likely a vestige of spray painter development when the
PaintableAirlock component wasn't in Content.Shared.

* Add trivial Produce and Seed components to Client

This allows the plant bag and botanical belt whitelists to correctly
match produce and seeds on the client, fixing the extraneous "Can't
insert" message that previously appeared.

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-02-02 00:33:57 +11:00
DrSmugleaf
2d58d19b07 Make all prototype types partial (#21374) 2023-11-01 19:56:23 -07:00
DrSmugleaf
a88e747a0b Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
c4llv07e
d7eb3bfb44 Pipe painter (now with airlock painter) (#19031)
* Add a pipe painting function to the airlock painter

Signed-off-by: c4llv07e <kseandi@gmail.com>

* Rename engineer painter to omnipainter

Signed-off-by: c4llv07e <kseandi@gmail.com>

* review changes

Signed-off-by: c4llv07e <kseandi@gmail.com>

* fix migration duplicate

Signed-off-by: c4llv07e <kseandi@gmail.com>

---------

Signed-off-by: c4llv07e <kseandi@gmail.com>
2023-08-14 15:06:21 +03:00