kevL wrote...
hey Lance,
what 'bout if you close the window entirely and start a new instance, with the same buttons etc?
<SNIP>
Hi KevL,
I finally found a workaround ... fix. It was not too dissimilar to some of the options we discussed at the start, but the final fix was a little obscure to say the least: As it turned out, the solution
was to send a brief "other" description prior to refreshing the text object with the description I wanted. However, while one would have thought a simple null text (e.g. " ") would have sufficed, it did not.
Here is how I worked out how to fix the problem, as it varies according to your text box ...
Basically, as I was testing this, I noticed that some item descriptions would "reset" the text box so that the text that followed would be set back up at the top of the box, which is what I wanted. However, not every description did this. i.e. An item description too long (that needed the scroll bar) or too short always made the next description that appeared to be "off" (already partly scrolled or even out of sight of the scroll had gone some way down before). However, (and here was the trick), some item description texts that filled the text screen just right caused the text window to reset for the next clicked item! It was a "goldilocks" solution. i.e. If the text prior to the next to be displayed was "just right", then it would reset the text box so that the text that followed was formatted correctly!
So, after some testing, I discovered that subject to the size of the text box, you have to send a load of
\\n in the form of a text string to "fill" the box to its sweet spot. For my inventory window I had to send 22 \\n and the store 21 \\n.
e.g.
SetGUIObjectText(OBJECT_SELF, "SCREEN_STORE", "BoxText", -1, " \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n "); //21
DelayCommand(0.1, SetGUIObjectText(OBJECT_SELF, "SCREEN_STORE", "BoxText", -1, sDescription));
And so there you have it! It requires a little testing depending on your text box, but once you find it, that's the solution.
Cheers,
Lance.
Modifié par Lance Botelle, 16 septembre 2013 - 02:12 .