mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Optional
|
||||
from PySide2.QtCore import QObject, Signal
|
||||
|
||||
from game import Game
|
||||
from game.game import TurnState
|
||||
from game.debriefing import Debriefing
|
||||
|
||||
|
||||
@@ -13,6 +14,7 @@ class GameUpdateSignal(QObject):
|
||||
instance = None
|
||||
gameupdated = Signal(Game)
|
||||
budgetupdated = Signal(Game)
|
||||
game_state_changed = Signal(TurnState)
|
||||
debriefingReceived = Signal(Debriefing)
|
||||
|
||||
game_loaded = Signal(Game)
|
||||
@@ -35,6 +37,11 @@ class GameUpdateSignal(QObject):
|
||||
# noinspection PyUnresolvedReferences
|
||||
self.debriefingReceived.emit(debriefing)
|
||||
|
||||
def gameStateChanged(self, state: TurnState):
|
||||
if state in (TurnState.WIN, TurnState.LOSS):
|
||||
# noinspection PyUnresolvedReferences
|
||||
self.game_state_changed.emit(state)
|
||||
|
||||
@staticmethod
|
||||
def get_instance() -> GameUpdateSignal:
|
||||
return GameUpdateSignal.instance
|
||||
|
||||
Reference in New Issue
Block a user