Page MenuHomeWildfire Games

Notify player to take action when window in background
Needs ReviewPublic

Authored by ffffffff on Oct 13 2017, 4:30 PM.

Details

Reviewers
elexis
vladislavbelov
Trac Tickets
#4984
Summary

Notify the player that has his 0 a. d. window in background about the game start or game unpause, that he needs to take action (by raising the window in front).

This could be now even more needable as we have stay ready button in gamesetup where we might go other window while wait to start game and we dont miss the start of the game.

Test Plan

test

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Oct 13 2017, 4:30 PM
ffffffff edited the summary of this revision. (Show Details)Oct 16 2017, 12:48 PM
vladislavbelov requested changes to this revision.Oct 22 2017, 6:25 PM
vladislavbelov added a subscriber: vladislavbelov.

I think, it's not good to force the focus. It can be really annoying if you're working atm, but someone is connecting/disconnecting/etc.

So I suggest do not raise, but flash/blink: https://gamedev.stackexchange.com/questions/136473/sdl2-taskbar-icon-notification-blinking-flashing-orange . It won't be so annoying IMO.

This revision now requires changes to proceed.Oct 22 2017, 6:25 PM

I think, it's not good to force the focus. It can be really annoying if you're working atm, but someone is connecting/disconnecting/etc.

So I suggest do not raise, but flash/blink: https://gamedev.stackexchange.com/questions/136473/sdl2-taskbar-icon-notification-blinking-flashing-orange . It won't be so annoying IMO.

ah jo this is done by the window manager normaly. in kde it blinks. but actualy i m not quite sure if does this in all environments like windows gnome ,etc. but i will test it.

I think it can be useful when a multiplayer game starts after the countdown.
But this is probably the only way this function can appear.

ffffffff updated this revision to Diff 4580.Dec 5 2017, 11:14 PM
ffffffff edited the summary of this revision. (Show Details)
ffffffff edited the test plan for this revision. (Show Details)

Hopefuly windows dependcode (not sure #ifdef WXMSW is the right definition here, grabbed it from sourcecode, and on windows side window flash not tested, shall work https://gamedev.stackexchange.com/questions/136473/sdl2-taskbar-icon-notification-blinking-flashing-orange)

So as far as we tested this if blinking works (cause i think raising whole window is a bit to much, but even if it is it can be configured later in options if even wished to have it switch on though)

  • its wip.
ffffffff edited the summary of this revision. (Show Details)Dec 5 2017, 11:14 PM

as right now im missed a game started because the 0ad window didnt signal me that a new buddy game was created :(

What did you try to catch by __WXMSW__?

ffffffff updated the Trac tickets for this revision.Jan 18 2018, 7:14 AM
elexis requested changes to this revision.Jan 20 2018, 7:14 PM

I think it can be useful when a multiplayer game starts after the countdown.
But this is probably the only way this function can appear.

This.
If the blinking-icon part won't make it, we could have this as an independent option. Care to write a ticket anyone?

source/ps/VideoMode.cpp
544

If blinking icons only work for one OS and we don't have anything equivalent on the other OS, then we should drop the feature in my opinion. 0AD should be platform independent as far as achievable.

This revision now requires changes to proceed.Jan 20 2018, 7:14 PM
ffffffff updated this revision to Diff 5472.Jan 24 2018, 10:31 AM

Ok i will go now for raising window when game action starts. So in single player mode when game starts and in multiplayer when all players are conntected and the game status goes to active and game starts. further i go for raise window when game was paused and player is not observer so active player and game action resumes now so unpause happens. u might want tot test that by minimize or unfocus window after you start a game from gamesetup in single player or multiplayer. the window should get raise after the game action starts.

ffffffff retitled this revision from SDL Raise window event/notify window manager to Notify about game start or game unpause to raise window when not in front.Jan 31 2018, 8:38 AM
ffffffff edited the summary of this revision. (Show Details)
ffffffff retitled this revision from Notify about game start or game unpause to raise window when not in front to Notify about game start or game unpause to raise window (when not in front).
ffffffff retitled this revision from Notify about game start or game unpause to raise window (when not in front) to Notify player to take action when window in background.
ffffffff edited the summary of this revision. (Show Details)

ideas

binaries/data/mods/public/gui/session/messages.js
669

only raise window once when gamesstatus switches to "active"

maybe we should go for !g_Observer check too as observer might not needed to be informed by raising window as he is not needed to take action as he is not actively playing.

binaries/data/mods/public/gui/session/session.js
269

For single player game start as player.

Maybe same check as above !g_Observer when single player game starts.

source/gui/scripting/JSInterface_GUIManager.cpp
1

8

source/gui/scripting/JSInterface_GUIManager.h
1

8

source/ps/VideoMode.cpp
1

8

source/ps/VideoMode.h
1

8

ffffffff edited the summary of this revision. (Show Details)Feb 2 2018, 7:55 PM