Thread
:
[TF2] Econ Data (supercedes TF2IDB, TF2ItemsInfo) (0.18.3, 2023-01-30)
View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
04-04-2019 , 20:28 Re: [TF2] Econ Data (supercedes TF2IDB, TF2ItemsInfo) (0.7.1, 2019-03-21)
#
10
Quote:
Originally Posted by
Drixevel
[...] do you know if there's a way to get a display name that can be used in menus and stuff from item definition indexes?
tl;dr: For menus in particular, not easily.
I'm not sure what you're referring to when it comes to
GetEntityClassname
, but there's two options for item names:
TF2Econ_GetItemName
returns the non-localized item name. It's limited to English-only, and the non-localized item name may not match the English-localized one (it still refers to "The Huo Long Heatmaker" internally instead of "Huo-Long Heater", among other ones).
TF2Econ_GetLocalizedItemName
returns a
#token
string. You can probably use it in a few things with Powerlord's
PrintValveTranslation
functions, but from what I recall (and have tried, since I quickly prototyped my own taunt menu while I was writing this library),
it doesn't support menus
. For localizing menus, you'll need to translate them server-side, either by
maintaining an SQLite database like TF2IDB
,
creating your own translation file
, or
internally parsing the translation files
.
Might have to make my next project a threaded lazy localization parser extension as another choice.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord --
PM me on the forums
regarding inquiries.
AlliedModders Releases
/
Github
/
TF2 Server
/ Donate (
BTC
/
BCH
/
coffee
)
Last edited by nosoop; 02-06-2021 at
21:43
. Reason: bitbucket linkrot
nosoop
View Public Profile
Send a private message to nosoop
Visit nosoop's homepage!
Find More Posts by nosoop