Fix eye animation and clicks
This commit is contained in:
parent
68b5ca9914
commit
6f9ea48c15
39
broker.lua
39
broker.lua
|
@ -7,6 +7,11 @@ local LFG_EYE_TEXTURES = { };
|
||||||
LFG_EYE_TEXTURES["default"] = { file = "Interface\\LFGFrame\\LFG-Eye", width = 512, height = 256, frames = 29, iconSize = 64, delay = 0.1 };
|
LFG_EYE_TEXTURES["default"] = { file = "Interface\\LFGFrame\\LFG-Eye", width = 512, height = 256, frames = 29, iconSize = 64, delay = 0.1 };
|
||||||
LFG_EYE_TEXTURES["raid"] = { file = "Interface\\LFGFrame\\LFR-Anim", width = 256, height = 256, frames = 16, iconSize = 64, delay = 0.05 };
|
LFG_EYE_TEXTURES["raid"] = { file = "Interface\\LFGFrame\\LFR-Anim", width = 256, height = 256, frames = 16, iconSize = 64, delay = 0.05 };
|
||||||
LFG_EYE_TEXTURES["unknown"] = { file = "Interface\\LFGFrame\\WaitAnim", width = 128, height = 128, frames = 4, iconSize = 64, delay = 0.25 };
|
LFG_EYE_TEXTURES["unknown"] = { file = "Interface\\LFGFrame\\WaitAnim", width = 128, height = 128, frames = 4, iconSize = 64, delay = 0.25 };
|
||||||
|
local LFG_ANGER_INC_VAL = 30;
|
||||||
|
local LFG_ANGER_DEC_VAL = 1;
|
||||||
|
local LFG_ANGER_INIT_VAL = 60;
|
||||||
|
local LFG_ANGER_END_VAL = 75;
|
||||||
|
local LFG_ANGER_CAP_VAL = 90;
|
||||||
for _, t in pairs(LFG_EYE_TEXTURES) do
|
for _, t in pairs(LFG_EYE_TEXTURES) do
|
||||||
local cols = floor(t.width / t.iconSize)
|
local cols = floor(t.width / t.iconSize)
|
||||||
local colWidth = t.iconSize / t.width
|
local colWidth = t.iconSize / t.width
|
||||||
|
@ -36,7 +41,33 @@ local actions = {
|
||||||
text = L["Click to open the Dungeon Finder."],
|
text = L["Click to open the Dungeon Finder."],
|
||||||
enabled = function() return C_LFGInfo.CanPlayerUseLFD() end,
|
enabled = function() return C_LFGInfo.CanPlayerUseLFD() end,
|
||||||
selected = function(button) return button == "LeftButton" and not IsModifierKeyDown() end,
|
selected = function(button) return button == "LeftButton" and not IsModifierKeyDown() end,
|
||||||
func = function() PVEFrame_ToggleFrame("GroupFinderFrame", LFDParentFrame) end,
|
func = function()
|
||||||
|
local inBattlefield, showScoreboard = QueueStatus_InActiveBattlefield();
|
||||||
|
if ( IsInLFDBattlefield() ) then
|
||||||
|
inBattlefield = true;
|
||||||
|
showScoreboard = true;
|
||||||
|
end
|
||||||
|
local lfgListActiveEntry = C_LFGList.HasActiveEntryInfo();
|
||||||
|
if ( inBattlefield ) then
|
||||||
|
if ( showScoreboard ) then
|
||||||
|
TogglePVPScoreboardOrResults();
|
||||||
|
end
|
||||||
|
elseif ( lfgListActiveEntry ) then
|
||||||
|
LFGListUtil_OpenBestWindow(true);
|
||||||
|
else
|
||||||
|
--See if we have any active LFGList applications
|
||||||
|
local apps = C_LFGList.GetApplications();
|
||||||
|
for i=1, #apps do
|
||||||
|
local _, appStatus = C_LFGList.GetApplicationInfo(apps[i]);
|
||||||
|
if ( appStatus == "applied" or appStatus == "invited" ) then
|
||||||
|
--We want to open to the LFGList screen
|
||||||
|
LFGListUtil_OpenBestWindow(true);
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
PVEFrame_ToggleFrame("GroupFinderFrame", LFDParentFrame)
|
||||||
|
end
|
||||||
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text = L["Alt-Click to open the Raid Finder."],
|
text = L["Alt-Click to open the Raid Finder."],
|
||||||
|
@ -68,9 +99,9 @@ local function OnClick(self, button)
|
||||||
if button == "RightButton" and child:GetQueueInfo() and not IsShiftKeyDown() then
|
if button == "RightButton" and child:GetQueueInfo() and not IsShiftKeyDown() then
|
||||||
PlaySound(SOUNDKIT.IG_MAINMENU_OPEN)
|
PlaySound(SOUNDKIT.IG_MAINMENU_OPEN)
|
||||||
local screenHalf = GetScreenHalf()
|
local screenHalf = GetScreenHalf()
|
||||||
QueueStatusMinimapButtonDropDown.point = screenHalf == "TOP" and "TOPLEFT" or "BOTTOMLEFT"
|
QueueStatusButtonDropDown.point = screenHalf == "TOP" and "TOPLEFT" or "BOTTOMLEFT"
|
||||||
QueueStatusMinimapButtonDropDown.relativePoint = screenHalf == "TOP" and "BOTTOMLEFT" or "TOPLEFT"
|
QueueStatusButtonDropDown.relativePoint = screenHalf == "TOP" and "BOTTOMLEFT" or "TOPLEFT"
|
||||||
ToggleDropDownMenu(1, nil, QueueStatusMinimapButtonDropDown, self, 0, 0)
|
ToggleDropDownMenu(1, nil, QueueStatusButtonDropDown, self, 0, 0)
|
||||||
else
|
else
|
||||||
for i = 1, #actions do
|
for i = 1, #actions do
|
||||||
local action = actions[i]
|
local action = actions[i]
|
||||||
|
|
27
core.lua
27
core.lua
|
@ -28,7 +28,22 @@ local queueTypes = {
|
||||||
"raid", -- Flex Raid
|
"raid", -- Flex Raid
|
||||||
"pvp" -- World PVP
|
"pvp" -- World PVP
|
||||||
}
|
}
|
||||||
|
for _, t in pairs(LFG_EYE_TEXTURES) do
|
||||||
|
local cols = floor(t.width / t.iconSize)
|
||||||
|
local colWidth = t.iconSize / t.width
|
||||||
|
local rowHeight = t.iconSize / t.height
|
||||||
|
|
||||||
|
local iconCoords = { }
|
||||||
|
for i = 1, t.frames do
|
||||||
|
local L = mod(i - 1, cols) * colWidth
|
||||||
|
local R = L + colWidth
|
||||||
|
local T = ceil(i / cols) * rowHeight
|
||||||
|
local B = T - rowHeight
|
||||||
|
|
||||||
|
iconCoords[i] = { L, R, B, T }
|
||||||
|
end
|
||||||
|
t.iconCoords = iconCoords
|
||||||
|
end
|
||||||
function child:GetQueueInfo()
|
function child:GetQueueInfo()
|
||||||
for i = 1, NUM_LE_LFG_CATEGORYS do
|
for i = 1, NUM_LE_LFG_CATEGORYS do
|
||||||
local mode, submode = GetLFGMode(i)
|
local mode, submode = GetLFGMode(i)
|
||||||
|
@ -86,15 +101,12 @@ local function OnEvent(self, event)
|
||||||
updateDelay = currentIcon.delay
|
updateDelay = currentIcon.delay
|
||||||
child:SetIcon(currentIcon.file)
|
child:SetIcon(currentIcon.file)
|
||||||
-- ldbobj['icon'] = currentIcon.file
|
-- ldbobj['icon'] = currentIcon.file
|
||||||
|
|
||||||
if queueType then
|
|
||||||
currentFrame = 1
|
currentFrame = 1
|
||||||
|
if queueType then
|
||||||
self:SetScript("OnUpdate", UpdateIconCoords)
|
self:SetScript("OnUpdate", UpdateIconCoords)
|
||||||
else
|
else
|
||||||
self:SetScript("OnUpdate", nil)
|
self:SetScript("OnUpdate", nil)
|
||||||
currentFrame = 1
|
|
||||||
child:SetIconCoords(iconCoords[1])
|
child:SetIconCoords(iconCoords[1])
|
||||||
-- ldbobj['iconCoords'] = iconCoords[1]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function OnEvent2(lib, event)
|
local function OnEvent2(lib, event)
|
||||||
|
@ -138,12 +150,15 @@ child['specs'] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
local function OnEvent3(self, event)
|
||||||
|
print(event)
|
||||||
|
end
|
||||||
function events:PLAYER_ENTERING_WORLD(event)
|
function events:PLAYER_ENTERING_WORLD(event)
|
||||||
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||||
local QSF = CreateFrame("Frame")
|
local QSF = CreateFrame("Frame")
|
||||||
Mixin(QSF, QueueStatusFrameMixin)
|
Mixin(QSF, QueueStatusFrameMixin)
|
||||||
-- QueueStatusFrame_OnLoad(QSF)
|
QSF:OnLoad()
|
||||||
QSF:SetScript("OnEvent", OnEvent)
|
QSF:HookScript("OnEvent", OnEvent)
|
||||||
child:RegisterEvent({"LFG_UPDATE", "LFG_ROLE_CHECK_UPDATE", "LFG_PROPOSAL_UPDATE", "LFG_PROPOSAL_FAILED", "LFG_PROPOSAL_SUCCEEDED", "LFG_PROPOSAL_SHOW", "LFG_QUEUE_STATUS_UPDATE"}, OnEvent2)
|
child:RegisterEvent({"LFG_UPDATE", "LFG_ROLE_CHECK_UPDATE", "LFG_PROPOSAL_UPDATE", "LFG_PROPOSAL_FAILED", "LFG_PROPOSAL_SUCCEEDED", "LFG_PROPOSAL_SHOW", "LFG_QUEUE_STATUS_UPDATE"}, OnEvent2)
|
||||||
end
|
end
|
||||||
child:NewAddOn(...)
|
child:NewAddOn(...)
|
Loading…
Reference in New Issue