space-wizards:master
← Ertanic:craftmenu-localization
opened 09:56PM - 20 Sep 24 UTC
## About the PR
The name, description and icon of the target crafting items a… re now taken directly from the prototypes. The ability to specify a name is left through localization files. See the secret door for an example.
Depends on ~~https://github.com/space-wizards/RobustToolbox/pull/5466~~.
## Why / Balance
Fixes #22814
## Technical details
Because prototypes are read only on the server, I moved some of the code from the Server segment to Shared and Client. When ConstructionPrototype comes in, it creates a ConstructionPrototype.ID-to-EntityPrototype.ID map, which the client then works with.
To take sprites directly from the prototypes, `ItemList` has been replaced by `ListContainer`, which uses `EntityPrototypeView`.
Fluent keys have been used to localize GraphStep. Therefore, the names of the `tag` and `material` steps, which are used directly in the build menu, have been moved to ftl files.
The `MaterialConstructionGraphStep` (set in StackPrototype) passes the necessary amount of material to be translated using selectors. Especially relevant for the Slavic language group.
## Media
<!-- Attach media if the PR makes ingame changes (clothing, items, features, etc).
Small fixes/refactors are exempt. Media may be used in SS14 progress reports with credit. -->
## Requirements
- [X] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [X] I have added media to this PR or it does not require an ingame showcase.
## Breaking changes
<!-- List any breaking changes, including namespaces, public class/method/field changes, prototype renames; and provide instructions for fixing them.
This will be posted in #codebase-changes. -->
**Changelog**
<!-- Add a Changelog entry to make players aware of new features or changes that could affect gameplay.
Make sure to read the guidelines and take this Changelog template out of the comment block in order for it to show up.
Changelog must have a :cl: symbol, so the bot recognizes the changes and adds them to the game's changelog. -->
<!--
:cl:
- add: Added fun!
- remove: Removed fun!
- tweak: Changed fun!
- fix: Fixed fun!
-->
- tweak: The name, description and icon of the target crafting items are now taken directly from the prototypes.
Construction has been updated to better support localization for non-English forks.
StackPrototype
now takes a LocId
for the name instead of just a raw string.
ConstructionPrototype
has been modified to now primarily use prototype information. The Name
and Description
fields are now both nullable LocId
s, where a null value results in the construction system automatically using the entity name and description. Additionally, the icon
and layers
fields have been removed entirely in favor of just displaying the entity prototype directly in the UI.
In similar vein, ComponentConstructionGraphStep
, MultipleTagsConstructionGraphStep
, and TagConstructionGraphStep
now also use LocId
s for the name
datafield to ensure proper localization support.
1 Like