GUI

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Sun Mar 23, 2008 11:57 pm

GUI

To all,
I've just dug through the CEGUI examples and although having a bit of trouble (Dave, when I switch the SdlDotNet example from the TaharezLook to SuaveLook it leaves some fairly ugly gaps and spacing all around the place...) it seems like this framework could be implemented quite easily...

So, what I'd like to do is get everyones preferences on how we should tackle the GUI...
Should we do it inside SDL? And if so, designs/styles/themes/concepts? ... I've always loved the Transport Tycoon Deluxe style toolbars... they work well... and having the permanent mini-map was good idea too...

Dave, are you tinkering with the WinForms vs. SDL (I can see this perpetually being a problem as SDL in itself [before it met .NET] was always a Single-Window and therefore never played well with others)?

Anyway, feel free to post screenshots, images, diagrams, etc... to help get this side of things rolling. :?

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Mon Mar 24, 2008 12:03 am

Re: GUI

Just to weigh in on the style side of things, I personally believe we should be true to the A-train style of UI. Of course, UI style is different to UI placement so we could be similar to TTD (toolbar + windows) - although I'll note that the minimap in TTD is a window (so can be closed - not sure what you meant by 'permanent').

Actually before I go any further I need to get FreeTrain running so I can play it a bit and understand the requirements a bit more. Hopefully that shouldn't be long after all the great work put in so far by yourself, Dave, and Atsushi.
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Mon Mar 24, 2008 12:58 am

Re: GUI

freegamer wrote:although I'll note that the minimap in TTD is a window (so can be closed - not sure what you meant by 'permanent').

Yah, have coded around and in that portion of the TTD code already 8-) I just meant the minimap that ATrain uses...

I suppose a proper round of usability testing/requirements gathering would be the best way to work out what we need in UI, but that's the ... real world approach and we all know everyone prefers to just hack something together and then manipulate to fit :o

jendave

Sticking around

Posts: 32

Joined: Fri Mar 14, 2008 7:53 pm

Post Mon Mar 24, 2008 3:41 pm

Re: GUI

stevenh wrote:Dave, are you tinkering with the WinForms vs. SDL (I can see this perpetually being a problem as SDL in itself [before it met .NET] was always a Single-Window and therefore never played well with others)?

Yes, but I have no idea if I can get this to work. Bascially, I am now looking at having a Winform Panel instance hold a single SDL window. That way, Winforms widgets can be used (since the project is rife with them), but they interact nicely with the SDL window. Note that SDL only allows one window period - end of discussion - so that is a limiting factor.

The problem with this approach is that it is platform specific. I have got it working on Windows, but not on Linux. Also the OSX version may even be impossible due to some window handle issues I have seen in the SDL mailing lists.

Right now I am going to focus on getting the current gui working on Linux (made some progress over the weekend), then worry about reworking it.

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Mon Mar 24, 2008 3:54 pm

Re: GUI

I think even a temporary solution is fine at this point. We can always go with two 'columns' inside a single window, putting the main game window in one column and the current active dialog alongside it in the other. A bit of wasted space is something that can be improved on later. We could always drop in the 'permanent' minimap as well.

Ascii art diagram:
  Code:
          main window
.-------------------------------------.
|                            |        |
|                            | dialog |
|                            |        |
|                            |        |
|         main game          |        |
|                            |--------|
|                            |        |
|                            | minimap|
|                            |        |
'-------------------------------------'
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

jendave

Sticking around

Posts: 32

Joined: Fri Mar 14, 2008 7:53 pm

Post Mon Mar 24, 2008 4:16 pm

Re: GUI

I agree with the layout. I will see what I can do to move towards that.

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Mon Mar 24, 2008 9:58 pm

Re: GUI

Have we got a Wiki yet?
I'm thinking that the SDL-based GUI is the best idea... not that I want to spoil your hard work... but the idea of having to have the controllers locked to a certain size and wedged in the main screen would be as damaging to them as having them rewitten in SDL :)

Based on your recent post of getting everything running on Linux, I take it the current situation of multiple extra dialogs on top of the SDL screen works ok? If so then that means the game is perfectly playable which is awesome. I suppose we just now need to make sure we have all the appropriate buttons available on the current Toolbar... of which needs re-architecting.

Thanks so much for joining this project :mrgreen:

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Tue Mar 25, 2008 12:39 am

Re: GUI

stevenh wrote:Have we got a Wiki yet?

For now use the Scratchpad wiki:
http://scratchpad.wikia.com/wiki/FreeTrain

When I install MediaWiki I'll copy across all the pages.
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Thu Mar 27, 2008 12:07 am

Re: GUI

Most likely not relevant nor helpful but I came across this discussion on cross-platform GUIs for Mono:
http://lists.ximian.com/pipermail/mono- ... 38059.html

You might try looking at the .NET bindings for the Qt toolkit (Qyoto).
AFAIK, Qt uses the native API on Windows so it will work nicely.

Qyoto home:
http://cougarpc.net/qyoto/

Of course the challenge for us is SDL...
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Thu Mar 27, 2008 12:46 am

Re: GUI

As you said, with anything like this the issue is creating another window on top of the SDL main window... unless we let them do so and limit the movement to within the main window....

jendave

Sticking around

Posts: 32

Joined: Fri Mar 14, 2008 7:53 pm

Post Thu Mar 27, 2008 7:28 pm

Re: GUI

Something I have been tinkering with the past couple of days is a Winforms MDI based solution. i have not checked it in, but when FT starts it opens the SDL window and a Winforms window. All of the basic controllers open up in that Winform. I was able to easily add the controllers for SLope, Land, Land Property, Station Passageway and PluginListDialog. It provides a nice unifed solution to the many-windows-all-over-the-place problem. It also could allow for the simplification of the controller classes (there is a lot of stuff in the classes to keep them in sync because they operate indendently). Before i check it in, I wanted to see if there were objections. I know this may not be the final solution, and I am still looking at some SDL-based ones, but I think it may be a good temporary solution since I have had success adding in the other controller/dialogs.

Thoughts?

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Thu Mar 27, 2008 7:58 pm

Re: GUI

Sounds ideal - what we want is something that first and foremost works and works with minimum of fuss. From there we can plan something more elegant/ideal and take time implementing it.

That's a yes, a vote for pragmatism. ;-)
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Thu Mar 27, 2008 9:56 pm

Re: GUI

Sounds ok to me... but just to clarify; the Winforms main window will just hold the controllers? not the main SDL window as well?

jendave

Sticking around

Posts: 32

Joined: Fri Mar 14, 2008 7:53 pm

Post Thu Mar 27, 2008 9:59 pm

Re: GUI

Right. There are two windows. The SDL Rendering window and the Winforms Controller window. It appears that I cannot get the SDL window to integrate with Winforms (at least not on Linux and OSX).

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Thu Mar 27, 2008 10:43 pm

Re: GUI

And then when things run smoothly and a stable release is made, we can [plan to] work on some way of migrating the WinForm controllers into swanky SDL counterparts...

...right? :D
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

stevenh

User avatar

Sticking around

Posts: 28

Joined: Sat Mar 15, 2008 4:48 am

Location: Canberra, Australia

Post Fri Mar 28, 2008 12:23 am

Re: GUI

...right... let's start a donation pot on paypal for the time required to do that. :P
Also, the work currently underway by our Japanese counterparts (FreeTrain Railways and such...) will heavily conflict and they'll all have to rewrite any GUIs they've made and everyone will be angry.
As much as I just want to dig in and create a pretty GUI in SDL... We need to work out a proper solution first... Dave is hard at work at forcing Forms and such to do what it's told... so we'll hold off on SDL GUI for now.

freegamer

User avatar

Site Admin

Posts: 119

Joined: Fri Mar 14, 2008 3:11 pm

Post Fri Mar 28, 2008 1:02 am

Re: GUI

That's kinda what I meant, although I can see how I was ambiguous.

Anybody had a look at their changes thus far?
Free Gamer - open source games blog
FreeGameDev forums - open source games development community

Return to Core Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.