Page MenuHomeWildfire Games

Improve acoustic GUI notifications
ClosedPublic

Authored by Polakrity on Aug 21 2017, 6:26 PM.

Details

Summary

Improve the acoustic notif. management as suggested in #4101 by @elexis.

Move the actual nick notification function to a function for manage/check the acoustic GUI notifications.

Test Plan

Check if the current acoustical GUI notification (Nick notif.) worth correctly.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Polakrity created this revision.Aug 21 2017, 6:26 PM
Vulcan added a subscriber: Vulcan.Aug 21 2017, 6:27 PM

Build has FAILED

Link to build: http://jw:8080/job/phabricator/1895/
See console output for more information: http://jw:8080/job/phabricator/1895/console

bb added inline comments.Sep 18 2017, 1:18 PM
trunk/binaries/data/mods/public/gui/common/functions_utility.js
6 ↗(On Diff #3259)

semicolomn

14 ↗(On Diff #3259)

Imo it doesn't seem worth it to merge these objects so ok

219 ↗(On Diff #3259)

when we add a sound for a buddy join, we will hear with this code the sound just once, not sure if that is intented, maybe we could set another object with the threshold times, which ofc can be set 0 in such a case.

Ah, this patch indeed has two use cases incoming. Good to see!

trunk/binaries/data/mods/public/gui/common/functions_utility.js
14 ↗(On Diff #3259)

Doing so would make it obvious to every reader that there is always exactly one timer per sound file and vice versa.
Do we actually want exactly one timer per file? Or exactly one global timer? Guess it's better to have it too noisy if people configured it that way than missing some requested event notifications.

219 ↗(On Diff #3259)

magic number -> global

elexis retitled this revision from Improve acoustic notifications to Improve acoustic GUI notifications.Sep 18 2017, 1:39 PM
bb added inline comments.Sep 18 2017, 2:02 PM
trunk/binaries/data/mods/public/gui/common/functions_utility.js
219 ↗(On Diff #3259)

Meaning "when two buddies join simultaneously then only one sound" ^^

elexis added inline comments.Sep 18 2017, 2:10 PM
trunk/binaries/data/mods/public/gui/common/functions_utility.js
14 ↗(On Diff #3259)

We don't have to define the property in advance

219 ↗(On Diff #3259)
g_Notifications = [
      {
            "soundfileorso": "filepath",
            "threshold": 2000
      },
      {
            "soundfileorso": "buddyjoin,
            "threshold": possibly 0 as it's less likely to be noisespammed
      }
];

eventually the options dialog should become accessible globally (fpre has a patch for that somewhere iirc),
so that people can enable the noisefilter quickly without leaving the lobby.

Polakrity updated this revision to Diff 3728.Sep 20 2017, 4:36 PM
Polakrity edited the summary of this revision. (Show Details)
Polakrity edited the test plan for this revision. (Show Details)

Changes according to @bb and @elexis review.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2055/ for more details.

bb added inline comments.Sep 20 2017, 8:30 PM
binaries/data/mods/public/gui/common/functions_utility.js
6 ↗(On Diff #3728)

old number seems to be 3000 but idc'ish

213 ↗(On Diff #3728)

Notice this check is different now, since when Engine.ConfigDB_GetValue("user", "sound.notify." + type) == "false" it will still return false, since i guess we should return... (we were checking against a string)

binaries/data/mods/public/gui/gamesetup/gamesetup.js
2237 ↗(On Diff #3728)

strictly could me inlined but meh

2238 ↗(On Diff #3728)

remove newline while at it

2240 ↗(On Diff #3728)

seems like ok to split rating
the last tab should be 4 spaces instead (use tabs only for indenting the scope, further spaces)

binaries/data/mods/public/gui/lobby/lobby.js
1281–1282 ↗(On Diff #3728)

Why not merge ifs?

1282 ↗(On Diff #3728)

(noticed: no rating here, so ok)

binaries/data/mods/public/gui/session/messages.js
1109 ↗(On Diff #3728)

remove newline while at it

1111 ↗(On Diff #3728)

Same tab => space here

Polakrity updated this revision to Diff 3734.Sep 21 2017, 1:21 AM
Lionkanzen added a subscriber: Lionkanzen.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2056/ for more details.

bb accepted this revision.Sep 21 2017, 6:46 PM

patch tested, style ok, seems useful indeed when looking at the tickets

This revision is now accepted and ready to land.Sep 21 2017, 6:46 PM
elexis requested changes to this revision.Sep 21 2017, 7:06 PM

No need for two globals. Use g_Notifications[foo].lastSomething instead of g_NotificationsTimes[foo].

binaries/data/mods/public/gui/common/functions_utility.js
5 ↗(On Diff #3734)

We have many notification types in the GUI (mostly in session/messages.js), so the name must be less ambiguous. Perhaps g_SoundNotifications or something like that

209 ↗(On Diff #3734)

(should be self-evident but idc)

This revision now requires changes to proceed.Sep 21 2017, 7:06 PM
Polakrity updated this revision to Diff 3743.Sep 22 2017, 10:58 AM
Polakrity marked 9 inline comments as done.
Polakrity updated this revision to Diff 3744.Sep 22 2017, 11:01 AM

Forgot the capital letter in g_SoundNotifications

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2060/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2061/ for more details.

elexis accepted this revision.Sep 22 2017, 12:54 PM

Thanks for the update, code reads good to me. Tested the lobby session and gamesetup ping briefly and doesn't fall apart.

binaries/data/mods/public/gui/common/functions_utility.js
3 ↗(On Diff #3744)

(avoid spam)

This revision is now accepted and ready to land.Sep 22 2017, 12:54 PM

WHERE IS THE SOUNDFILE???

WHERE IS THE SOUNDFILE???

TRY A FILE SEARCH FOR THAT NAME AND YOU'LL FIND IT!!!!

Polakrity updated this revision to Diff 3757.Sep 23 2017, 12:28 PM
Polakrity marked 3 inline comments as done.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2065/ for more details.

bb accepted this revision.Sep 24 2017, 12:27 PM
This revision was automatically updated to reflect the committed changes.