Thread Tools Display Modes
05/08/14, 10:30 AM   #1
Kuvu
Join Date: Feb 2014
Posts: 11
request: Campaign Hotkey

Would be great if there was a way to setup a hotkey for the home and guest campaigns. So we hit hot key 1 and takes up to our home campaign and hot key 2 to the guest campaign. No reason to go through all that UI garbage they have in place.
  Reply With Quote
05/08/14, 02:02 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Kuvu View Post
Would be great if there was a way to setup a hotkey for the home and guest campaigns. So we hit hot key 1 and takes up to our home campaign and hot key 2 to the guest campaign. No reason to go through all that UI garbage they have in place.
This is not worth of addon so just how to do it (just for solo queue, you can easily add more bindings for group):

CampaignBindings.txt:
Code:
## Title: Campaign Bindings v1.0
## Author: Garkin
## Version: 1.0
## APIVersion: 100003

Bindings.xml
CampaignBindings.lua
Bindings.xml
Code:
<Bindings>
  <Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
    <Category name="Campaign Bindings">
      <Action name="QUEUE_FOR_HOME_CAMPAIGN">
        <Down>
             CampBindings.QueueForHomeCampaign()
        </Down>
      </Action>
      <Action name="QUEUE_FOR_GUEST_CAMPAIGN">
        <Down>
             CampBindings.QueueForGuestCampaign()
        </Down>
      </Action>
    </Category>
  </Layer>
</Bindings>
CampaignBindings.lua:
Lua Code:
  1. CampBindings = {}
  2.  
  3. local function DoQueueForCampaign(campaignId, inGroup)
  4.     if GetCurrentCampaignId() ~= campaignId and DoesPlayerMeetCampaignRequirements(campaignId) then
  5.         if not IsQueuedForCampaign(campaignId, inGroup) then
  6.             if not inGroup then
  7.                 QueueForCampaign(campaignId, inGroup)
  8.                 return true
  9.             elseif IsUnitGrouped("player") and IsUnitGroupLeader("player") then
  10.                 QueueForCampaign(campaignId, inGroup)
  11.                 return true
  12.             end
  13.         end
  14.     end
  15.     return false
  16. end
  17.  
  18. function CampBindings.QueueForHomeCampaign()
  19.     if DoQueueForCampaign(GetAssignedCampaignId(), false) then
  20.         d("Successfully queued for home campaign.")
  21.     else
  22.         d("Queue request for home campaign failed.")
  23.     end
  24. end
  25.  
  26. function CampBindings.QueueForGuestCampaign()
  27.     if DoQueueForCampaign(GetGuestCampaignId(), false) then
  28.         d("Successfully queued for guest campaign.")
  29.     else
  30.         d("Queue request for guest campaign failed.")
  31.     end
  32. end
  33.  
  34. local function OnLoaded(event, addonName)
  35.     if addonName ~= "CampaignBindings" then return end
  36.  
  37.     ZO_CreateStringId("SI_BINDING_NAME_QUEUE_FOR_HOME_CAMPAIGN", "Queue for home campaign")
  38.     ZO_CreateStringId("SI_BINDING_NAME_QUEUE_FOR_GUEST_CAMPAIGN", "Queue for guest campaign")
  39.  
  40.     EVENT_MANAGER:UnregisterForEvent("CampaignBindings", EVENT_ADDON_LOADED)
  41. end
  42.  
  43.  
  44. EVENT_MANAGER:RegisterForEvent("CampaignBindings", EVENT_ADD_ON_LOADED, OnLoaded)

Last edited by Garkin : 05/08/14 at 03:13 PM. Reason: Fixed some typos :)
  Reply With Quote
05/09/14, 06:06 PM   #3
Kuvu
Join Date: Feb 2014
Posts: 11
Not sure what i am looking at but ty
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » request: Campaign Hotkey


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