diff --git a/qt_ui/windows/newgame/QNewGameWizard.py b/qt_ui/windows/newgame/QNewGameWizard.py index a1bb2a27..d5553bf5 100644 --- a/qt_ui/windows/newgame/QNewGameWizard.py +++ b/qt_ui/windows/newgame/QNewGameWizard.py @@ -10,13 +10,13 @@ from jinja2 import Environment, FileSystemLoader, select_autoescape from game import db from game.settings import Settings +from game.theater.start_generator import GameGenerator, GeneratorSettings from qt_ui.widgets.spinsliders import TenthsSpinSlider from qt_ui.windows.newgame.QCampaignList import ( Campaign, QCampaignList, load_campaigns, ) -from game.theater.start_generator import GameGenerator, GeneratorSettings jinja_env = Environment( loader=FileSystemLoader("resources/ui/templates"), @@ -272,14 +272,21 @@ class TheaterConfiguration(QtWidgets.QWizardPage): # Faction description self.campaignMapDescription = QTextEdit("") self.campaignMapDescription.setReadOnly(True) + self.campaignMapDescription.setMaximumHeight(150) + + self.performanceText = QTextEdit("") + self.performanceText.setReadOnly(True) + self.performanceText.setMaximumHeight(150) def on_campaign_selected(): template = jinja_env.get_template("campaigntemplate_EN.j2") + template_perf = jinja_env.get_template("campaign_performance_template_EN.j2") index = campaignList.selectionModel().currentIndex().row() campaign = campaignList.campaigns[index] self.setField("selectedCampaign", campaign) self.campaignMapDescription.setText(template.render({"campaign": campaign})) self.faction_selection.setDefaultFactions(campaign) + self.performanceText.setText(template_perf.render({"performance": campaign.performance})) campaignList.selectionModel().setCurrentIndex(campaignList.indexAt(QPoint(1, 1)), QItemSelectionModel.Rows) campaignList.selectionModel().selectionChanged.connect(on_campaign_selected) @@ -292,11 +299,6 @@ class TheaterConfiguration(QtWidgets.QWizardPage): mapSettingsLayout = QtWidgets.QGridLayout() mapSettingsLayout.addWidget(QtWidgets.QLabel("Invert Map"), 0, 0) mapSettingsLayout.addWidget(invertMap, 0, 1) - - #mapSettingsLayout.addWidget(QtWidgets.QLabel("Start at mid game"), 1, 0) - #midgame = QtWidgets.QCheckBox() - #self.registerField('midGame', midgame) - #mapSettingsLayout.addWidget(midgame, 1, 1) mapSettingsGroup.setLayout(mapSettingsLayout) # Time Period @@ -310,7 +312,6 @@ class TheaterConfiguration(QtWidgets.QWizardPage): # Register fields self.registerField('timePeriod', timePeriodSelect) - self.registerField('timePeriod', timePeriodSelect) timeGroupLayout = QtWidgets.QGridLayout() timeGroupLayout.addWidget(timePeriod, 0, 0) @@ -319,10 +320,11 @@ class TheaterConfiguration(QtWidgets.QWizardPage): layout = QtWidgets.QGridLayout() layout.setColumnMinimumWidth(0, 20) - layout.addWidget(campaignList, 0, 0, 3, 1) + layout.addWidget(campaignList, 0, 0, 4, 1) layout.addWidget(self.campaignMapDescription, 0, 1, 1, 1) - layout.addWidget(mapSettingsGroup, 1, 1, 1, 1) - layout.addWidget(timeGroup, 2, 1, 1, 1) + layout.addWidget(self.performanceText, 1, 1, 1, 1) + layout.addWidget(mapSettingsGroup, 2, 1, 1, 1) + layout.addWidget(timeGroup, 3, 1, 1, 1) self.setLayout(layout) diff --git a/resources/campaigns/battle_of_britain.json b/resources/campaigns/battle_of_britain.json index 2220bd07..1eb7fb74 100644 --- a/resources/campaigns/battle_of_britain.json +++ b/resources/campaigns/battle_of_britain.json @@ -5,5 +5,6 @@ "recommended_player_faction": "United Kingdom 1944", "recommended_enemy_faction": "Germany 1942", "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
", - "miz": "battle_of_britain.miz" + "miz": "battle_of_britain.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/black_sea.json b/resources/campaigns/black_sea.json index 116c7a3b..4b9a3a51 100644 --- a/resources/campaigns/black_sea.json +++ b/resources/campaigns/black_sea.json @@ -3,5 +3,6 @@ "theater": "Caucasus", "authors": "Colonel Panic", "description": "A medium sized theater with bases along the coast of the Black Sea.
", - "miz": "black_sea.miz" + "miz": "black_sea.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/desert_war.json b/resources/campaigns/desert_war.json index b268c8f9..2c076f9d 100644 --- a/resources/campaigns/desert_war.json +++ b/resources/campaigns/desert_war.json @@ -5,5 +5,6 @@ "recommended_player_faction": "USA 2005", "recommended_enemy_faction": "Iran 2015", "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.
", - "miz": "desert_war.miz" + "miz": "desert_war.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/dunkirk.json b/resources/campaigns/dunkirk.json index 7c9a8f76..47859eab 100644 --- a/resources/campaigns/dunkirk.json +++ b/resources/campaigns/dunkirk.json @@ -5,5 +5,6 @@ "recommended_player_faction": "Allies 1944", "recommended_enemy_faction": "Germany 1942", "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
", - "miz": "dunkirk.miz" + "miz": "dunkirk.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/emirates.json b/resources/campaigns/emirates.json index d2e7fc26..78ffc4f9 100644 --- a/resources/campaigns/emirates.json +++ b/resources/campaigns/emirates.json @@ -5,5 +5,6 @@ "recommended_player_faction": "USA 2005", "recommended_enemy_faction": "Iran 2015", "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.
", - "miz": "emirates.miz" + "miz": "emirates.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/full_caucasus.json b/resources/campaigns/full_caucasus.json index a11173ef..35fdc4a5 100644 --- a/resources/campaigns/full_caucasus.json +++ b/resources/campaigns/full_caucasus.json @@ -3,5 +3,6 @@ "theater": "Caucasus", "authors": "george", "description": "Full map of the Caucasus
Note: This scenario is heavy on performance, enabling \"culling\" in settings is highly recommended.
", - "miz": "full_caucasus.miz" + "miz": "full_caucasus.miz", + "performance": 3 } \ No newline at end of file diff --git a/resources/campaigns/golan_heights.json b/resources/campaigns/golan_heights.json index 33757de3..bd6106b0 100644 --- a/resources/campaigns/golan_heights.json +++ b/resources/campaigns/golan_heights.json @@ -5,5 +5,6 @@ "recommended_player_faction": "Israel 2000", "recommended_enemy_faction": "Syria 2011", "description": "In this scenario, you start in Israel and the conflict is focused around the golan heights, an historically disputed territory.
You can use the inverted configuration to start on the Syrian side.
If this scenario is too heavy, try the lite version.
In this scenario, you start in Israel and the conflict is focused around the golan heights, an historically disputed territory.
This scenario is designed to be performance friendly.
In this scenario, you start from Jordan, and have to fight your way through eastern Syria.
", - "miz": "inherent_resolve.miz" + "miz": "inherent_resolve.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/invasion_from_turkey.json b/resources/campaigns/invasion_from_turkey.json index b1b86a8d..5610312a 100644 --- a/resources/campaigns/invasion_from_turkey.json +++ b/resources/campaigns/invasion_from_turkey.json @@ -5,5 +5,6 @@ "recommended_player_faction": "Turkey 2005", "recommended_enemy_faction": "Insurgents (Hard)", "description": "In this scenario, you start from Turkey and have to invade territories in northern Syria.
", - "miz": "invasion_from_turkey.miz" + "miz": "invasion_from_turkey.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/invasion_of_iran.json b/resources/campaigns/invasion_of_iran.json index 5adfb17a..cb22512d 100644 --- a/resources/campaigns/invasion_of_iran.json +++ b/resources/campaigns/invasion_of_iran.json @@ -5,5 +5,6 @@ "recommended_player_faction": "USA 2005", "recommended_enemy_faction": "Iran 2015", "description": "In this scenario, you start in Bandar Abbas, and must invade Iran.
", - "miz": "invasion_of_iran.miz" + "miz": "invasion_of_iran.miz", + "performance": 3 } \ No newline at end of file diff --git a/resources/campaigns/invasion_of_iran_[lite].json b/resources/campaigns/invasion_of_iran_[lite].json index f3100887..fbeba09e 100644 --- a/resources/campaigns/invasion_of_iran_[lite].json +++ b/resources/campaigns/invasion_of_iran_[lite].json @@ -5,5 +5,6 @@ "recommended_player_faction": "USA 2005", "recommended_enemy_faction": "Iran 2015", "description": "This is lighter version of the invasion of Iran scenario.
", - "miz": "invasion_of_iran_lite.miz" + "miz": "invasion_of_iran_lite.miz", + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/normandy.json b/resources/campaigns/normandy.json index 2ee32ae0..8a21115c 100644 --- a/resources/campaigns/normandy.json +++ b/resources/campaigns/normandy.json @@ -4,7 +4,7 @@ "authors": "Khopa", "recommended_player_faction": "Allies 1944", "recommended_enemy_faction": "Germany 1944", - "performance": 3, "description": "Normandy 1944 D-Day scenario.
", - "miz":"normandy.miz" + "miz":"normandy.miz", + "performance": 3 } \ No newline at end of file diff --git a/resources/campaigns/normandy_small.json b/resources/campaigns/normandy_small.json index f7a99b97..d09e9a77 100644 --- a/resources/campaigns/normandy_small.json +++ b/resources/campaigns/normandy_small.json @@ -5,5 +5,6 @@ "recommended_player_faction": "Allies 1944", "recommended_enemy_faction": "Germany 1944", "description": "A lighter version of the Normandy 1944 D-Day scenario.
", - "miz": "normandy_small.miz" + "miz": "normandy_small.miz", + "performance": 2 } \ No newline at end of file diff --git a/resources/campaigns/north_caucasus.json b/resources/campaigns/north_caucasus.json index 08f60007..3090b625 100644 --- a/resources/campaigns/north_caucasus.json +++ b/resources/campaigns/north_caucasus.json @@ -97,5 +97,6 @@ "Maykop-Khanskaya", "Mineralnye Vody" ] - ] + ], + "performance": 1 } \ No newline at end of file diff --git a/resources/campaigns/persian_gulf_full_map.json b/resources/campaigns/persian_gulf_full_map.json index b47ecce3..8c6e581d 100644 --- a/resources/campaigns/persian_gulf_full_map.json +++ b/resources/campaigns/persian_gulf_full_map.json @@ -3,5 +3,6 @@ "theater": "Persian Gulf", "authors": "Plob", "description": "Full map of the Persian Gulf
Note: This scenario is heavy on performance, enabling \"culling\" in settings is highly recommended.
", - "miz": "persian_gulf_full_map.miz" + "miz": "persian_gulf_full_map.miz", + "performance": 3 } \ No newline at end of file diff --git a/resources/campaigns/russia_small.json b/resources/campaigns/russia_small.json index 3d9c34f0..570c70ee 100644 --- a/resources/campaigns/russia_small.json +++ b/resources/campaigns/russia_small.json @@ -4,7 +4,7 @@ "authors": "Khopa", "recommended_player_faction": "Russia 2010", "recommended_enemy_faction": "USA 1990", - "performance": "heavy", "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.
", - "miz": "russia_small.miz" + "miz": "russia_small.miz", + "performance": 0 } \ No newline at end of file diff --git a/resources/campaigns/syria_full_map_remastered.json b/resources/campaigns/syria_full_map_remastered.json index d0df2b54..3a10f5c6 100644 --- a/resources/campaigns/syria_full_map_remastered.json +++ b/resources/campaigns/syria_full_map_remastered.json @@ -3,5 +3,6 @@ "theater": "Syria", "authors": "Hawkmoon", "description": "Full map of Syria
Note:For a better early game experience is suggested to give the AI an high amount of starting money This scenario is heavy on performance, enabling \"culling\" in settings is highly recommended.
", - "miz": "syria_full_map_remastered.miz" + "miz": "syria_full_map_remastered.miz", + "performance": 3 } \ No newline at end of file diff --git a/resources/campaigns/syrian_civil_war.json b/resources/campaigns/syrian_civil_war.json index a4ec32a8..86fb6ad1 100644 --- a/resources/campaigns/syrian_civil_war.json +++ b/resources/campaigns/syrian_civil_war.json @@ -5,5 +5,6 @@ "recommended_player_faction": "Russia 2010", "recommended_enemy_faction": "Insurgents (Hard)", "description": "This scenario can be used to simulate parts of the Syrian Civil War.
You start on the coast with an airbase in Latakia, and ground forces in Tartus.
This scenario can also be used to simulate a western invasion of Syria.
In inverted configuration you start in Aleppo.
+This scenario is rather performance friendly. +
+{% elif performance == 1 %} ++This scenario requires a very good computer to run. +
+{% elif performance == 2 %} ++This scenario is not performance friendly. The usage of the culling settings is recommended for most users. +
+{% elif performance == 3 %} ++This theater is huge, and will generate very complex DCS missions with hundreds of units, pushing the limits of DCS engine. +An insanely powerful computer will be necessary to run it. +Usage of culling settings will probably be mandatory for decent FPS. +
+{%endif %} + ++Ce scénario est d'une taille limitée et pensé pour obtenir de bonnes performances en jeu. +
+{% elif performance == 1 %} ++Ce scénario nécessite une machine puissante. +
+{% elif performance == 2 %} ++Ce scénario n'est pas pensé pour la performance et requiert une machine très puissante. +L'usage des paramètres "culling" est recommandé pour la plupart des utilisateurs. +
+{% elif performance == 3 %} ++Ce scénario est gigantesque, et générera des missions DCS d'une grande compléxité contenant des centaines/milliers d'unités. +Une machine extrêmement puissante est nécessaire, et l'utilisation des paramètres de "culling" sera obligatoire pour des performances décentes. +
+{%endif %} + +