From 81e2ee0c8ce0953fb881bf2cb589fea498fd8427 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:09:09 -0800 Subject: [PATCH 1/5] Fix Megalith's `GetCommandQueue` not functioning as expected It would return its default factory rally point instead of its own move orders Annotate some related categories --- engine/Core/Categories.lua | 6 +++++- engine/User/UserUnit.lua | 2 +- units/XRL0403/XRL0403_unit.bp | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/Core/Categories.lua b/engine/Core/Categories.lua index 96237bf913..f385be163f 100644 --- a/engine/Core/Categories.lua +++ b/engine/Core/Categories.lua @@ -69,6 +69,7 @@ categories = { CONSTRUCTION = categoryValue, CONSTRUCTIONSORTDOWN = categoryValue, COUNTERINTELLIGENCE = categoryValue, + --- Allows queuing commands before the unit is finished building CQUEMOV = categoryValue, CRABEGG = categoryValue, CRUISER = categoryValue, @@ -85,10 +86,12 @@ categories = { ECONOMIC = categoryValue, ENERGYPRODUCTION = categoryValue, ENERGYSTORAGE = categoryValue, + --- Unit counts as an engineer for GetIdleEngineers() ENGINEER = categoryValue, ENGINEERPRESET = categoryValue, ENGINEERSTATION = categoryValue, EXPERIMENTAL = categoryValue, + --- Replaces the unit's command queue with the rally point orders. Also gives it a default rally point order upon creation FACTORY = categoryValue, FAVORSWATER = categoryValue, FERRYBEACON = categoryValue, @@ -123,7 +126,7 @@ categories = { NAVALCARRIER = categoryValue, NAVAL = categoryValue, - -- Allows this unit to be build by engineers + --- Allows this unit to be built by engineers NEEDMOBILEBUILD = categoryValue, NOFORMATION = categoryValue, --- Prevents splash damage being applied to the entity @@ -154,6 +157,7 @@ categories = { PRODUCTSC1 = categoryValue, PROJECTILE = categoryValue, RADAR = categoryValue, + -- Causes orders given to the unit to be added to the rally point queue RALLYPOINT = categoryValue, RAMBOPRESET = categoryValue, RASPRESET = categoryValue, diff --git a/engine/User/UserUnit.lua b/engine/User/UserUnit.lua index 4f7d4c8e17..6d3b3340af 100644 --- a/engine/User/UserUnit.lua +++ b/engine/User/UserUnit.lua @@ -105,7 +105,7 @@ end function UserUnit:GetBuildRate() end ---- Returns a table of commands +--- Returns a table of commands. If the unit has the `FACTORY` category, returns the rally point command queue. ---@return UICommandInfo[] function UserUnit:GetCommandQueue() end diff --git a/units/XRL0403/XRL0403_unit.bp b/units/XRL0403/XRL0403_unit.bp index 602f500f8f..6d699d6990 100644 --- a/units/XRL0403/XRL0403_unit.bp +++ b/units/XRL0403/XRL0403_unit.bp @@ -40,7 +40,6 @@ UnitBlueprint{ "DIRECTFIRE", "DRAGBUILD", "EXPERIMENTAL", - "FACTORY", "LAND", "LOWSELECTPRIO", "MOBILE", From a150a9a9f099a2cbe656de2472e0a212e28e26c0 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:48:21 -0800 Subject: [PATCH 2/5] Fix hotbuild megalith selection v1 Incompatible UI with mods, judging by the changes required to long-standing categories --- lua/keymap/hotbuild.lua | 5 +---- units/UEL0401/UEL0401_unit.bp | 1 - units/XEB0104/XEB0104_unit.bp | 1 - units/XEB0204/XEB0204_unit.bp | 1 - units/XRB0104/XRB0104_unit.bp | 1 - units/XRB0204/XRB0204_unit.bp | 1 - units/XRB0304/XRB0304_unit.bp | 1 - 7 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lua/keymap/hotbuild.lua b/lua/keymap/hotbuild.lua index fe9479f0b2..1e8703acbb 100644 --- a/lua/keymap/hotbuild.lua +++ b/lua/keymap/hotbuild.lua @@ -364,10 +364,7 @@ function buildAction(name) local selection = GetSelectedUnits() if selection then -- If current selection is engineer or commander or megalith - if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE, selection)) or - not - table.empty(EntityCategoryFilterDown(categories.FACTORY * categories.EXPERIMENTAL * categories.CYBRAN, - selection)) then + if not table.empty(EntityCategoryFilterDown(categories.CONSTRUCTION - categories.FACTORY, selection)) then buildActionBuilding(name, modifier) else -- Buildqueue or normal applying all the command buildActionUnit(name, modifier) diff --git a/units/UEL0401/UEL0401_unit.bp b/units/UEL0401/UEL0401_unit.bp index aeddaca7a1..8f75878ce5 100644 --- a/units/UEL0401/UEL0401_unit.bp +++ b/units/UEL0401/UEL0401_unit.bp @@ -41,7 +41,6 @@ UnitBlueprint{ "BUBBLESHIELDSPILLOVERCHECK", "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", - "CONSTRUCTION", "CQUEMOV", "DRAGBUILD", "EXPERIMENTAL", diff --git a/units/XEB0104/XEB0104_unit.bp b/units/XEB0104/XEB0104_unit.bp index b9cfcb8c35..4c0af3cf66 100644 --- a/units/XEB0104/XEB0104_unit.bp +++ b/units/XEB0104/XEB0104_unit.bp @@ -21,7 +21,6 @@ UnitBlueprint{ "BUILTBYTIER2ENGINEER", "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", - "CONSTRUCTION", "CQUEMOV", "DRAGBUILD", "ENGINEERSTATION", diff --git a/units/XEB0204/XEB0204_unit.bp b/units/XEB0204/XEB0204_unit.bp index 1444b16cda..4d6decf243 100644 --- a/units/XEB0204/XEB0204_unit.bp +++ b/units/XEB0204/XEB0204_unit.bp @@ -17,7 +17,6 @@ UnitBlueprint{ AverageDensity = 2500, BuildIconSortPriority = 200, Categories = { - "CONSTRUCTION", "DRAGBUILD", "ENGINEERSTATION", "OVERLAYMISC", diff --git a/units/XRB0104/XRB0104_unit.bp b/units/XRB0104/XRB0104_unit.bp index c1963c02ed..d8dfeaea28 100644 --- a/units/XRB0104/XRB0104_unit.bp +++ b/units/XRB0104/XRB0104_unit.bp @@ -28,7 +28,6 @@ UnitBlueprint{ "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", "CAPTURE", - "CONSTRUCTION", "CQUEMOV", "CYBRAN", "DRAGBUILD", diff --git a/units/XRB0204/XRB0204_unit.bp b/units/XRB0204/XRB0204_unit.bp index eb037aa918..bc903a9c11 100644 --- a/units/XRB0204/XRB0204_unit.bp +++ b/units/XRB0204/XRB0204_unit.bp @@ -24,7 +24,6 @@ UnitBlueprint{ BuildIconSortPriority = 200, Categories = { "CAPTURE", - "CONSTRUCTION", "CQUEMOV", "CYBRAN", "DRAGBUILD", diff --git a/units/XRB0304/XRB0304_unit.bp b/units/XRB0304/XRB0304_unit.bp index 285f739525..af9e8d667c 100644 --- a/units/XRB0304/XRB0304_unit.bp +++ b/units/XRB0304/XRB0304_unit.bp @@ -24,7 +24,6 @@ UnitBlueprint{ BuildIconSortPriority = 200, Categories = { "CAPTURE", - "CONSTRUCTION", "CYBRAN", "DRAGBUILD", "ENGINEER", From 1738bb10d612072cb7fd44ff6835776f28346617 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:48:25 -0800 Subject: [PATCH 3/5] Revert "Fix hotbuild megalith selection v1" This reverts commit a150a9a9f099a2cbe656de2472e0a212e28e26c0. --- lua/keymap/hotbuild.lua | 5 ++++- units/UEL0401/UEL0401_unit.bp | 1 + units/XEB0104/XEB0104_unit.bp | 1 + units/XEB0204/XEB0204_unit.bp | 1 + units/XRB0104/XRB0104_unit.bp | 1 + units/XRB0204/XRB0204_unit.bp | 1 + units/XRB0304/XRB0304_unit.bp | 1 + 7 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/keymap/hotbuild.lua b/lua/keymap/hotbuild.lua index 1e8703acbb..fe9479f0b2 100644 --- a/lua/keymap/hotbuild.lua +++ b/lua/keymap/hotbuild.lua @@ -364,7 +364,10 @@ function buildAction(name) local selection = GetSelectedUnits() if selection then -- If current selection is engineer or commander or megalith - if not table.empty(EntityCategoryFilterDown(categories.CONSTRUCTION - categories.FACTORY, selection)) then + if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE, selection)) or + not + table.empty(EntityCategoryFilterDown(categories.FACTORY * categories.EXPERIMENTAL * categories.CYBRAN, + selection)) then buildActionBuilding(name, modifier) else -- Buildqueue or normal applying all the command buildActionUnit(name, modifier) diff --git a/units/UEL0401/UEL0401_unit.bp b/units/UEL0401/UEL0401_unit.bp index 8f75878ce5..aeddaca7a1 100644 --- a/units/UEL0401/UEL0401_unit.bp +++ b/units/UEL0401/UEL0401_unit.bp @@ -41,6 +41,7 @@ UnitBlueprint{ "BUBBLESHIELDSPILLOVERCHECK", "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", + "CONSTRUCTION", "CQUEMOV", "DRAGBUILD", "EXPERIMENTAL", diff --git a/units/XEB0104/XEB0104_unit.bp b/units/XEB0104/XEB0104_unit.bp index 4c0af3cf66..b9cfcb8c35 100644 --- a/units/XEB0104/XEB0104_unit.bp +++ b/units/XEB0104/XEB0104_unit.bp @@ -21,6 +21,7 @@ UnitBlueprint{ "BUILTBYTIER2ENGINEER", "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", + "CONSTRUCTION", "CQUEMOV", "DRAGBUILD", "ENGINEERSTATION", diff --git a/units/XEB0204/XEB0204_unit.bp b/units/XEB0204/XEB0204_unit.bp index 4d6decf243..1444b16cda 100644 --- a/units/XEB0204/XEB0204_unit.bp +++ b/units/XEB0204/XEB0204_unit.bp @@ -17,6 +17,7 @@ UnitBlueprint{ AverageDensity = 2500, BuildIconSortPriority = 200, Categories = { + "CONSTRUCTION", "DRAGBUILD", "ENGINEERSTATION", "OVERLAYMISC", diff --git a/units/XRB0104/XRB0104_unit.bp b/units/XRB0104/XRB0104_unit.bp index d8dfeaea28..c1963c02ed 100644 --- a/units/XRB0104/XRB0104_unit.bp +++ b/units/XRB0104/XRB0104_unit.bp @@ -28,6 +28,7 @@ UnitBlueprint{ "BUILTBYTIER3COMMANDER", "BUILTBYTIER3ENGINEER", "CAPTURE", + "CONSTRUCTION", "CQUEMOV", "CYBRAN", "DRAGBUILD", diff --git a/units/XRB0204/XRB0204_unit.bp b/units/XRB0204/XRB0204_unit.bp index bc903a9c11..eb037aa918 100644 --- a/units/XRB0204/XRB0204_unit.bp +++ b/units/XRB0204/XRB0204_unit.bp @@ -24,6 +24,7 @@ UnitBlueprint{ BuildIconSortPriority = 200, Categories = { "CAPTURE", + "CONSTRUCTION", "CQUEMOV", "CYBRAN", "DRAGBUILD", diff --git a/units/XRB0304/XRB0304_unit.bp b/units/XRB0304/XRB0304_unit.bp index af9e8d667c..285f739525 100644 --- a/units/XRB0304/XRB0304_unit.bp +++ b/units/XRB0304/XRB0304_unit.bp @@ -24,6 +24,7 @@ UnitBlueprint{ BuildIconSortPriority = 200, Categories = { "CAPTURE", + "CONSTRUCTION", "CYBRAN", "DRAGBUILD", "ENGINEER", From e16758964bfb34998c177d05481af08bb59820a6 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:48:54 -0800 Subject: [PATCH 4/5] Fix hotbuild megalith selection v2 --- lua/keymap/hotbuild.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/keymap/hotbuild.lua b/lua/keymap/hotbuild.lua index fe9479f0b2..3b70fa87a8 100644 --- a/lua/keymap/hotbuild.lua +++ b/lua/keymap/hotbuild.lua @@ -364,10 +364,7 @@ function buildAction(name) local selection = GetSelectedUnits() if selection then -- If current selection is engineer or commander or megalith - if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE, selection)) or - not - table.empty(EntityCategoryFilterDown(categories.FACTORY * categories.EXPERIMENTAL * categories.CYBRAN, - selection)) then + if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE + categories.xrl0403, selection)) then buildActionBuilding(name, modifier) else -- Buildqueue or normal applying all the command buildActionUnit(name, modifier) From ea6b05fce4944b02adb8500578e018afbb1a1f8e Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:01:19 -0800 Subject: [PATCH 5/5] Create fix.6578.md --- changelog/snippets/sections/fix.6578.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/snippets/sections/fix.6578.md diff --git a/changelog/snippets/sections/fix.6578.md b/changelog/snippets/sections/fix.6578.md new file mode 100644 index 0000000000..8ce5495b00 --- /dev/null +++ b/changelog/snippets/sections/fix.6578.md @@ -0,0 +1 @@ +- (#6578) Fix Megalith's `GetCommandQueue` returning a hidden factory rally point queue instead of the Megalith's command queue.