The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
Adding Custom Setting - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: Adding Custom Setting (/showthread.php?tid=1702)



Adding Custom Setting - Linksblackmask - 03-13-2013

Hello Again All,

I was hoping for some advice, I'm trying add my own game setting to the options, and have hit a snag, it doesn't seem to want to show my option...

I have currently done the following;

--

added this to settings.h
public...
int GetRecordData() const
{
return RecordData;
}

void SetRecordData(int value)
{
RecordData = value;
}

private...
int RecordData;

added -

RecordData(0)

to the SETTINGS::SETTINGS() in settings.cpp

added-

Param(config, write, section, "RecordData", RecordData);

to the "display" section in SETTINGS::Serialize in settings.cpp

--

I have seen within vdrift.config my param has been added, however it fails to appear in the GUI, so my question is where/how do I add the option to the GUI??

and help would be massively appreciated!

all the best

Smile


RE: Adding Custom Setting - NaN - 03-14-2013

Ah, the SETTINGS class. Need to remove it someday, and serialize options directly instead.

I assume the RecordData value is some index, which is limited to some number. This number is determined at runtime?

1. In data/settings/options.config add
Code:
[ record_data ]
cat = game
name = record_data
desc = bla...
type = int
default = 0
values = record_data

2. Write a GAME:TongueopulateRecordData function (have a look at the existing populate functions for inspiration) to init record_data option. Add it to PopulateValueLists function.

3. In data/skins/simple/menus pick the guipage you want your option to be available. The guipage config might look a bit scary at first, mostly because it is explicit. There is no layout manager and co. But in general all you have to do is copy/paste an existing option and adjust the vertical position (top) and widget calbacks.

Example of adding a record_data option to Garage guipage:
1. Copy Traction Control option widgets: widget-14a,..., widget-14d
2. Rename them to whatever names you prefer: record-lbl, record-prv, record-nxt, record-val
3. Change record-lbl text
4. Fix the onfocus/onblur callbacks to point to the renamed widgets
5. Change onselect/onmoveright/onmoveleft/text callbacks to use game.record_data option
6. Fix onmovedown/onmoveup callbacks of you new widgets, the widgets before(widget-14) and the following widgets (widget-16).
7. Adjust the vertical(top) placement of the new and the following widgets and the height of [bg-options], [bg-labels] (should be renamed to labels/options-bg).

I know it looks somewhat laborious. Ideally there would be a minimal gui editor to deal with the details.


RE: Adding Custom Setting - Linksblackmask - 03-14-2013

:O

Record Data is a predefined list, 0 1 2 3, so I've found one that looked similar Smile

Okay, Thanks NaN! - getting on it Smile


RE: Adding Custom Setting - Linksblackmask - 03-14-2013

Winning! Thanks works great! Smile