From e035b1ed58710dfa9cefbb4894d2ef60f2c7d63e Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Tue, 12 Mar 2024 09:30:51 -0500 Subject: [PATCH] Hide nonfunctional game modifications tab --- lib/common.rb | 2 +- lib/pages/games.rb | 6 ++++-- lib/pages/server_browser.rb | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index a0081b0..6f028ac 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -184,7 +184,7 @@ class W3DHub path = case File.basename(command) when "zenity", "matedialog", "qarma" - `#{command} --file-selection --directory --title "#{title} #{Dir.home}"` + `#{command} --file-selection --directory --title "#{title}"` when "kdialog" `#{command} --title "#{title}" --getexistingdirectory #{Dir.home}"` else diff --git a/lib/pages/games.rb b/lib/pages/games.rb index 542bd67..db1f9fd 100644 --- a/lib/pages/games.rb +++ b/lib/pages/games.rb @@ -232,8 +232,10 @@ class W3DHub end unless Store.offline_mode - menu_item(I18n.t(:"games.game_modifications")) do - populate_game_modifications(game, channel) + if W3DHUB_DEVELOPER + menu_item(I18n.t(:"games.game_modifications")) do + populate_game_modifications(game, channel) + end end if game.id != "ren" diff --git a/lib/pages/server_browser.rb b/lib/pages/server_browser.rb index 21b0c38..cf2bc81 100644 --- a/lib/pages/server_browser.rb +++ b/lib/pages/server_browser.rb @@ -438,8 +438,8 @@ class W3DHub end if W3DHUB_DEVELOPER - list_box(items: (1..12).to_a.map(&:to_s), margin_left: 16, width: 72, tip: "Number of game clients", **TESTING_BUTTON) - button "Multijoin", tip: "Launch multiple clients with configured username_\#{number}", **TESTING_BUTTON, enabled: true + list_box(items: (1..12).to_a.map(&:to_s), margin_left: 16, width: 72, tip: "Number of game clients", enabled: (game_installed && !game_updatable), **TESTING_BUTTON) + button "Multijoin", tip: "Launch multiple clients with configured username_\#{number}", enabled: (game_installed && !game_updatable), **TESTING_BUTTON end flow(fill: true)