Skip to content

Commit

Permalink
Fix issues with context based templates and clarify the hotkey names (F…
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored Jan 12, 2024
1 parent 63ea221 commit 8ac595a
Show file tree
Hide file tree
Showing 25 changed files with 288 additions and 55 deletions.
2 changes: 0 additions & 2 deletions loc/CZ/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4729,7 +4729,6 @@ key_desc_0222="Select nearest idle engineer (not ACU)"
key_desc_0223="Select/Add nearest idle engineers"
key_desc_0224="Cycle through idle factories"
key_desc_0225="Cycle through unit types in selection (Land, Sea, Air)"
key_desc_0226="Create build template (Factory)"
key_desc_0227="Select all Gunships"
key_desc_0228="Select all Bombers"
key_desc_0229="Select all Air Fighters"
Expand Down Expand Up @@ -4768,7 +4767,6 @@ key_desc_0261="build T1 artilleries + T1 light gunship"
key_desc_0262="build mass extractors + T2 Engineers"
key_desc_0263="build mass fabricators + T2 Bots + T2 air fighters + T2 subs"
key_desc_0264="build power generators + T2 Tanks + T2 Torpedo Bombers + T2 Destroyers"
key_desc_0265="build templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0266="build engineers stations + T2 Mobile AA + T2 Air Transports + T2 Boats"
key_desc_0267="build Mobile Missiles launchers + T2 Air Guided Missile (mercy)"
key_desc_0268="build T2 Mobiles Shields and mobile Stealth fields"
Expand Down
2 changes: 0 additions & 2 deletions loc/PL/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4728,7 +4728,6 @@ key_desc_0222="Select nearest idle engineer (not ACU)"
key_desc_0223="Select/Add nearest idle engineers"
key_desc_0224="Cycle through idle factories"
key_desc_0225="Cycle through unit types in selection (Land, Sea, Air)"
key_desc_0226="Create build template (Factory)"
key_desc_0227="Select all Gunships"
key_desc_0228="Select all Bombers"
key_desc_0229="Select all Air Fighters"
Expand Down Expand Up @@ -4767,7 +4766,6 @@ key_desc_0261="build T1 artilleries + T1 light gunship"
key_desc_0262="build mass extractors + T2 Engineers"
key_desc_0263="build mass fabricators + T2 Bots + T2 air fighters + T2 subs"
key_desc_0264="build power generators + T2 Tanks + T2 Torpedo Bombers + T2 Destroyers"
key_desc_0265="build templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0266="build engineers stations + T2 Mobile AA + T2 Air Transports + T2 Boats"
key_desc_0267="build Mobile Missiles launchers + T2 Air Guided Missile (mercy)"
key_desc_0268="build T2 Mobiles Shields and mobile Stealth fields"
Expand Down
8 changes: 4 additions & 4 deletions loc/US/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4269,7 +4269,7 @@ key_desc_0222="Select nearest idle engineer (not ACU)"
key_desc_0223="Select/Add nearest idle engineers"
key_desc_0224="Cycle through idle factories"
key_desc_0225="Cycle through unit types in selection (Land, Sea, Air)"
key_desc_0226="Create build template (Factory)"
key_desc_0226="Create a factory build queue template based on the currently selected factory"
key_desc_0227="Select all Gunships"
key_desc_0228="Select all Bombers"
key_desc_0229="Select all Air Fighters"
Expand Down Expand Up @@ -4310,8 +4310,8 @@ key_desc_0261="build T1 artilleries + T1 light gunship"
key_desc_0262="build mass extractors + T2 Engineers"
key_desc_0263="build mass fabricators + T2 Bots + T2 air fighters + T2 subs"
key_desc_0264="build power generators + T2 Tanks + T2 Torpedo Bombers + T2 Destroyers"
key_desc_0265="build templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0406="cycle templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0265="cycle user templates & build T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0406="cycle context templates & build T2 Hover Tanks + T2 Gunships + T2 Cruisers"
key_desc_0266="build engineers stations + T2 Mobile AA + T2 Air Transports + T2 Boats"
key_desc_0267="build Mobile Missiles launchers + T2 Air Guided Missile (mercy)"
key_desc_0268="build T2 Mobiles Shields and mobile Stealth fields"
Expand Down Expand Up @@ -4448,7 +4448,7 @@ key_desc_0394="build sonars + transports + amphibious / hover tanks"
key_desc_0395="build mass extractors / fabricators + tanks + bombers + frigates / destroyers / battlecruisers / battleships"
key_desc_0396="build steath fields & cybran T3 sonar + mobile stealth fields + counter intelligence boat"
key_desc_0397="build power generators / storage + snipers & Loyalist / titan & gattling / rocket bots & LABs + gunships"
key_desc_0398="build templates + factory templates"
key_desc_0398="cycle user templates + factory build queue templates"
key_desc_0399="build engineers stations + field engineers"
key_desc_0400="build point defenses & walls + structure upgrades"
key_desc_0401="build static AA + air staging + mobile AA & flaks + air fighters + aircrafts carriers / cruisers / attack boat"
Expand Down
12 changes: 6 additions & 6 deletions lua/keymap/keydescriptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ keyDescriptions = {
['cycle_idle_factories'] = '<LOC key_desc_0224>Cycle through idle factories',
['cycle_unit_types_in_sel'] = '<LOC key_desc_0225>Cycle through unit types in selection (Land, Sea, Air)',

['create_template_factory'] = '<LOC key_desc_0226>Create build template (Factory)',
['create_template_factory'] = '<LOC key_desc_0226>Create a factory build queue template based on the currently selected factory',

['select_gunships'] = '<LOC key_desc_0227>Select all Gunships',
['select_bombers'] = '<LOC key_desc_0228>Select all Bombers',
Expand Down Expand Up @@ -364,8 +364,8 @@ keyDescriptions = {
['mass'] = '<LOC key_desc_0262>build mass extractors + T2 Engineers',
['massfab'] = '<LOC key_desc_0263>build mass fabricators + T2 Bots + T2 air fighters + T2 subs',
['pgen'] = '<LOC key_desc_0264>build power generators + T2 Tanks + T2 Torpedo Bombers + T2 Destroyers',
['templates'] = '<LOC key_desc_0265>build templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers',
['cycle_templates'] = '<LOC key_desc_0406>cycle templates + T2 Hover Tanks + T2 Gunships + T2 Cruisers',
['templates'] = '<LOC key_desc_0265>cycle user templates & build T2 Hover Tanks + T2 Gunships + T2 Cruisers',
['cycle_templates'] = '<LOC key_desc_0406>cycle context templates & build T2 Hover Tanks + T2 Gunships + T2 Cruisers',
['engystation'] = '<LOC key_desc_0266>build engineers stations + T2 Mobile AA + T2 Air Transports + T2 Boats',
['mml'] = '<LOC key_desc_0267>build Mobile Missiles launchers + T2 Air Guided Missile (mercy)',
['mobileshield'] = '<LOC key_desc_0268>build T2 Mobiles Shields and mobile Stealth fields',
Expand All @@ -387,7 +387,7 @@ keyDescriptions = {
['alt_mass'] = '<LOC key_desc_0395>build mass extractors / fabricators + tanks + bombers + frigates / destroyers / battlecruisers / battleships', -- also Brick from Megalith
['alt_stealth'] = '<LOC key_desc_0396>build steath fields & cybran T3 sonar + mobile stealth fields + counter intelligence boat',
['alt_pgen'] = '<LOC key_desc_0397>build power generators / storage + snipers & Loyalist / titan & gattling / rocket bots & LABs + gunships',
['alt_templates'] = '<LOC key_desc_0398>build templates + factory templates',
['alt_templates'] = '<LOC key_desc_0398>cycle user templates + factory build queue templates',
['alt_engystation'] = '<LOC key_desc_0399>build engineers stations + field engineers',
['alt_defense'] = '<LOC key_desc_0400>build point defenses & walls + structure upgrades',
['alt_aa'] = '<LOC key_desc_0401>build static AA + air staging + mobile AA & flaks + air fighters + aircrafts carriers / cruisers / attack boat', -- also flak & T3 mobile anti air from Megalith
Expand Down Expand Up @@ -548,8 +548,8 @@ keyDescriptions = {
['shift_spreadattack'] = '<LOC key_desc_shift_distribute_orders>Distribute orders',
['spreadattack_context'] = '<LOC key_desc_distribute_orders>Distribute orders from the unit beneath the mouse cursor',
['shift_spreadattack_context'] = '<LOC key_desc_shift_distribute_orders>Distribute orders from the unit beneath the mouse cursor',
['cycle_context_based_templates'] = '<LOC key_desc_context_based_templates>Cycle templates',
['shift_cycle_context_based_templates'] = '<LOC key_desc_shift_context_based_templates>Cycle templates',
['cycle_context_based_templates'] = '<LOC key_desc_context_based_templates>Cycle context templates',
['shift_cycle_context_based_templates'] = '<LOC key_desc_shift_context_based_templates>Cycle context templates',

['load_transports'] = '<LOC key_desc_load_transports>Load into transports',
['load_transports_clear'] = '<LOC key_desc_load_transports_clear>Load into transports. Applies immediately',
Expand Down
10 changes: 7 additions & 3 deletions lua/ui/game/hotkeys/context-based-templates-data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ CapRadarWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/Ca
CapOpticsWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/CapOpticsWithPower.lua").Template
CapT2ArtilleryWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/CapT2ArtilleryWithPower.lua").Template
CapT3FabricatorWithStorages = import("/lua/ui/game/hotkeys/context-based-templates-data/CapT3FabricatorWithStorages.lua").Template
CapT2ArtilleryWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/CapT2ArtilleryWithPower.lua").Template
CapT3ArtilleryWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/CapT3ArtilleryWithPower.lua").Template
CapSalvationWithPower = import("/lua/ui/game/hotkeys/context-based-templates-data/CapSalvationWithPower.lua").Template
PointDefense = import("/lua/ui/game/hotkeys/context-based-templates-data/PointDefense.lua").Template
AirDefenseLand = import("/lua/ui/game/hotkeys/context-based-templates-data/AirDefenseLand.lua").Template
AirDefenseWater = import("/lua/ui/game/hotkeys/context-based-templates-data/AirDefenseWater.lua").Template
Expand All @@ -60,9 +62,11 @@ T1Hydrocarbon = import("/lua/ui/game/hotkeys/context-based-templates-data/T1Hydr
-------------------------------------------------------------------------------
--#region By command mode context

AppendMassStorages = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendMassStorages.lua").Template
AppendMassStoragesAndFabricators = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendMassStoragesAndFabricators.lua").Template
AppendPowerGeneratorsToArtillery = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToArtillery.lua").Template
AppendMassStoragesToExtractors = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendMassStoragesToExtractors.lua").Template
AppendMassStoragesAndFabricatorsToT3Extractor = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendMassStoragesAndFabricatorsToT3Extractor.lua").Template
AppendPowerGeneratorsToT2Artillery = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToT2Artillery.lua").Template
AppendPowerGeneratorsToT3Artillery = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToT3Artillery.lua").Template
AppendPowerGeneratorsToSalvation = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToSalvation.lua").Template
AppendPowerGeneratorsToEnergyStorage = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToEnergyStorage.lua").Template
AppendPowerGeneratorsToRadar = import("/lua/ui/game/hotkeys/context-based-templates-data/AppendPowerGeneratorsToRadar.lua").Template
-- Soothsayer and Eye have different footprints so they need different appending templates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnBuilding = (categories.AIR * categories.SUPPORTFACTORY * categories.TECH3),
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
24,
24,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnBuilding = categories.MASSEXTRACTION * categories.TECH3,
TemplateSortingOrder = 110,
TemplateData = {
0,
0,
10,
10,
{
'dummy',
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnBuilding = categories.MASSEXTRACTION * (categories.TECH2 + categories.TECH3),
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnBuilding = (categories.ENERGYSTORAGE * categories.TECH1),
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
---@type ContextBasedTemplate
Template = {
Name = 'Power generators',
TriggersOnBuilding = (categories.RADAR * categories.OMNI),
TriggersOnBuilding = (categories.TECH2 * categories.RADAR + categories.OMNI),
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
--******************************************************************************************************
--** Copyright (c) 2024 Il1i1
--**
--** Permission is hereby granted, free of charge, to any person obtaining a copy
--** of this software and associated documentation files (the "Software"), to deal
--** in the Software without restriction, including without limitation the rights
--** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
--** copies of the Software, and to permit persons to whom the Software is
--** furnished to do so, subject to the following conditions:
--**
--** The above copyright notice and this permission notice shall be included in all
--** copies or substantial portions of the Software.
--**
--** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
--** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
--** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
--** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
--** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
--** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
--** SOFTWARE.
--******************************************************************************************************

---@type ContextBasedTemplate
Template = {
Name = 'Power generators',
TriggersOnBuilding = categories.STRUCTURE * categories.ARTILLERY * categories.SIZE20,
TemplateSortingOrder = 100,
TemplateData = {
26,
26,
{
'dummy',
0,
3,
3
},
{
'uab1301',
101,
12,
2
},
{
'uab1101',
102,
9,
7
},
{
'uab1301',
111,
4,
12
},
{
'uab1101',
112,
-1,
9
},

{
'uab1301',
121,
-6,
4
},
{
'uab1101',
122,
-3,
-1
},

{
'uab1301',
131,
2,
-6
},
{
'uab1101',
132,
7,
-3
},

},
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnBuilding = (categories.ARTILLERY * categories.TECH2),
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
--******************************************************************************************************
--** Copyright (c) 2024 Il1i1
--**
--** Permission is hereby granted, free of charge, to any person obtaining a copy
--** of this software and associated documentation files (the "Software"), to deal
--** in the Software without restriction, including without limitation the rights
--** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
--** copies of the Software, and to permit persons to whom the Software is
--** furnished to do so, subject to the following conditions:
--**
--** The above copyright notice and this permission notice shall be included in all
--** copies or substantial portions of the Software.
--**
--** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
--** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
--** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
--** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
--** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
--** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
--** SOFTWARE.
--******************************************************************************************************

---@type ContextBasedTemplate
Template = {
Name = 'Power generators',
TriggersOnBuilding = categories.STRUCTURE * categories.ARTILLERY * (categories.TECH3 + categories.EXPERIMENTAL) - categories.SIZE20,
TemplateSortingOrder = 100,
TemplateData = {
24,
24,
{
'dummy',
0,
2,
2,
},
{
'uab1301',
5352,
10,
2
},
{
'uab1301',
5369,
2,
10
},
{
'uab1301',
5385,
-6,
2
},
{
'uab1301',
5408,
2,
-6
}
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
---@type ContextBasedTemplate
Template = {
Name = 'Power generators',
TriggersOnBuilding = (categories.TACTICALMISSILEPLATFORM + categories.TECH2),
TriggersOnBuilding = categories.TACTICALMISSILEPLATFORM * categories.TECH2,
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'dummy',
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnUnit = categories.MASSEXTRACTION,
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'uab1106',
33986,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template = {
TriggersOnUnit = (categories.RADAR + categories.OMNI) * categories.STRUCTURE,
TemplateSortingOrder = 100,
TemplateData = {
0,
0,
6,
6,
{
'uab1101',
33986,
Expand Down
Loading

0 comments on commit 8ac595a

Please sign in to comment.