Page 1 of 1

Keeping mod settings and mod setting descriptions in sync

Posted: Thu Jan 02, 2020 10:02 am
by Pi-C
First, I want to wish a happy new year to everybody! :-)

I've found a problem with settings of a mod I've just installed. Here's the settings definition:

Code: Select all

    {
        type = "int-setting",
        name = "central-rails-rail-count",
        setting_type = "runtime-global",
        default_value = 2,
        minimum_value = 1,
        maximum_value = 10,
        order="hamster1"
    },
This is the matching description:

Code: Select all

-- Locale file
[mod-setting-description]
central-rails-rail-count=How many rails per side to install. Defaults to 1.
As you can see, the description ("Defaults to 1") doesn't fit the real default_value. These things happen if you change values in one file, but then forget to update the description as well -- I've been guilty of this myself previously. I think it would be useful if things like default, minimum, and maximum value of a setting would be accessible within the locale files, so that the values in the description would always be in sync with the actually allowed settings, something like:

Code: Select all

[mod-setting-description]
central-rails-rail-count=How many rails per side to install. Defaults to __MOD_SETTINGS_MAP__central-rails-rail-count__default_value__.
As far as I can see, it isn't possible to do this yet. Could you implement such a feature, please?

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Thu Jan 02, 2020 3:02 pm
by eradicator
I'd prefer having a tooltip stating default/min/max/etc on every mod setting value element (text field, listbox, checkbox) generated automatically.

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Mon Jan 20, 2020 11:38 am
by Honktown
eradicator wrote:
Thu Jan 02, 2020 3:02 pm
I'd prefer having a tooltip stating default/min/max/etc on every mod setting value element (text field, listbox, checkbox) generated automatically.
Minimum and maximum are there in numerical boxes... only if you enter a value outside of the range (the box goes red). Sadly no default value anywhere.

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 4:22 pm
by Rseding91
I could add a setting to mod settings that makes them show defaults/values/ranges in the tooltip along with the description.

Would that address this?

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 4:35 pm
by Pi-C
Rseding91 wrote:
Wed Feb 26, 2020 4:22 pm
I could add a setting to mod settings that makes them show defaults/values/ranges in the tooltip along with the description.

Would that address this?
It sounds like it would. :-)

A bit off-topic, I just noticed that in modsettings, there is a scrollbar for start-up and per-player settings, but not for map settings. The list of map settings does fill more than fits on the screen, and I can use the mouse wheel to scroll down the list, but it looks strange that the scrollbar is missing. Should I file a separate bug for that?

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 4:39 pm
by Optera
Could we also have a way to read default, min and max values during data stage?
For example I'd like to only change a stack size to setting.value when setting.default_value == item.stack_size.

Probably should start a new post for this.

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 4:54 pm
by Rseding91
Optera wrote:
Wed Feb 26, 2020 4:39 pm
Could we also have a way to read default, min and max values during data stage?
For example I'd like to only change a stack size to setting.value when setting.default_value == item.stack_size.

Probably should start a new post for this.
No, that's exactly what can never be done because it's a cyclic dependency.

data stage is defined using mod settings. Now you want mod settings defined using data stage. It just doesn't work :)


Nevermind that, I miss-read what you asked for.

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 5:12 pm
by Rseding91
Pi-C wrote:
Wed Feb 26, 2020 4:35 pm
Rseding91 wrote:
Wed Feb 26, 2020 4:22 pm
I could add a setting to mod settings that makes them show defaults/values/ranges in the tooltip along with the description.

Would that address this?
It sounds like it would. :-)

A bit off-topic, I just noticed that in modsettings, there is a scrollbar for start-up and per-player settings, but not for map settings. The list of map settings does fill more than fits on the screen, and I can use the mouse wheel to scroll down the list, but it looks strange that the scrollbar is missing. Should I file a separate bug for that?
You mean this one? viewtopic.php?f=11&t=74891

It might be resolved in the next release. If you have a save with mods to reproduce it and it still happens in the next release then yes make a new report.

Re: Keeping mod settings and mod setting descriptions in sync

Posted: Wed Feb 26, 2020 5:26 pm
by Pi-C
Rseding91 wrote:
Wed Feb 26, 2020 5:12 pm
Pi-C wrote:
Wed Feb 26, 2020 4:35 pm
A bit off-topic, I just noticed that in modsettings, there is a scrollbar for start-up and per-player settings, but not for map settings. The list of map settings does fill more than fits on the screen, and I can use the mouse wheel to scroll down the list, but it looks strange that the scrollbar is missing. Should I file a separate bug for that?
You mean this one? viewtopic.php?f=11&t=74891
I see more or less the same thing, but in my case, it is the map settings where the scrollbar is missing, while the startup settings are OK.
It might be resolved in the next release. If you have a save with mods to reproduce it and it still happens in the next release then yes make a new report.
I got the save file from somebody who reported a crash in one of my mods. I'll try to reproduce it later with my own game, but I guess I'd get permission to forward the original file if necessary.