removed LUA errors on startup

Cette révision appartient à :
Albirew 2019-09-20 00:10:54 +02:00
Parent 3f4baf829e
révision d4ad0f72f6
3 fichiers modifiés avec 27 ajouts et 44 suppressions

Voir le fichier

@ -34,7 +34,7 @@ Const.KeyBindOverlayColor = {0.3, 0.7, 0.1, 0.4};
Const.BarBackdrop = {0.1, 0.1, 0.4, 0.85};
Const.BonusBarBackdrop = {0.1, 0.5, 0.1, 0.85};
Const.IconDragOverlayColor = {0.0, 0.1, 0.3, 0.0};
Const.ImagesDir = "Interface\\Addons\\ButtonForge-classic\\Images\\";
Const.ImagesDir = "Interface\\AddOns\\ButtonForge-classic\\Images\\";
Const.SlashNumLines = 4; --Num of lines to show before breaking the message up
Const.DisableAutoAlignAgainstDefaultBars = false; --Set to true and reload UI in order to not check the Blizzard bars when performing auto-alignment, this probably isn't needed but just in case

Voir le fichier

@ -77,13 +77,11 @@ end
--[[------------------------------------------------------------------------
Misc Resync type events
--------------------------------------------------------------------------]]
Misc:RegisterEvent("COMPANION_LEARNED"); --resync companions
Misc:RegisterEvent("LEARNED_SPELL_IN_TAB"); --refresh/promote spells
Misc:RegisterEvent("SPELLS_CHANGED"); --refresh spells depending on play style this could trigger often, we will instead rely on other events to keep spells synched
Misc:RegisterEvent("CHARACTER_POINTS_CHANGED"); --refresh spells
Misc:RegisterEvent("UPDATE_MACROS"); --resync macros
Misc:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); --refresh spells (and prevent spell promotion)
Misc:RegisterEvent("EQUIPMENT_SETS_CHANGED"); --resync equip sets
--Misc:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); --refresh spells (and prevent spell promotion)
Misc:RegisterEvent("PLAYER_REGEN_DISABLED"); --enter combat
Misc:RegisterEvent("PLAYER_REGEN_ENABLED"); --out of combat
Misc:RegisterEvent("CURSOR_UPDATE"); --possibly show button grids
@ -91,7 +89,7 @@ Misc:RegisterEvent("ACTIONBAR_SHOWGRID"); --...
Misc:RegisterEvent("ACTIONBAR_HIDEGRID"); --...
Misc:RegisterEvent("BAG_UPDATE"); --Refresh the bag item index cache
Misc:RegisterEvent("UNIT_INVENTORY_CHANGED"); --Refresh the inv (equipped) item index cache
Misc:RegisterEvent("SPELL_FLYOUT_UPDATE"); --Refresh the spell_flyouts (mainly due to default blizz code that forces my custom flyout border off)
--Misc:RegisterEvent("SPELL_FLYOUT_UPDATE"); --Refresh the spell_flyouts (mainly due to default blizz code that forces my custom flyout border off)
Misc:RegisterEvent("UI_SCALE_CHANGED");
Misc:RegisterEvent("MODIFIER_STATE_CHANGED");
@ -103,17 +101,14 @@ Misc:RegisterEvent("MODIFIER_STATE_CHANGED");
--------------------------------------------------------------------------]]
Checked:RegisterEvent("TRADE_SKILL_SHOW");
Checked:RegisterEvent("TRADE_SKILL_CLOSE");
Checked:RegisterEvent("ARCHAEOLOGY_TOGGLE");
Checked:RegisterEvent("ARCHAEOLOGY_CLOSED");
Checked:RegisterEvent("COMPANION_UPDATE");
Checked:RegisterEvent("CURRENT_SPELL_CAST_CHANGED");
Checked:RegisterEvent("ACTIONBAR_UPDATE_STATE"); --I am not certain how excessive this event is yet, it may not be needed and is a canidate to remove
Checked:RegisterEvent("PLAYER_ENTER_COMBAT");
Checked:RegisterEvent("PLAYER_LEAVE_COMBAT");
Checked:RegisterEvent("START_AUTOREPEAT_SPELL");
Checked:RegisterEvent("STOP_AUTOREPEAT_SPELL");
Checked:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
Checked:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
--Checked:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
--Checked:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
Checked:RegisterEvent("ACTIONBAR_PAGE_CHANGED");
--[[------------------------------------------------------------------------
@ -130,10 +125,10 @@ Usable:RegisterEvent("PLAYER_CONTROL_LOST");
Usable:RegisterEvent("PLAYER_CONTROL_GAINED");
Usable:RegisterEvent("BAG_UPDATE");
Usable:RegisterEvent("MINIMAP_UPDATE_ZOOM");
Usable:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
Usable:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
--Usable:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
--Usable:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
Usable:RegisterEvent("ACTIONBAR_UPDATE_USABLE"); --Use this as a backup...
Usable:RegisterEvent("VEHICLE_UPDATE");
--Usable:RegisterEvent("VEHICLE_UPDATE");
Usable:RegisterEvent("ACTIONBAR_PAGE_CHANGED");
--BFA fix: UPDATE_WORLD_STATES is deprecated
-- Usable:RegisterEvent("UPDATE_WORLD_STATES");
@ -160,8 +155,8 @@ Text:RegisterEvent("UNIT_AURA");
--[[------------------------------------------------------------------------
Glow Events
--------------------------------------------------------------------------]]
Glow:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW");
Glow:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE");
--Glow:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW");
--Glow:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE");
--[[------------------------------------------------------------------------
@ -185,21 +180,21 @@ Flash:RegisterEvent("STOP_AUTOREPEAT_SPELL");
--------------------------------------------------------------------------]]
Conditional:RegisterEvent("MODIFIER_STATE_CHANGED"); --mod:
Conditional:RegisterEvent("PLAYER_TARGET_CHANGED"); --harm, help, etc
Conditional:RegisterEvent("PLAYER_FOCUS_CHANGED"); --harm, help, etc
--Conditional:RegisterEvent("PLAYER_FOCUS_CHANGED"); --harm, help, etc
Conditional:RegisterEvent("ACTIONBAR_PAGE_CHANGED"); --actionbar
Conditional:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
Conditional:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
--Conditional:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
--Conditional:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
Conditional:RegisterEvent("PLAYER_REGEN_ENABLED"); --nocombat
Conditional:RegisterEvent("PLAYER_REGEN_DISABLED"); --combat
Conditional:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START"); --channel:
Conditional:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP"); --channel:
Conditional:RegisterEvent("PLAYER_EQUIPMENT_CHANGED"); --equipped:
Conditional:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); --spec:
--Conditional:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); --spec:
Conditional:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN"); --stance/form:
Conditional:RegisterEvent("UPDATE_SHAPESHIFT_FORM"); --stance/form:
Conditional:RegisterEvent("UPDATE_STEALTH"); --stealth
Conditional:RegisterEvent("UNIT_ENTERED_VEHICLE"); --vehicleui
Conditional:RegisterEvent("UNIT_EXITED_VEHICLE"); --vehicleui
--Conditional:RegisterEvent("UNIT_ENTERED_VEHICLE"); --vehicleui
--Conditional:RegisterEvent("UNIT_EXITED_VEHICLE"); --vehicleui
Conditional:RegisterEvent("MINIMAP_UPDATE_ZOOM"); --indoors/outdoors
Conditional:RegisterEvent("ACTIONBAR_SLOT_CHANGED"); --This event is excessive, the system is designed not to need it; although at times it may provide slightly (very slightly) faster macro refreshes
@ -216,7 +211,6 @@ Conditional:RegisterEvent("ACTIONBAR_SLOT_CHANGED"); --This event is excessive,
Full Events (includes init events)
---------------------------------------------------------------------------]]
Full:RegisterEvent("PLAYER_ENTERING_WORLD"); --Both Full Refresh, and also Spell/Companion cache (definte spell, possibly companion)
Full:RegisterEvent("COMPANION_UPDATE"); --Cache companion (possibly... not used here after init)
Full:RegisterEvent("VARIABLES_LOADED"); --Macros are available
Full:RegisterEvent("ADDON_LOADED"); --Saved info is available
@ -243,9 +237,6 @@ function Full:InitialOnEvent(Event, Arg1)
elseif (Event == "VARIABLES_LOADED") then
self.MacrosLoaded = true;
elseif (Event == "COMPANION_UPDATE") then
Util.CacheCompanions(); --Just while we are starting up we are trying to cache companion info... there is no reliable event to let us know when this is possible - it could be this overloaded event or none at all?!?
end
if (Util.CompanionsCached and self.AddonLoaded and self.MacrosLoaded and self.SpellsCached) then
@ -268,7 +259,6 @@ function Full:InitialOnEvent(Event, Arg1)
--self:SetScript("OnUpdate", self.OnUpdate);
self:UnregisterEvent("COMPANION_UPDATE");
end
end
@ -458,18 +448,11 @@ function Misc:OnEvent(Event, ...)
self.RefreshSpells = true;
self:SetScript("OnUpdate", self.OnUpdate);
elseif (Event =="ACTIVE_TALENT_GROUP_CHANGED") then
-- elseif (Event =="ACTIVE_TALENT_GROUP_CHANGED") then
--Set the talentswap flag so we know not to auto promote any spells
self.RefreshSpells = true;
self.TalentSwap = true;
self:SetScript("OnUpdate", self.OnUpdate);
elseif (Event == "COMPANION_LEARNED") then
Util.CacheCompanions();
Util.RefreshCompanions();
elseif (Event == "EQUIPMENT_SETS_CHANGED") then
Util.RefreshEquipmentSets();
-- self.RefreshSpells = true;
-- self.TalentSwap = true;
-- self:SetScript("OnUpdate", self.OnUpdate);
elseif (Event == "PLAYER_REGEN_DISABLED") then
Util.PreCombatStateUpdate();

Voir le fichier

@ -1840,13 +1840,13 @@ function Util.CacheCompanions()
end]]
Util.Mounts = {};
for i, mountID in pairs(C_MountJournal.GetMountIDs()) do
local creatureName, spellID = C_MountJournal.GetMountInfoByID(mountID);
if (not creatureName) then
return;
end
Util.Mounts[spellID] = mountID;
end
-- for i, mountID in pairs(C_MountJournal.GetMountIDs()) do
-- local creatureName, spellID = C_MountJournal.GetMountInfoByID(mountID);
-- if (not creatureName) then
-- return;
-- end
-- Util.Mounts[spellID] = mountID;
-- end
Util.CompanionsCached = true;
end