[REL] Play a sound on new lobby chat messages - 51118

Discussion in 'Mod Discussions' started by sneakyness, July 23, 2013.

  1. sneakyness

    sneakyness Member

    Messages:
    106
    Likes Received:
    5
    I saw some people wishing the lobby made a noise when new players joined, given how long games can take to start currently. I'm lazy, and this is just as good, so here you go :cool:

    In \PA\media\ui\alpha\lobby\lobby_alpha.js, insert this at line 310:
    Code:
         self.chatNotificationTimeout = ko.observable(false);
    Then, at line 324:
    Code:
            if (!self.chatNotificationTimeout()) {
                self.chatNotificationTimeout(true);
                engine.call('fire_and_forget_sound', '/SE/UI/UI_Alert_metal_low');
                setTimeout(function () { self.chatNotificationTimeout(false); }, 15 * 1000); 
            }
    This prevents the sound from being played more than once every 15 seconds.

    Alternatively, here are a few other sounds:
    • engine.call('fire_and_forget_sound', '/SE/UI/UI_Alert_energy_low');
    • engine.call('fire_and_forget_sound', '/SE/UI/UI_commander_under_attack');
    • engine.call('fire_and_forget_sound', '/SE/UI/UI_commander_low_health');
    • engine.call('fire_and_forget_sound', '/SE/UI/UI_under_attack');

    Changelog:
    • Added a 15 second timeout to the notification
    • Updated for 51118 :mrgreen:

    Attached Files:

    Last edited: July 24, 2013
  2. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    Re: [REFERENCE] Play a sound on new lobby chat messages - 50

    nice.
  3. glinkot

    glinkot Active Member

    Messages:
    250
    Likes Received:
    28
    This is great sneakyness - haven't tried it yet but it will really help when waiting on a slow night for people to appear!
  4. greysuit

    greysuit New Member

    Messages:
    29
    Likes Received:
    9
    Does this still work somehow?
  5. kryovow

    kryovow Well-Known Member

    Messages:
    1,112
    Likes Received:
    240
    can you also add a Sound if the last player-Slot is filled?

Share This Page