[REL] Settings Manager v1.6.0 [67342]

Discussion in 'Released Mods' started by Raevn, December 9, 2013.

  1. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    oh no, not again. The last time that happened it messed up half of the mods on PAMM.
  2. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Yeah but it looks fixable it should be easier to apply the Uber Visual style to the extra settings as well.
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    As an experiment I tried converting Gross Economy (which only uses drop-downs) to use the Uber system. Mind, I can't run the live game portion now, but getting a setting is trivial to test.

    Extending the list was no harder than Settings Manager (although I had to spell out the default value) There are no subcategories, and we'd have to supply HTML for the other control types. Great care may be required to add sections, because they use index numbers (!) in the HTML. This is especially crazy since api.settings.definitions is an object, I guess webkit must have ordered object keys.

    Getting settings will require changes, because settings manger didn't really address this. The obvious 'get' method is async, but synchronous 'value' appears to be used everywhere expect the KO extender (at the moment...), A mod that still wanted a settings POJO could probably replace the localStorage decode with api.settings.data[section], though that's violating the settings api encapsulation.

    Defaults supply a value from the setting definition when the value is undefined. initialSettingValue could either set the value or fill in a partial definition, but it will have know about groups in either case.
  4. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    The ideal way would just be to update this mod so it works again and matches the new settings style. That way we don't end up having to rewrite so many mods.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Do you mean make a visual update and still store things on localStorage.settings?
  6. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Well it all depends on how many times uber is gonna change the settings scene in the future.
    They've changed it a lot lately...
  7. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    yeah. That way it won't break existing mods.
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Another wrinkle with built-in system - api.settings.value will fail if a default is needed and there is no definition, which pushes towards having a settings file thats loaded in both settings and the mod's scene.
  9. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Workaround: .isSet(group, setting, true) is used by .value pre-defaults.
  10. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    As the PTE build is now the live build, this is broken in the live build currently. There are some mods that use it, however a fix is not blisteringly urgent imo, unless someone really wants to fix it before raevn gets back :p
  11. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Well raevn is back and we now can use uber's system.
  12. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    That's nice. Are there any mods using Uber's system that I can half-arsedly learn from?
  13. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    https://forums.uberent.com/threads/rel-gross-economy-v5-0-0-67342.56640/

    https://forums.uberent.com/threads/rel-instant-sandbox-1-3-0-67342.56920/

    Still some things I'm not entirely happy with (like defaults) Instant Sandbox had to hack an extra button in, so there may still be a place for an extended settings controls mod. That setting actually when outside of the settings system (even originally) and I didn't look into whether it could be integrated now.
    trialq likes this.
  14. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I've updated the mod so that the functions now map to the new settings API. I've only mapped across DropDown and Sliders; MultiSelect, buttons and text are deprecated. This is simply to stop mods breaking; mods should move to the new settings API.

Share This Page