Issue 3204 (#3458)

This issue addresses Issue #3204 by allowing factions to set a different
weapon introduction date.
This commit is contained in:
zhexu14
2024-11-09 23:43:01 +11:00
committed by GitHub
parent c29c61ade3
commit fa41b00ef0
12 changed files with 70 additions and 14 deletions

View File

@@ -26,7 +26,9 @@ class QPylonEditor(QComboBox):
self.addItem("None", None)
if self.game.settings.restrict_weapons_by_date:
weapons = pylon.available_on(self.game.date)
weapons = pylon.available_on(
self.game.date, flight.squadron.coalition.faction
)
else:
weapons = pylon.allowed
allowed = sorted(weapons, key=operator.attrgetter("name"))
@@ -68,7 +70,11 @@ class QPylonEditor(QComboBox):
def matching_weapon_name(self, loadout: Loadout) -> str:
if self.game.settings.restrict_weapons_by_date:
loadout = loadout.degrade_for_date(self.flight.unit_type, self.game.date)
loadout = loadout.degrade_for_date(
self.flight.unit_type,
self.game.date,
self.flight.squadron.coalition.faction,
)
weapon = self.weapon_from_loadout(loadout)
if weapon is None:
return "None"