- Add Content::Key as proxy to Language::try_msg
- Add Content::Attr as proxy to Language::try_attr
- Extend ItemKey::TagExamples so it includes base asset id
- Implement ItemDesc::l10n using new Content variants
- Add all_items_expect() function to grab all items, because
try_all_item_defs() covers only items in asset folder.
Required assets will go in next commit
- Add ItemL10n struct that is similar to ItemImgs except it holds i18n
description and not items. ItemDesc::l10n uses this struct to provide
common_i18n::Content for both names and descriptions.
So far it only used in voxygen, but it can be used by rtsim in
dialogues.
- Introduced new deprecation, ItemKind::Ingredient, because it uses
item.name().
It's not deleted, because it's used in inventory sorting, and our
inventory sorting is, for some reason, server-side.
- Crafting UI also still uses deprecated item.name(), because again,
sorting. It's probably will be easier to handle, because it's UI
sorting and we can use localized names here, but still, it's a thing
to discuss.
- Moved Item::describe() to voxygen/hud/util.
The most important thing to note is we don't want to completely delete
deprecated .name() and .description() along with corresponding fields
in ItemDef because ItemDef is now "public" API, exposed in plugins and I
don't want to break plugins before we actually implement i18n for them.
Otherwise, it would be basically impossible to use items in plugins.
What's left is actually fully implementing ItemDesc::l10n, create
item_l10n.ron and add fallback on current .name() and .description()
implementation.
- Add the comment that recommends avoiding all `get_variation` methods.
- Add the comment that recommends avoiding Content with random i18n.
- Improve `get_content` docs.
- Mark Item::name() and Item::description() deprecated, along with
corresponding ItemDesc methods.
- Dummify dialogue code that uses items, as it's not used anyway. In the
future it should use common_i18n::Content.
- Allow usage of deprecated .name() for Inventory ordering, for now.
- Allow usage of deprecated .name() for Inventory ordering for
merchants, for now.
As veloren-server enables plugin feature automatically, it results in
veloren-common-state inherit this feature, which enables
common/state/plugin/mod.rs which asks for common::assets function that
is enabled only if plugin feature is enabled, but because
veloren-common-state doesn't depend on common::assets, this feature is
kind of lost half-way.
This commit fixes this by adding explicit optional dependency on
common-assets in common-state that is enabled by plugin feature.