Label / String Isuse in Developer Help
|
|
I am currently displaying the players inventory as 8 slots on their interface using 8 labels. I use the code :
winset(src,"MainWindow.1","text=[Slot1]") winset(src,"MainWindow.1A","text=[Slot1A]") winset(src,"MainWindow.2","text=[Slot2]") winset(src,"MainWindow.2A","text=[Slot2A]") winset(src,"MainWindow.3","text=[Slot3]") winset(src,"MainWindow.3A","text=[Slot3A]") winset(src,"MainWindow.4","text=[Slot4]") winset(src,"MainWindow.4A","text=[Slot4A]") winset(src,"MainWindow.5","text=[Slot5]") winset(src,"MainWindow.5A","text=[Slot5A]") winset(src,"MainWindow.6","text=[Slot6]") winset(src,"MainWindow.6A","text=[Slot6A]") winset(src,"MainWindow.7","text=[Slot7]") winset(src,"MainWindow.7A","text=[Slot7A]") winset(src,"MainWindow.8","text=[Slot8]") winset(src,"MainWindow.8A","text=[Slot8A]")
|
This code fills all 8 slots with the required text and another 8 with how many of that object there are.
The problem is that I want to add an extension " " to this text. I do so using this :
verb Slot1() usr.Slot1 += " <Selected>" Update_Stats()
|
However.. Due to the space at the start of this extra string, nothing happens. When the space is removed or replaced with an underscore, the text is displayed but only then. I need that space to keep the item name and the add on separate, like :
"BroadSword "
What am I doing wrong? Thanks.
|
To make sure you're setting text to the entire value of the string you're sending at it (including internal spaces of said string).
Besides that heres a little something for you to examine: