Page MenuHomeWildfire Games

Improve acoustic GUI notifications
ClosedPublic

Authored by Polakrity on Aug 21 2017, 6:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 2, 12:01 AM
Unknown Object (File)
Wed, Aug 28, 8:06 AM
Unknown Object (File)
Mon, Aug 26, 5:48 PM
Unknown Object (File)
Sat, Aug 24, 10:42 AM
Unknown Object (File)
Sat, Aug 24, 10:42 AM
Unknown Object (File)
Sat, Aug 24, 10:42 AM
Unknown Object (File)
Sat, Aug 24, 10:42 AM
Unknown Object (File)
Sat, Aug 24, 10:42 AM
Tokens
"Like" token, awarded by Lionkanzen.

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
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 3233
Build 5592: Vulcan BuildJenkins

Event Timeline

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
trunk/binaries/data/mods/public/gui/common/functions_utility.js
219 ↗(On Diff #3259)

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

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 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.

binaries/data/mods/public/gui/common/functions_utility.js
7

old number seems to be 3000 but idc'ish

209

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

strictly could me inlined but meh

2237–2238

remove newline while at it

2239

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
1280–1282

Why not merge ifs?

1281–1282

(noticed: no rating here, so ok)

binaries/data/mods/public/gui/session/messages.js
1108–1109

remove newline while at it

1110

Same tab => space here

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.

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
6–8

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

205

(should be self-evident but idc)

This revision now requires changes to proceed.Sep 21 2017, 7:06 PM
Polakrity marked 9 inline comments as done.

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.

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

(avoid spam)

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

WHERE IS THE SOUNDFILE???

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

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.

This revision was automatically updated to reflect the committed changes.