Star Wars: BattleCry

Development forum for Star Wars: BattleCry
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 HUD | UI system

Go down 
AuthorMessage
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: HUD | UI system   Thu May 02, 2013 3:50 am

First off: I distinguish between (In-game) HUD (UI connected to the gameplay) and UI (main menu, smaller menus, server browser).

Now to the cool stuff: I've written the base for an a bit more sophisticated (and cleaner) HUD system today.
Design is as follows:
The HUD has been split into Infantry, Vehicle and Spawn Screen (for now).
These will all have separate UIElements (official name for Flash files you can load).

A C++ class (CGameHUD) with its ScriptBind (GameHUD) act as the middle man between the UI (Flash) and the gameplay code (either Lua or C++).
Most of the interaction will happen in the UI Flowgraph.
All calls sent from Lua (or other C++) to the GameHUD will be output into the Flowgraph via the CGameHUD class.
All fscommands from Flash will be output into the Flowgraph, too.
Then they all can be connected and interwoven etc.

So no UIElement file (or setup) is hardcoded.

I tried to keep the Lua-to-UI code to a minimum but as Lua IS the main gameplay it will always need to take part a bit.

The CGameHUD class will only be active as long as a map is loaded (which means if we want to have a map as background for the main menu we'd need to handle that as a special case).


Next up today: UI (as in main + sub menus)

That's not very important, it's just a good looking 'overlay' over some CVars/console commands. More knowledge is always better though, and the more planning we do until we get to creating the UI, the better.
For most of the main menu we won't even need code (as in, not-ActionScript code), the server browser will need some though.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
sceluk
void Work();


Posts : 364
Join date : 2012-11-07

PostSubject: Re: HUD | UI system   Thu May 02, 2013 8:01 am

Nice work
Since the main menu is a (scripted) map, the CGameHUD will be loaded. So the main menu will just be another HUD.
Back to top Go down
View user profile
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: HUD | UI system   Thu May 02, 2013 8:15 am

Yes, but it would be cleaner if we just ignored CGameHUD in that case and had one extra class for the main menu as it will need very different functionality.
With all the events (which we will at least need for the server browser) communicating between C++ and Flash the CGameHUD would be very cluttered.
We'll see about that when we come to the Main menu and comrades.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
sceluk
void Work();


Posts : 364
Join date : 2012-11-07

PostSubject: Re: HUD | UI system   Fri May 03, 2013 4:45 am

Hmm, I see your point. It would be more object oriented as well, and that means we can update one or the other without f'king everything up.
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: HUD | UI system   

Back to top Go down
 
HUD | UI system
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Star Wars: BattleCry :: Development :: Development discussion :: Coding-
Jump to: