Is there a way to make a list box automatically scroll to the bottom when a new item is added? I have tried automatically selecting the newest entry for all players, but that just scrolls it down to the second newest entry instead of the newest one (how does this making any friggin sense?)
I also want to change the scroll bar image of the list box.
You could try to save the current selection of the player, add the new entry, add an additional entry, select the last one, remove it and reselect the previously saved entry.
To change the scroll bar image you have to script your UI through XML files directly, I guess. In "StandardTemplates.SC2Layout" you'll find a list box template. Change its scroll bar. You may ask for further details if you are new to those XML files ;)
Is there a way to make a list box automatically scroll to the bottom when a new item is added? I have tried automatically selecting the newest entry for all players, but that just scrolls it down to the second newest entry instead of the newest one (how does this making any friggin sense?)
I also want to change the scroll bar image of the list box.
I would appreciate any help.
I ran into this problem with Malum Ruina and Xeno Crisis. My solution was to remove the old list items so the newest ones were always visible, eliminating the scroll bar completely.
I actually tried that, all it does is scroll to the second newest entry (even after deleting the newest it still goes back one further, so there is always one entry that isn't shown).
I actually tried that, all it does is scroll to the second newest entry (even after deleting the newest it still goes back one further, so there is always one entry that isn't shown).
I considered that...but since I am using it as a chat I really want people to be able to go back through it.
Well you could create another dialog to act as a chat log. In that case, the player could click a button to bring up the log and peruse through it at his leisure.
The other consideration is to scrap the idea of using a list for chat and instead use a system which generates labels from chat messages.
you could also make an edit box at the bottom of the chat area which has the most recent message in it.or make a blank message at the bottom which remove each time it updates and the add the message and the blank back in, that way it always shows the most recent message. you could even have the blank be something like "Gameheart Overlay by rtschutter"
Thank you guys very much for all of your suggestions. I am considering all of them.
I eventually came to the same idea that Willuwontu has suggested and it works okay, the main problem with it is that the scrollbar of course still shows that it isn't quite at the bottom yet (which will drive any OCD player like me up the wall).
The other problem with using a list box system is that if someone types too many characters it just cuts them off with a "..." at the end instead of dropping down to a new line and continuing. A dialog label system might be the right way to do it, but creating a scroll bar from scratch is not an idea that excites me to be honest.
The other problem with using a list box system is that if someone types too many characters it just cuts them off with a "..." at the end instead of dropping down to a new line and continuing. A dialog label system might be the right way to do it, but creating a scroll bar from scratch is not an idea that excites me to be honest.
Even with a label system you would run into the problem of text being cut off. Unless you have a font where every character is the same width, it's impossible to tell exactly how long each line will be. The system I used was to break the entered chat line into separate strings and create multiple list items. For example, if the entered chat line was between 20 and 40 characters, I would break the entered chat line into two substrings, the first being 20 characters long and the next being as long as the number of characters remaining in the chat line. It's certainly not ideal, but it worked well about 85% of the time.
Is there a way to make a list box automatically scroll to the bottom when a new item is added? I have tried automatically selecting the newest entry for all players, but that just scrolls it down to the second newest entry instead of the newest one (how does this making any friggin sense?)
I also want to change the scroll bar image of the list box.
I would appreciate any help.
You could try to save the current selection of the player, add the new entry, add an additional entry, select the last one, remove it and reselect the previously saved entry.
To change the scroll bar image you have to script your UI through XML files directly, I guess. In "StandardTemplates.SC2Layout" you'll find a list box template. Change its scroll bar. You may ask for further details if you are new to those XML files ;)
I ran into this problem with Malum Ruina and Xeno Crisis. My solution was to remove the old list items so the newest ones were always visible, eliminating the scroll bar completely.
@Sanktoras: Go
I actually tried that, all it does is scroll to the second newest entry (even after deleting the newest it still goes back one further, so there is always one entry that isn't shown).
@BasharTeg: Go
I considered that...but since I am using it as a chat I really want people to be able to go back through it.
Well you could create another dialog to act as a chat log. In that case, the player could click a button to bring up the log and peruse through it at his leisure.
The other consideration is to scrap the idea of using a list for chat and instead use a system which generates labels from chat messages.
you could also make an edit box at the bottom of the chat area which has the most recent message in it.or make a blank message at the bottom which remove each time it updates and the add the message and the blank back in, that way it always shows the most recent message. you could even have the blank be something like "Gameheart Overlay by rtschutter"
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Thank you guys very much for all of your suggestions. I am considering all of them.
I eventually came to the same idea that Willuwontu has suggested and it works okay, the main problem with it is that the scrollbar of course still shows that it isn't quite at the bottom yet (which will drive any OCD player like me up the wall).
The other problem with using a list box system is that if someone types too many characters it just cuts them off with a "..." at the end instead of dropping down to a new line and continuing. A dialog label system might be the right way to do it, but creating a scroll bar from scratch is not an idea that excites me to be honest.
Even with a label system you would run into the problem of text being cut off. Unless you have a font where every character is the same width, it's impossible to tell exactly how long each line will be. The system I used was to break the entered chat line into separate strings and create multiple list items. For example, if the entered chat line was between 20 and 40 characters, I would break the entered chat line into two substrings, the first being 20 characters long and the next being as long as the number of characters remaining in the chat line. It's certainly not ideal, but it worked well about 85% of the time.
@BasharTeg: Go
that method will not work if you are putting the players name in which since it is a chat system it will not work