Permalink
Browse files

Merge pull request #5 from yanivkalfa/animate_search_eye_according_to…

…_queue_count

Animate search eye according to queue count
  • Loading branch information...
yanivkalfa committed Mar 6, 2017
2 parents dbd3eb5 + 24486a9 commit ec0d705f940d3c9a30f854b7b2c98acd7373cfc7
@@ -36,9 +36,9 @@ function LFG.Actions.Event.create()
LFG.QueueScrollFrames.queueList = {};
LFG.QueueScrollFrames.updateLFGQueue();
LFG_Settings.event = event;
LFG_Settings.eventBlockedUsersList = {};
LFG.EventScrollFrames.newEvent = true;
LFG.Tabs.select("events.viewQueues");
DEFAULT_CHAT_FRAME:AddMessage("Create");
end

function LFG.Actions.Event.remind()
@@ -49,7 +49,6 @@ end

function LFG.Actions.Event.update(request)
local event = LFG.Utils.Event.createEvent();
DEFAULT_CHAT_FRAME:AddMessage("event.I: ".. tostring(event.I));
LFG.Outgoing:send(LFG.Constants.EVENTS.E_UPDATE, nil, event);
LFG_Settings.event = event;
LFG.Tabs.select("events.viewQueues");
@@ -77,14 +76,16 @@ function LFG.Actions.Event.remove(event)
return event.OR == value.OR;
end)

LFG.Actions.Queue.count = LFG.Actions.Queue.count - 1;

if ( foundIndex ) then
table.remove(LFG.EventScrollFrames.eventList, foundIndex);
LFG.EventScrollFrames.updateLFGEvent();
end

end

function LFG.Actions.Event.cancelQueue(name, event, hideEvent)
function LFG.Actions.Event.cancelQueue(name, event)

if( type(event) ~= "table") then
return false;
@@ -95,12 +96,10 @@ function LFG.Actions.Event.cancelQueue(name, event, hideEvent)
end

event.QTE = nil;

if (hideEvent) then
event.hide = true;
LFG.EventScrollFrames.resetSelection(event);
LFG.RolePicker.reset(event);
end
event.hide = true;
LFG.EventScrollFrames.resetSelection(event);
LFG.RolePicker.reset(event);
LFG.Actions.Queue.count = LFG.Actions.Queue.count - 1;

if (name and not hideEvent) then
LFG.EventScrollFrames.LFGEventItemUpdateButton(name, event);
@@ -23,7 +23,7 @@ function LFG.Actions.Queue.create()
};
event.QTE = {
expireAt = time() + LFG.Constants.QUEUE_TIMEOUT,
timer = Timer.setTimeout(LFG.Constants.QUEUE_TIMEOUT, LFG.Actions.Queue.cancel, { name, event, true } ),
timer = Timer.setTimeout(LFG.Constants.QUEUE_TIMEOUT, LFG.Actions.Queue.cancel, { name, event } ),
requestTimer = Timer.setTimeout(LFG.Constants.QUEUE_REQUEST_TIMEOUT, LFG.Actions.Event.remove, { event } ),
queue = queue;
};
@@ -32,9 +32,8 @@ function LFG.Actions.Queue.create()
LFG.EventScrollFrames.LFGEventItemUpdateButton(name, event);
end

function LFG.Actions.Queue.cancel(name, event, hideEvent)
LFG.Actions.Event.cancelQueue(name, event, hideEvent);
LFG.Actions.Queue.count = LFG.Actions.Queue.count - 1;
function LFG.Actions.Queue.cancel(name, event)
LFG.Actions.Event.cancelQueue(name, event);
LFG.Outgoing:send(LFG.Constants.EVENTS.Q_DELETE, event.OR, {});
end

@@ -46,6 +45,12 @@ function LFG.Actions.Queue.acceptQueue(name, index)
end

function LFG.Actions.Queue.delete(index)
local queue = LFG.QueueScrollFrames.queueList[index];

if (queue and queue.OR) then
local pos = table.getn(LFG_Settings.eventBlockedUsersList) + 1;
table.insert(LFG_Settings.eventBlockedUsersList, pos, queue.OR);
end
table.remove(LFG.QueueScrollFrames.queueList, index);
LFG.QueueScrollFrames.updateLFGQueue()
end
@@ -26,8 +26,6 @@ function LFG.EventScrollFrames.resetSelection(event)

end



function LFG.EventScrollFrames.LFGEventResetSelected()
for line=1,LFG.Constants.MAX_PAGE_SIZE do
getglobal("LFGEventItem"..line):SetButtonState("NORMAL");
@@ -76,28 +74,6 @@ function LFG.EventScrollFrames.LFGEventOnEnter()
GameTooltip:SetText(toolTip);
end

--[[
function LFG.EventScrollFrames.LFGEventOnLoad()
for i=1,53 do
LFG.EventScrollFrames.eventList[i] = {
I=i,
OR="Zeeclienth",
TT="Some Title_"..i,
DC="Some Description_"..i,
F="H",
ML="25",
QT="ONY",
TS=1485898756 + i*20,
PIQ={ T=1, H=1, D=3, TT=5 }
};
if(i == 13 or i==11 or i ==20) then
LFG.EventScrollFrames.eventList[i].QTE = true;
end
end
LFGEventScrollFrame:Show()
end
]]--

function LFG.EventScrollFrames.LFGEventItemUpdateButton(LFGEventItemName, event)
local LFGEventItemButton, LFGEventItemButton_Title, LFGEventItemButton_QueueTo,
LFGEventItemButton_EventMembersCount, LFGEventItemButton_PendingText,
@@ -154,7 +130,6 @@ local function filter(index, value)
local inQueueTo = string.find(queueTo, text) or queueTo == text;
local InLevel = string.find(value.ML, text) or value.ML == text;

--DEFAULT_CHAT_FRAME:AddMessage("inTitle, inDescription, inQueueTo, InLevel: "..tostring(inTitle)..", "..tostring(inDescription)..", "..tostring(inQueueTo)..", "..tostring(InLevel));
if(not inTitle and not inDescription and not inQueueTo and not InLevel ) then
return true;
end
@@ -9,7 +9,7 @@ LFG.MinimapIcon = {

function LFG.MinimapIcon.updateIcon()

if(LFG.animateIcon) then
if(LFG.Actions.Queue.count >= 1) then
LFG.MinimapIcon.counter = LFG.MinimapIcon.counter + arg1;

if(LFG.MinimapIcon.counter >= LFG.MinimapIcon.rate) then
@@ -62,5 +62,4 @@ function LFG.MinimapIcon.OnUpdate()
end

function LFG.MinimapIcon.onClick()
DEFAULT_CHAT_FRAME:AddMessage(tostring(arg1).." was clicked.");
end
@@ -1,7 +1,6 @@
LFG.QueueDropDownMenu = {};

function LFG.QueueDropDownMenu.OnClick()
--DEFAULT_CHAT_FRAME:AddMessage("UIDROPDOWNMENU_MENU_VALUE".. UIDROPDOWNMENU_MENU_VALUE);
local id = this:GetID();
local name = LFG.QueueScrollFrames.queueDropDownFocus.name;
local index = LFG.QueueScrollFrames.queueDropDownFocus.index;
@@ -13,8 +13,6 @@ function LFG.QueueScrollFrames.LFGQueueResetSelected()
end

function LFG.QueueScrollFrames.LFGQueueOnClick(button)
--DEFAULT_CHAT_FRAME:AddMessage("aaaaaaa".. self.GetName());
-- if left we select the row
if ( button == "LeftButton") then
LFG.QueueScrollFrames.LFGQueueResetSelected()
LFG.QueueScrollFrames.queueSelected = { index=this.queueIndex, name=this:GetName() };
@@ -103,7 +101,7 @@ end

function LFG.QueueScrollFrames.updateLFGQueue()
-- 1 through 5 of our window to scroll , an index into our data calculated from the scroll offset
local line, index, LFGQueueItemButton, LFGQueueItemName, totalResults;
local line, index, LFGQueueItemButton, LFGQueueItemName, totalResults, LFGQueueItemButton_InviteQueue;
totalResults = table.getn(LFG.QueueScrollFrames.queueList);

-- hiding tooltips to avoid incorrect data
@@ -114,6 +112,15 @@ function LFG.QueueScrollFrames.updateLFGQueue()
index = line + FauxScrollFrame_GetOffset(LFGQueueScrollFrame);
LFGQueueItemName = "LFGQueueItem"..line;
LFGQueueItemButton = getglobal(LFGQueueItemName);
LFGQueueItemButton_InviteQueue = getglobal(LFGQueueItemName.."InviteQueue");

if ( totalResults > LFG.Constants.MAX_QUEUE_PAGE_SIZE ) then
LFGQueueItemButton:SetWidth(297);
LFGQueueItemButton_InviteQueue:SetPoint("RIGHT", LFGQueueItemButton, "RIGHT", -35, 0);
else
LFGQueueItemButton:SetWidth(314);
LFGQueueItemButton_InviteQueue:SetPoint("RIGHT", LFGQueueItemButton, "RIGHT", -30, 0);
end

if (index <= totalResults) then
LFGQueueItemButton:Show();
@@ -82,15 +82,12 @@ function LFG.RolePicker.cancel()
LFGRoleDPSCheckButton:SetChecked(false);

if(LFG_Settings.lastRoleSelected.T) then
DEFAULT_CHAT_FRAME:AddMessage("T");
LFGRoleTankCheckButton:SetChecked(true);
end
if(LFG_Settings.lastRoleSelected.H) then
DEFAULT_CHAT_FRAME:AddMessage("H");
LFGRoleHealCheckButton:SetChecked(true);
end
if(LFG_Settings.lastRoleSelected.D) then
DEFAULT_CHAT_FRAME:AddMessage("D");
LFGRoleDPSCheckButton:SetChecked(true);
end
end

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -20,6 +20,7 @@ UIPanelWindows["LFGFrame"] = { area = "left", pushable = 11, whileDead = 1 };
LFG_Settings = LFG_Settings or {
minimapPos = -45,
event = nil,
eventBlockedUsersList = {},
queue = {},
lastRoleSelected = { T = nil, H = nil, D = nil },
character = {
@@ -50,6 +51,7 @@ function LFG:OnEvent()

if ( event == "VARIABLES_LOADED") then
LFG:updateCharacter();
--LFG_Settings.eventBlockedUsersList = {};
LFG.MinimapIcon.reposition();
if (LFG_Settings.character.isValid) then
LFG.EventSelectMenu:setCurrentPage();
@@ -98,8 +100,6 @@ LFG:bindEvents();

-- FIX People In queue to be members - when soemone join the group it should update the PIQ value

-- todo fix queue button size when queueList too small
-- todo: add a block list on events and check before returning events or accepting queus if the person is in block list.
-- todo: add commend line
-- todo: add invite / accept funtionality
-- todo: add member count update functionality.
@@ -33,10 +33,6 @@ Components\LFG_RolePicker.lua
Components\LFG_Tabs.lua
Components\LFG_Whisper.lua

## Controllers
Ctrls\EventsCtrl.lua
Ctrls\QueuesCtrl.lua

## Actions
Actions\EventActions.lua
Actions\QueueActions.lua
@@ -439,7 +439,7 @@
<AbsInset left="9" right="7" top="-7" bottom="10"/>
</HitRectInsets>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
<Anchor point="LEFT" relativeTo="$parentInviteQueue" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-5" y="-1"/>
</Offset>
@@ -7,7 +7,7 @@ function LFG.Incoming.Q_DECLINE(payload, sender, language, channelString, target

if (foundIndex >= 1) then
local event = LFG.EventScrollFrames.eventList[foundIndex];
LFG.Actions.Event.cancelQueue(nil, event, true);
LFG.Actions.Event.cancelQueue(nil, event);
end
end
function LFG.Incoming.Q_ACCEPT(payload, sender, language, channelString, target, flags, arg7, channelNumber, channelName, arg8) end
@@ -18,7 +18,6 @@ function LFG.Incoming.Q_DELETE(payload, sender, language, channelString, target,
return sender == value.OR;
end);

DEFAULT_CHAT_FRAME:AddMessage("foundIndex, ".. tostring(foundIndex));
if (foundIndex >= 1) then
Timer.clearTimer(LFG.QueueScrollFrames.queueList[foundIndex].timer);
LFG.Actions.Queue.delete(foundIndex);
@@ -46,10 +45,13 @@ function LFG.Incoming.Q_CREATE(payload, sender, language, channelString, target,

if ( LFG_Settings.event) then

for key, value in pairs(payload) do
DEFAULT_CHAT_FRAME:AddMessage("key = ".. tostring(key)..", value = "..tostring(value));
end
local foundBlockedUserIndex = table.findIndex(LFG_Settings.eventBlockedUsersList, function(index, username)
return sender == username;
end)

if( foundBlockedUserIndex >= 1 ) then
return false;
end

local foundIndex = table.findIndex(LFG.QueueScrollFrames.queueList, function(index, value)
return sender == value.OR;
@@ -170,6 +172,15 @@ end

function LFG.Incoming.E_REQUEST(payload, sender, language, channelString, target, flags, arg7, channelNumber, channelName, arg8)
if ( LFG_Settings.event ) then

local foundIndex = table.findIndex(LFG_Settings.eventBlockedUsersList, function(index, username)
return sender == username;
end)

if( foundIndex >= 1 ) then
return false;
end

LFG.Outgoing:send(LFG.Constants.EVENTS.E_RESPONSE, sender, LFG_Settings.event);
end
end
@@ -14,27 +14,4 @@ function Router:route(message, sender, language, channelString, target, flags, a
return self.routes[msg.T](msg.PL, sender, language, channelString, target, flags, arg7, channelNumber, channelName, arg8);
end
return false;
end

--[[
function Router:route(message, sender, language, channelString, target, flags, arg7, channelNumber, channelName, arg8)
--DEFAULT_CHAT_FRAME:AddMessage("request handle: ".. type(message));
local msg = LFG.Utils.Message.parseMessage(message);
if ( not msg or type(msg) ~= "table" ) then
return false;
end
local method = msg.T;
if ( self.transport ) then
method = self.transport[msg.T];
end
if ( type(self.routes[method]) == "function" ) then
return self.routes[method](msg.PL, sender, language, channelString, target, flags, arg7, channelNumber, channelName, arg8);
end
return false;
end
]]
end
Oops, something went wrong.

0 comments on commit ec0d705

Please sign in to comment.