WoWInterface SVN DagAssist

Compare Revisions

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

Rev 15 → Rev 14

4.03/DagAssist.lua
100,6 → 100,14
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();
125,58 → 133,23
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](self, event, ...);
DagAssist[event](DagAssist, 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 = {}};
197,7 → 170,7
end
end
 
function DagAssist:PLAYER_ENTERING_WORLD(self, event)
function DagAssist:PLAYER_ENTERING_WORLD(event)
DagAssist:PositionMinimapButton();
DagAssist:LoadMenu();
DagAssist.MinimapButton:Show();
214,10 → 187,6
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
231,9 → 200,6
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
254,15 → 220,16
 
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
btnMenuItem.Texture = _G["DA_MenuButton"..buttonIndex.."Icon"];
buttonTexture = _G["DA_MenuButton"..buttonIndex.."Icon"];
btnMenuItem.Action = action;
 
if action.DA_ActionType == "companion" then
286,8 → 253,7
if (not btnMenuItem) then
btnMenuItem = CreateFrame("Button", "DA_MenuSecureButton"..buttonIndex, menu, "SecureActionButtonTemplate, SecureHandlerBaseTemplate, DA_MenuSpellButtonTemplate");
end
btnMenuItem.Texture = _G["DA_MenuSecureButton"..buttonIndex.."Icon"];
btnMenuItem.Action = action;
buttonTexture = _G["DA_MenuSecureButton"..buttonIndex.."Icon"];
 
if action.DA_ActionType == "item" then
btnMenuItem:SetAttribute("type","item");
314,24 → 280,14
btnMenuItem:SetAttribute("enabled", true);
btnMenuItem:SetFrameLevel(btnMenuItem:GetFrameLevel() + 1);
 
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
buttonTexture:SetTexture(actionInfo.Texture);
btnMenuItem:SetText(actionInfo.Name);
btnMenuItem:Show();
 
btnMinimap:SetFrameRef("child", btnMenuItem);
btnMinimap:Execute([[
table.insert(menuItems, self:GetFrameRef("child"));
]]);
table.insert(DagAssist.Buttons, btnMenuItem);
end
end
 
387,24 → 343,13
 
dag_menu:SetHeight(menuHeight);
]]);
DagAssist.MenuLoaded = true;
end
 
function DagAssist:PLAYER_REGEN_DISABLED(self, event)
--DagAssist:SetMenuItemVisibility();
end
function DagAssist:PLAYER_REGEN_ENABLED(self, event)
function DagAssist:PLAYER_REGEN_ENABLED(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,7 → 499,6
DagAssistConfigSaveSection(fraConfig.cboHeaders.SelectedItem);
DagAssist.Config:Hide();
else
DagAssistConfigLoadHeaders();
DagAssist.Config:Show();
end
end