* 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>
* make hover and info use construction proto name, not entity name
* recipeButtons uses IDs as keys, not names
* return making item green when selected
* Persist construction menu favorites to player profile
* Use `ProtoId`s for construction favorites
* Validate construction favorites updates from the client
* Actually await the async database call
* Now the name of the target craft items is taken directly from the prototypes
* Deleting unnecessary fields
* Deleting unnecessary fields
* Added suffix field
* Added override via localization keys
* My favorite ItemList and TextureRect have been replaced with ListContainer and EntityPrototypeView
* Fix suffix
* Fix construction ghosts... maybe
* Remove suffix from UI
* Suffixes have been removed from prototypes
* Added a description for the secret door
* Fix search..?
* The Icon field of ConstructionPrototype has been removed
* StackPrototypes used in the construction menu have been localized
* TagConstructionGraphStep used in the construction menu have been localized
* The search bar has been localized
* Fix localization and prototypes
* Recipes are now only loaded when the crafting window is opened.
* Fix crooked merge grid of the crafting menu.
* Localization update
* Fix cyborg graph
* Revert "Recipes are now only loaded when the crafting window is opened."
This reverts commit 97749483542c2d6272bda16edf49612c69a0761a.
* Fix loc
* fix merge
* Fix upstream
* Some of the logic has been moved to Shared
* fix
* Small adjustments
* Very small change
---------
Co-authored-by: EmoGarbage404 <retron404@gmail.com>
* Added fovarite button
* Some fixes in xaml
* added some events for favorite recipes
* set methods for presenter
* fixes for presenter
* added translates
* reset seach when you select any category
* added some margins
* some fixes from compared
* fixed PR notes about arrays
* deleted controls & margins
* did simpleer with arrays
* review
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
* Replace obsolete whitelist is valid with whitelist system
* Consistency
* Fix logic
* Bork
* I figured out how to get whitelists on the client lol
* test fail
* woops
* HELP ME FUNCTIONS
* Fix errors
* simplify
---------
Co-authored-by: plykiya <plykiya@protonmail.com>
- Completely rewrited the `ConstructionComponent` logic to be ECS, *without* looking too much at the original implementation.
- The original implementation was dirty and unmaintainable, whereas this new implementation is much cleaner, well-organized and maintainable. I've made sure to leave many comments around, explaining what everything does.
- Construction now has a framework for handling events other than `InteractUsing`.
- This means that you can now have CGL steps for things other than inserting items, using tools...
- Construction no longer uses `async` everywhere for `DoAfter`s. Instead it uses events.
- Construction event handling occurs in the `ConstructionSystem` update tick, instead of on event handlers.
- This ensures we can delete/modify entities without worrying about "collection modified while enumerating" exceptions.
- This also means the construction update tick is where all the fun happens, meaning it'll show up on our metrics and give us an idea of how expensive it is/how much tick time is spent in construction.
- `IGraphCondition` and `IGraphAction` have been refactored to take in `EntityUid`, `IEntityManager`, and to not be async.
- Removes nested steps, as they made maintainability significantly worse, and nothing used them yet.
- This fixes#4892 and fixes#4857
Please note, this leaves many things unchanged, as my idea is to split this into multiple PRs. Some unchanged things:
- Initial construction code is the same. In the future, it'll probably use dummy entities.
- Client-side guided steps are the same. In the future, the server will generate the guided steps and send them to clients as needed, caching these in both the server and client to save cycles and bandwidth.
- No new construction graph steps... Yet! 👀