tModLoader Mod Settings Configurator

Discussion in 'Works-in-Progress' started by Flashkirby99, Jun 1, 2017.

  1. Flashkirby99

    Flashkirby99 Skeletron

    Mod Settings Configurator
    v1.1, for tModLoader v0.10.0.1


    Just a simple menu for editing values for mods that support it. In case you ever wanted to do that. Minor support for HERO's Mod and Cheat Sheet in the form of a button!

    (Files are available on GitHub)
    If you want to copypasta and get this up and running, example code is here:

    Other things to remember/consider:
    • Include "weakReferences = FKTModSettings" in your build.txt
    • More variables that can be added:
    • [​IMG]
    • I cannot write tutorials to save my life.
    This mod can save changes in your mod for you, should you wish to know how it works, please refer to this tutorial by @goldenapple for information on how to use configuration files.


    Supported Mods
    Let me know if you manage to add stuff for this, I will include in the list. Also mods included from the occasional forum search.
    Todo List
    More of a self-reminder if I ever find the time to get back into this:

    • Better support for more ways to input and output variables.
    • Add generics.
    • Fix UI.
    • Fix multiplayer bugs (mods using this are using workarounds I believe).
    • String option support (Drop down lists).
    • Generally make it nicer to use.
    • Remove weak reference requirements, check out Mod Call methods.
    • Legacy support for inevitable rewrite as necessary.

    via GitHub
    via Mod Browser

    Flashkirby99 - I am making this mod.
    github repo
    Last edited: Nov 8, 2017
  2. goldenapple

    goldenapple Steampunker

    This is great! I wanted to do something like this for my mods, but I just didn't get around to it.

    Does your mod save the settings? I've looked through the source code and it looks like it doesn't... I could be wrong, though. Anyway, I think adding an option to save a setting would make this mod a lot more useful.

    Also, it would be really cool if you added support for string options. So that I could add an array of strings, and the user could pick one of them, same as True/False.
    Last edited: Jul 28, 2017
  3. Flashkirby99

    Flashkirby99 Skeletron

    Unfortunately not, but really a mod should be saving it's own settings anyway. I'll point to your tutorial on that on this page too just to be clear.

    Also I've considered the multi option bool thing before, but for now it's not top priority.
    Last edited: Jun 5, 2017
    the 11th doctor likes this.
  4. Flashkirby99

    Flashkirby99 Skeletron

    Updated to tModLoader

    This mod can now save the mod values you provide it with, using setting.EnableAutoConfig();

    See example for more information until I get around to writing a tutorial.
    CatNoir and hamstar like this.
  5. Jofairden

    Jofairden Golem

    Hey, I released Bouncy Coins v0.1.3, which integrates support with this mod!
    I added full control, meaning players can edit everything they want.
    The variables are stored per player. The bounce is only a visual change, so the positions of coins aren't actually affected.
    In any case, this means you can add the mod to your OP if you want.
    If anyone (modders) is interested in how I integrated, the source is available on Github.

    Here's an example of the settings screen
    Flashkirby99 likes this.
  6. CatNoir

    CatNoir Terrarian

    This Mod sounds too good! I hope it supports more mods some day
    Jofairden likes this.
  7. SlippyCheeze

    SlippyCheeze Terrarian

    I play at 2560x1600, which forces a scale of 133% on the game. The layout of the configuration dialog does not keep in sync with changed size. All the cursor vs control detection is off, etc. You can probably reproduce this by setting scaling above 100 percent on a 1920x1200 or smaller monitor, though I obviously can't test that myself. :)
    Flashkirby99 likes this.
  8. SlippyCheeze

    SlippyCheeze Terrarian

    FWIW, that is actually the wrong way around: you wish more mod authors would add support for "mod settings configerator", rather than this author adding support for more mods. :)
  9. I've made pretty much all my configurable mods support this GUI, however it causes immense strain with the more mods of mine I load with this. Like it's updating every tic in the background.

    This could be the MCM of Terraria, but this performance issue should be addressed.
    Also, perhaps the support of editing strings, single push buttons (not True/False buttons), cycling choice buttons and perhaps even dropdown boxes.
  10. Flashkirby99

    Flashkirby99 Skeletron

    Yeah definitely not sure how to code well or effeciently, but I only did this out of necessity since I couldn't find an equivalent to MCM anywhere. Sure it could use with tonnes of optimisation, but personally I think after having discussions about basically making this mod better, it could do with an almost complete rewrite on the back end.
  11. I believe for now, the only time it should run updates is when it's open. Then at least, there will be no loss of performance otherwise. Also, updating every nth tic should help keep it from slowing down too much too.
    Flashkirby99 likes this.
  12. Tyro

    Tyro Terrarian

    Does this work with tmodloader version 10.1? I'm using 10.0.2 and want to know if I can safely update.
  13. Flashkirby99

    Flashkirby99 Skeletron

    This mod and all others compiled for at least tModLoader 0.10, by numbering convention, should work with any version of tModLoader v0.10.*

    So yes. It will probably only stop working if there is a tModLoader 0.11, much like how we lost some mods from tModLoader 0.9 -> 0.10
  14. Tyro

    Tyro Terrarian

    Understood, thank you for the quick and helpful response :)
  15. Tyro

    Tyro Terrarian

    I'm not seeing it in the mod browser, and the OP here is far from exhaustive - I've seen multiple mods mention working with this that aren't mentioned up top. Off the top of my head, vanilla tweaks and its associated mods like boss expertise and recipe browser.
  16. Flashkirby99

    Flashkirby99 Skeletron

    Hi, thanks for reminding me; No idea why it might not be on the mod browser - I will go check. Also I'm bad at keeping lists up to date, forgive me.

    EDIT: Ok, added. Also did a quick search to see who else was using this and added that too.
    Last edited: Sep 25, 2017
    Tyro likes this.
  17. FinalDawn

    FinalDawn Terrarian

    Keep it up dude, this is a great mod!
    Flashkirby99 likes this.
  18. Tyro

    Tyro Terrarian

    There's a DPI scaling bug where if you scale up the UI it doesn't properly adjust the mouse location (you have to click somewhere that's not on a button to click a given button at anything but 100%, and if it's large enough you can't click on anything at all). I play at 150% UI and just now figured out what the problem was :/
  19. whismerhill

    whismerhill Terrarian

    hi, this mod seems great. I have a mod working with a text configuration file already, wondering about integrating this, though I don't want to lose the text file feature, hence not sure yet where it'll go yet in the workflow.Also unsure if live in game changes would be taken into account immediately.

    EDIT: turns out tmodloader will include a configuration menu sooner or later.
    it doesn't remove anything from this mod, just I think it's plain better for my mod to be configured BEFORE launching a game instead of DURING a game.
    Last edited: Jan 4, 2018