Cleanup after cherry-picking...

This commit is contained in:
Raffson 2023-05-14 21:34:28 +02:00
parent f9e9c2793a
commit 785beffee0
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
8 changed files with 10 additions and 6 deletions

View File

@ -299,7 +299,6 @@ class Flight(SidcDescribable, RadioFrequencyContainer, TacanContainer):
def clone_flight(flight: Flight) -> Flight:
return Flight(
flight.package,
flight.country,
flight.squadron,
flight.count,
flight.flight_type,

View File

@ -41,7 +41,7 @@ class FactionLoader:
try:
with f.open("r", encoding="utf-8") as fdata:
data = json.load(fdata)
factions[data["name"]] = Faction.from_json(data)
factions[data["name"]] = Faction.from_dict(data)
logging.info("Loaded faction : " + str(f))
except Exception:
logging.exception(f"Unable to load faction : {f}")

View File

@ -75,8 +75,10 @@ class ConvoyGenerator:
unit_types = list(units.items())
main_unit_type, main_unit_count = unit_types[0]
faction = self.game.coalition_for(for_player).faction
group = self.mission.vehicle_group(
self.game.coalition_for(for_player).faction.country,
faction.country,
name,
main_unit_type.dcs_unit_type,
position=position,

View File

@ -251,7 +251,6 @@ class Settings:
CAMPAIGN_MANAGEMENT_PAGE,
PILOTS_AND_SQUADRONS_SECTION,
default=False,
remember_player_choice=True,
detail="If set, squadrons will be limited to a maximum number of aircraft.",
)

View File

@ -180,3 +180,5 @@ VERSION = _build_version_string()
#: * Support for defining squadron sizes.
#: * 'ground_forces' in yaml file to specify preset groups for TGOs,
#: given the group is available for the faction and the task matches
CAMPAIGN_FORMAT_VERSION = (10, 6)

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from PySide6.QtWidgets import QComboBox
from PySide2.QtWidgets import QComboBox
from game.ato import FlightType
from game.dcs.aircrafttype import AircraftType

View File

@ -169,6 +169,7 @@ class SquadronLiverySelector(QComboBox):
self.addItem("No available liveries (using DCS default)")
self.setEnabled(False)
class SquadronSizeSpinner(QSpinBox):
def __init__(self, starting_size: int, parent: QWidget | None) -> None:
super().__init__(parent)

View File

@ -2,7 +2,6 @@ import pytest
from typing import Any
from dcs.mapping import Point
from dcs.terrain import Terrain
from game.ato.flighttype import FlightType
from game.theater.presetlocation import PresetLocation
from game.theater.theatergroundobject import (
@ -21,6 +20,7 @@ from game.theater.controlpoint import OffMapSpawn
from game.utils import Heading
@pytest.fixture
def test_mission_types_friendly(mocker: Any) -> None:
"""
Test the mission types that can be planned against friendly Theater Ground Objects
@ -68,6 +68,7 @@ def test_mission_types_friendly(mocker: Any) -> None:
assert mission_types == [FlightType.BARCAP]
@pytest.fixture
def test_mission_types_enemy(mocker: Any) -> None:
"""
Test the mission types that can be planned against enemy Theater Ground Objects