From a44cbe59724ff89980e72654f7c40c85a72065b5 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 1 Oct 2020 23:57:53 -0700 Subject: [PATCH 1/5] Tone down failure message for missing plugin file. This looked an awful lot like an error, but it's the common case. --- game/operation/operation.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/game/operation/operation.py b/game/operation/operation.py index 4bee75b0..c0ce5e67 100644 --- a/game/operation/operation.py +++ b/game/operation/operation.py @@ -236,18 +236,19 @@ class Operation: # Inject Plugins Lua Scripts listOfPluginsScripts = [] - try: - with open("./resources/scripts/plugins/__plugins.lst", "r") as a_file: - for line in a_file: - name = line.strip() - if not name.startswith( '#' ): - trigger = TriggerStart(comment="Load " + name) - listOfPluginsScripts.append(name) - fileref = self.current_mission.map_resource.add_resource_file("./resources/scripts/plugins/" + name) - trigger.add_action(DoScriptFile(fileref)) - self.current_mission.triggerrules.triggers.append(trigger) - except Exception as e: - print(e) + plugin_file_path = Path("./resources/scripts/plugins/__plugins.lst") + if plugin_file_path.exists(): + for line in plugin_file_path.read_text().splitlines(): + name = line.strip() + if not name.startswith( '#' ): + trigger = TriggerStart(comment="Load " + name) + listOfPluginsScripts.append(name) + fileref = self.current_mission.map_resource.add_resource_file("./resources/scripts/plugins/" + name) + trigger.add_action(DoScriptFile(fileref)) + self.current_mission.triggerrules.triggers.append(trigger) + else: + logging.info( + f"Not loading plugins, {plugin_file_path} does not exist") # Inject Mist Script if not done already in the plugins if not "mist.lua" in listOfPluginsScripts and not "mist_4_3_74.lua" in listOfPluginsScripts: # don't load the script twice From f8ef5db5a31e8c218643c4e3a20cc8119b867059 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 2 Oct 2020 14:29:40 +0200 Subject: [PATCH 2/5] bug when continuing an old campaign save --- game/game.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/game.py b/game/game.py index 385261b8..0d8b9682 100644 --- a/game/game.py +++ b/game/game.py @@ -190,9 +190,9 @@ class Game: def is_player_attack(self, event): if isinstance(event, Event): - return event.attacker_name == self.player_name + return event and event.attacker_name and event.attacker_name == self.player_name else: - return event.name == self.player_name + return event and event.name and event.name == self.player_name def pass_turn(self, no_action=False, ignored_cps: typing.Collection[ControlPoint] = None): From 98b2d8b3b9c28725a3a91676860945ad2c00ec26 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 2 Oct 2020 14:30:12 +0200 Subject: [PATCH 3/5] typo in the `generate_initial_units` function name --- qt_ui/windows/newgame/QNewGameWizard.py | 2 +- theater/start_generator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qt_ui/windows/newgame/QNewGameWizard.py b/qt_ui/windows/newgame/QNewGameWizard.py index 3daace57..cba58371 100644 --- a/qt_ui/windows/newgame/QNewGameWizard.py +++ b/qt_ui/windows/newgame/QNewGameWizard.py @@ -83,7 +83,7 @@ class NewGameWizard(QtWidgets.QWizard): print("Enemy name : " + enemy_name) print("Player name : " + player_name) print("Midgame : " + str(midgame)) - start_generator.generate_inital_units(conflictTheater, enemy_name, True, multiplier) + start_generator.generate_initial_units(conflictTheater, enemy_name, True, multiplier) print("-- Initial units generated") game = Game(player_name=player_name, diff --git a/theater/start_generator.py b/theater/start_generator.py index b029ae92..d459cbb1 100644 --- a/theater/start_generator.py +++ b/theater/start_generator.py @@ -27,7 +27,7 @@ COUNT_BY_TASK = { } -def generate_inital_units(theater: ConflictTheater, enemy_country: str, sams: bool, multiplier: float): +def generate_initial_units(theater: ConflictTheater, enemy_country: str, sams: bool, multiplier: float): for cp in theater.enemy_points(): if cp.captured: continue From e72c82521a290b831e3063398ab3f58fcbaa2a79 Mon Sep 17 00:00:00 2001 From: Khopa Date: Sat, 3 Oct 2020 16:45:21 +0200 Subject: [PATCH 4/5] Forgot the changelog for 2.1.4 --- changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog.md b/changelog.md index 0f60b72f..59a20d76 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# 2.1.4 + +## Fixes : +* **[UI]** Fixed an issue that prevent generating the mission (take off button no working) on old savegames. + # 2.1.3 ## Features/Improvements : From 7dd3367203b042fdaef639016dc249ac38c42123 Mon Sep 17 00:00:00 2001 From: Khopa Date: Sat, 3 Oct 2020 16:50:56 +0200 Subject: [PATCH 5/5] Version number for release 2.1.4 --- qt_ui/uiconstants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt_ui/uiconstants.py b/qt_ui/uiconstants.py index ada6c94c..30f61ef1 100644 --- a/qt_ui/uiconstants.py +++ b/qt_ui/uiconstants.py @@ -8,7 +8,7 @@ from game.event import UnitsDeliveryEvent, FrontlineAttackEvent from theater.theatergroundobject import CATEGORY_MAP from userdata.liberation_theme import get_theme_icons -VERSION_STRING = "2.1.3" +VERSION_STRING = "2.1.4" URLS : Dict[str, str] = { "Manual": "https://github.com/khopa/dcs_liberation/wiki",