Button in mod settings

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Button in mod settings

Post by darkfrei »

Hi devs!
Can you please to add button to runtime mod settings. It can be useful for reset some values, that this mod has collected.

Bilka
Factorio Staff
Factorio Staff
Posts: 3130
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Button in mod settings

Post by Bilka »

What?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Bilka wrote:
Wed Dec 11, 2019 6:43 pm
What?
For example my mod has seasons and the player wants to reset the season to default one. Just open mod settings and click on the "reset season" button for it.

Bilka
Factorio Staff
Factorio Staff
Posts: 3130
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Button in mod settings

Post by Bilka »

So this?
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Bilka wrote:
Wed Dec 11, 2019 7:59 pm
So this?
No, I don't want to reset settings, but I want some event, that can be called from mod settings, may be with the by the on_runtime_mod_setting_changed.

Another example - the players wants to reset evolution in the mod about custom evolution, but he cannot use just checkbox for it. If he clicks just the button, the event will be run and the script can change the evolution factor to 0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3130
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Button in mod settings

Post by Bilka »

You want a button for mod functionality mixed in with the mod settings, do I understand correctly?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Bilka wrote:
Wed Dec 11, 2019 8:33 pm
You want a button for mod functionality mixed in with the mod settings, do I understand correctly?
Yes, but this button can be used for changing mod's state.
2019-12-11T21_34_06-Window.png
2019-12-11T21_34_06-Window.png (33.95 KiB) Viewed 4197 times
Suggested button for mod settings:
2019-12-11T21_34_06-Window_a.png
2019-12-11T21_34_06-Window_a.png (30.44 KiB) Viewed 4191 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Button in mod settings

Post by Rseding91 »

I don't quite understand what you want. It sounds like maybe you want a way to individually reset some setting(s) to their default instead of all settings?
If you want to get ahold of me I'm almost always on Discord.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Rseding91 wrote:
Wed Dec 11, 2019 9:22 pm
I don't quite understand what you want. It sounds like maybe you want a way to individually reset some setting(s) to their default instead of all settings?
No, just interface for mod settings. If I want to set anything in the global to it's default value, then I can click the button n the mod interface. Right now I can do the same with the checkbox, but the checkbox has two options.
The suggested button must have only one position and the event will be triggered the same way as by the checkbox.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

I can write the mod "Always Day", where the player has the mod setting checkbox "always day for all surfaces enabled" = true.

The script checks all surfaces where surface.always_day is false, set them to true and adds the list of surfaces into the global table.

Another mod adds new surfaces, some of them have surface.always_day as true, some as false.

For updating I need to switch off the mod setting to false, then set it to true for handing all new added surfaces.

With such suggested buttons I can update the script manually, all new surfaces will be handled the same as before just click the button without disabling and enabling this mod setting.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Button in mod settings

Post by Rseding91 »

In that example, the mod should be listening to the surface_created event and setting the always_day value to true/false depending on the mod setting.
If you want to get ahold of me I'm almost always on Discord.

PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: Button in mod settings

Post by PyroFire »

Rseding91 wrote:
Wed Dec 11, 2019 9:22 pm
I don't quite understand what you want.
It sounds more like a macro button.

For example, in Randotorio i have a seed setting.
You can either enter the seed manually, or click this hypothetical settings-macro-button to give you a random seed.

+1

It also makes me think of having a thing that lets us select from "settings presets" that are author-configured settings.

example:
In Warptorio2, brutal difficulty is the *Only* difficulty and i'm wondering if there's an easy way to simplify having the options to finely-tune the difficulty or select from a preset.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Rseding91 wrote:
Thu Dec 12, 2019 3:52 pm
In that example, the mod should be listening to the surface_created event and setting the always_day value to true/false depending on the mod setting.
Yo are right. But with the button I can set the current surface to ignore list, or restart the script, for example if another mod needs surface without always_day changing.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Next issue: mod settings button to delete LuaRendering lines.

See bug report: https://mods.factorio.com/mod/PlayerTra ... 000cc1823e

The user has changed the time to very small and some of lines got time_to_live less than 1 tick.
It would be nice to start the event, that removes all lines.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Button in mod settings

Post by Klonan »

darkfrei wrote:
Thu Jan 23, 2020 8:24 am
Next issue: mod settings button to delete LuaRendering lines.

See bug report: https://mods.factorio.com/mod/PlayerTra ... 000cc1823e

The user has changed the time to very small and some of lines got time_to_live less than 1 tick.
It would be nice to start the event, that removes all lines.
You can add a console command, or something

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Button in mod settings

Post by darkfrei »

Klonan wrote:
Thu Jan 23, 2020 10:24 am
You can add a console command, or something
Yes, I can add console command, that disables achievements-with-mods; hotkey, that is normally never must be used; GUI, that close small part of view and normally must be not clicked; I can add migration and all lines by new version will be deleted; also I can this script to the event.on_configuration_changes.

Finally, I can add the checkbox to the mod settings and check if it was changed. Yes, I can use the check box as a button to raise the event for script starting, but not the button itself.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Button in mod settings

Post by Klonan »

darkfrei wrote:
Thu Jan 23, 2020 11:26 am
Klonan wrote:
Thu Jan 23, 2020 10:24 am
You can add a console command, or something
Yes, I can add console command, that disables achievements-with-mods;
Mod commands don't disable achievements:
https://lua-api.factorio.com/latest/Lua ... essor.html

nastyslave
Inserter
Inserter
Posts: 40
Joined: Sat Aug 06, 2016 11:48 am
Contact:

Re: Button in mod settings

Post by nastyslave »

+1 to need that sort of buttons!

curiosity
Filter Inserter
Filter Inserter
Posts: 325
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Button in mod settings

Post by curiosity »

nastyslave wrote:
Sun Apr 04, 2021 6:53 pm
+1 to need that sort of buttons!
No. Buttons that have nothing to do with settings have no place in settings. Add a button or a command in-game, where it belongs. Not in settings.

Post Reply

Return to “Modding interface requests”