mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Merge remote-tracking branch 'khopa/develop' into develop
This commit is contained in:
commit
b289e41a0d
@ -9,6 +9,7 @@ Saves from 2.5 are not compatible with 3.0.
|
|||||||
* **[Campaign]** Ground units must now be recruited at a base with a factory and transferred to their destination. When buying units in the UI, the purchase will automatically be fulfilled at the closest factory, and a transfer will be created on the next turn.
|
* **[Campaign]** Ground units must now be recruited at a base with a factory and transferred to their destination. When buying units in the UI, the purchase will automatically be fulfilled at the closest factory, and a transfer will be created on the next turn.
|
||||||
* **[UI]** Campaigns generated for an older or newer version of the game will now be marked as incompatible. They can still be played, but bugs may be present.
|
* **[UI]** Campaigns generated for an older or newer version of the game will now be marked as incompatible. They can still be played, but bugs may be present.
|
||||||
* **[Modding]** Campaigns now choose locations for factories to spawn.
|
* **[Modding]** Campaigns now choose locations for factories to spawn.
|
||||||
|
* **[Modding]** Can now install custom factions to <DCS saved games>/Liberation/Factions instead of the Liberation install directory.
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
@ -22,6 +23,9 @@ Saves from 2.5 are not compatible with 3.0.
|
|||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
* **[Campaigns]** EWRs associated with a base will now only be generated near the base.
|
||||||
|
* **[Flight Planner]** Fixed error when generating AEW&C flight plans in campaigns with no front lines.
|
||||||
|
|
||||||
# 2.5.0
|
# 2.5.0
|
||||||
|
|
||||||
Saves from 2.4 are not compatible with 2.5.
|
Saves from 2.4 are not compatible with 2.5.
|
||||||
|
|||||||
@ -1548,7 +1548,7 @@ def unit_get_expanded_info(country_name: str, unit_type, request_type: str) -> s
|
|||||||
default_value = None
|
default_value = None
|
||||||
faction_value = None
|
faction_value = None
|
||||||
with UNITINFOTEXT_PATH.open("r", encoding="utf-8") as fdata:
|
with UNITINFOTEXT_PATH.open("r", encoding="utf-8") as fdata:
|
||||||
data = json.load(fdata, encoding="utf-8")
|
data = json.load(fdata)
|
||||||
type_exists = data.get(original_name)
|
type_exists = data.get(original_name)
|
||||||
if type_exists is not None:
|
if type_exists is not None:
|
||||||
for faction in type_exists:
|
for faction in type_exists:
|
||||||
|
|||||||
@ -2,8 +2,9 @@ from __future__ import annotations
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Iterator, Optional, Type
|
from typing import Dict, Iterator, List, Optional, Type
|
||||||
|
|
||||||
|
from game import persistency
|
||||||
from game.factions.faction import Faction
|
from game.factions.faction import Faction
|
||||||
|
|
||||||
FACTION_DIRECTORY = Path("./resources/factions/")
|
FACTION_DIRECTORY = Path("./resources/factions/")
|
||||||
@ -23,15 +24,22 @@ class FactionLoader:
|
|||||||
if self._factions is None:
|
if self._factions is None:
|
||||||
self._factions = self.load_factions()
|
self._factions = self.load_factions()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def find_faction_files_in(path: Path) -> List[Path]:
|
||||||
|
return [f for f in path.glob("*.json") if f.is_file()]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_factions(cls: Type[FactionLoader]) -> Dict[str, Faction]:
|
def load_factions(cls: Type[FactionLoader]) -> Dict[str, Faction]:
|
||||||
files = [f for f in FACTION_DIRECTORY.glob("*.json") if f.is_file()]
|
user_faction_path = Path(persistency.base_path()) / "Liberation/Factions"
|
||||||
|
files = cls.find_faction_files_in(
|
||||||
|
FACTION_DIRECTORY
|
||||||
|
) + cls.find_faction_files_in(user_faction_path)
|
||||||
factions = {}
|
factions = {}
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
try:
|
try:
|
||||||
with f.open("r", encoding="utf-8") as fdata:
|
with f.open("r", encoding="utf-8") as fdata:
|
||||||
data = json.load(fdata, encoding="utf-8")
|
data = json.load(fdata)
|
||||||
factions[data["name"]] = Faction.from_json(data)
|
factions[data["name"]] = Faction.from_json(data)
|
||||||
logging.info("Loaded faction : " + str(f))
|
logging.info("Loaded faction : " + str(f))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@ -72,6 +72,9 @@ class TotEstimator:
|
|||||||
return startup_time
|
return startup_time
|
||||||
|
|
||||||
def earliest_tot(self) -> timedelta:
|
def earliest_tot(self) -> timedelta:
|
||||||
|
if not self.package.flights:
|
||||||
|
return timedelta(0)
|
||||||
|
|
||||||
earliest_tot = max(
|
earliest_tot = max(
|
||||||
(self.earliest_tot_for_flight(f) for f in self.package.flights)
|
(self.earliest_tot_for_flight(f) for f in self.package.flights)
|
||||||
)
|
)
|
||||||
|
|||||||
@ -213,9 +213,6 @@ def lint_weapon_data() -> None:
|
|||||||
def main():
|
def main():
|
||||||
logging_config.init_logging(VERSION)
|
logging_config.init_logging(VERSION)
|
||||||
|
|
||||||
# Load eagerly to catch errors early.
|
|
||||||
db.FACTIONS.initialize()
|
|
||||||
|
|
||||||
game: Optional[Game] = None
|
game: Optional[Game] = None
|
||||||
|
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|||||||
@ -17,7 +17,8 @@ pathspec==0.8.1
|
|||||||
pefile==2019.4.18
|
pefile==2019.4.18
|
||||||
Pillow==8.1.1
|
Pillow==8.1.1
|
||||||
pre-commit==2.10.1
|
pre-commit==2.10.1
|
||||||
PyInstaller==3.6
|
pyinstaller==4.3
|
||||||
|
pyinstaller-hooks-contrib==2021.1
|
||||||
pyproj==3.0.1
|
pyproj==3.0.1
|
||||||
PySide2==5.15.2
|
PySide2==5.15.2
|
||||||
pywin32-ctypes==0.2.0
|
pywin32-ctypes==0.2.0
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
"F_15E",
|
"F_15E",
|
||||||
"F_16C_50",
|
"F_16C_50",
|
||||||
"SH_60B",
|
"SH_60B",
|
||||||
"SH_60B",
|
|
||||||
"S_3B",
|
"S_3B",
|
||||||
"UH_1H",
|
"UH_1H",
|
||||||
"UH_60A"
|
"UH_60A"
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
"F_16C_50",
|
"F_16C_50",
|
||||||
"Hercules",
|
"Hercules",
|
||||||
"SH_60B",
|
"SH_60B",
|
||||||
"SH_60B",
|
|
||||||
"S_3B",
|
"S_3B",
|
||||||
"UH_1H",
|
"UH_1H",
|
||||||
"UH_60A"
|
"UH_60A"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user