Refactor Templates to Layouts, Review and Cleanup

- Fix tgogenerator
- Fix UI for ForceGroup and Layouts
- Fix ammo depot handling
- Split bigger files in smaller meaningful files (TGO, layouts, forces)
- Renamed Template to Layout
- Renamed GroundGroup to TheaterGroup and GroundUnit to TheaterUnit
- Reorganize Layouts and UnitGroups to a ArmedForces class and ForceGroup similar to the AirWing and Squadron
- Reworded the UnitClass, GroupRole, GroupTask (adopted to PEP8) and reworked the connection from Role and Task
- added comments
- added missing unit classes
- added temp workaround for missing classes
- add repariable property to TheaterUnit
- Review and Cleanup

Added serialization for loaded templates

Loading the templates from the .miz files takes a lot of computation time and in the future there will be more templates added to the system. Therefore a local pickle serialization for the loaded templates was re-added:
- The pickle will be created the first time the TemplateLoader will be accessed
- Pickle is stored in Liberation SaveDir
- Added UI option to (re-)import templates
This commit is contained in:
RndName
2022-02-10 12:23:16 +01:00
parent 1ae6503ceb
commit 2c17a9a52e
138 changed files with 1985 additions and 3096 deletions

View File

@@ -20,4 +20,4 @@ groups:
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz
layout_file: resources/layouts/anti_air/AAA.miz

View File

@@ -26,4 +26,4 @@ groups:
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz
layout_file: resources/layouts/anti_air/AAA.miz

View File

@@ -20,4 +20,4 @@ groups:
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz
layout_file: resources/layouts/anti_air/AAA.miz

View File

@@ -33,4 +33,4 @@ groups:
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/flak.miz
layout_file: resources/layouts/anti_air/flak.miz

View File

@@ -12,4 +12,4 @@ groups:
alternative_classes:
- SearchRadar
- SearchTrackRadar
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -48,4 +48,4 @@ groups:
- 4
unit_types:
- Blitz_36-6700A
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -48,4 +48,4 @@ groups:
- 3
unit_types:
- soldier_mauser98
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -21,4 +21,4 @@ groups:
- 2
unit_types:
- Ural-375 ZU-23
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -33,4 +33,4 @@ groups:
- 1
unit_types:
- Vulcan
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 4
unit_types:
- NASAMS_LN_B
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 4
unit_types:
- NASAMS_LN_C
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -53,4 +53,4 @@ groups:
- 2
unit_classes:
- SHORAD
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 2
unit_types:
- rapier_fsa_launcher
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 1
unit_types:
- M 818
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 4
unit_types:
- SA-11 Buk LN 9A310M1
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 3
unit_types:
- SA-17 Buk M1-2 LN 9A310M1-2
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 6
unit_types:
- S_75M_Volhov
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -18,4 +18,4 @@ groups:
- 4
unit_types:
- 5p73 s-125 ln
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -23,4 +23,4 @@ groups:
- 6
unit_types:
- S-200_Launcher
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -13,4 +13,4 @@ groups:
- 4
unit_types:
- Kub 2P25 ln
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -16,4 +16,4 @@ groups:
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/shorad.miz
layout_file: resources/layouts/anti_air/shorad.miz

View File

@@ -38,4 +38,4 @@ groups:
- 1
unit_types:
- Bedford_MWD
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -13,4 +13,4 @@ groups:
- 1
unit_types:
- Blitz_36-6700A
template_file: resources/templates/anti_air/legacy_ground_templates.miz
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz

View File

@@ -1,4 +1,5 @@
name: allycamp1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -80,4 +81,4 @@ groups:
- 4
unit_types:
- house2arm
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: ammo1
generic: true
role: Building
tasks:
- Ammo
@@ -18,4 +19,4 @@ groups:
- 2
unit_types:
- Hangar B
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: comms
generic: true
role: Building
tasks:
- StrikeTarget
@@ -12,4 +13,4 @@ groups:
unit_types:
- TV tower
- Comms tower M
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: derrick1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -27,4 +28,4 @@ groups:
- 1
unit_types:
- Subsidiary structure 2
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: factory1
generic: true
role: Building
tasks:
- Factory
@@ -19,4 +20,4 @@ groups:
- 3
unit_types:
- Tech hangar A
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: farp1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -37,4 +38,4 @@ groups:
- 2
unit_types:
- FARP Fuel Depot
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: fob1
generic: true
role: Building
tasks:
- FOB
@@ -27,4 +28,4 @@ groups:
- 2
unit_types:
- Garage small B
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: fuel1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -24,4 +25,4 @@ groups:
- 2
unit_types:
- Tank 3
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: oil1
generic: true
role: Building
tasks:
- OffShoreStrikeTarget
@@ -14,4 +15,4 @@ groups:
- 4
unit_types:
- Oil platform
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: power1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -33,4 +34,4 @@ groups:
- 1
unit_types:
- Farm B
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: village1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -35,4 +36,4 @@ groups:
- 3
unit_types:
- Small house 1B
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: ware1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -20,4 +21,4 @@ groups:
- 3
unit_types:
- Hangar A
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: ww2bunker1
generic: true
role: Building
tasks:
- StrikeTarget
@@ -30,4 +31,4 @@ groups:
- 4
unit_types:
- SK_C_28_naval_gun
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -1,4 +1,5 @@
name: ww2bunker2
generic: true
role: Building
tasks:
- StrikeTarget
@@ -53,4 +54,4 @@ groups:
- 7
unit_types:
- Czech hedgehogs 1
template_file: resources/templates/buildings/buildings.miz
layout_file: resources/layouts/buildings/buildings.miz

View File

@@ -31,4 +31,4 @@ groups:
- 1
unit_classes:
- SHORAD
template_file: resources/templates/defenses/defenses.miz
layout_file: resources/layouts/defenses/defenses.miz

View File

@@ -26,4 +26,4 @@ groups:
- 1
unit_classes:
- SHORAD
template_file: resources/templates/defenses/defenses.miz
layout_file: resources/layouts/defenses/defenses.miz

View File

@@ -14,4 +14,4 @@ groups:
- ATGM
- IFV
- Tank
template_file: resources/templates/ground_forces/ground_forces.miz
layout_file: resources/layouts/ground_forces/ground_forces.miz

View File

@@ -23,4 +23,4 @@ groups:
- AAA
- SHORAD
- Manpad
template_file: resources/templates/ground_forces/ground_forces.miz
layout_file: resources/layouts/ground_forces/ground_forces.miz

View File

@@ -16,4 +16,4 @@ groups:
- 4
unit_classes:
- Destroyer
template_file: resources/templates/naval/legacy_naval_templates.miz
layout_file: resources/layouts/naval/legacy_naval_templates.miz

View File

@@ -22,4 +22,4 @@ groups:
- 2
unit_types:
- TICONDEROG
template_file: resources/templates/naval/legacy_naval_templates.miz
layout_file: resources/layouts/naval/legacy_naval_templates.miz

View File

@@ -16,4 +16,4 @@ groups:
- 2
unit_classes:
- Destroyer
template_file: resources/templates/naval/legacy_naval_templates.miz
layout_file: resources/layouts/naval/legacy_naval_templates.miz

View File

@@ -20,4 +20,4 @@ groups:
- 1
unit_classes:
- Cruiser
template_file: resources/templates/naval/naval.miz
layout_file: resources/layouts/naval/naval.miz

View File

@@ -14,4 +14,4 @@ groups:
- Boat
- Submarine
- LandingShip
template_file: resources/templates/naval/naval.miz
layout_file: resources/layouts/naval/naval.miz

View File

@@ -13,4 +13,4 @@ groups:
- 3
unit_types:
- LST_Mk2
template_file: resources/templates/naval/legacy_naval_templates.miz
layout_file: resources/layouts/naval/legacy_naval_templates.miz

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ name: Ally Flak
role: AntiAir
tasks:
- AAA
ground_units:
units:
- QF 3.7-inch AA Gun
- M1 37mm Gun
- M45 Quadmount
@@ -10,5 +10,5 @@ ground_units:
- M30 Cargo Carrier
- M4 High-Speed Tractor
- Truck Bedford
templates:
layouts:
- WW2 Ally Flak Site

View File

@@ -2,9 +2,9 @@ name: Carrier Strike Group 8
role: Naval
tasks:
- Navy
ship_units:
units:
- CVN-74 John C. Stennis
- DDG Arleigh Burke IIa
- CG Ticonderoga
templates:
layouts:
- Carrier Strike Group 8

View File

@@ -2,9 +2,9 @@ name: Chinese Navy
role: Naval
tasks:
- Navy
ship_units:
units:
- Type 052C Destroyer
- Type 052B Destroyer
- Type 054A Frigate
templates:
layouts:
- Naval Group

View File

@@ -2,8 +2,8 @@ name: Cold-War-Flak
role: AntiAir
tasks:
- AAA
ground_units:
units:
- 8.8 cm Flak 18
- S-60 57mm
templates:
layouts:
- Cold War Flak Site

View File

@@ -2,7 +2,7 @@ name: Flak
role: AntiAir
tasks:
- AAA
ground_units:
units:
- 2 cm Flakvierling 38
- 8.8 cm Flak 18
- 8.8 cm Flak 36
@@ -14,5 +14,5 @@ ground_units:
- AAA SP Kdo.G.40
- LUV Kubelwagen 82
- Truck Opel Blitz
templates:
layouts:
- Flak Site

View File

@@ -2,7 +2,7 @@ name: Freya
role: AntiAir
tasks:
- SHORAD
ground_units:
units:
- EWR FuMG-401 Freya LZ
- 2 cm Flakvierling 38
- 8.8 cm Flak 18
@@ -12,5 +12,5 @@ ground_units:
- PU Maschinensatz_33
- AAA SP Kdo.G.40
- Infantry Mauser 98
templates:
layouts:
- Freya EWR Site

View File

@@ -2,8 +2,8 @@ name: HQ-7
role: AntiAir
tasks:
- SHORAD
ground_units:
units:
- HQ-7 Self-Propelled STR
- HQ-7 Launcher
templates:
layouts:
- HQ-7 Site

View File

@@ -2,10 +2,10 @@ name: Hawk
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM Hawk SR (AN/MPQ-50)
- SAM Hawk Platoon Command Post (PCP)
- SAM Hawk TR (AN/MPQ-46)
- SAM Hawk LN M192
templates:
layouts:
- Hawk Site

View File

@@ -2,8 +2,8 @@ name: KS-19
role: AntiAir
tasks:
- AAA
ground_units:
units:
- AAA SON-9 Fire Can
- AAA 100mm KS-19
templates:
layouts:
- AAA Radar Site

View File

@@ -2,9 +2,9 @@ name: NASAMS AIM-120B
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM NASAMS C2
- SAM NASAMS SR MPQ64F1
- SAM NASAMS LN AIM-120B
templates:
layouts:
- NASAMS AIM-120B

View File

@@ -2,9 +2,9 @@ name: NASAMS AIM-120C
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM NASAMS C2
- SAM NASAMS SR MPQ64F1
- SAM NASAMS LN AIM-120C
templates:
layouts:
- NASAMS AIM-120C

View File

@@ -2,12 +2,12 @@ name: Patriot
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM Patriot STR
- SAM Patriot CR (AMG AN/MRC-137)
- SAM Patriot ECS
- SAM Patriot C2 ICC
- SAM Patriot EPP-III
- SAM Patriot LN
templates:
layouts:
- Patriot Battery

View File

@@ -2,9 +2,9 @@ name: Rapier
role: AntiAir
tasks:
- SHORAD
ground_units:
units:
- SAM Rapier Blindfire TR
- SAM Rapier Tracker
- SAM Rapier LN
templates:
layouts:
- Rapier AA Site

View File

@@ -2,8 +2,8 @@ name: Roland
role: AntiAir
tasks:
- SHORAD
ground_units:
units:
- SAM Roland EWR
- Roland 2 (Marder Chassis)
templates:
layouts:
- Roland Site

View File

@@ -2,11 +2,11 @@ name: Russian Navy
role: Naval
tasks:
- Navy
ship_units:
units:
- Corvette 1124.4 Grish
- Corvette 1241.1 Molniya
- Frigate 11540 Neustrashimy
- Frigate 1135M Rezky
- Cruiser 1164 Moskva
templates:
layouts:
- Naval Group

View File

@@ -2,12 +2,12 @@ name: SA-10/S-300PS
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-10 S-300 "Grumble" Clam Shell SR
- SAM SA-10 S-300 "Grumble" Big Bird SR
- SAM SA-10 S-300 "Grumble" C2
- SAM SA-10 S-300 "Grumble" Flap Lid TR
- SAM SA-10 S-300 "Grumble" TEL D
- SAM SA-10 S-300 "Grumble" TEL C
templates:
layouts:
- S-300 Site

View File

@@ -2,12 +2,12 @@ name: SA-10B/S-300PS
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-10B S-300PS 40B6MD SR
- SAM SA-10B S-300PS 64H6E SR
- SAM SA-10B S-300PS 54K6 CP
- SAM SA-10B S-300PS 30N6 TR
- SAM SA-10B S-300PS 5P85SE LN
- SAM SA-10B S-300PS 5P85SU LN
templates:
layouts:
- S-300 Site

View File

@@ -2,9 +2,9 @@ name: SA-11
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM SA-11 Buk "Gadfly" Snow Drift SR
- SAM SA-11 Buk "Gadfly" C2
- SAM SA-11 Buk "Gadfly" Fire Dome TEL
templates:
layouts:
- SA-11 Buk Battery

View File

@@ -2,12 +2,12 @@ name: SA-12/S-300V
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-12 S-300V 9S15 SR
- SAM SA-12 S-300V 9S19 SR
- SAM SA-12 S-300V 9S457 CP
- SAM SA-12 S-300V 9S32 TR
- SAM SA-12 S-300V 9A82 LN
- SAM SA-12 S-300V 9A83 LN
templates:
layouts:
- S-300 Site

View File

@@ -2,9 +2,9 @@ name: SA-17
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM SA-11 Buk "Gadfly" Snow Drift SR
- SAM SA-11 Buk "Gadfly" C2
- SAM SA-17 Buk M1-2 LN 9A310M1-2
templates:
layouts:
- SA-17 Grizzly Battery

View File

@@ -2,9 +2,9 @@ name: SA-2/S-75
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM P19 "Flat Face" SR (SA-2/3)
- SAM SA-2 S-75 "Fan Song" TR
- SAM SA-2 S-75 "Guideline" LN
templates:
layouts:
- SA-2/S-75 Site

View File

@@ -2,12 +2,12 @@ name: SA-20/S-300PMU-1
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-20 S-300PMU1 SR 5N66E
- SAM SA-20 S-300PMU1 SR 64N6E
- SAM SA-20 S-300PMU1 CP 54K6
- SAM SA-20 S-300PMU1 TR 30N6E
- SAM SA-20 S-300PMU1 LN 5P85CE
- SAM SA-20 S-300PMU1 LN 5P85DE
templates:
layouts:
- S-300 Site

View File

@@ -2,11 +2,11 @@ name: SA-20B/S-300PMU-2
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-20 S-300PMU1 SR 5N66E
- SAM SA-20 S-300PMU1 SR 64N6E
- SAM SA-20B S-300PMU2 CP 54K6E2
- SAM SA-20B S-300PMU2 TR 92H6E(truck)
- SAM SA-20B S-300PMU2 LN 5P85SE2
templates:
layouts:
- S-300 Site

View File

@@ -2,12 +2,12 @@ name: SA-23/S-300VM
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-23 S-300VM 9S15M2 SR
- SAM SA-23 S-300VM 9S19M2 SR
- SAM SA-23 S-300VM 9S457ME CP
- SAM SA-23 S-300VM 9S32ME TR
- SAM SA-23 S-300VM 9A82ME LN
- SAM SA-23 S-300VM 9A83ME LN
templates:
layouts:
- S-300 Site

View File

@@ -2,9 +2,9 @@ name: SA-3/S-125
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM P19 "Flat Face" SR (SA-2/3)
- SAM SA-3 S-125 "Low Blow" TR
- SAM SA-3 S-125 "Goa" LN
templates:
layouts:
- SA-3/S-125 Site

View File

@@ -2,9 +2,9 @@ name: SA-5/S-200
role: AntiAir
tasks:
- LORAD
ground_units:
units:
- SAM SA-5 S-200 ST-68U "Tin Shield" SR
- SAM SA-5 S-200 "Square Pair" TR"
- SAM SA-5 S-200 "Gammon" LN"
templates:
layouts:
- SA-5/S-200 Site

View File

@@ -2,8 +2,8 @@ name: SA-6
role: AntiAir
tasks:
- MERAD
ground_units:
units:
- SAM SA-6 Kub "Straight Flush" STR
- SAM SA-6 Kub "Gainful" TEL
templates:
layouts:
- SA-6 Kub Site

View File

@@ -2,8 +2,8 @@ name: Silkworm
role: Defenses
tasks:
- Coastal
ground_units:
units:
- AShM SS-N-2 Silkworm
- AShM Silkworm SR
templates:
layouts:
- Silkworm

View File

@@ -2,8 +2,8 @@ name: WW2LST
role: Naval
tasks:
- Navy
ship_units:
units:
- LS Samuel Chase
- LST Mk.II
templates:
layouts:
- WW2 LST Group