Thread Tools Display Modes
01/10/15, 07:05 AM   #1
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
BIG LOUD sound when you can enter Campaign

please make this addon, sometimes i need to w8 two hours! if i failed and didnt notice when

Solo Access Avialable. Expires in ....

also if it possible to make this sound over other applications??? when you alt-tab, etc.

Ty in advance
  Reply With Quote
01/10/15, 07:43 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
QueueQueue
  Reply With Quote
01/10/15, 07:53 AM   #3
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
ty, i will try
however, its not playing sound standalone of game, when you alt-tab, afaik
will test
  Reply With Quote
01/10/15, 08:58 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
you need to set "Plays in Background" in the audio settings to on. otherwise the game won't play any sounds when you alt tab out
  Reply With Quote
01/10/15, 09:01 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by QuadroTony View Post
ty, i will try
however, its not playing sound standalone of game, when you alt-tab, afaik
will test
So you want allow background audio (so you will hear the sound) when campaign becomes available?

Then you need change function QueueQueue.OnCampaignQueueStateChanged(...) to something like this:
Lua Code:
  1. function QueueQueue.OnCampaignQueueStateChanged(event, campaignId, isGroup, state)
  2.     QueueQueue.queues[campaignId].state = state
  3.  
  4.     -- If entry just became available, play a very noticeable sound.
  5.     if state == CAMPAIGN_QUEUE_REQUEST_STATE_CONFIRMING and QueueQueue.savedVariables.sound then
  6.  
  7.         --enable game sounds if game doesn't have focus
  8.         if not DoesGameHaveFocus() and GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO) == "false" then
  9.             SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "true")
  10.             EVENT_MANAGER:RegisterForEvent(QueueQueue.name, EVENT_GAME_FOCUS_CHANGED, function(evt, hasFocus)
  11.                    if hasFocus then
  12.                        EVENT_MANAGER:UnregisterForEvent(QueueQueue.name, EVENT_GAME_FOCUS_CHANGED)
  13.                        SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "false")
  14.                    end
  15.                end)
  16.         end
  17.  
  18.         PlaySound(SOUNDS.LEVEL_UP)
  19.     end
  20. end
  Reply With Quote
01/10/15, 03:01 PM   #6
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
Originally Posted by Garkin View Post
can you update it pls
i cant install it by the minion because its outated...
  Reply With Quote
01/22/15, 10:53 PM   #7
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
So you want allow background audio (so you will hear the sound) when campaign becomes available?

Then you need change function QueueQueue.OnCampaignQueueStateChanged(...) to something like this:
Lua Code:
  1. function QueueQueue.OnCampaignQueueStateChanged(event, campaignId, isGroup, state)
  2.     QueueQueue.queues[campaignId].state = state
  3.  
  4.     -- If entry just became available, play a very noticeable sound.
  5.     if state == CAMPAIGN_QUEUE_REQUEST_STATE_CONFIRMING and QueueQueue.savedVariables.sound then
  6.  
  7.         --enable game sounds if game doesn't have focus
  8.         if not DoesGameHaveFocus() and GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO) == "false" then
  9.             SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "true")
  10.             EVENT_MANAGER:RegisterForEvent(QueueQueue.name, EVENT_GAME_FOCUS_CHANGED, function(evt, hasFocus)
  11.                    if hasFocus then
  12.                        EVENT_MANAGER:UnregisterForEvent(QueueQueue.name, EVENT_GAME_FOCUS_CHANGED)
  13.                        SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "false")
  14.                    end
  15.                end)
  16.         end
  17.  
  18.         PlaySound(SOUNDS.LEVEL_UP)
  19.     end
  20. end
Thanks for always helping out Garkin.

For anyone else though who tries to use this though, when you set this setting, you can use "true" or "false"
Lua Code:
  1. -- These work:
  2. SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "true")
  3. SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, "false")

But GetSetting(..) returns a string of "1" instead of "true" or a "0" instead of "false".

So here you have to use:
Lua Code:
  1. -- But here instead of this:
  2. -- if not DoesGameHaveFocus() and GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO) == "false" then
  3.  
  4. -- use this:
  5. if not DoesGameHaveFocus() and GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO) == "0" then

Or you could just use GetSetting_Bool(..)
Lua Code:
  1. if not (DoesGameHaveFocus() or GetSetting_Bool(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO)) then
  2. ...
  3. end

Last edited by circonian : 01/22/15 at 10:59 PM.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » BIG LOUD sound when you can enter Campaign


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off