Add a Falklands theater.

Not at all done yet, but loads.

https://github.com/dcs-liberation/dcs_liberation/issues/2242
This commit is contained in:
Dan Albert 2022-09-06 13:37:56 -07:00 committed by Raffson
parent cbfeebd28c
commit c4fe3a31a7
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
3 changed files with 32 additions and 9 deletions

View File

@ -14,6 +14,7 @@ from game.profiling import logged_duration
from game.theater import (
CaucasusTheater,
ConflictTheater,
FalklandsTheater,
MarianaIslandsTheater,
NevadaTheater,
NormandyTheater,
@ -122,6 +123,7 @@ class Campaign:
"The Channel": TheChannelTheater,
"Syria": SyriaTheater,
"MarianaIslands": MarianaIslandsTheater,
"Falklands": FalklandsTheater,
}
theater = theaters[self.data["theater"]]
t = theater()

View File

@ -10,6 +10,7 @@ from uuid import UUID
from dcs.mapping import Point
from dcs.terrain import (
caucasus,
falklands,
marianaislands,
nevada,
normandy,
@ -41,7 +42,6 @@ class ReferencePoint:
class ConflictTheater:
terrain: Terrain
overview_image: str
landmap: Optional[Landmap]
daytime_map: DaytimeMap
iads_network: IadsNetwork
@ -256,7 +256,6 @@ class ConflictTheater:
class CaucasusTheater(ConflictTheater):
terrain = caucasus.Caucasus()
overview_image = "caumap.gif"
landmap = load_landmap(Path("resources/caulandmap.p"))
daytime_map = DaytimeMap(
@ -279,7 +278,6 @@ class CaucasusTheater(ConflictTheater):
class PersianGulfTheater(ConflictTheater):
terrain = persiangulf.PersianGulf()
overview_image = "persiangulf.gif"
landmap = load_landmap(Path("resources/gulflandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=8)),
@ -301,7 +299,6 @@ class PersianGulfTheater(ConflictTheater):
class NevadaTheater(ConflictTheater):
terrain = nevada.Nevada()
overview_image = "nevada.gif"
landmap = load_landmap(Path("resources/nevlandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=4), datetime.time(hour=6)),
@ -323,7 +320,6 @@ class NevadaTheater(ConflictTheater):
class NormandyTheater(ConflictTheater):
terrain = normandy.Normandy()
overview_image = "normandy.gif"
landmap = load_landmap(Path("resources/normandylandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=8)),
@ -345,7 +341,6 @@ class NormandyTheater(ConflictTheater):
class TheChannelTheater(ConflictTheater):
terrain = thechannel.TheChannel()
overview_image = "thechannel.gif"
landmap = load_landmap(Path("resources/channellandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=8)),
@ -367,7 +362,6 @@ class TheChannelTheater(ConflictTheater):
class SyriaTheater(ConflictTheater):
terrain = syria.Syria()
overview_image = "syria.gif"
landmap = load_landmap(Path("resources/syrialandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=8)),
@ -389,7 +383,6 @@ class SyriaTheater(ConflictTheater):
class MarianaIslandsTheater(ConflictTheater):
terrain = marianaislands.MarianaIslands()
overview_image = "marianaislands.gif"
landmap = load_landmap(Path("resources/marianaislandslandmap.p"))
daytime_map = DaytimeMap(
@ -408,3 +401,30 @@ class MarianaIslandsTheater(ConflictTheater):
from .seasonalconditions.marianaislands import CONDITIONS
return CONDITIONS
class FalklandsTheater(ConflictTheater):
terrain = falklands.Falklands()
# TODO: https://github.com/dcs-liberation/dcs_liberation/issues/2242
landmap = None
# TODO: https://github.com/dcs-liberation/dcs_liberation/issues/2242
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=9)),
day=(datetime.time(hour=9), datetime.time(hour=18)),
dusk=(datetime.time(hour=18), datetime.time(hour=20)),
night=(datetime.time(hour=0), datetime.time(hour=5)),
)
# TODO: https://github.com/dcs-liberation/dcs_liberation/issues/2242
@property
def timezone(self) -> datetime.timezone:
return datetime.timezone(datetime.timedelta(hours=4))
# TODO: https://github.com/dcs-liberation/dcs_liberation/issues/2242
@property
def seasonal_conditions(self) -> SeasonalConditions:
from .seasonalconditions.caucasus import CONDITIONS
return CONDITIONS

View File

@ -3,7 +3,6 @@ from typing import Dict
from PySide2.QtGui import QPixmap
from game.theater.theatergroundobject import NAME_BY_CATEGORY
from .liberation_theme import get_theme_icons
URLS: Dict[str, str] = {
@ -70,6 +69,8 @@ def load_icons():
ICONS["Terrain_TheChannel"] = QPixmap("./resources/ui/terrain_channel.gif")
ICONS["Terrain_Syria"] = QPixmap("./resources/ui/terrain_syria.gif")
ICONS["Terrain_MarianaIslands"] = QPixmap("./resources/ui/terrain_marianas.gif")
# TODO
ICONS["Terrain_Falklands"] = QPixmap("./resources/ui/terrain_marianas.gif")
ICONS["Dawn"] = QPixmap("./resources/ui/conditions/timeofday/dawn.png")
ICONS["Day"] = QPixmap("./resources/ui/conditions/timeofday/day.png")