From 24a1a8211e7f20dfe9551343c963c8354078adb7 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 28 Aug 2024 07:34:09 +0900 Subject: [PATCH 01/22] chore: bump version --- dzgui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dzgui.sh b/dzgui.sh index 3e764be..9f0982e 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.3.3-beta.5 +version=5.3.3-beta.6 #CONSTANTS aid=221100 From 80babbfea89f0c50f882df1d198b6bf4802a9c80 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 28 Aug 2024 07:52:20 +0900 Subject: [PATCH 02/22] fix: conditional operator --- dzgui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index 9f0982e..fd08763 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.3.3-beta.6 +version=5.3.3-beta.7 #CONSTANTS aid=221100 @@ -380,7 +380,7 @@ test_display_mode(){ check_architecture(){ local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}') read -a APU_MODEL <<< "$cpu" - if [[ ${APU_MODEL[3]} != "0932" ]] || [[ ${APU_MODEL[3]} != "0405" ]]; then + if [[ ${APU_MODEL[3]} != "0932" ]] && [[ ${APU_MODEL[3]} != "0405" ]]; then is_steam_deck=0 logger INFO "Setting architecture to 'desktop'" return From 06359a40aeb6d615441fbb4d528c9524edd0e592 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:42:51 +0900 Subject: [PATCH 03/22] fix: block/unblock signal handlers --- CHANGELOG.md | 19 ++++++++++++++----- docs/dzgui.adoc | 4 ++++ docs/dzgui_dark.adoc | 4 ++++ dzgui.sh | 10 +++++++--- helpers/funcs | 2 +- helpers/ui.py | 15 ++++++++++----- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7831b8..9b61325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,36 @@ # Changelog -## [5.3.3-beta.5] 2024-08-27 +## [5.4.1-beta.5] 2024-09-10 +### Added +- Pre-boot validation check for users with self-compiled version of jq +### Fixed +- When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps +- Server filter toggle signals were accessible from the main menu when switching between menu contexts +- Global cooldown dialog could sometimes block filter toggles after cooldown reset +- Normalized minor version number due to a previous clerical error + +## [5.4.0-beta.5] 2024-08-27 ### Added - Freedesktop application icons for system taskbar, tray, and other dialogs ### Fixed - Errors being printed to the console when Exit button was explicitly clicked -## [5.3.3-beta.4] 2024-08-21 +## [5.4.0-beta.4] 2024-08-21 ### Added - Emit CPU model name when exporting system debug log ### Fixed - Detect Steam Deck OLED APU variant during initial setup -## [5.3.3-beta.3] 2024-08-04 +## [5.4.0-beta.3] 2024-08-04 ### Added - Scan local area network for DayZ servers -## [5.3.3-beta.2] 2024-08-03 +## [5.4.0-beta.2] 2024-08-03 ### Fixed - Clerical hotfix for previous player names fix - Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection -## [5.3.3-beta.1] 2024-07-16 +## [5.4.0-beta.1] 2024-07-16 ### Fixed - Encapsulate player names correctly so that names with whitespace in them are supported diff --git a/docs/dzgui.adoc b/docs/dzgui.adoc index e18dcff..e059491 100644 --- a/docs/dzgui.adoc +++ b/docs/dzgui.adoc @@ -33,6 +33,10 @@ All dependencies are installed out of the box on Steam Deck. - `wmctrl` or `xdotool` - `PyGObject` (`python-gobject`) + +[NOTE] +If you are using a self-compiled version of jq (e.g. gentoo), it must be configured with support for oniguruma (this is the default setting on most distributions). + === Preparation ==== Step 1: Download DZGUI and make it executable diff --git a/docs/dzgui_dark.adoc b/docs/dzgui_dark.adoc index 004be46..967ffa5 100644 --- a/docs/dzgui_dark.adoc +++ b/docs/dzgui_dark.adoc @@ -33,6 +33,10 @@ All dependencies are installed out of the box on Steam Deck. - `wmctrl` or `xdotool` - `PyGObject` (`python-gobject`) + +[NOTE] +If you are using a self-compiled version of jq (e.g. gentoo), it must be configured with support for oniguruma (this is the default setting on most distributions). + === Preparation ==== Step 1: Download DZGUI and make it executable diff --git a/dzgui.sh b/dzgui.sh index fd08763..0a1d3e2 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.3.3-beta.7 +version=5.4.1-beta.1 #CONSTANTS aid=221100 @@ -220,6 +220,10 @@ depcheck(){ raise_error_and_quit "$msg" fi done + local jqmsg="jq must be compiled with support for oniguruma" + local jqtest + jqtest=$(echo '{"test": "foo"}' | jq '.test | test("^foo$")') + [[ $? -ne 0 ]] && raise_error_and_quit "$jqmsg" logger INFO "Initial dependencies satisfied" } check_pyver(){ @@ -562,10 +566,10 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="f89047e3fde843dbb52d343daf8d2675" + ["ui.py"]="9a5df05a4b67af3be06e39d9d7cebff3" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="44eca80b207057423c2d298cc7cf1e29" + ["funcs"]="b73289e0aa71a91da539c28707a6405c" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index 7d19b29..59bf84e 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.3.3 +version=5.4.1 #CONSTANTS aid=221100 diff --git a/helpers/ui.py b/helpers/ui.py index a15fc50..37b56d6 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -19,7 +19,7 @@ gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango from enum import Enum -# 5.3.3 +# 5.4.1 app_name = "DZGUI" start_time = 0 @@ -574,6 +574,7 @@ class ButtonBox(Gtk.Box): column = Gtk.TreeViewColumn(column_title, renderer, text=i) treeview.append_column(column) self._populate(context) + toggle_signal(treeview, treeview, '_on_keypress', False) treeview.set_model(row_store) treeview.grab_focus() @@ -1033,7 +1034,6 @@ class TreeView(Gtk.TreeView): # Local server lists may have different filter toggles from remote list # FIXME: tree selection updates twice here. attach signal later toggle_signal(self, self.selected_row, '_on_tree_selection_changed', False) - # toggle_signal(self, self.selected_row, '_on_check_toggled', False) for column in self.get_columns(): self.remove_column(column) row_store.clear() @@ -1071,6 +1071,10 @@ class TreeView(Gtk.TreeView): self.update_first_col(mode) transient_parent = self.get_outer_window() + # Reset map selection + selected_map.clear() + selected_map.append("Map=All maps") + for check in checks: toggle_signal(self.get_outer_grid().right_panel.filters_vbox, check, '_on_check_toggle', True) toggle_signal(self, self, '_on_keypress', True) @@ -1190,20 +1194,20 @@ class TreeView(Gtk.TreeView): valid_contexts = ["Server browser", "My saved servers", "Recent servers", "Scan LAN servers"] if chosen_row in valid_contexts: # server contexts share the same model type - for check in checks: - toggle_signal(filters_vbox, check, '_on_check_toggle', False) if chosen_row == "Server browser": - reinit_checks() cooldown = call_out(self, "test_cooldown", "", "") if cooldown.returncode == 1: spawn_dialog(self.get_outer_window(), cooldown.stdout, "NOTIFY") return 1 + reinit_checks() else: for check in checks: if check.get_label() not in toggled_checks: toggled_checks.append(check.get_label()) check.set_active(True) + for check in checks: + toggle_signal(filters_vbox, check, '_on_check_toggle', False) self._update_multi_column(chosen_row) map_store.clear() @@ -1812,6 +1816,7 @@ class App(Gtk.Application): is_steam_deck = False is_game_mode = False + GLib.set_prgname(app_name) self.win = OuterWindow(is_steam_deck, is_game_mode) self.win.set_icon_name("dzgui") From 523ff2c32d732e0934e79a2a058a9f68054309fc Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:57:33 +0900 Subject: [PATCH 04/22] fix: signal control flow --- CHANGELOG.md | 6 +++++- dzgui.sh | 2 +- helpers/ui.py | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b61325..0ca8908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## [5.4.1-beta.5] 2024-09-10 +## [5.4.1-beta.2] 2024-09-10 +### Fixed +- Checkbox toggle signal handling control flow + +## [5.4.1-beta.1] 2024-09-10 ### Added - Pre-boot validation check for users with self-compiled version of jq ### Fixed diff --git a/dzgui.sh b/dzgui.sh index 0a1d3e2..e8ae0de 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -566,7 +566,7 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="9a5df05a4b67af3be06e39d9d7cebff3" + ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="b73289e0aa71a91da539c28707a6405c" diff --git a/helpers/ui.py b/helpers/ui.py index 37b56d6..5e77f68 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -1200,14 +1200,15 @@ class TreeView(Gtk.TreeView): if cooldown.returncode == 1: spawn_dialog(self.get_outer_window(), cooldown.stdout, "NOTIFY") return 1 + for check in checks: + toggle_signal(filters_vbox, check, '_on_check_toggle', False) reinit_checks() else: for check in checks: + toggle_signal(filters_vbox, check, '_on_check_toggle', False) if check.get_label() not in toggled_checks: toggled_checks.append(check.get_label()) check.set_active(True) - for check in checks: - toggle_signal(filters_vbox, check, '_on_check_toggle', False) self._update_multi_column(chosen_row) map_store.clear() From 3e1170ffd8adfb1da72d95c3e11feb46ddf88a31 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:42:47 +0900 Subject: [PATCH 05/22] fix: fallback logic for network traversal (#128) --- CHANGELOG.md | 6 +++++- dzgui.sh | 4 ++-- helpers/funcs | 38 +++++++++++++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca8908..c62e093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog +## [5.4.1-beta.2] 2024-09-12 +### Fixed +- Use fallback logic for modlist queries when user traverses networks + ## [5.4.1-beta.2] 2024-09-10 ### Fixed -- Checkbox toggle signal handling control flow +- Fix signal handling control flow for checkbox toggles ## [5.4.1-beta.1] 2024-09-10 ### Added diff --git a/dzgui.sh b/dzgui.sh index e8ae0de..420b769 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.1-beta.1 +version=5.4.1-beta.3 #CONSTANTS aid=221100 @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="b73289e0aa71a91da539c28707a6405c" + ["funcs"]="4a06a823b6240c518687d2a8ec20e914" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index 59bf84e..16030fd 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -285,7 +285,15 @@ a2s(){ local qport="$2" local mode="$3" logger INFO "Querying '$ip:$qport' with mode '$mode'" - python3 "$query_helper" "$ip" "$qport" "$mode" + local res + res=$(python3 "$query_helper" "$ip" "$qport" "$mode") + if [[ $? -eq 1 ]]; then + res=$(try_fallback "$ip" "$qport" "$mode") + if [[ $? -eq 1 ]]; then + return 1 + fi + fi + printf "%s\n" "$res" } is_in_favs(){ shift @@ -1064,6 +1072,34 @@ update_symlinks(){ legacy_symlinks symlinks } +try_fallback(){ + local ip="$1" + local qport="$2" + local mode="$3" + if [[ $mode != "rules" ]] && [[ $mode != "names" ]]; then + return 1 + fi + [[ -z $api_key ]] && return 1 + local res=$(curl -s "$bm_api" -H "Authorization: Bearer "$api_key"" \ + -G -d "filter[game]=$game" \ + -d "filter[search]=%22${ip}:${qport}%22") + [[ -z $res ]] && return 1 + local len=$(<<< "$res" jq '.data|length') + [[ $len -eq 0 ]] && return 1 + local record=$(<<< "$res" jq -r ' + .data[].attributes + |select(.status != "removed").details') + case "$mode" in + "rules") + <<< "$record" jq '.modIds[]' + ;; + "names") + <<< "$record" jq ' + [.modNames, .modIds] as [$n, $i] + | {names: $n, ids: $i}' + ;; + esac +} try_connect(){ local record="$1" local ip=$(<<< $record awk -F: '{print $1}') From ed07fd03435adcf6ef985367b22dca1774663224 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:08:29 +0900 Subject: [PATCH 06/22] chore: normalize changelog --- CHANGELOG.md | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c62e093..7c4bd94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,46 +1,26 @@ # Changelog -## [5.4.1-beta.2] 2024-09-12 -### Fixed -- Use fallback logic for modlist queries when user traverses networks - -## [5.4.1-beta.2] 2024-09-10 -### Fixed -- Fix signal handling control flow for checkbox toggles - -## [5.4.1-beta.1] 2024-09-10 +## [5.4.1] 2024-09-25 ### Added - Pre-boot validation check for users with self-compiled version of jq ### Fixed +- Use fallback logic for modlist queries when user traverses networks +- Fix signal handling control flow for checkbox toggles - When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps - Server filter toggle signals were accessible from the main menu when switching between menu contexts - Global cooldown dialog could sometimes block filter toggles after cooldown reset - Normalized minor version number due to a previous clerical error -## [5.4.0-beta.5] 2024-08-27 -### Added -- Freedesktop application icons for system taskbar, tray, and other dialogs -### Fixed -- Errors being printed to the console when Exit button was explicitly clicked - -## [5.4.0-beta.4] 2024-08-21 -### Added -- Emit CPU model name when exporting system debug log -### Fixed -- Detect Steam Deck OLED APU variant during initial setup - -## [5.4.0-beta.3] 2024-08-04 +## [5.4.0] 2024-08-27 ### Added - Scan local area network for DayZ servers - -## [5.4.0-beta.2] 2024-08-03 -### Fixed -- Clerical hotfix for previous player names fix -- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection - -## [5.4.0-beta.1] 2024-07-16 +- Freedesktop application icons for system taskbar, tray, and other dialogs +- Emit CPU model name when exporting system debug log ### Fixed +- Errors being printed to the console when Exit button was explicitly clicked +- Detect Steam Deck OLED APU variant during initial setup - Encapsulate player names correctly so that names with whitespace in them are supported +- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection ## [5.3.2] 2024-07-02 ### Fixed From d10cd212b4a3b3709bb266e9a61ecb962070bf45 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 6 Oct 2024 03:19:32 +0900 Subject: [PATCH 07/22] fix: sanitize UGC IDs (#155) --- CHANGELOG.md | 4 ++++ dzgui.sh | 6 +++--- helpers/funcs | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c62e093..fe6a399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [5.4.2-beta.1] 2024-10-05 +### Fixed +- Sanitize third-party API IDs to remove UGC collisions + ## [5.4.1-beta.2] 2024-09-12 ### Fixed - Use fallback logic for modlist queries when user traverses networks diff --git a/dzgui.sh b/dzgui.sh index 420b769..fe7b953 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.1-beta.3 +version=5.4.2-beta.1 #CONSTANTS aid=221100 @@ -549,7 +549,7 @@ fetch_icons(){ "128" "256" ) - url="$testing_url/images/icons" + url="$stable_url/images/icons" for i in "${res[@]}"; do size="${i}x${i}" dir="$HOME/.local/share/icons/hicolor/$size/apps" @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="4a06a823b6240c518687d2a8ec20e914" + ["funcs"]="7221bda853145942c4c728cbc76ac633" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index 16030fd..071c8d3 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1019,7 +1019,11 @@ query_defunct(){ -H "Content-Type:application/x-www-form-urlencoded"\ -d "$(payload)" 'https://api.steampowered.com/ISteamRemoteStorage/GetPublishedFileDetails/v1/?format=json' } - local result=$(post | jq -r '.[].publishedfiledetails[] | select(.result==1) | "\(.file_size) \(.publishedfileid)"') + local result=$(post | jq -r ' + .[].publishedfiledetails[] + | select(.result==1) + | select(.filename|contains("screenshot")|not) + | "\(.file_size) \(.publishedfileid)"') <<< "$result" awk '{print $2}' } encode(){ @@ -1177,6 +1181,7 @@ focus_beta_client(){ $steam_cmd steam://open/console 2>/dev/null 1>&2 } auto_mod_install(){ + # currently unused, merged with manual method local ip="$1" local gameport="$2" local diff="$3" From 278aa8c28ab3b832ff53ac783c3a35dba55ecfe3 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 6 Oct 2024 03:26:24 +0900 Subject: [PATCH 08/22] chore: update checksum --- CHANGELOG.md | 42 +++++++++++------------------------------- dzgui.sh | 4 ++-- helpers/funcs | 2 +- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe6a399..edf2aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,50 +1,30 @@ # Changelog -## [5.4.2-beta.1] 2024-10-05 -### Fixed +## [5.4.2] 2024-10-05 - Sanitize third-party API IDs to remove UGC collisions -## [5.4.1-beta.2] 2024-09-12 -### Fixed -- Use fallback logic for modlist queries when user traverses networks - -## [5.4.1-beta.2] 2024-09-10 -### Fixed -- Fix signal handling control flow for checkbox toggles - -## [5.4.1-beta.1] 2024-09-10 +## [5.4.1] 2024-09-25 ### Added - Pre-boot validation check for users with self-compiled version of jq ### Fixed +- Use fallback logic for modlist queries when user traverses networks +- Fix signal handling control flow for checkbox toggles - When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps - Server filter toggle signals were accessible from the main menu when switching between menu contexts - Global cooldown dialog could sometimes block filter toggles after cooldown reset - Normalized minor version number due to a previous clerical error -## [5.4.0-beta.5] 2024-08-27 -### Added -- Freedesktop application icons for system taskbar, tray, and other dialogs -### Fixed -- Errors being printed to the console when Exit button was explicitly clicked - -## [5.4.0-beta.4] 2024-08-21 -### Added -- Emit CPU model name when exporting system debug log -### Fixed -- Detect Steam Deck OLED APU variant during initial setup - -## [5.4.0-beta.3] 2024-08-04 +## [5.4.0] 2024-08-27 ### Added - Scan local area network for DayZ servers - -## [5.4.0-beta.2] 2024-08-03 -### Fixed -- Clerical hotfix for previous player names fix -- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection - -## [5.4.0-beta.1] 2024-07-16 +- Freedesktop application icons for system taskbar, tray, and other dialogs +- Emit CPU model name when exporting system debug log ### Fixed +- Errors being printed to the console when Exit button was explicitly clicked +- Detect Steam Deck OLED APU variant during initial setup - Encapsulate player names correctly so that names with whitespace in them are supported +- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection +- Report WM_CLASS name to the window manager ## [5.3.2] 2024-07-02 ### Fixed diff --git a/dzgui.sh b/dzgui.sh index fe7b953..7b9437e 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.2-beta.1 +version=5.4.2 #CONSTANTS aid=221100 @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="7221bda853145942c4c728cbc76ac633" + ["funcs"]="71d3a941209792a41f381f011e78def8" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index 071c8d3..8bf10c5 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.1 +version=5.4.2 #CONSTANTS aid=221100 From d7b3ff8b3e1e799dedddb81a04ab8e3227acd5cd Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 6 Oct 2024 03:29:20 +0900 Subject: [PATCH 09/22] chore: update checksum --- dzgui.sh | 2 +- helpers/funcs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index fe7b953..638435f 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="7221bda853145942c4c728cbc76ac633" + ["funcs"]="71d3a941209792a41f381f011e78def8" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index 071c8d3..8bf10c5 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.1 +version=5.4.2 #CONSTANTS aid=221100 From 9189837a344584eecb32fd0b7d8bee128e19c1c5 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:58:56 +0900 Subject: [PATCH 10/22] feat: support dlc servers --- CHANGELOG.md | 7 +++++ dzgui.sh | 12 ++++---- helpers/funcs | 32 +++++++++++++++++---- helpers/ui.py | 80 ++++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 106 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe6a399..7677861 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [5.5.0-beta.1] 2024-10-30 +### Added +- Support servers running DLC content (fixes Frostline servers) +- Text autocompletion in maps search field +### Fixed +- Abort fallback query method if DLC is required + ## [5.4.2-beta.1] 2024-10-05 ### Fixed - Sanitize third-party API IDs to remove UGC collisions diff --git a/dzgui.sh b/dzgui.sh index 638435f..dd7bbec 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -525,14 +525,14 @@ fetch_a2s(){ logger INFO "Updated A2S helper to sha '$sha'" } fetch_dzq(){ - local sum="232f42b98a3b50a0dd6e73fee55521b2" + local sum="9caed1445c45832f4af87736ba3f9637" local file="$helpers_path/a2s/dayzquery.py" if [[ -f $file ]] && [[ $(get_hash "$file") == $sum ]]; then logger INFO "DZQ is current" return 0 fi - local sha=ccc4f71b48610a1885706c9d92638dbd8ca012a5 - local author="yepoleb" + local sha=788e85b82189cb3485d4a08ee350c67994b29ea3 + local author="aclist" local repo="dayzquery" local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py" curl -Ls "$url" > "$file" @@ -566,10 +566,10 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="9cac4d3b87ef292e7d30b25ca86cc438" + ["ui.py"]="91ea4d842d35a7d5e1441174f1f463c5" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="71d3a941209792a41f381f011e78def8" + ["funcs"]="105e7be170eea48ce61fcfe7b50b8f59" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" @@ -868,7 +868,7 @@ initial_setup(){ watcher_deps check_architecture test_connection - fetch_helpers > >(pdialog "Checking helper files") +# fetch_helpers > >(pdialog "Checking helper files") varcheck source "$config_file" lock diff --git a/helpers/funcs b/helpers/funcs index 8bf10c5..6aa8790 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.2 +version=5.5.0 #CONSTANTS aid=221100 @@ -280,6 +280,14 @@ initialize_remote_servers(){ res=$(get_remote_servers) parse_server_json "$res" >> "$file" } +is_dlc(){ + local dlc + local ip="$1" + local gport="$2" + local res="$(curl -Ls "https://api.steampowered.com/IGameServersService/GetServerList/v1/?filter=\gameaddr\\${ip}:${gport}\appid\221100&key=$steam_api")" + dlc=$(<<< "$res" jq '.response.servers[].gametype|contains("isDLC")') + printf "%s\n" "$dlc" +} a2s(){ local ip="$1" local qport="$2" @@ -1081,25 +1089,39 @@ try_fallback(){ local qport="$2" local mode="$3" if [[ $mode != "rules" ]] && [[ $mode != "names" ]]; then + logger WARN "Fallback query API called with an invalid mode: '$mode'" return 1 fi [[ -z $api_key ]] && return 1 + logger INFO "Using fallback query API on '$ip:$qport' with mode: '$mode'" local res=$(curl -s "$bm_api" -H "Authorization: Bearer "$api_key"" \ -G -d "filter[game]=$game" \ -d "filter[search]=%22${ip}:${qport}%22") [[ -z $res ]] && return 1 local len=$(<<< "$res" jq '.data|length') [[ $len -eq 0 ]] && return 1 + + # cull defunct entries local record=$(<<< "$res" jq -r ' .data[].attributes - |select(.status != "removed").details') + |select(.status != "removed")') + + # reverse lookup gport + local dlc + local gport=$(<<< "$record" jq -r '.port') + dlc=$(is_dlc "$ip" "$gport") + if [[ $dlc == "true" ]]; then + logger FAIL "Fallback query API called on DLC-enabled server" + return 1 + fi + case "$mode" in "rules") - <<< "$record" jq '.modIds[]' + <<< "$record" jq '.details.modIds[]' ;; "names") <<< "$record" jq ' - [.modNames, .modIds] as [$n, $i] + .details|[.modNames, .modIds] as [$n, $i] | {names: $n, ids: $i}' ;; esac @@ -1403,7 +1425,7 @@ manual_mod_install(){ if [[ $mode == "auto" ]] || [[ $mode == "force" ]]; then $steam_cmd "steam://url/CommunityFilePage/${stage_mods[$i]}+workshop_download_item $aid ${stage_mods[$i]}" - echo "# Opening workshop page for ${stage_mods[$i]}" + echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress, you may be out of disk space." else $steam_cmd "steam://url/CommunityFilePage/${stage_mods[$i]}" echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress after subscribing, try unsubscribing and resubscribing again until the download commences." diff --git a/helpers/ui.py b/helpers/ui.py index 5e77f68..7e7e4f6 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -19,7 +19,7 @@ gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango from enum import Enum -# 5.4.1 +# 5.5.0 app_name = "DZGUI" start_time = 0 @@ -895,8 +895,7 @@ class TreeView(Gtk.TreeView): case Gdk.KEY_m: if self.get_first_col() == "Mod": return - grid.right_panel.filters_vbox.maps_combo.grab_focus() - grid.right_panel.filters_vbox.maps_combo.popup() + grid.right_panel.filters_vbox.maps_entry.grab_focus() case _: return False elif keyname.isnumeric() and int(keyname) > 0: @@ -1566,7 +1565,7 @@ def KeysDialog(parent, text, mode): Enter/Space/Double click: connect to server Right-click on row/Ctrl-l: displays additional context menus Ctrl-f: jump to keyword field - Ctrl-m: jump to maps dropdown + Ctrl-m: jump to maps field Ctrl-d: toggle dry run (debug) mode Ctrl-r: refresh player count for active row 1-9: toggle filter ON/OFF @@ -1639,7 +1638,7 @@ class ModDialog(GenericDialog): def _load(): dialog.destroy() if data.returncode == 1: - spawn_dialog(parent, "Server has no mods installed", "NOTIFY") + spawn_dialog(parent, "Server has no mods installed or is unsupported in this mode", "NOTIFY") return self.show_all() self.set_markup("Modlist (%s mods)" %(mod_count)) @@ -1858,15 +1857,29 @@ class FilterPanel(Gtk.Box): self.keyword_entry.set_placeholder_text("Filter by keyword") self.keyword_entry.connect("activate", self._on_keyword_enter) self.keyword_entry.connect("key-press-event", self._on_esc_pressed) + + completion = Gtk.EntryCompletion(inline_completion=True) + completion.set_text_column(0) + completion.set_minimum_key_length(1) + completion.connect("match_selected", self._on_completer_match) renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END) - self.maps_combo = Gtk.ComboBox.new_with_model(map_store) + self.maps_combo = Gtk.ComboBox.new_with_entry() + self.maps_combo.set_entry_text_column(0) + self.maps_combo.set_model(map_store) + + # instantiate maps completer entry + self.maps_entry = self.maps_combo.get_child() + self.maps_entry.set_completion(completion) + self.maps_entry.set_placeholder_text("Filter by map") + self.maps_entry.connect("changed", self._on_map_completion, True) + self.maps_entry.connect("key-press-event", self._on_map_entry_keypress) + self.maps_combo.pack_start(renderer_text, True) self.maps_combo.add_attribute(renderer_text, "text", 0) self.maps_combo.connect("changed", self._on_map_changed) self.maps_combo.connect("key-press-event", self._on_esc_pressed) - self.pack_start(self.filters_label, False, False, True) self.pack_start(self.keyword_entry, False, False, True) self.pack_start(self.maps_combo, False, False, True) @@ -1874,6 +1887,37 @@ class FilterPanel(Gtk.Box): for i, check in enumerate(checks[0:]): self.pack_start(checks[i], False, False, True) + def _on_map_entry_keypress(self, entry, event): + match event.keyval: + case Gdk.KEY_Return: + text = entry.get_text() + if text is None: + return + # if entry is exact match for value in liststore, + # trigger map change function + for i in enumerate(map_store): + if text == i[1][0]: + self.maps_combo.set_active(i[0]) + self._on_map_changed(self.maps_combo) + case Gdk.KEY_Escape: + GLib.idle_add(self.restore_focus_to_treeview) + # TODO: this is a workaround for widget.grab_remove() + # set cursor position to SOL when unfocusing + text = self.maps_entry.get_text() + self.maps_entry.set_position(len(text)) + case _: + return + + def _on_completer_match(self, completion, model, iter): + self.maps_combo.set_active_iter(iter) + + def _on_map_completion(self, entry, editable): + text = entry.get_text() + completion = entry.get_completion() + + if len(text) >= completion.get_minimum_key_length(): + completion.set_model(map_store) + self._on_map_changed(self.maps_combo) def grab_keyword_focus(self): self.keyword_entry.grab_focus() @@ -1884,9 +1928,11 @@ class FilterPanel(Gtk.Box): return False def _on_esc_pressed(self, entry, event): - keyname = Gdk.keyval_name(event.keyval) - if keyname == "Escape": - GLib.idle_add(self.restore_focus_to_treeview) + match event.keyval: + case Gdk.KEY_Escape: + GLib.idle_add(self.restore_focus_to_treeview) + case _: + return True def get_outer_grid(self): panel = self.get_parent() @@ -1952,13 +1998,19 @@ class FilterPanel(Gtk.Box): tree_iter = combo.get_active_iter() if tree_iter is not None: - selected_map.clear() + # take no action if completer query is same as current map sel + old_sel = selected_map[0].split("Map=")[1] model = combo.get_model() selection = model[tree_iter][0] - selected_map.append("Map=" + selection) - logger.info("User selected map '%s'" %(selection)) - filter_servers(transient_parent, self, treeview, context) + if selection == old_sel: + return + selected_map.clear() + if selection is not None: + selected_map.append("Map=" + selection) + logger.info("User selected map '%s'" %(selection)) + filter_servers(transient_parent, self, treeview, context) + self.maps_entry.set_text(selection) def main(): From d5426314218b3c1fc87b36eb25bf2745d1de00c7 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:01:18 +0900 Subject: [PATCH 11/22] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7677861..b940559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Added - Support servers running DLC content (fixes Frostline servers) - Text autocompletion in maps search field +- Add disk space warning to popup dialog ### Fixed - Abort fallback query method if DLC is required From 4a64ec8292bddaba5c4c2921f405ae197b980875 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:02:14 +0900 Subject: [PATCH 12/22] chore: uncomment --- dzgui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dzgui.sh b/dzgui.sh index dd7bbec..3fee9a7 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -868,7 +868,7 @@ initial_setup(){ watcher_deps check_architecture test_connection -# fetch_helpers > >(pdialog "Checking helper files") + fetch_helpers > >(pdialog "Checking helper files") varcheck source "$config_file" lock From f6edbc1c9543f2ee70853790b093cad289f2cfc7 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:05:14 +0900 Subject: [PATCH 13/22] chore: bump version --- dzgui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dzgui.sh b/dzgui.sh index 3fee9a7..58afb62 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.4.2-beta.1 +version=5.5.0-beta.1 #CONSTANTS aid=221100 From be06a87d8d45bd152c1a8f7e35ce1caf24b6b101 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:41:28 +0900 Subject: [PATCH 14/22] fix: restore keyboard input --- CHANGELOG.md | 4 ++++ dzgui.sh | 4 ++-- helpers/ui.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b940559..fc3aa30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [5.5.0-beta.1] 2024-10-31 +### Fixed +- Restore keyboard input to keyword entry field + ## [5.5.0-beta.1] 2024-10-30 ### Added - Support servers running DLC content (fixes Frostline servers) diff --git a/dzgui.sh b/dzgui.sh index 58afb62..18212c2 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.5.0-beta.1 +version=5.5.0-beta.2 #CONSTANTS aid=221100 @@ -566,7 +566,7 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="91ea4d842d35a7d5e1441174f1f463c5" + ["ui.py"]="804fd1ec88da07b7c6015fd341c5c133" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="105e7be170eea48ce61fcfe7b50b8f59" diff --git a/helpers/ui.py b/helpers/ui.py index 7e7e4f6..ba1e4dc 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -1932,7 +1932,7 @@ class FilterPanel(Gtk.Box): case Gdk.KEY_Escape: GLib.idle_add(self.restore_focus_to_treeview) case _: - return True + return False def get_outer_grid(self): panel = self.get_parent() From 9d1ff35559f9bb1a3f0888d5c1bb4460b5694959 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:54:56 +0900 Subject: [PATCH 15/22] fix: duplicated combobox --- CHANGELOG.md | 6 +++++- dzgui.sh | 4 ++-- helpers/ui.py | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc3aa30..4eb4db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## [5.5.0-beta.1] 2024-10-31 +## [5.5.0-beta.3] 2024-10-31 +### Fixed +- Prevent maps combobox from duplicating contents + +## [5.5.0-beta.2] 2024-10-31 ### Fixed - Restore keyboard input to keyword entry field diff --git a/dzgui.sh b/dzgui.sh index 18212c2..61a74bf 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.5.0-beta.2 +version=5.5.0-beta.3 #CONSTANTS aid=221100 @@ -566,7 +566,7 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="804fd1ec88da07b7c6015fd341c5c133" + ["ui.py"]="bfdc7d510cea375731d4b92b9c3ab510" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="105e7be170eea48ce61fcfe7b50b8f59" diff --git a/helpers/ui.py b/helpers/ui.py index ba1e4dc..3714cd9 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -1864,9 +1864,8 @@ class FilterPanel(Gtk.Box): completion.connect("match_selected", self._on_completer_match) renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END) - self.maps_combo = Gtk.ComboBox.new_with_entry() + self.maps_combo = Gtk.ComboBox.new_with_model_and_entry(map_store) self.maps_combo.set_entry_text_column(0) - self.maps_combo.set_model(map_store) # instantiate maps completer entry self.maps_entry = self.maps_combo.get_child() @@ -1876,7 +1875,6 @@ class FilterPanel(Gtk.Box): self.maps_entry.connect("key-press-event", self._on_map_entry_keypress) self.maps_combo.pack_start(renderer_text, True) - self.maps_combo.add_attribute(renderer_text, "text", 0) self.maps_combo.connect("changed", self._on_map_changed) self.maps_combo.connect("key-press-event", self._on_esc_pressed) From ce93fdf869ac4689a8b43ecd3a0b44f3b007c11a Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 1 Nov 2024 00:11:09 +0900 Subject: [PATCH 16/22] feat: make fullscreen option sticky --- CHANGELOG.md | 6 ++++++ dzgui.sh | 3 +++ helpers/funcs | 12 ++++++++++++ helpers/ui.py | 20 ++++++++++++++++---- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb4db6..dfb4af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.5.0-beta.4] 2024-10-31 +### Added +- Expose a toggle setting for whether to launch the application in fullscreen +### Fixed +- Enable adding/removing servers to/from My Saved Servers when in Recent Servers context + ## [5.5.0-beta.3] 2024-10-31 ### Fixed - Prevent maps combobox from duplicating contents diff --git a/dzgui.sh b/dzgui.sh index 61a74bf..38093a0 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -193,6 +193,9 @@ debug="$debug" #Toggle stable/testing branch branch="$branch" +#Start in fullscreen +fullscreen="$fullscreen" + #Steam API key steam_api="$steam_api" diff --git a/helpers/funcs b/helpers/funcs index 6aa8790..b69640f 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -410,6 +410,7 @@ query_config(){ "name" "fav_label" "preferred_client" + "fullscreen" ) if [[ -n $key ]]; then if [[ -n ${!key} ]]; then @@ -714,6 +715,9 @@ debug="$debug" #Toggle stable/testing branch branch="$branch" +#Start in fullscreen +fullscreen="$fullscreen" + #Steam API key steam_api="$steam_api" @@ -807,6 +811,14 @@ toggle(){ else preferred_client="steam" fi + ;; + Toggle[[:space:]]DZGUI[[:space:]]fullscreen[[:space:]]boot) + if [[ $fullscreen == "true" ]]; then + fullscreen="false" + else + fullscreen="true" + fi + ;; esac update_config return 90 diff --git a/helpers/ui.py b/helpers/ui.py index 3714cd9..62d9541 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -105,6 +105,7 @@ options = [ ("Toggle release branch",), ("Toggle mod install mode",), ("Toggle Steam/Flatpak",), + ("Toggle DZGUI fullscreen boot",), ("Change player name",), ("Change Steam API key",), ("Change Battlemetrics API key",), @@ -153,6 +154,7 @@ status_tooltip = { "Toggle release branch": "Switch between stable and testing branches", "Toggle mod install mode": "Switch between manual and auto mod installation", "Toggle Steam/Flatpak": "Switch the preferred client to use for launching DayZ", + "Toggle DZGUI fullscreen boot": "Whether to start DZGUI as a maximized window (desktop only)", "Change player name": "Update your in-game name (required by some servers)", "Change Steam API key": "Can be used if you revoked an old API key", "Change Battlemetrics API key": "Can be used if you revoked an old API key", @@ -348,7 +350,12 @@ def process_tree_option(input, treeview): logger.info("Parsing tree option '%s' for the context '%s'" %(command, context)) transient_parent = treeview.get_outer_window() - toggle_contexts = ["Toggle mod install mode", "Toggle release branch", "Toggle Steam/Flatpak"] + toggle_contexts = [ + "Toggle mod install mode", + "Toggle release branch", + "Toggle Steam/Flatpak", + "Toggle DZGUI fullscreen boot" + ] def call_on_thread(bool, subproc, msg, args): def _background(subproc, args, dialog): @@ -374,7 +381,6 @@ def process_tree_option(input, treeview): msg = out[-1] process_shell_return_code(transient_parent, msg, rc, input) - match context: case "Help": if command == "View changelog": @@ -465,7 +471,8 @@ class OuterWindow(Gtk.Window): if is_game_mode is True: self.fullscreen() else: - self.maximize() + if query_config(None, "fullscreen")[0] == "true": + self.maximize() # Hide FilterPanel on main menu self.show_all() @@ -1237,7 +1244,8 @@ def format_metadata(row_sel): "auto_install": config_vals[2], "name": config_vals[3], "fav_label": config_vals[4], - "preferred_client": config_vals[5] + "preferred_client": config_vals[5], + "fullscreen": config_vals[6] } match row_sel: case "Quick-connect to favorite server" | "Change favorite server": @@ -1257,6 +1265,10 @@ def format_metadata(row_sel): val = "branch" case "Toggle Steam/Flatpak": val = "preferred_client" + case "Toggle DZGUI fullscreen boot": + default = "false" + alt = "true" + val = "fullscreen" case _: return prefix From a363afbbf8af9811c9ade2798faf360d1ecbcfbd Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 1 Nov 2024 00:11:55 +0900 Subject: [PATCH 17/22] fix: recent servers context menu options --- helpers/ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/ui.py b/helpers/ui.py index 62d9541..d7ec741 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -766,7 +766,7 @@ class TreeView(Gtk.TreeView): mod_context_items = ["Open in Steam Workshop", "Delete mod"] subcontext_items = {"Server browser": ["Add to my servers", "Copy IP to clipboard", "Show server-side mods", "Refresh player count"], "My saved servers": ["Remove from my servers", "Copy IP to clipboard", "Show server-side mods", "Refresh player count"], - "Recent servers": ["Remove from history", "Copy IP to clipboard", "Show server-side mods", "Refresh player count"], + "Recent servers": ["Add to my servers", "Remove from history", "Copy IP to clipboard", "Show server-side mods", "Refresh player count"], } # submenu hierarchy https://stackoverflow.com/questions/52847909/how-to-add-a-sub-menu-to-a-gtk-menu if context == "Mod": @@ -779,7 +779,7 @@ class TreeView(Gtk.TreeView): return for item in items: - if subcontext == "Server browser" and item == "Add to my servers": + if subcontext == "Server browser" or "Recent servers" and item == "Add to my servers": record = "%s:%s" %(self.get_column_at_index(7), self.get_column_at_index(8)) proc = call_out(widget, "is_in_favs", record) if proc.returncode == 0: From 6acc379b92a64f464af29c4db0c4277162f318c4 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 1 Nov 2024 00:13:04 +0900 Subject: [PATCH 18/22] chore: update checksums --- dzgui.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index 38093a0..64b10cc 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.5.0-beta.3 +version=5.5.0-beta.4 #CONSTANTS aid=221100 @@ -569,10 +569,10 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="bfdc7d510cea375731d4b92b9c3ab510" + ["ui.py"]="f4aaf17ec91b95b9b951fc1bc7c2b7b4" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="105e7be170eea48ce61fcfe7b50b8f59" + ["funcs"]="d8ae2662fbc3c62bdb5a51dec1935705" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" From c01f9714f8c1776a8270c0b2931208ab431ff210 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 3 Nov 2024 22:22:46 +0900 Subject: [PATCH 19/22] fix: duplicate options in context menu --- CHANGELOG.md | 6 ++++++ dzgui.sh | 6 +++--- helpers/ui.py | 11 ++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfb4af3..0982e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.5.0-beta.5] 2024-11-03 +### Changed +- Use updated A2S_RULES logic +### Fixed +- Servers in saved servers list would populate context menu with same option when right-clicking in server browser + ## [5.5.0-beta.4] 2024-10-31 ### Added - Expose a toggle setting for whether to launch the application in fullscreen diff --git a/dzgui.sh b/dzgui.sh index 64b10cc..5a0bac8 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.5.0-beta.4 +version=5.5.0-beta.5 #CONSTANTS aid=221100 @@ -534,7 +534,7 @@ fetch_dzq(){ logger INFO "DZQ is current" return 0 fi - local sha=788e85b82189cb3485d4a08ee350c67994b29ea3 + local sha=3088bbfb147b77bc7b6a9425581b439889ff3f7f local author="aclist" local repo="dayzquery" local url="https://raw.githubusercontent.com/$author/$repo/$sha/dayzquery.py" @@ -569,7 +569,7 @@ fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="f4aaf17ec91b95b9b951fc1bc7c2b7b4" + ["ui.py"]="dd7aa34df1d374739127cca3033a3f67" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="d8ae2662fbc3c62bdb5a51dec1935705" diff --git a/helpers/ui.py b/helpers/ui.py index d7ec741..9508760 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -779,11 +779,12 @@ class TreeView(Gtk.TreeView): return for item in items: - if subcontext == "Server browser" or "Recent servers" and item == "Add to my servers": - record = "%s:%s" %(self.get_column_at_index(7), self.get_column_at_index(8)) - proc = call_out(widget, "is_in_favs", record) - if proc.returncode == 0: - item = "Remove from my servers" + if subcontext == "Server browser" or "Recent servers": + if item == "Add to my servers": + record = "%s:%s" %(self.get_column_at_index(7), self.get_column_at_index(8)) + proc = call_out(widget, "is_in_favs", record) + if proc.returncode == 0: + item = "Remove from my servers" item = Gtk.MenuItem(label=item) item.connect("activate", self._on_menu_click) self.menu.append(item) From 10c6a79b17bbe752cd550e12ab22833f183d4545 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 11 Nov 2024 06:05:49 +0900 Subject: [PATCH 20/22] chore: normalize changelog --- CHANGELOG.md | 73 ++++++++++++++-------------------------------------- 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0982e75..7ba51df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,78 +1,45 @@ # Changelog -## [5.5.0-beta.5] 2024-11-03 -### Changed -- Use updated A2S_RULES logic -### Fixed -- Servers in saved servers list would populate context menu with same option when right-clicking in server browser - -## [5.5.0-beta.4] 2024-10-31 -### Added -- Expose a toggle setting for whether to launch the application in fullscreen -### Fixed -- Enable adding/removing servers to/from My Saved Servers when in Recent Servers context - -## [5.5.0-beta.3] 2024-10-31 -### Fixed -- Prevent maps combobox from duplicating contents - -## [5.5.0-beta.2] 2024-10-31 -### Fixed -- Restore keyboard input to keyword entry field - -## [5.5.0-beta.1] 2024-10-30 +## [5.5.0] 2024-11-10 ### Added - Support servers running DLC content (fixes Frostline servers) -- Text autocompletion in maps search field -- Add disk space warning to popup dialog +- Expose a toggle setting for whether to launch the application in fullscreen +- Text autocompletion in maps search field (partial search) +- Add disk space warning to popup dialog when downloading mods ### Fixed +- Servers in saved servers list would populate context menu with same option when right-clicking in server browser +- Enable adding/removing servers to/from My Saved Servers when in Recent Servers context +- Prevent maps combobox from duplicating contents +- Restore keyboard input to keyword entry field +### Changed - Abort fallback query method if DLC is required -## [5.4.2-beta.1] 2024-10-05 +## [5.4.2] 2024-10-05 ### Fixed - Sanitize third-party API IDs to remove UGC collisions -## [5.4.1-beta.2] 2024-09-12 -### Fixed -- Use fallback logic for modlist queries when user traverses networks - -## [5.4.1-beta.2] 2024-09-10 -### Fixed -- Fix signal handling control flow for checkbox toggles - -## [5.4.1-beta.1] 2024-09-10 +## [5.4.1] 2024-09-25 ### Added - Pre-boot validation check for users with self-compiled version of jq ### Fixed +- Use fallback logic for modlist queries when user traverses networks +- Fix signal handling control flow for checkbox toggles - When reloading the server browser, the map combobox selection would revert to the last selected map instead of All Maps - Server filter toggle signals were accessible from the main menu when switching between menu contexts - Global cooldown dialog could sometimes block filter toggles after cooldown reset - Normalized minor version number due to a previous clerical error -## [5.4.0-beta.5] 2024-08-27 -### Added -- Freedesktop application icons for system taskbar, tray, and other dialogs -### Fixed -- Errors being printed to the console when Exit button was explicitly clicked - -## [5.4.0-beta.4] 2024-08-21 -### Added -- Emit CPU model name when exporting system debug log -### Fixed -- Detect Steam Deck OLED APU variant during initial setup - -## [5.4.0-beta.3] 2024-08-04 +## [5.4.0] 2024-08-27 ### Added - Scan local area network for DayZ servers - -## [5.4.0-beta.2] 2024-08-03 -### Fixed -- Clerical hotfix for previous player names fix -- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection - -## [5.4.0-beta.1] 2024-07-16 +- Freedesktop application icons for system taskbar, tray, and other dialogs +- Emit CPU model name when exporting system debug log ### Fixed +- Errors being printed to the console when Exit button was explicitly clicked +- Detect Steam Deck OLED APU variant during initial setup - Encapsulate player names correctly so that names with whitespace in them are supported +- Test if DayZ directory is empty at startup, implying that the game was moved to a new library collection +- Report WM_CLASS name to the window manager ## [5.3.2] 2024-07-02 ### Fixed From c0ab8111fd21ecf7b84e79f163881b00878bedd7 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 11 Nov 2024 06:05:56 +0900 Subject: [PATCH 21/22] chore: bump version --- dzgui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dzgui.sh b/dzgui.sh index 5a0bac8..b9409e0 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.5.0-beta.5 +version=5.5.0 #CONSTANTS aid=221100 From 5496f914f26677decaa9089fce2ef9f3ce8783e9 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:17:47 +0900 Subject: [PATCH 22/22] fix: correct typo --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd7a58a..7ba51df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,7 @@ ## [5.5.0] 2024-11-10 ### Added -- Support servers running DLC content (fixes F git push --set-upstream origin release/5.5.0-stable -rostline servers) +- Support servers running DLC content (fixes Frostline servers) - Expose a toggle setting for whether to launch the application in fullscreen - Text autocompletion in maps search field (partial search) - Add disk space warning to popup dialog when downloading mods