Radio Button in Mod Settings

Discuss modding questions and implementation details.
Post Reply
User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Radio Button in Mod Settings

Post by Ralzar »

I just noticed that the ingame Effects Settings menu uses radio buttons.
For example, switching aspect ratio in Retro Mode settings.

Mod Settings, as far as I know, does not have a way to code the modsettings.json file to use this function. So everyone that makes a mod with a choice between several settings option uses the slider, which is not really what the slider is intended for and tends to look awkward in the layout.


So yeah, I was wondering if there was any way to get radio button for the mod settings?

User avatar
Interkarma
Posts: 7244
Joined: Sun Mar 22, 2015 1:51 am

Re: Radio Button in Mod Settings

Post by Interkarma »

That's a bespoke setup I made with a few checkbox controls. There's no radio control in DFU at this time.

It was easy to do though - make a method to clear all checkbox controls in group, call it from the click handler of each control in group, set self to enabled then do work on click as normal.

Post Reply