mirror of
https://github.com/yairm210/Unciv.git
synced 2025-08-03 00:29:18 +07:00
Create turn notifier for when the game is running for Windows (#6682)
* Create turn notifier for when the game is running for Windows If playing on Desktop, you often put the game into background, but still want to know if it's your turn. A standard Windows function for that is `FlashWindow` from winuser.h, which is implemented here * Fix: Use the window from the listener instead of the static one from libGDL * Only notify if it's the turn of the player that is playing * Always notify spectators of the next players' turn * Refactor: Move notifier into GeneralPlatformSpecificHelpers * Only load Windows DLL when we're actually on Windows
This commit is contained in:
@ -11,7 +11,12 @@ interface GeneralPlatformSpecificHelpers {
|
||||
* @param allow `true`: allow all orientations (follows sensor as limited by OS settings)
|
||||
* `false`: allow only landscape orientations (both if supported, otherwise default landscape only)
|
||||
*/
|
||||
fun allowPortrait(allow: Boolean)
|
||||
fun allowPortrait(allow: Boolean) {}
|
||||
|
||||
fun isInternetConnected(): Boolean
|
||||
|
||||
/**
|
||||
* Notifies the user that it's their turn while the game is running
|
||||
*/
|
||||
fun notifyTurnStarted() {}
|
||||
}
|
||||
|
@ -363,6 +363,9 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas
|
||||
// stuff has changed and the "waiting for X" will now show the correct civ
|
||||
stopMultiPlayerRefresher()
|
||||
latestGame.isUpToDate = true
|
||||
if (viewingCiv.civName == latestGame.currentPlayer || viewingCiv.civName == Constants.spectator) {
|
||||
game.platformSpecificHelper?.notifyTurnStarted()
|
||||
}
|
||||
postCrashHandlingRunnable { createNewWorldScreen(latestGame) }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user