1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-27 12:52:36 +01:00

Merge pull request #161 from aclist/release/5.5.0-beta.4

Release/5.5.0-beta.4
This commit is contained in:
aclist 2024-11-02 23:23:36 +09:00 committed by GitHub
commit abcbb1b427
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 9 deletions

View file

@ -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

View file

@ -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
@ -193,6 +193,9 @@ debug="$debug"
#Toggle stable/testing branch
branch="$branch"
#Start in fullscreen
fullscreen="$fullscreen"
#Steam API key
steam_api="$steam_api"
@ -566,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"

View file

@ -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

View file

@ -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()
@ -759,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":
@ -772,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:
@ -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