Hooking up the OptionsDlg
by James Ford · in Torque Game Builder · 10/14/2007 (3:04 pm) · 1 replies
I am attempting to hook up the OptionsDlg from the common folder to work with my game. In particular I would like the user to be able to customize keybindings as in the TGB editor. However, I could not find where that tab is populated within options.cs.
This could be related to the errors I am seeing (and others have reported) about TGB failing to export xml settings when it is closed (binds.cs does not exist).
Well I'll do some more investigation on this but if anyone already knows drop me a note!
This could be related to the errors I am seeing (and others have reported) about TGB failing to export xml settings when it is closed (binds.cs does not exist).
Well I'll do some more investigation on this but if anyone already knows drop me a note!
About the author
http://jamesdev.info
Associate James Ford
Sickhead Games
It turns out its already loaded with the "common" path initialization. Keybinds automatically appear in the list if do:
activatepackage( keybindspackage );
before calling actionmap.bind(...), which is pretty cool to say the least.
The errors with loading and saving the commonconfig.xml file are not related, but also correctable.
My question now is conserning the defaultprefs.cs file. It appears that preferences are loaded but never saved back out. This means that when you, say, adjust the volume in the optionsdlg it will be back at its default value the next time you run TGB.
I am currently looking into how / if preferences are saved in the TGB editor scripts. It appears there are some console-functions for dealing specifically with preference files such as "execPref" and "export". But I am so far unclear as how to reimplement preference exporting for my own TGB project. Guess its time to whip out Visual Studio.
Drop me a line if you already have experience doing this!