mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Move campaign format version to a stable location.
This commit is contained in:
parent
39135f8c80
commit
c92e4e06cc
@ -84,15 +84,6 @@ def pairwise(iterable):
|
|||||||
|
|
||||||
|
|
||||||
class MizCampaignLoader:
|
class MizCampaignLoader:
|
||||||
#: The latest version of the campaign format. Increment this version whenever all
|
|
||||||
#: existing campaigns should be flagged as incompatible in the UI. We will still
|
|
||||||
#: attempt to load old campaigns, but this provides a warning to the user that the
|
|
||||||
#: campaign may not work correctly.
|
|
||||||
#:
|
|
||||||
#: There is no verification that the campaign author updated their campaign
|
|
||||||
#: correctly, this is just a UI hint.
|
|
||||||
VERSION = 1
|
|
||||||
|
|
||||||
BLUE_COUNTRY = CombinedJointTaskForcesBlue()
|
BLUE_COUNTRY = CombinedJointTaskForcesBlue()
|
||||||
RED_COUNTRY = CombinedJointTaskForcesRed()
|
RED_COUNTRY = CombinedJointTaskForcesRed()
|
||||||
|
|
||||||
|
|||||||
@ -16,3 +16,12 @@ def _build_version_string() -> str:
|
|||||||
|
|
||||||
#: Current version of Liberation.
|
#: Current version of Liberation.
|
||||||
VERSION = _build_version_string()
|
VERSION = _build_version_string()
|
||||||
|
|
||||||
|
#: The latest version of the campaign format. Increment this version whenever all
|
||||||
|
#: existing campaigns should be flagged as incompatible in the UI. We will still attempt
|
||||||
|
#: to load old campaigns, but this provides a warning to the user that the campaign may
|
||||||
|
#: not work correctly.
|
||||||
|
#:
|
||||||
|
#: There is no verification that the campaign author updated their campaign correctly
|
||||||
|
#: this is just a UI hint.
|
||||||
|
CAMPAIGN_FORMAT_VERSION = 1
|
||||||
|
|||||||
@ -13,6 +13,7 @@ from PySide2.QtWidgets import QAbstractItemView, QListView
|
|||||||
|
|
||||||
import qt_ui.uiconstants as CONST
|
import qt_ui.uiconstants as CONST
|
||||||
from game.theater import ConflictTheater, MizCampaignLoader
|
from game.theater import ConflictTheater, MizCampaignLoader
|
||||||
|
from game.version import CAMPAIGN_FORMAT_VERSION
|
||||||
|
|
||||||
PERF_FRIENDLY = 0
|
PERF_FRIENDLY = 0
|
||||||
PERF_MEDIUM = 1
|
PERF_MEDIUM = 1
|
||||||
@ -63,12 +64,12 @@ class Campaign:
|
|||||||
@property
|
@property
|
||||||
def is_out_of_date(self) -> bool:
|
def is_out_of_date(self) -> bool:
|
||||||
"""Returns True if this campaign is not up to date with the latest format."""
|
"""Returns True if this campaign is not up to date with the latest format."""
|
||||||
return self.version < MizCampaignLoader.VERSION
|
return self.version < CAMPAIGN_FORMAT_VERSION
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_from_future(self) -> bool:
|
def is_from_future(self) -> bool:
|
||||||
"""Returns True if this campaign is newer than the supported format."""
|
"""Returns True if this campaign is newer than the supported format."""
|
||||||
return self.version > MizCampaignLoader.VERSION
|
return self.version > CAMPAIGN_FORMAT_VERSION
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_compatible(self) -> bool:
|
def is_compatible(self) -> bool:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user