Can anyone help me with a CSharp function to convert "current" item Shortnames to standard Item Names?
So from this metal.refined to this ==> High Quality Metal
I'd like it to always fetch the current item list after a Rust update.
Funtion for item names
Discussion in 'Rust Development' started by isuelt, Oct 1, 2015.
-
Wulf Community Admin
Take a look at oxide-plugins/Exporter.cs at master · lukespragg/oxide-plugins · GitHub.
item.displayName.english is likely what you are looking for. -
Wulf thanks for the info. I'm new at this. While this looks like a useful way for developers to get the item list and write it to a file. I'm looking to a function to add to a plugin is do an adhoc lookup. Can you provide more code for me? Maybe some simple code that does the quick and dirty and I'll try and play with it.
-
Wulf Community Admin
The plugin I linked above should provide all you are looking for. -
If you're just looking for a quick and dirty method, this will work:
However, I recommend you code using the Item and ItemDefinition, and if necessary ItemId, and avoid using strings for as proxies for proper references, which are far faster, and don't generate nearly so much garbage. Of course, if you're just starting out and didn't understand a word of the last sentence, the above will get things working for you - learning and having fun is important too ;-)Code:string ShortNameToDisplayName(string shortName) { return ItemManager.FindItemDefinition(shortName).displayName.english; }Last edited by a moderator: Oct 2, 2015 -
Thanks for being the fun teacher and handing me an example. I am learning !
Because of you I was able to quickly do this: Missions/Quests | Page 4 | Oxide
THANKS !!
