Quantcast
WoWInterface: SVN - DagAssist - Path Comparison - /branches Rev 14 and /branches Rev 15

WoWInterface SVN DagAssist

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /branches
    from Rev 14 to Rev 15
    Reverse comparison

Rev 14 → Rev 15

4.03/DagAssist.lua
100,14 → 100,6
end
]]);
 
-- btnMinimap:SetAttribute("_onattributechanged", [[
-- if (name == "escpressed") then
-- if self:GetFrameRef("dag_menu"):IsVisible() then
-- control:Run(Close);
-- end
-- end
-- ]]);
 
btnMinimap:SetScript("OnDragStart",
function(self, event, ...)
self:StartMoving();
133,23 → 125,58
end
)
 
-- btnMinimap:SetScript("OnKeyDown",
-- function(self, key, ...)
-- if (key == "ESCAPE") then
-- btnMinimap:SetAttribute("EscPressed", "");
-- end
-- end
-- )
 
--btnMinimap:EnableKeyboard(true);
btnMinimap:RegisterForClicks("AnyDown");
btnMinimap:SetScript("OnEvent", function(self, event, ...)
if (type(DagAssist[event]) == 'function') then
DagAssist[event](DagAssist, event);
DagAssist[event](self, event, ...);
end
end)
btnMinimap:RegisterEvent("PLAYER_ENTERING_WORLD");
 
function DagAssist.OnUpdate(self, elapsed, ...)
if (not DagAssist.MenuLoaded) then
return;
end
if (DagAssist.AllIconsSet) then
btnMinimap:SetScript("OnUpdate", nil);
return;
end
 
if (self.TimeSinceLastUpdate) then
self.TimeSinceLastUpdate = self.TimeSinceLastUpdate + elapsed;
 
if (self.TimeSinceLastUpdate > 0.1) then
self.TimeSinceLastUpdate = 0;
 
local allIconsSet = true;
for buttonIndex = 1, table.getn(DagAssist.Buttons) do
local btn = DagAssist.Buttons[buttonIndex];
if (not btn.IconSet) then
local actionInfo = DagAssistGetActionInfo(btn.Action.DA_ActionType, btn.Action.DA_ActionData, btn.Action.DA_ActionSubType);
if (actionInfo.Name) then
btn:SetText(actionInfo.Name);
if (actionInfo.Texture) then
btn.Texture:SetTexture(actionInfo.Texture);
btn.IconSet = true;
else
btn.IconSet = false;
allIconsSet = false;
end
else
btn.IconSet = false;
allIconsSet = false;
end
end
end
 
DagAssist.AllIconsSet = allIconsSet;
end
else
self.TimeSinceLastUpdate = 0;
end
end
btnMinimap:SetScript("OnUpdate", DagAssist.OnUpdate);
 
function DagAssist:PositionMinimapButton()
if (not DA_Vars) then
DA_Vars = {Minimap = {}};
170,7 → 197,7
end
end
 
function DagAssist:PLAYER_ENTERING_WORLD(event)
function DagAssist:PLAYER_ENTERING_WORLD(self, event)
DagAssist:PositionMinimapButton();
DagAssist:LoadMenu();
DagAssist.MinimapButton:Show();
187,6 → 214,10
return;
end
 
DagAssist.MenuLoaded = false;
DagAssist.AllIconsSet = false;
btnMinimap:SetScript("OnUpdate", DagAssist.OnUpdate);
 
btnMinimap:Execute([[
if (menuItems) then
for i, button in ipairs(menuItems) do
200,6 → 231,9
if (not DA_Vars.Menu) then
DA_Vars.Menu = DagAssist.LoadDefaultMenu()
end
if (not DagAssist.Buttons) then
DagAssist.Buttons = {};
end
local menuItems = DA_Vars.Menu;
local btnMenuItem;
for index = 1, table.getn(menuItems) do
220,16 → 254,15
 
for actionIndex = 1, table.getn(section.Actions) do
local action = section.Actions[actionIndex];
local actionInfo = DagAssistGetActionInfo(action.DA_ActionType, action.DA_ActionData, action.DA_ActionSubType)
local actionInfo = DagAssistGetActionInfo(action.DA_ActionType, action.DA_ActionData, action.DA_ActionSubType);
 
local buttonIndex = actionIndex + (index * 100);
local buttonTexture;
if action.DA_ActionType == "companion" or action.DA_ActionType == "equipmentset" then
btnMenuItem = _G["DA_MenuButton"..buttonIndex];
if (not btnMenuItem) then
btnMenuItem = CreateFrame("Button", "DA_MenuButton"..buttonIndex, menu, "SecureHandlerBaseTemplate, DA_MenuSpellButtonTemplate");
end
buttonTexture = _G["DA_MenuButton"..buttonIndex.."Icon"];
btnMenuItem.Texture = _G["DA_MenuButton"..buttonIndex.."Icon"];
btnMenuItem.Action = action;
 
if action.DA_ActionType == "companion" then
253,7 → 286,8
if (not btnMenuItem) then
btnMenuItem = CreateFrame("Button", "DA_MenuSecureButton"..buttonIndex, menu, "SecureActionButtonTemplate, SecureHandlerBaseTemplate, DA_MenuSpellButtonTemplate");
end
buttonTexture = _G["DA_MenuSecureButton"..buttonIndex.."Icon"];
btnMenuItem.Texture = _G["DA_MenuSecureButton"..buttonIndex.."Icon"];
btnMenuItem.Action = action;
 
if action.DA_ActionType == "item" then
btnMenuItem:SetAttribute("type","item");
280,14 → 314,24
btnMenuItem:SetAttribute("enabled", true);
btnMenuItem:SetFrameLevel(btnMenuItem:GetFrameLevel() + 1);
 
buttonTexture:SetTexture(actionInfo.Texture);
btnMenuItem:SetText(actionInfo.Name);
if (actionInfo.Name) then
btnMenuItem:SetText(actionInfo.Name);
if (actionInfo.Texture) then
btnMenuItem.Texture:SetTexture(actionInfo.Texture);
btnMenuItem.IconSet = true;
else
btnMenuItem.IconSet = false;
end
else
btnMenuItem.IconSet = false;
end
btnMenuItem:Show();
 
btnMinimap:SetFrameRef("child", btnMenuItem);
btnMinimap:Execute([[
table.insert(menuItems, self:GetFrameRef("child"));
]]);
table.insert(DagAssist.Buttons, btnMenuItem);
end
end
 
343,13 → 387,24
 
dag_menu:SetHeight(menuHeight);
]]);
DagAssist.MenuLoaded = true;
end
 
function DagAssist:PLAYER_REGEN_ENABLED(event)
function DagAssist:PLAYER_REGEN_DISABLED(self, event)
--DagAssist:SetMenuItemVisibility();
end
function DagAssist:PLAYER_REGEN_ENABLED(self, event)
if (DagAssist.ReloadNeeded) then
DagAssist:LoadMenu();
DagAssist.ReloadNeeded = false;
end
end
function DagAssist:BAG_UPDATE(self, event)
--DagAssist:SetMenuItemVisibility();
end
function DagAssist:LEARNED_SPELL_IN_TAB(self, event)
--DagAssist:SetMenuItemVisibility();
end
 
 
 
4.03/DagAssistConfig.lua
42,32 → 42,32
end
)
 
fraConfig.DagAssistLoaded = false;
fraConfig:SetScript("OnEvent",
function(self, event, ...)
if (event == "ADDON_LOADED") then
local name = ...;
if (name == "DagAssist") then
fraConfig.DagAssistLoaded = true;
-- fraConfig.DagAssistLoaded = false;
-- fraConfig:SetScript("OnEvent",
-- function(self, event, ...)
-- if (event == "ADDON_LOADED") then
-- local name = ...;
-- if (name == "DagAssist") then
-- fraConfig.DagAssistLoaded = true;
 
if (not DA_Vars) then
DA_Vars = {};
end
if (not DA_Vars.Menu) then
DA_Vars.Menu = DagAssist.LoadDefaultMenu();
end
-- if (not DA_Vars) then
-- DA_Vars = {};
-- end
-- if (not DA_Vars.Menu) then
-- DA_Vars.Menu = DagAssist.LoadDefaultMenu();
-- end
 
end
elseif (event == "PLAYER_ENTERING_WORLD") then
if (fraConfig.DagAssistLoaded) then
fraConfig:UnregisterEvent("PLAYER_ENTERING_WORLD");
DagAssistConfigLoadHeaders();
end
end
end
)
fraConfig:RegisterEvent("ADDON_LOADED");
fraConfig:RegisterEvent("PLAYER_ENTERING_WORLD");
-- end
-- elseif (event == "PLAYER_ENTERING_WORLD") then
-- if (fraConfig.DagAssistLoaded) then
-- fraConfig:UnregisterEvent("PLAYER_ENTERING_WORLD");
-- DagAssistConfigLoadHeaders();
-- end
-- end
-- end
-- )
-- fraConfig:RegisterEvent("ADDON_LOADED");
-- fraConfig:RegisterEvent("PLAYER_ENTERING_WORLD");
 
 
--Title
499,6 → 499,7
DagAssistConfigSaveSection(fraConfig.cboHeaders.SelectedItem);
DagAssist.Config:Hide();
else
DagAssistConfigLoadHeaders();
DagAssist.Config:Show();
end
end