Forums

Full Version: New menu system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Quote:Since I don't have outlines of all our tracks anymore, I have just taken some screenshots and used these for the track preview on the Practice Game and Network Game menus. Check out this screenshot of the Practice Game menu to see what it looks like. It'd be nice to have track outlines again, but I don't have an easy way to make them. Taking a screenshot from really high in the air in free camera mode sorta works but the result is not very pretty, especially on Road Atlanta and Nurburgring. One could trace such a screenshot though, and I may yet do that. I'd like to keep the track shots though, in fact...
I could write a track outline shot function easily (it'd be almost identical to my previous one) if you want outlines, but I really don't think they are as good as the track screenshots.
joevenzon Wrote:I could write a track outline shot function easily (it'd be almost identical to my previous one) if you want outlines, but I really don't think they are as good as the track screenshots.
That'd be great if you did, people like to see what the course is like to guage how difficult it will be. Might be nice to show the length too...I could cheat and put it in the outline pic Smileedit: having track outlines would be useful too, if we decide to have a little mini-track-map in the corner during the game that shows the cars on the tracks as dots or something, like many games have.
joevenzon Wrote:I'd suggest overlaying some semi-transparent text over the icon, such as "B1" over a joystick icon to indicate it's joystick button 1. Same goes with the axis number "A1", keyname "F1", etc.
Oops, missed this post earlier. I was thinking just putting the key name on the key would be possible, with a few exceptions - for the arrow keys there could be some actual arrows. In fact I could use the same arrow graphic, just rotate it different ways for the different arrow keys. SmileAs for axes and joystick buttons...I have been thinking about this a little, and it poses a little problem. If we use the joystick, axis or button numbers provided by the OS, then the numbering starts at zero (on Linux, not sure about Win/Mac). We could make this a little more user-friendly by starting numbering at 1. However, this may confuse power users who know that joystick indeces start at 0. For now, I think numbering from 0 is fine.Alternately, we could ditch numbers for joysticks/axes/buttons and use letters instead. It would be possibly less confusing, but just as meaningless and arbitrary (since most joysticks' axes and buttons aren't arranged in any order that makes immediate sense).The ideal way to do this would be for the user to have a way to map his joystick axes so that something like "joy 0 axis 0 (-)" is mapped to "first joystick left analog stick move up". Then when the controlgrab detects the user setting something to joy 0 axis 0 negative, it instead displays that he's moving the first joystick's left analog stick up by looking this up in a table. This is one of those ideas for the future...but it's the best way in my mind, it is most consistent with other racing games (especially console ones where they know which joystick axes are which actual joysticks). We could even come up with some presets so the user could just select "Logitech Wingman Rumblepad", "Gravis Gamepad", "Sony Playstation Controller", or allow the user to create his own control mapping for whatever control they have.
There was a problem with the game running slowly in the menus-v2 branch. I fixed this, it was objects.cpp calling settings.Get() in its Update(), so I just made objects have some local vars to remember what's in settings, which get updated any time the display settings are changed.This is fixed in r906.
Good catch.
Since the menus-v2 branch has stabilized and is largely usable now, I have merged it into the SVN trunk. Check out r924, compile install and test please...

Finally! 8)
A few bugs/comments

BTW: It is tested in windows, I dind't test these bugs in linux yet.

Assigning controls:
* When you go to a submenu your changes in that menu are lost (sice you din't click on OK)
* When you click on + when you didn't want it and you press escape all your previous changes are lost (you go back to the parent menu, but I did want to skip the current assign)
* You can't see easily wich keys are assigned to an item. (only how many)
At least for the most common ones (Up, Down, Left, Right, all letters) an image should be used.
EDIT 2:
* You can use multiple the same keys, without that it is warning you...

Change Display options
When you change a display option , vdrift becomes white and isn't usable anymore, maybe this is an error in my options which aren't compatible for my graphics card...
EDIT: Even when I don't change anything the menu is becoming white, but I remembered that this is a known bug in windows.
FFuser Wrote:A few bugs/comments

BTW: It is tested in windows, I dind't test these bugs in linux yet.

Assigning controls:
* When you go to a submenu your changes in that menu are lost (sice you din't click on OK)
* When you click on + when you didn't want it and you press escape all your previous changes are lost (you go back to the parent menu, but I did want to skip the current assign)
These two are now fixed plus some other little stuff in SVN (r934).

FFuser Wrote:* You can't see easily wich keys are assigned to an item. (only how many)
At least for the most common ones (Up, Down, Left, Right, all letters) an image should be used.
This is just a matter of getting around to making the graphics for this. I only need gfx for a few, the rest I can use the font system to draw.

FFuser Wrote:* You can use multiple the same keys, without that it is warning you...
I have to figure out a way to efficiently check all the controls available when one is assigned, so dupes don't happen...I'll see what I can come up with.

FFuser Wrote:Change Display options
When you change a display option , vdrift becomes white and isn't usable anymore, maybe this is an error in my options which aren't compatible for my graphics card...
EDIT: Even when I don't change anything the menu is becoming white, but I remembered that this is a known bug in windows.
OK the way this is supposed to work: User enters Display Options. If they make changes and press OK, the video settings are updated, and the textures are all reloaded. Windows is kinda funky in that when you change the application's resolution or something like that, the OpenGL context is lost. This requires the reload of all textures, which is done, so it should work. If it doesn't, I'm not sure what else can be done...perhaps Joe has some ideas...which textures are missing? all of them?


There are a few other things which need to be fixed that I will just jot down here so I don't forget:
* Joystick calibration routine still needed so joystick axes can be assigned, etc.
* Only first three controls can be accessed bug still there


Thanks to matthew_i for making the variously typed wheel widget classes one templated class. It is much easier to deal with that way.
hmmm r935 doesn't seem to work for me:

Code:
menu.cpp:225: error: 'class SETTINGS' has no member named 'GetIsHosting'
menu.cpp:226: error: 'class SETTINGS' has no member named 'GetServerIP'
menu.cpp:228: error: 'class SETTINGS' has no member named 'GetServerPort'
menu.cpp:806: error: 'class SETTINGS' has no member named 'SetIsHosting'
menu.cpp:807: error: 'class SETTINGS' has no member named 'SetServerIP'
menu.cpp:808: error: 'class SETTINGS' has no member named 'SetServerPort'
menu.cpp:1223: error: 'class VAMOSWORLD' has no member named 'ToggleHUD'
menu.cpp:1228: error: 'class SETTINGS' has no member named 'SetViewDistance'
menu.cpp:1233: error: 'class SETTINGS' has no member named 'SetViewDistance'
menu.cpp:1238: error: 'class SETTINGS' has no member named 'SetViewDistance'
menu.cpp:1243: error: 'class SETTINGS' has no member named 'SetTexSize'
menu.cpp:1248: error: 'class SETTINGS' has no member named 'SetTexSize'
menu.cpp:1253: error: 'class SETTINGS' has no member named 'SetTexSize'
menu.cpp:1259: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1265: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1271: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1277: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1283: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1289: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1295: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1301: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1307: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1313: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1319: error: 'class SETTINGS' has no member named 'SetSoundVolume'
menu.cpp:1325: error: 'class SETTINGS' has no member named 'SetMouseEnabled'
menu.cpp:1331: error: 'class SETTINGS' has no member named 'SetMouseXSens'
menu.cpp:1337: error: 'class SETTINGS' has no member named 'SetMouseXSens'
menu.cpp:1343: error: 'class SETTINGS' has no member named 'SetMouseXSens'
menu.cpp:1349: error: 'class SETTINGS' has no member named 'SetMouseXSens'
menu.cpp:1355: error: 'class SETTINGS' has no member named 'SetMouseXSens'
menu.cpp:1361: error: 'class SETTINGS' has no member named 'SetMouseYDead'
menu.cpp:1367: error: 'class SETTINGS' has no member named 'SetMouseYDead'
menu.cpp:1373: error: 'class SETTINGS' has no member named 'SetMouseYDead'
menu.cpp:1379: error: 'class SETTINGS' has no member named 'SetMouseYDead'
menu.cpp:1385: error: 'class SETTINGS' has no member named 'SetMouseYDead'
menu.cpp:1391: error: 'class SETTINGS' has no member named 'SetMouseYSens'
menu.cpp:1397: error: 'class SETTINGS' has no member named 'SetMouseYSens'
menu.cpp:1403: error: 'class SETTINGS' has no member named 'SetMouseYSens'
menu.cpp:1409: error: 'class SETTINGS' has no member named 'SetMouseYSens'
menu.cpp:1415: error: 'class SETTINGS' has no member named 'SetMouseYSens'
menu.cpp:1502: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1507: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1512: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1517: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1522: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1527: error: 'class GAMESTATE' has no member named 'SetTreeDetail'
menu.cpp:1532: error: 'class GAMESTATE' has no member named 'SetTerrainDetail'
menu.cpp:1537: error: 'class GAMESTATE' has no member named 'SetTerrainDetail'
menu.cpp:1542: error: 'class GAMESTATE' has no member named 'SetTerrainDetail'
menu.cpp:1547: error: 'class SETTINGS' has no member named 'SetMPH'
menu.cpp:1552: error: 'class SETTINGS' has no member named 'SetMPH'
menu.cpp:1557: error: 'class SETTINGS' has no member named 'SetAutoClutch'
menu.cpp:1562: error: 'class SETTINGS' has no member named 'SetAutoClutch'
menu.cpp:1892: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1898: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1900: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1901: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1901: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1902: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1903: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1903: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1905: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1907: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1911: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1916: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1918: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1932: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1934: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1935: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1939: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1976: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1980: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1981: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:1983: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2028: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2094: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2098: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2100: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2103: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2103: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2105: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2105: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2107: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2111: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2114: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2117: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2120: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2126: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2129: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2129: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2131: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2131: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2159: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2167: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2168: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2169: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2170: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2171: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2172: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2186: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2225: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2233: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2234: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2235: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2236: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2238: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2240: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2254: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2291: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2311: error: 'class GAMECONTROLS' has no member named 'GetControls'
menu.cpp:2515: error: 'class SETTINGS' has no member named 'SetCarName'
menu.cpp:2516: error: 'class SETTINGS' has no member named 'SetCarPaint'
menu.cpp:2727: error: 'class SETTINGS' has no member named 'GetCarName'
menu.cpp is no longer used... gui/gui.cpp and everything else in gui/ replaces it. 8)
ok thx works now ;-)
looks/works quite good, although i noticed that the display options do not use the dynamically determined resolutions anymore (that i checked in some days ago)
Almost nothing is dynamically listed now. The list of cars, the list of resolutions, etc. are all listed in the menu files now. I know this is a limitation but I haven't yet made widgets which can draw data from another location (not clear on how I want to implement it yet).
On the topic of dynamically loaded values, I think that the best way to handle this would be to create a list of options, their names, their types, and their possible values. For options such as track and selected_car, there could be a switch for that option allowing it to dynamically load those. For instance:
Code:
[option-00]
cat = game
name = game_mode
type = int
default = 0
values = list
opt00 = Free Drive
val00 = 0
opt01 = Time Trial
val01 = 1
opt02 = Networked
val02 = 2

[option-01]
cat = game
name = camera_mode
type = int
default = 0
values = list
opt00 = view_hood
val00 = 0
opt01 = view_incar
val01 = 1
opt02 = view_chaserigid
val02 = 2
....

[option-02]
cat = game
name = track
type = string
default = ruudskogen
values = tracks

[option-03]
cat = game
name = selected_car
type = string
default = XS
values = cars

[option-04]
cat = game
name = car_paint
type = int
default = 0
values = car_paints

...

my power is blinking...stupid thunderstorms...i'll finish this post in the morning
Alright to pick up where I left off, I have started creating an OPTION template class which will store a generic option and its list of values etc. The SETTINGS class will manage it (it's in settings.h) by maintaining vectors of each type of option (it already maintains vectors something like this but simpler).

This will greatly simplify menu design because now each widget that represents an option in the menu needs only to know the name of the setting that it corresponds to (in fact, they already do). Then using the setting name it can look up the data necessary.

The options data will be loaded when the SETTINGS class gets initialized and all dynamically generated value lists (like list of cars, car paint, tracks, and available resolutions) will be generated then too. The options definitions will be read from a file in the configfile format we use for other files, stored in "data/settings/options.config".

Since this file will have all the default values for each option, as well as the name and category, this data could be used to generate a VDrift.config with default values (which means we could perhaps get rid of the file "data/settings/VDrift.config"...)
There is yet another new class, VIDEOMODES in settings.h, added to manage video modes data (not sure if I'll keep this or just merge it into the SETTINGS class). This class's most important data structure is a vector<SDL_Rect> representing the valid video modes. I've written a function in SETTINGS which gets the list of valid modes.

The options list is now fully parsed in SVN r970. Next I'll start getting the SETTINGS class and Gui class to use the options data loaded dynamically and from the file. This shouldn't be terribly hard...
Pages: 1 2 3 4 5