@diablosnaps/assets
v1.1.1
Published
Provides loaders for `affixes`, `items` and `translations` assets. These assets are used to translate item data into human-readable text.
Downloads
9
Readme
@diablosnaps/assets
Provides loaders for affixes
, items
and translations
assets. These assets are used to translate item data into human-readable text.
Usage
import { Assets } from '@diablosnaps/assets';
import { Game } from '@diablosnaps/common';
const affixes = await Assets.loadAffixes();
const affixDescription = Game.getItemAffixDescription(Game.AffixType.Basic, '577013', Game.Language.English, affixes, '13');
// => '+13 Maximum Mana'
const items = await Assets.loadItems();
const name = Game.getItemName('1210590', Game.Language.English, items);
// => '100,000 Steps'
const translations = await Assets.loadTranslations();
const variantText = Game.getItemVariantText(Game.ItemVariant.Ancestral, Game.Language.English, translations);
// => 'Ancestral'
Installation
npm install @diablosnaps/assets
# or yarn
yarn add @diablosnaps/assets