mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
It sounds like PySide2 will not be moving to Python 3.11, so we're stuck on 3.10 without this. Upgrading to a newer Qt also fixes some high DPI bugs (the file browser dialog for save/load is no longer tiny on 4k). https://github.com/pyinstaller/pyinstaller/issues/5414 previously blocked this, but the bug appears to be fixed now.
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from PySide6.QtCore import QObject, Signal
|
|
|
|
from game import Game
|
|
from game.debriefing import Debriefing
|
|
|
|
|
|
class GameUpdateSignal(QObject):
|
|
|
|
instance = None
|
|
gameupdated = Signal(Game)
|
|
budgetupdated = Signal(Game)
|
|
debriefingReceived = Signal(Debriefing)
|
|
|
|
game_loaded = Signal(Game)
|
|
|
|
def __init__(self):
|
|
super(GameUpdateSignal, self).__init__()
|
|
GameUpdateSignal.instance = self
|
|
|
|
self.game_loaded.connect(self.updateGame)
|
|
|
|
def updateGame(self, game: Optional[Game]):
|
|
# noinspection PyUnresolvedReferences
|
|
self.gameupdated.emit(game)
|
|
|
|
def updateBudget(self, game: Game):
|
|
# noinspection PyUnresolvedReferences
|
|
self.budgetupdated.emit(game)
|
|
|
|
def sendDebriefing(self, debriefing: Debriefing) -> None:
|
|
# noinspection PyUnresolvedReferences
|
|
self.debriefingReceived.emit(debriefing)
|
|
|
|
@staticmethod
|
|
def get_instance() -> GameUpdateSignal:
|
|
return GameUpdateSignal.instance
|