Skip to content

Settings rework#194

Open
DaddelZeit wants to merge 8 commits intoTheHellBox:devfrom
DaddelZeit:settings-refactor
Open

Settings rework#194
DaddelZeit wants to merge 8 commits intoTheHellBox:devfrom
DaddelZeit:settings-refactor

Conversation

@DaddelZeit
Copy link
Copy Markdown
Contributor

This overhauls settings handling within KissMP. Previously, everything was stored inside kissui prepared for imgui widgets. This new solution notifies of changes passively via an extension hook and simplifies access to settings, instead of actively overwriting values from kissconfig directly.


This also introduces a new config save version. Previously, settings were stored like this:

{"base_secret_v2":" (omitted) ","show_drivers":false,"addr":"","show_nametags":true,"window_opacity":0.80000001192093,"enable_view_distance":false,"name":" (omitted) ","view_distance":300}

This was converted to:

{
  "data":{
    "perf.enable_view_distance":true,
    "perf.view_distance":200,
    "players.show_drivers":true,
    "players.show_nametags":true,
    "security.base_secret_v2":" (omitted) ",
    "ui.addr":"127.0.0.1:3690",
    "ui.name":" (omitted) ",
    "ui.window_opacity":0.89999997615814
  },
  "header":{
    "version":2
  }
}

Backward compatibility is given using header detection and converting formats if needed. Default values are provided in a separate config file and used by the code as fallback should a new version of KissMP run on an older config.


In addition to these changes, the settings tab within the main menu was overhauled. Previously, it looked like this:
grafik

This is the new layout:
grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants