Originally Posted by Kuvu
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:
CampBindings = {}
local function DoQueueForCampaign(campaignId, inGroup)
if GetCurrentCampaignId() ~= campaignId and DoesPlayerMeetCampaignRequirements(campaignId) then
if not IsQueuedForCampaign(campaignId, inGroup) then
if not inGroup then
QueueForCampaign(campaignId, inGroup)
return true
elseif IsUnitGrouped("player") and IsUnitGroupLeader("player") then
QueueForCampaign(campaignId, inGroup)
return true
end
end
end
return false
end
function CampBindings.QueueForHomeCampaign()
if DoQueueForCampaign(GetAssignedCampaignId(), false) then
d("Successfully queued for home campaign.")
else
d("Queue request for home campaign failed.")
end
end
function CampBindings.QueueForGuestCampaign()
if DoQueueForCampaign(GetGuestCampaignId(), false) then
d("Successfully queued for guest campaign.")
else
d("Queue request for guest campaign failed.")
end
end
local function OnLoaded(event, addonName)
if addonName ~= "CampaignBindings" then return end
ZO_CreateStringId("SI_BINDING_NAME_QUEUE_FOR_HOME_CAMPAIGN", "Queue for home campaign")
ZO_CreateStringId("SI_BINDING_NAME_QUEUE_FOR_GUEST_CAMPAIGN", "Queue for guest campaign")
EVENT_MANAGER:UnregisterForEvent("CampaignBindings", EVENT_ADDON_LOADED)
end
EVENT_MANAGER:RegisterForEvent("CampaignBindings", EVENT_ADD_ON_LOADED, OnLoaded)