Commit Graph

16 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
Centronias
c709d4d55c Add CVar for disabling loadout item role timers (#36775) 2025-09-03 13:04:44 +02:00
Tayrtahn
a9f7cfbcb6 Update UIControllers to use Log (#37792)
Update UIControllers to use Log
2025-05-28 12:50:31 -04:00
SpaceManiac
4122310735 Fix 38 non-obsolete warnings (#33794) 2025-02-11 20:59:50 +11:00
Pieter-Jan Briers
299b13f21b Give silicons proper lobby/character editor previews (#33763)
* Give silicons proper lobby/character editor previews

No more naked dummies, properly show a borg/AI sprite now.

This means taking the JobEntity into account when spawning the dummy. For AIs I had to add a "JobPreviewEntity" field because they'd look like a posibrain otherwise. AI therefore uses a custom dummy entity I defined.

Also I had to add some margins to the UI, because otherwise the 32x32 sprite of the AI would look bad.

* Update Content.Shared/Roles/JobPrototype.cs

* Update Content.Client/Lobby/LobbyUIController.cs

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

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-12-08 02:46:41 +01:00
dffdff2423
2c82a2dfc0 Add admin remarks button to lobby (#31761) 2024-11-15 23:09:29 -06:00
metalgearsloth
9a8620d9d8 De-duplicate loadout gear (#30341)
* De-duplicate loadout gear

Needs supporting code, probably with an interface with StartingGearPrototype which would also use it, but I regexed the yaml.

* Code updates

* Remaining yaml

* Fix automatic naming

* raiseEvent

* Don't code when tired kids
2024-08-05 00:42:25 -04:00
metalgearsloth
0432f21110 Add sprite exporting (#29874)
* Redo of code

* Dump IDs on lobby exports
2024-07-31 11:14:19 -04:00
Winkarst-cpu
adcbe8d0be Character menu asks if you want to save your character on exit (#29875)
* Character menu asks if you want to save your character on exit

* Fix

* Another fix, little mistake by me

* Update Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml.cs

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-07-11 10:24:37 +10:00
metalgearsloth
8f12e90b90 Don't use invalid defaults for loadouts (#28740)
* Don't use invalid defaults for loadouts

At the time it made more sense but now with species specific stuff it's better to have nothing.

* Loadout SetDefault only applies valid loadouts
2024-06-15 16:53:42 +10:00
Leon Friedrich
e7f2ae52ab Give jobs & antags prototypes a guide field (#28614)
* Give jobs & antags prototypes a guide field

* A

* space

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>

* Add todo

* Fix merge errors

---------

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
2024-06-06 05:05:58 -07:00
Leon Friedrich
adeed705e6 Add Job preference tests (#28625)
* Misc Job related changes

* Add JobTest

* A

* Aa

* Lets not confuse the yaml linter

* fixes

* a
2024-06-06 00:19:24 +10:00
DrSmugleaf
19be94c9ea Add job whitelist system (#28085)
* Add job whitelist system

* Address reviews

* Fix name

* Apply suggestions from code review

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* cancinium

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2024-06-01 05:08:31 -07:00
metalgearsloth
332f54a3ae Lobby refactor + species loadouts support (#27576)
* Vox stuff

* Species loadouts and lobby refactor

The control flow for lobby is all over the shop so I pulled it all up from the individual controls so now they handle the bare minimum required and LobbyUIController handles the rest.

* a

* Bulk changes

* a

* weh

* Character import / export

* finalise

* woops this stuff too

* Also datafield exporting

* comments

* Review
2024-05-12 09:18:21 +10:00
metalgearsloth
fcd6c25242 LobbyUI fixes (#27033)
* LobbyUI fixes

I have no idea which were bugs prior but anyway fix stuff.

* More fixes

* Test moment
2024-04-17 12:54:54 +10:00
metalgearsloth
12766fe6e3 Loadouts redux (#25715)
* Loadouts redux

* Loadout window mockup

* More workout

* rent

* validation

* Developments

* bcs

* More cleanup

* Rebuild working

* Fix model and loading

* obsession

* efcore

* We got a stew goin

* Cleanup

* Optional + SeniorEngineering fix

* Fixes

* Update science.yml

* add

add

* Automatic naming

* Update nukeops

* Coming together

* Right now

* stargate

* rejig the UI

* weh

* Loadouts tweaks

* Merge conflicts + ordering fix

* yerba mate

* chocolat

* More updates

* Add multi-selection support

* test

h

* fikss

* a

* add tech assistant and hazard suit

* huh

* Latest changes

* add medical loadouts

* and science

* finish security loadouts

* cargo

* service done

* added wildcards

* add command

* Move restrictions

* Finalising

* Fix existing work

* Localise next batch

* clothing fix

* Fix storage names

* review

* the scooping room

* Test fixes

* Xamlify

* Xamlify this too

* Update Resources/Prototypes/Loadouts/Jobs/Medical/paramedic.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Security/detective.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* ben

* Margins

---------

Co-authored-by: Firewatch <54725557+musicmanvr@users.noreply.github.com>
Co-authored-by: Mr. 27 <koolthunder019@gmail.com>
Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
2024-04-16 22:57:43 +10:00