From f1aa6a02ebbbdeb18b8912ab5fe878239bdf8ab9 Mon Sep 17 00:00:00 2001 From: FAForever Machine User Date: Thu, 17 Oct 2024 21:14:22 +0000 Subject: [PATCH 1/7] Post-process deployment --- lua/shared/components/DebugComponent.lua | 2 +- lua/version.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/shared/components/DebugComponent.lua b/lua/shared/components/DebugComponent.lua index 6ceb164723..f4d623c940 100644 --- a/lua/shared/components/DebugComponent.lua +++ b/lua/shared/components/DebugComponent.lua @@ -35,7 +35,7 @@ DebugComponent = ClassSimple { EnabledLogging = true, EnabledWarnings = true, EnabledErrors = true, - EnabledDrawing = true, + EnabledDrawing = false, --#endregion } diff --git a/lua/version.lua b/lua/version.lua index 6449b4ecee..f4e34677e6 100644 --- a/lua/version.lua +++ b/lua/version.lua @@ -28,9 +28,9 @@ -- - https://github.com/FAForever/fa/blob/develop/.github/workflows/deploy-fafbeta.yaml -- - https://github.com/FAForever/fa/blob/develop/.github/workflows/deploy-fafdevelop.yaml -local GameType = 'unknown' -- The use of `'` instead of `"` is **intentional** +local GameType = "FAF Develop" -- The use of `'` instead of `"` is **intentional** -local Commit = 'unknown' -- The use of `'` instead of `"` is **intentional** +local Commit = "6780001ed8a649cd4c9af492c7e892c6e3e17877" -- The use of `'` instead of `"` is **intentional** --#endregion From ce27cc76f8d692dc3589fca029af5d9b492ff745 Mon Sep 17 00:00:00 2001 From: clyfordv Date: Tue, 12 Nov 2024 22:00:26 -0500 Subject: [PATCH 2/7] Add misc key action for commander select + transport search --- lua/keymap/misckeyactions.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lua/keymap/misckeyactions.lua b/lua/keymap/misckeyactions.lua index 7ab142d2bc..ab9044eea4 100644 --- a/lua/keymap/misckeyactions.lua +++ b/lua/keymap/misckeyactions.lua @@ -2,6 +2,7 @@ local Prefs = import("/lua/user/prefs.lua") local SelectionUtils = import("/lua/ui/game/selection.lua") +local SetIgnoreSelection = import("/lua/ui/game/gamemain.lua").SetIgnoreSelection local lockZoomEnable = false function lockZoom() @@ -662,3 +663,30 @@ SelectAllResourceConsumers = function(onscreen) SelectUnits(units) end + +--- Select the commander with an option to zoom to. Will search for commanders in transports if none are found otherwise. +---@param zoomTo boolean +SelectCommander = function(zoomTo) + UISelectionByCategory("COMMAND", false, false, true, false) + local selectedUnits = GetSelectedUnits() + if not selectedUnits then + SetIgnoreSelection(true) + UISelectionByCategory("CANTRANSPORTCOMMANDER", false, false, false, false) + local transports = GetSelectedUnits() + SelectUnits(nil) + SetIgnoreSelection(false) + for _, transport in transports do + local attachedCommanders = EntityCategoryFilterDown(categories.COMMAND, GetAttachedUnitsList({transport})) + if attachedCommanders and table.getn(attachedCommanders) > 0 then + if zoomTo then + UISelectAndZoomTo(transport, 0) + else + SelectUnits({transport}) + end + break + end + end + elseif zoomTo then + UIZoomTo(selectedUnits, 0) + end +end \ No newline at end of file From 1ead2620ee16251b2663adea55ab6c38cbf4849d Mon Sep 17 00:00:00 2001 From: clyfordv Date: Tue, 12 Nov 2024 22:00:56 -0500 Subject: [PATCH 3/7] modify existing keyActions to use new commander select function --- lua/keymap/keyactions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymap/keyactions.lua b/lua/keymap/keyactions.lua index 0bb395a03b..4a4d52d8f1 100755 --- a/lua/keymap/keyactions.lua +++ b/lua/keymap/keyactions.lua @@ -223,11 +223,11 @@ local keyActionsSelectionQuickSelect = { category = 'selection', }, ['goto_commander'] = { - action = 'UI_SelectByCategory +nearest +goto COMMAND', + action = 'UI_Lua import("/lua/keymap/misckeyactions.lua").SelectCommander(true)', category = 'selection', }, ['select_commander'] = { - action = 'UI_SelectByCategory +nearest COMMAND', + action = 'UI_Lua import("/lua/keymap/misckeyactions.lua").SelectCommander(false)', category = 'selection', }, ['select_all'] = { From 390570516fdef280de0a26c8e480298f8773c87e Mon Sep 17 00:00:00 2001 From: clyfordv Date: Tue, 12 Nov 2024 22:19:53 -0500 Subject: [PATCH 4/7] Revert "Post-process deployment" This reverts commit f1aa6a02ebbbdeb18b8912ab5fe878239bdf8ab9. --- lua/shared/components/DebugComponent.lua | 2 +- lua/version.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/shared/components/DebugComponent.lua b/lua/shared/components/DebugComponent.lua index f4d623c940..6ceb164723 100644 --- a/lua/shared/components/DebugComponent.lua +++ b/lua/shared/components/DebugComponent.lua @@ -35,7 +35,7 @@ DebugComponent = ClassSimple { EnabledLogging = true, EnabledWarnings = true, EnabledErrors = true, - EnabledDrawing = false, + EnabledDrawing = true, --#endregion } diff --git a/lua/version.lua b/lua/version.lua index f4e34677e6..6449b4ecee 100644 --- a/lua/version.lua +++ b/lua/version.lua @@ -28,9 +28,9 @@ -- - https://github.com/FAForever/fa/blob/develop/.github/workflows/deploy-fafbeta.yaml -- - https://github.com/FAForever/fa/blob/develop/.github/workflows/deploy-fafdevelop.yaml -local GameType = "FAF Develop" -- The use of `'` instead of `"` is **intentional** +local GameType = 'unknown' -- The use of `'` instead of `"` is **intentional** -local Commit = "6780001ed8a649cd4c9af492c7e892c6e3e17877" -- The use of `'` instead of `"` is **intentional** +local Commit = 'unknown' -- The use of `'` instead of `"` is **intentional** --#endregion From 9a6cf47b0357d4b2b3d1244e0f26751bde1ed99e Mon Sep 17 00:00:00 2001 From: clyfordv Date: Wed, 13 Nov 2024 11:58:03 -0500 Subject: [PATCH 5/7] changelog --- changelog/snippets/features.6534.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/snippets/features.6534.md diff --git a/changelog/snippets/features.6534.md b/changelog/snippets/features.6534.md new file mode 100644 index 0000000000..3dbed32689 --- /dev/null +++ b/changelog/snippets/features.6534.md @@ -0,0 +1 @@ +- (#6534) Select/go to commander hotkeys will now search for commanders in transports if it doesn't find any on the ground \ No newline at end of file From 06bbcbaa6372487a212d4f20b1f8ce045ae5f2eb Mon Sep 17 00:00:00 2001 From: clyfordv Date: Wed, 13 Nov 2024 12:04:59 -0500 Subject: [PATCH 6/7] update "Select ACU (control group)" hotkeys to use new logic --- lua/keymap/misckeyactions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymap/misckeyactions.lua b/lua/keymap/misckeyactions.lua index ab9044eea4..97a2ee300c 100644 --- a/lua/keymap/misckeyactions.lua +++ b/lua/keymap/misckeyactions.lua @@ -201,9 +201,9 @@ function ACUSelectCG() local curTime = GetSystemTimeSeconds() local diffTime = curTime - lastACUSelectionTime if diffTime > 1.0 then - ConExecute('UI_SelectByCategory +nearest COMMAND') + SelectCommander(false) else - ConExecute('UI_SelectByCategory +nearest +goto COMMAND') + SelectCommander(true) end lastACUSelectionTime = curTime From e2730f1f08b18255044503e08c8e4a8791225721 Mon Sep 17 00:00:00 2001 From: clyfordv Date: Wed, 13 Nov 2024 12:08:29 -0500 Subject: [PATCH 7/7] change "ACU (control group)" function descriptions to "ACU (double tap to zoom)" --- loc/CZ/strings_db.lua | 4 ++-- loc/PL/strings_db.lua | 4 ++-- loc/US/strings_db.lua | 4 ++-- lua/keymap/keydescriptions.lua | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/loc/CZ/strings_db.lua b/loc/CZ/strings_db.lua index f7145683fa..bdd4b20586 100644 --- a/loc/CZ/strings_db.lua +++ b/loc/CZ/strings_db.lua @@ -4723,8 +4723,8 @@ key_desc_0216="One-key zoom-pop" key_desc_0217="Select onscreen idle mass extractors." key_desc_0218="Select all mass extractors." key_desc_0219="Select nearest onscreen lowest tech idle mass extractor." -key_desc_0220="Select ACU (control group)" -key_desc_0221="Append ACU to selection (control group)" +key_desc_0220="Select ACU (double tap to zoom)" +key_desc_0221="Append ACU to selection (double tap to zoom)" key_desc_0222="Select nearest idle engineer (not ACU)" key_desc_0223="Select/Add nearest idle engineers" key_desc_0224="Cycle through idle factories" diff --git a/loc/PL/strings_db.lua b/loc/PL/strings_db.lua index 355e703fe3..accaef2e45 100644 --- a/loc/PL/strings_db.lua +++ b/loc/PL/strings_db.lua @@ -4722,8 +4722,8 @@ key_desc_0216="One-key zoom-pop" key_desc_0217="Select onscreen idle mass extractors." key_desc_0218="Select all mass extractors." key_desc_0219="Select nearest onscreen lowest tech idle mass extractor." -key_desc_0220="Select ACU (control group)" -key_desc_0221="Append ACU to selection (control group)" +key_desc_0220="Select ACU (double tap to zoom)" +key_desc_0221="Append ACU to selection (double tap to zoom)" key_desc_0222="Select nearest idle engineer (not ACU)" key_desc_0223="Select/Add nearest idle engineers" key_desc_0224="Cycle through idle factories" diff --git a/loc/US/strings_db.lua b/loc/US/strings_db.lua index f19efe6f6e..9110ab2628 100644 --- a/loc/US/strings_db.lua +++ b/loc/US/strings_db.lua @@ -4267,8 +4267,8 @@ key_desc_0216="One-key zoom-pop" key_desc_0217="Select onscreen idle mass extractors." key_desc_0218="Select all mass extractors." key_desc_0219="Select nearest onscreen lowest tech idle mass extractor." -key_desc_0220="Select ACU (control group)" -key_desc_0221="Append ACU to selection (control group)" +key_desc_0220="Select ACU (double tap to zoom)" +key_desc_0221="Append ACU to selection (double tap to zoom)" key_desc_0222="Select nearest idle engineer (not ACU)" key_desc_0223="Select/Add nearest idle engineers" key_desc_0224="Cycle through idle factories" diff --git a/lua/keymap/keydescriptions.lua b/lua/keymap/keydescriptions.lua index 586fb6263d..0038d15413 100755 --- a/lua/keymap/keydescriptions.lua +++ b/lua/keymap/keydescriptions.lua @@ -312,8 +312,8 @@ keyDescriptions = { ['select_all_mex'] = 'Select all mass extractors.', ['select_nearest_idle_lt_mex'] = 'Select nearest onscreen lowest tech idle mass extractor.', - ['acu_select_cg'] = 'Select ACU (control group)', - ['acu_append_cg'] = 'Append ACU to selection (control group)', + ['acu_select_cg'] = 'Select ACU (double tap to zoom)', + ['acu_append_cg'] = 'Append ACU to selection (double tap to zoom)', ['select_nearest_idle_eng_not_acu'] = 'Select nearest idle engineer (not ACU)', ['add_nearest_idle_engineers_seq'] = 'Select/Add nearest idle engineers', ['cycle_idle_factories'] = 'Cycle through idle factories',