Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Trivial Psychic on December 23, 2013, 11:25:32 pm

Title: Lab Space and Large Lists
Post by: Trivial Psychic on December 23, 2013, 11:25:32 pm
I was doing some examining of the BP2 shiplist in the Lab recently, and noticed how when some of the species lists are expanded, they list extends beyond the bottom of the screen.  Is it possible for there to be an automatic snap-to-next-column option, or perhaps a scrollbar or something?  As campaigns like BP add onto their creations with more expansion releases, the amount of available space will no longer be sufficient.
Title: Re: Lab Space and Large Lists
Post by: fightermedic on December 24, 2013, 05:53:19 am
i'm having the same problem with my own mod
fixing this would be welcome
Title: Re: Lab Space and Large Lists
Post by: z64555 on December 24, 2013, 08:10:28 am
Would anyone be willing to submit a Mantis ticket?  ;)
Title: Re: Lab Space and Large Lists
Post by: DahBlount on December 24, 2013, 03:12:28 pm
Problem is mantised. http://scp.indiegames.us/mantis/view.php?id=2986
Title: Re: Lab Space and Large Lists
Post by: z64555 on December 26, 2013, 02:08:08 pm
Ok, so, the issue is that there is no Scroll Bar that is available to the user. Creating the control itself is somewhat trivial.

However, the content inside the windows was not set up for scrolling, so the mechanism will have to be put in. There's a couple of scrolling methods that we can go with:

Sharp Scrolling:
Scrolling is achieved by sharply moving line by line, or character by character. Easy to implement with existing gr functions.

Smooth Scrolling:
Scrolling is achieved by smoothly moving the text pixel by pixel. Text and other content is clipped to be shown only within the borders. This may be tricky for me to do, because I haven't found any gr function that'll do something like this. The_E and m|m have suggested using Render-to-Texture of the text/content, painting it to a quad, and then scroll the texture.

Marque Scrolling:
Smooth scrolling, but the text "rolls" around the corners like you'd see on a marque, or belt. This can be achieved by manipulating quads the text is painted on so that they will tilt when they get to some predefined position away from the border.
Title: Re: Lab Space and Large Lists
Post by: Dragon on December 26, 2013, 05:08:10 pm
Sharp scrolling. Easy to implement and functional. Since the Lab is a modding tool, not an end user one, I think that it would be enough. No need for fancy changes that would probably end up taking longer and possibly eating up performance.
Title: Re: Lab Space and Large Lists
Post by: z64555 on December 26, 2013, 07:04:54 pm
As a matter of fact, I've found out that the credits screen in the Tech Room has smooth scrolling! It uses a clipping plane (that I couldn't find earlier) that will ignore all graphics calls outside of its bounding box. This in conjunction with some smart iteration through the text container will allow smooth scrolling to be implemented.

The reason I'm so focused on smooth scrolling is because it seems more professional to me, and if need be the same draw functions can be set up to do sharp scrolling with minimal changes.

There's still some other issues, though, such as the hot-spot regions that are used to hover/select over text will need to be taken into acount, and of course the scroll bars need to be implemented. I'll map things out and see what I can do.

Title: Re: Lab Space and Large Lists
Post by: FreeSpaceFreak on December 27, 2013, 03:54:30 am
I'd go with sharp scrolling too - for what Dragon said, and also because the Tech Room does it too.
Title: Re: Lab Space and Large Lists
Post by: Dragon on December 27, 2013, 12:42:31 pm
The reason I'm so focused on smooth scrolling is because it seems more professional to me, and if need be the same draw functions can be set up to do sharp scrolling with minimal changes.
Again, this is for modders, not for the end user. As such, the least complicated method would be preferable. You could even forgo the scroll bar, just use up/down arrows like in start menu on old Windows. If the program list would go off the screen, a little arrow would appear as the uppermost and lowermost position. They would scroll the menu, IIRC in sharp scrolling manner. Uncomplicated, can be done with minimal interface changes and has all the required functionality. The code is enough of a mess as it is, and such a minor, cosmetic feature as smooth scrolling is simply unnecessary. Scrolling itself is needed, but let's not forget about KISS.