From 879d0650d4e80432dd6349b3ad672e299ec4e12e Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 21 Jun 2026 22:17:38 +0900 Subject: [PATCH] fix: insert missing values prior to serialization --- dzgui/config/convert.py | 6 ++++++ tests/fixtures/dztuirc_1 | 45 ++++++++++++++++++++++++++++++++++++++++ tests/fixtures/dztuirc_2 | 45 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 tests/fixtures/dztuirc_1 create mode 100644 tests/fixtures/dztuirc_2 diff --git a/dzgui/config/convert.py b/dzgui/config/convert.py index 8061adb..26fabf2 100644 --- a/dzgui/config/convert.py +++ b/dzgui/config/convert.py @@ -3,6 +3,8 @@ import shlex from pathlib import Path from typing import Any +from dzgui.const.boilerplate import config_boilerplate + """ Convert legacy dztuirc to config.json @@ -89,4 +91,8 @@ def rc2json(file: Path) -> str: keys["ip_list"] = ips keys["use_miles"] = False keys["start_tab"] = 0 + # NOTE: workaround for DZGUI 6 logic (see #375) + for key in config_boilerplate.keys(): + if key not in keys: + keys[key] = config_boilerplate[key] return json.dumps(keys, indent=2) diff --git a/tests/fixtures/dztuirc_1 b/tests/fixtures/dztuirc_1 new file mode 100644 index 0000000..9ba40aa --- /dev/null +++ b/tests/fixtures/dztuirc_1 @@ -0,0 +1,45 @@ +#Path to DayZ installation +steam_path="/tmp" + +#Battlemetrics API key +api_key="" + +#Favorited server IP:PORT array +ip_list=( +) + +#Favorite server to fast-connect to (limit one) +fav_server="" + +#Favorite server label (human readable) +fav_label="" + +#Custom player name (optional, required by some servers) +name="" + +#Set to 1 to perform dry-run and print launch options +debug="1" + +#Toggle stable/testing branch +branch="testing" + +#Start in fullscreen +fullscreen="false" + +#Steam API key +steam_api="" + +#Auto-install mods +auto_install="2" + +#Automod staging directory +staging_dir="/tmp" + +#Path to default Steam client +default_steam_path="/tmp" + +#Preferred Steam launch command (for Flatpak support) +preferred_client="steam" + +#DZGUI source path +src_path="" diff --git a/tests/fixtures/dztuirc_2 b/tests/fixtures/dztuirc_2 new file mode 100644 index 0000000..6869f4a --- /dev/null +++ b/tests/fixtures/dztuirc_2 @@ -0,0 +1,45 @@ +#Path to DayZ installation +steam_path="/tmp" + +#Battlemetrics API key +api_key="" + +#Favorited server IP:PORT array +ip_list=( +) + +#Favorite server to fast-connect to (limit one) +fav_server="" + +#Favorite server label (human readable) +fav_label="" + +#Custom player name (optional, required by some servers) +name="" + +#Set to 1 to perform dry-run and print launch options +debug="" + +#Toggle stable/testing branch +branch="testing" + +#Start in fullscreen +fullscreen="false" + +#Steam API key +steam_api="" + +#Auto-install mods +auto_install="0" + +#Automod staging directory +staging_dir="/tmp" + +#Path to default Steam client +default_steam_path="/tmp" + +#Preferred Steam launch command (for Flatpak support) +preferred_client="steam" + +#DZGUI source path +src_path=""