diff --git a/qt_ui/windows/newgame/QCampaignList.py b/qt_ui/windows/newgame/QCampaignList.py index 1c3ccf7d..617869bc 100644 --- a/qt_ui/windows/newgame/QCampaignList.py +++ b/qt_ui/windows/newgame/QCampaignList.py @@ -20,6 +20,7 @@ class Campaign: name: str icon_name: str authors: str + description: str theater: ConflictTheater @classmethod @@ -29,7 +30,7 @@ class Campaign: sanitized_theater = data["theater"].replace(" ", "") return cls(data["name"], f"Terrain_{sanitized_theater}", data.get("authors", "???"), - ConflictTheater.from_json(data)) + data.get("description", ""), ConflictTheater.from_json(data)) def load_campaigns() -> List[Campaign]: diff --git a/qt_ui/windows/newgame/QNewGameWizard.py b/qt_ui/windows/newgame/QNewGameWizard.py index 193cb860..e82357dc 100644 --- a/qt_ui/windows/newgame/QNewGameWizard.py +++ b/qt_ui/windows/newgame/QNewGameWizard.py @@ -17,6 +17,16 @@ from qt_ui.windows.newgame.QCampaignList import ( ) from theater.start_generator import GameGenerator +jinja_env = Environment( + loader=FileSystemLoader("resources/ui/templates"), + autoescape=select_autoescape( + disabled_extensions=("",), + default_for_string=True, + default=True, + ), + trim_blocks=True, + lstrip_blocks=True, +) class NewGameWizard(QtWidgets.QWizard): def __init__(self, parent=None): @@ -177,17 +187,7 @@ class FactionSelection(QtWidgets.QWizardPage): red_faction = db.FACTIONS[self.redFactionSelect.currentText()] blue_faction = db.FACTIONS[self.blueFactionSelect.currentText()] - env = Environment( - loader=FileSystemLoader("resources/ui/templates"), - autoescape=select_autoescape( - disabled_extensions=("",), - default_for_string=True, - default=True, - ), - trim_blocks=True, - lstrip_blocks=True, - ) - template = env.get_template("factiontemplate_EN.j2") + template = jinja_env.get_template("factiontemplate_EN.j2") blue_faction_txt = template.render({"faction": blue_faction}) red_faction_txt = template.render({"faction": red_faction}) @@ -235,10 +235,16 @@ class TheaterConfiguration(QtWidgets.QWizardPage): campaignList = QCampaignList(campaigns) self.registerField("selectedCampaign", campaignList) + # Faction description + self.campaignMapDescription = QTextEdit("") + self.campaignMapDescription.setReadOnly(True) + def on_campaign_selected(): + template = jinja_env.get_template("campaigntemplate_EN.j2") index = campaignList.selectionModel().currentIndex().row() campaign = campaignList.campaigns[index] self.setField("selectedCampaign", campaign) + self.campaignMapDescription.setText(template.render({"campaign": campaign})) campaignList.selectionModel().setCurrentIndex(campaignList.indexAt(QPoint(1, 1)), QItemSelectionModel.Rows) campaignList.selectionModel().selectionChanged.connect(on_campaign_selected) @@ -274,8 +280,9 @@ class TheaterConfiguration(QtWidgets.QWizardPage): layout = QtWidgets.QGridLayout() layout.setColumnMinimumWidth(0, 20) layout.addWidget(campaignList, 0, 0, 3, 1) - layout.addWidget(mapSettingsGroup, 0, 1, 1, 1) - layout.addWidget(timeGroup, 1, 1, 1, 1) + layout.addWidget(self.campaignMapDescription, 0, 1, 1, 1) + layout.addWidget(mapSettingsGroup, 1, 1, 1, 1) + layout.addWidget(timeGroup, 2, 1, 1, 1) self.setLayout(layout) diff --git a/resources/campaigns/battle_of_britain.json b/resources/campaigns/battle_of_britain.json index 281e2db3..4515bac1 100644 --- a/resources/campaigns/battle_of_britain.json +++ b/resources/campaigns/battle_of_britain.json @@ -2,7 +2,7 @@ "name": "The Channel - Battle of Britain", "theater": "The Channel", "authors": "Khopa", - "description": "", + "description": "
Experience the Battle of Britain on the Channel map !
Note: It is not possible to cross the channel to capture enemy bases yet, but you can consider you won if you manage to destroy all the ennemy targets
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/desert_war.json b/resources/campaigns/desert_war.json index 088ba7b9..b8a1e150 100644 --- a/resources/campaigns/desert_war.json +++ b/resources/campaigns/desert_war.json @@ -2,7 +2,7 @@ "name": "Persian Gulf - Desert War", "theater": "Persian Gulf", "authors": "Khopa", - "description": "", + "description": "This is a simple scenario in the Desert near Dubai and Abu-Dhabi. Progress from Liwa airbase to Al-Minhad.
This scenario shouldn't require too much performance.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/dunkirk.json b/resources/campaigns/dunkirk.json index a8b6c1ba..09a70d2d 100644 --- a/resources/campaigns/dunkirk.json +++ b/resources/campaigns/dunkirk.json @@ -2,7 +2,7 @@ "name": "The Channel - Dunkirk", "theater": "The Channel", "authors": "Khopa", - "description": "", + "description": "In this scenario, your forces starts in Dunkirk and can be supported by the airfields on the other side of the Channel.
If you select the inverted configuration, you can play a German invasion of England.
Note: B-17 should be operated from Manston airfield
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/emirates.json b/resources/campaigns/emirates.json index acab6325..147295e3 100644 --- a/resources/campaigns/emirates.json +++ b/resources/campaigns/emirates.json @@ -2,7 +2,7 @@ "name": "Persian Gulf - Emirates", "theater": "Persian Gulf", "authors": "Khopa", - "description": "", + "description": "In this scenario, you can play an invasion of the Emirates and Oman, where your forces starts in Fujairah.
Note: Fujairah airfield has very few slots for aircrafts, so it recommended to operate from carriers at the start of the campaign. Thus, a carrier-capable faction is recommended.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/full_caucasus.json b/resources/campaigns/full_caucasus.json index a312a999..ce4d3858 100644 --- a/resources/campaigns/full_caucasus.json +++ b/resources/campaigns/full_caucasus.json @@ -2,7 +2,7 @@ "name": "Caucasus - Full Map", "theater": "Caucasus", "authors": "george", - "description": "Full Caucasus Map", + "description": "Full map of the Caucasus
Note: This scenario is heavy on performance, enabling \"culling\" in settings is highly recommended.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/golan_heights_battle.json b/resources/campaigns/golan_heights_battle.json index 978e38eb..6afd303f 100644 --- a/resources/campaigns/golan_heights_battle.json +++ b/resources/campaigns/golan_heights_battle.json @@ -2,7 +2,7 @@ "name": "Syria - Golan heights battle", "theater": "Syria", "authors": "Khopa", - "description": "", + "description": "In this scenario, you start in Israel and the conflict is focused around the golan heights, an historically disputed territory.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/inherent_resolve.json b/resources/campaigns/inherent_resolve.json index 7c178920..fc5969a5 100644 --- a/resources/campaigns/inherent_resolve.json +++ b/resources/campaigns/inherent_resolve.json @@ -2,7 +2,7 @@ "name": "Syria - Inherent Resolve", "theater": "Syria", "authors": "Khopa", - "description": "", + "description": "In this scenario, you start from Jordan, and have to fight your way through eastern Syria.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/invasion_from_turkey.json b/resources/campaigns/invasion_from_turkey.json index 7473d5d4..41cd39a2 100644 --- a/resources/campaigns/invasion_from_turkey.json +++ b/resources/campaigns/invasion_from_turkey.json @@ -2,7 +2,7 @@ "name": "Syria - Invasion from Turkey", "theater": "Syria", "authors": "Khopa", - "description": "", + "description": "In this scenario, you start from Turkey and have to invade territories in northern Syria.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/invasion_of_iran.json b/resources/campaigns/invasion_of_iran.json index 727e2543..248356fb 100644 --- a/resources/campaigns/invasion_of_iran.json +++ b/resources/campaigns/invasion_of_iran.json @@ -2,7 +2,7 @@ "name": "Persian Gulf - Invasion of Iran", "theater": "Persian Gulf", "authors": "Khopa", - "description": "", + "description": "In this scenario, you start in Bandar Abbas, and must invade Iran.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/invasion_of_iran_[lite].json b/resources/campaigns/invasion_of_iran_[lite].json index 2ac59c3b..840fb55c 100644 --- a/resources/campaigns/invasion_of_iran_[lite].json +++ b/resources/campaigns/invasion_of_iran_[lite].json @@ -2,7 +2,7 @@ "name": "Persian Gulf - Invasion of Iran [Lite]", "theater": "Persian Gulf", "authors": "Khopa", - "description": "", + "description": "This is lighter version of the invasion of Iran scenario.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/normandy.json b/resources/campaigns/normandy.json index f74554bc..b656709b 100644 --- a/resources/campaigns/normandy.json +++ b/resources/campaigns/normandy.json @@ -2,7 +2,7 @@ "name": "Normandy - Normandy", "theater": "Normandy", "authors": "Khopa", - "description": "", + "description": "Normandy 1944 D-Day scenario.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/normandy_small.json b/resources/campaigns/normandy_small.json index a38529a5..3bbee783 100644 --- a/resources/campaigns/normandy_small.json +++ b/resources/campaigns/normandy_small.json @@ -2,7 +2,7 @@ "name": "Normandy - Normandy Small", "theater": "Normandy", "authors": "Khopa", - "description": "", + "description": "A lighter version of the Normandy 1944 D-Day scenario.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/north_caucasus.json b/resources/campaigns/north_caucasus.json index bebb5efb..08f60007 100644 --- a/resources/campaigns/north_caucasus.json +++ b/resources/campaigns/north_caucasus.json @@ -2,7 +2,7 @@ "name": "Caucasus - North Caucasus", "theater": "Caucasus", "authors": "Khopa", - "description": "", + "description": "In this scenario you will have to fight in the moutain of Caucasus
Note: Running CAS in the moutains can be a bit difficult.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/north_nevada.json b/resources/campaigns/north_nevada.json index dc0a2a71..86521fc2 100644 --- a/resources/campaigns/north_nevada.json +++ b/resources/campaigns/north_nevada.json @@ -2,7 +2,7 @@ "name": "Nevada - North Nevada", "theater": "Nevada", "authors": "Khopa", - "description": "", + "description": "A scenario taking place in the NTTR. Here you can simulate a red flag exercise.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/pg_map_full.json b/resources/campaigns/pg_map_full.json deleted file mode 100644 index 1d0a2618..00000000 --- a/resources/campaigns/pg_map_full.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "name": "Persian Gulf - Full", - "theater": "Persian Gulf", - "authors": "Khopa", - "description": "Full persian gulf map. For performance reason, please enable 'culling' in settings when playing this map. Known issues : Islands can only be captured through cheating.", - "player_points": [ - { - "type": "carrier", - "id": 1001, - "x": 59514.324335475, - "y": 28165.517980635 - }, - { - "type": "lha", - "id": 1002, - "x": -27500.813952358, - "y": -147000.65947136 - } - ], - "enemy_points": [ - { - "type": "airbase", - "id": "Ras Al Khaimah", - "size": 1000, - "importance": 1.2 - }, - { - "type": "airbase", - "id": "Khasab", - "size": 600, - "importance": 1.2 - }, - { - "type": "airbase", - "id": "Qeshm Island", - "radials": [ - 270, - 315, - 0, - 45, - 90, - 135, - 180 - ], - "size": 600, - "importance": 1.1 - }, - { - "type": "airbase", - "id": "Havadarya", - "radials": [ - 225, - 270, - 315, - 0, - 45 - ], - "size": 1000, - "importance": 1.4 - }, - { - "type": "airbase", - "id": "Bandar Abbas Intl", - "size": 2000, - "importance": 1.4 - }, - { - "type": "airbase", - "id": "Bandar Lengeh", - "radials": [ - 270, - 315, - 0, - 45 - ], - "size": 600, - "importance": 1.4 - }, - { - "type": "airbase", - "id": "Shiraz International Airport", - "size": 2000, - "importance": 1.4, - "captured_invert": true - }, - { - "type": "airbase", - "id": "Jiroft Airport", - "size": 2000, - "importance": 1.4 - }, - { - "type": "airbase", - "id": "Kerman Airport", - "size": 2000, - "importance": 1.4 - }, - { - "type": "airbase", - "id": "Lar Airbase", - "size": 1000, - "importance": 1.4 - } - ], - "links": [ - [ - "Khasab", - "Ras Al Khaimah" - ], - [ - "Bandar Lengeh", - "Lar Airbase" - ], - [ - "Havadarya", - "Lar Airbase" - ], - [ - "Bandar Abbas Intl", - "Havadarya" - ], - [ - "Bandar Abbas Intl", - "Jiroft Airport" - ], - [ - "Lar Airbase", - "Shiraz International Airport" - ], - [ - "Kerman Airport", - "Shiraz International Airport" - ], - [ - "Jiroft Airport", - "Kerman Airport" - ], - [ - "Kerman Airport", - "Lar Airbase" - ] - ] -} \ No newline at end of file diff --git a/resources/campaigns/russia_small.json b/resources/campaigns/russia_small.json index 022aa893..d79c4d92 100644 --- a/resources/campaigns/russia_small.json +++ b/resources/campaigns/russia_small.json @@ -2,7 +2,7 @@ "name": "Caucasus - Russia Small", "theater": "Caucasus", "authors": "Khopa", - "description": "", + "description": "A small theater in Russia, progress from Mozdok to Maykop.
This scenario is pretty simple, it is ideal if you want to run a short campaign. If your PC is not powerful, this is also the less performance heavy scenario.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/full_map.json b/resources/campaigns/syria_full_map.json similarity index 94% rename from resources/campaigns/full_map.json rename to resources/campaigns/syria_full_map.json index 935fb0f0..aa45dae0 100644 --- a/resources/campaigns/full_map.json +++ b/resources/campaigns/syria_full_map.json @@ -2,7 +2,7 @@ "name": "Syria - Full Map", "theater": "Syria", "authors": "Khopa", - "description": "", + "description": "Full map of Syria
Note: This scenario is heavy on performance, enabling \"culling\" in settings is highly recommended.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/syrian_civil_war.json b/resources/campaigns/syrian_civil_war.json index 233e1734..0ca59b44 100644 --- a/resources/campaigns/syrian_civil_war.json +++ b/resources/campaigns/syrian_civil_war.json @@ -2,7 +2,7 @@ "name": "Syria - Syrian Civil War", "theater": "Syria", "authors": "Khopa", - "description": "", + "description": "This scenario can be used to simulate parts of the Syrian Civil War.
", "player_points": [ { "type": "airbase", diff --git a/resources/campaigns/western_georgia.json b/resources/campaigns/western_georgia.json index e111d236..df1c755d 100644 --- a/resources/campaigns/western_georgia.json +++ b/resources/campaigns/western_georgia.json @@ -2,7 +2,7 @@ "name": "Caucasus - Western Georgia", "theater": "Caucasus", "authors": "Khopa", - "description": "", + "description": "A medium sized theater in the south west of the Caucasus map. Shouldn't be too hard on performance.
", "player_points": [ { "type": "airbase", diff --git a/resources/factions/bluefor_coldwar_a4_mb339.json b/resources/factions/bluefor_coldwar_a4_mb339.json index fc7fb01d..d106c693 100644 --- a/resources/factions/bluefor_coldwar_a4_mb339.json +++ b/resources/factions/bluefor_coldwar_a4_mb339.json @@ -62,6 +62,7 @@ "Ticonderoga_class" ], "requirements": { + "MB-339A/PAN by Frecce Tricolori Virtuali": "http://www.freccetricolorivirtuali.net/", "Community A-4E": "https://heclak.github.io/community-a4e-c/" }, "carrier_names": [ diff --git a/resources/factions/italy_1990_mb339.json b/resources/factions/italy_1990_mb339.json index dbb0e0f1..bad67565 100644 --- a/resources/factions/italy_1990_mb339.json +++ b/resources/factions/italy_1990_mb339.json @@ -53,6 +53,7 @@ "Ticonderoga_class" ], "requirements": { + "MB-339A/PAN by Frecce Tricolori Virtuali": "http://www.freccetricolorivirtuali.net/" }, "carrier_names": [ ], diff --git a/resources/factions/pmc_us_with_mb339.json b/resources/factions/pmc_us_with_mb339.json index 56407fde..3d42fa03 100644 --- a/resources/factions/pmc_us_with_mb339.json +++ b/resources/factions/pmc_us_with_mb339.json @@ -30,7 +30,7 @@ "AvengerGenerator" ], "requirements": { - "MB-339A": "http://www.freccetricolorivirtuali.net/" + "MB-339A/PAN by Frecce Tricolori Virtuali": "http://www.freccetricolorivirtuali.net/" }, "has_jtac": true, "jtac_unit": "MQ_9_Reaper" diff --git a/resources/factions/russia_2020.json b/resources/factions/russia_2020.json index 93b2f182..bfc5e118 100644 --- a/resources/factions/russia_2020.json +++ b/resources/factions/russia_2020.json @@ -71,7 +71,9 @@ "cruisers": [ "FSG_1241_1MP_Molniya" ], - "requirements": {}, + "requirements": { + "SU-57 Felon By CubanAce Simulations": "https://www.digitalcombatsimulator.com/fr/files/2539621/" + }, "carrier_names": [ "Admiral Kuznetov" ], diff --git a/resources/ui/templates/campaigntemplate_EN.j2 b/resources/ui/templates/campaigntemplate_EN.j2 new file mode 100644 index 00000000..88a210fb --- /dev/null +++ b/resources/ui/templates/campaigntemplate_EN.j2 @@ -0,0 +1,7 @@ +Author(s): {{ campaign.authors }} +