Page 1 of 1

Feature Request: Setting Labels

Posted: 05 Feb 2009 17:30
by Zutty
Hi all,

I know its late in the day for feature requests but this is something that I think might make AIs a bit easier to use and help make NoAI feel more polished.

It would be nice if we could specify labels for settings such that the AI config window displays those labels (if provided) instead of the raw numbers. Something like...

Code: Select all

AddSetting({name = "aggro" description = "Aggression", min_value = 0, max_value = 1, easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = 0, labels = {0 = "Off, 1 = "On"}});
It would be nice to have "Low", "Medium", "High", etc.. instead of rather arbitrary looking 0...5 values. It would be especially useful though for stuff like "On" and "Off" for boolean 0, 1 values or for more abstract things that don't really represent continuous settings, e.g. if you wanted the player to be able to specify what cargo types are used you might want labels like "None", "Mail", "Mail & Goods", "All Cargo".

I know all the devs must be busy right now, and I can't imagine I'm the first person to think of or suggest this, but I thought I'd mention it anyway. :)

Thanks.

Re: Feature Request: Setting Labels

Posted: 05 Feb 2009 17:33
by Yexo
For boolean values, try using

Code: Select all

AddSetting({name = "some_bool" description = "Aggression", easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = AICONFIG_BOOLEAN});
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.

Re: Feature Request: Setting Labels

Posted: 05 Feb 2009 20:08
by Zutty
Yexo wrote:For boolean values, try using

Code: Select all

AddSetting({name = "some_bool" description = "Aggression", easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = AICONFIG_BOOLEAN});
Oooh I didn't know that. I might put this in the wiki (assuming it isn't already there!).
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.

Re: Feature Request: Setting Labels

Posted: 05 Feb 2009 20:25
by Yexo
Zutty wrote:
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.
Please read your pm.

Edit: I updated http://wiki.openttd.org/wiki/index.php/AI:AIInfo to reflect all current options.

Re: Feature Request: Setting Labels

Posted: 05 Feb 2009 23:10
by Zutty
Yexo wrote:
Zutty wrote:
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.
Please read your pm.

Edit: I updated http://wiki.openttd.org/wiki/index.php/AI:AIInfo to reflect all current options.
Thanks for the explanation. Some stuff in there I wasn't aware of!

Replied to your PM too.

Re: Feature Request: Setting Labels

Posted: 06 Feb 2009 00:39
by Yexo
Implemented in r15366, see http://wiki.openttd.org/wiki/index.php/AI:AIInfo for usage information.

Re: Feature Request: Setting Labels

Posted: 06 Feb 2009 01:11
by Zutty
Wow that was quick. Thanks very much Yexo. :bow: