WoWInterface SVN TotemManager

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 90 to Rev 91
    Reverse comparison

Rev 90 → Rev 91

TotemManager/TotemManager.lua
38,6 → 38,37
-- end import
 
 
local TotemManagerFrameHandler, TotemManagerFrameHandlerFactory, totemManagerFrameHandlerFactory = factoryLib.Factory.CreateType();
 
function TotemManagerFrameHandler:GetDirection()
return self.frame:GetDirection();
end
 
function TotemManagerFrameHandler:SetDirection(_, direction)
if self.totemManager:CheckCombat() then
return;
end
self.frame:SetDirection(tonumber(direction));
end
 
function TotemManagerFrameHandler:IsVisible()
return self.frame:IsVisible();
end
 
function TotemManagerFrameHandler:ToggleVisibility()
if self.totemManager:CheckCombat() then
return;
end
self.frame:ToggleVisibility();
end
 
function TotemManagerFrameHandlerFactory:Create(totemManager, frame)
local totemManagerFrame = self:NewInstance();
totemManagerFrame.totemManager = totemManager;
totemManagerFrame.frame = frame;
return totemManagerFrame;
end
 
-- Ankh cooldown updater (only shaman)
local AnkhTimerUpdater, ankhTimerUpdater = factoryLib.Factory.CreateSingletonType(timerUpdaterLib.TimerUpdaterFactory, {"UNIT_INVENTORY_CHANGED"});
 
94,10 → 125,18
 
end
 
function TotemManager:CheckCombat()
if InCombatLockdown() then
self.console:Print("You are in combat");
return true;
else
return false;
end
end
 
function TotemManager:Reset()
self:FirstActivation();
totemManagerData.alreadyActivate3_1 = true;
self.console:Print("Configuration reset, you need to restart your UI");
totemManagerData.alreadyActivate3_1 = false;
self.console:Print("Configuration will be reset, you need to restart your UI");
end
 
function TotemManager:SetTooltipVisibility(_, value)
114,6 → 153,9
end
 
function TotemManager:ToggleLocked()
if self:CheckCombat() then
return;
end
self.locked = not self.locked;
for _, frame in pairs(self.frames) do
frame:ToggleLocked();
125,6 → 167,9
end
 
function TotemManager:SetTimerSkin(_, value)
if self:CheckCombat() then
return;
end
totemManagerData.timerSkin = tonumber(value);
end
 
133,6 → 178,9
end
 
function TotemManager:SetActionBarSkin(_, value)
if self:CheckCombat() then
return;
end
local nvalue = tonumber(value);
local rendererCreatorFunc = self.ACTION_BAR_SKIN[nvalue];
if rendererCreatorFunc ~= nil then
148,15 → 196,22
end
 
function TotemManager:SetScale(_, value)
if self:CheckCombat() then
return;
end
local nvalue = tonumber(value);
if nvalue>0 then
totemManagerData.scale = nvalue;
for _, frame in pairs(self.wowFrame) do
frame:SetScale(nvalue);
frame:Raise();
end
end
end
 
function TotemManager:OpenGui()
InterfaceOptionsFrame_OpenToCategory(self.optionFrame);
end
 
function TotemManager:CreateConsole()
 
208,19 → 263,17
get = "GetScale",
set = "SetScale",
},
--[[
reset = {
type = "execute",
name = "reset",
func = "Reset",
desc = "reset configuration (delete savedVariables in WTF)"
scale = {
type = "execute",
name = "mark for reset",
desc = "on next ui load, default values will be used",
func = "Reset",
},
]]
}
};
 
for frameName, frame in pairs(self.frames) do
options.args[frameName] = {type="group", name=frameName, handler=frame, args = {
options.args[frameName] = {type="group", name=frameName, handler=totemManagerFrameHandlerFactory:Create(self, frame), args = {
visibility = {
type = "toggle",
name = "visible",
248,28 → 301,20
end});
 
LibStub("AceConfig-3.0"):RegisterOptionsTable("TotemManager", options);
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TotemManager", "TotemManager");
self.optionFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TotemManager", "TotemManager");
console:RegisterChatCommand("totemmanager", "ChatCommand");
console:RegisterChatCommand("tm", "ChatCommand");
 
function console:ChatCommand(input)
LibStub("AceConfigCmd-3.0").HandleCommand(totemManager, "tm", "TotemManager", input);
if not input or input:trim() == "" then
totemManager:OpenGui();
else
LibStub("AceConfigCmd-3.0").HandleCommand(totemManager, "tm", "TotemManager", input);
end
end
 
end
 
function TotemManager:FirstActivation()
if true then
-- these data are in TotemManagerBackup
totemManagerData = self.defaultTotemManagerData;
else
-- or new data
totemManagerData = { timerSkin = 1, actionBarSkin = 2, tooltipVisibility = 1, scale = 1 };
end
 
self:Activate();
end
 
function TotemManager:Activate()
ActionBarRenderer.tooltipVisibility = totemManagerData.tooltipVisibility;
 
423,7 → 468,9
self.removeFuncMap,
totemManagerData["totemActionFrame"],
messages,
rendererCreatorFunc
rendererCreatorFunc,
280,
590
);
totemManagerData["totemActionFrame"] = self.frames["totemActionFrame"]:GetBackup();
 
441,7 → 488,9
self.removeFuncMap,
totemManagerData["buffActionFrame"],
messages,
rendererCreatorFunc
rendererCreatorFunc,
280,
390
);
totemManagerData["buffActionFrame"] = self.frames["buffActionFrame"]:GetBackup();
 
453,7 → 502,9
self.removeFuncMap,
totemManagerData["ankhActionFrame"],
messages,
rendererCreatorFunc
rendererCreatorFunc,
845,
615
);
totemManagerData["ankhActionFrame"] = self.frames["ankhActionFrame"]:GetBackup();
 
564,7 → 615,8
-- activate
self:Activate();
else
self:FirstActivation();
totemManagerData = self.defaultTotemManagerData;
self:Activate();
totemManagerData.alreadyActivate3_1 = true;
self.console:Print("Successful installation");
end
TotemManager/versions.txt
20,10 → 20,13
totem manager functionnalities
- Add scaling capability
- ActionBar skins can be changed dynamically
- Add mark for reset option
- GUI configuration can now be acceded with /tm or /totemmanager
 
Bug correction :
- Duration of searing totem
- Fix issue which can happend when specialisations changed
- Check for combat before doing unsafe operations
 
Regression :
- Remove candy bar timer renderer (maybe LibBar will be use in future)
TotemManager/TotemManagerBackup.lua
25,20 → 25,14
["ankhActionFrame"] = {
["visible"] = true,
["direction"] = 1,
["left"] = 845,
["top"] = 615,
},
["totemActionFrame"] = {
["visible"] = true,
["direction"] = 1,
["left"] = 280,
["top"] = 590,
},
["buffActionFrame"] = {
["visible"] = true,
["direction"] = 1,
["left"] = 280,
["top"] = 390,
},
["tooltipVisibility"] = 1,
["actionBarBackup"] = {