@Nogrod lang.RegisterMessages() won't accept a Python's Dictionary to register messages
Code:RuntimeError: Failed to call Init (ArgumentTypeException: expected Dictionary[str, str], got dict)Code:class test(): def __init__(self, arg): self.Title = 'Test' self.Version = V(0, 0, 0) self.Author = 'SkinN' def LoadVariables(self): lang.RegisterMessages( { "Message One": "This is message one!", "Message Two": "This is message two!" }, self.Plugin ); def Init(self): self.LoadVariables()
Solved Registering messages with Lang API using Python?
Discussion in 'Rust Development' started by NobodyFTW, Mar 3, 2016.
-
Wulf Community Admin
Code:from System import String from System.Collections.Generic import Dictionary lang.RegisterMessages(Dictionary[str,str]({"pykey" : "pymessage"}),self.Plugin) -
Marvelous ! Thank you
-
Wulf Community Admin
Thank @Nogrod, he passed this to me the other day.
-
No offence but I did found odd being you to provide this.
-
Wulf Community Admin
Yeah... not a Python guy.
