diff --git a/RaidNotifier.lua b/RaidNotifier.lua index 6ed9f1d..5ce9322 100644 --- a/RaidNotifier.lua +++ b/RaidNotifier.lua @@ -1,5 +1,8 @@ RaidNotifier = RaidNotifier or {} RaidNotifier.Util = RaidNotifier.Util or {} +local LCSA = LibCSA +local LGS = LibGroupSocket +local LUNIT = LibUnits2 local RaidNotifier = RaidNotifier @@ -128,7 +131,6 @@ do --------------------------------- end local CSA = CENTER_SCREEN_ANNOUNCE - local LCSA = LibStub:GetLibrary("LibCSA") function RaidNotifier:AddAnnouncement(text, category, setting, interval) @@ -265,8 +267,10 @@ do ---------------------- local window = nil - local LGS = LibStub("LibGroupSocket", true) - local ultimateHandler = LGS and LGS:GetHandler(LGS.MESSAGE_TYPE_ULTIMATE) + local ultimateHandler + if LibGroupSocket then + ultimateHandler = LGS:GetHandler(LGS.MESSAGE_TYPE_ULTIMATE) + end RNUltimateHandler = ultimateHandler -- debug local ultimateAbilityId = 40223 -- Aggressive Warhorn Rank IV local ultimateGroupId = 29 -- hardcoded for now @@ -872,7 +876,6 @@ do ---------------------- CALLBACK_MANAGER:RegisterCallback("OnWorldMapChanged", OnZoneChanged) -- might as well listen to this since that code is executed anyways -- Change vitality bonus announcement to not conflict with our own - local LCSA = LibStub:GetLibrary("LibCSA") LCSA:HookHandler(EVENT_RAID_REVIVE_COUNTER_UPDATE, function(messageParams, currentCount, countDelta) if messageParams then messageParams:SetCategory(CSA_CATEGORY_SMALL_TEXT) @@ -912,7 +915,6 @@ end do --------------------------- - local LUNIT = LibUnits2 local Util = RaidNotifier.Util function RaidNotifier.UnitIdToString(id) diff --git a/RaidNotifier.txt b/RaidNotifier.txt index 9525a5b..eede1a4 100644 --- a/RaidNotifier.txt +++ b/RaidNotifier.txt @@ -5,10 +5,9 @@ ## AddOnVersion: 229 ## APIVersion: 101040 101041 ## SavedVariables: RNVars RN_DEBUG_LOG -## DependsOn: LibAddonMenu-2.0>=36 LibUnits2>=102 +## DependsOn: LibAddonMenu-2.0>=36 LibUnits2>=102 LibCSA>=210 ## OptionalDependsOn: LibGroupSocket>=13 -libs/LibStub/LibStub.lua libs/LibCustomTitles/LibTitleLocale.lua libs/LibCustomTitles/LibCustomTitles.lua libs/LibCustomTitles/Titles/Kyoma.lua @@ -16,8 +15,6 @@ libs/LibCustomTitles/Titles/Woeler.lua libs/LibCustomTitles/Titles/Valve.lua libs/LibCustomTitles/Titles/Memus.lua -libs/LibCSA/LibCSA.lua - UltimateHandler.lua TrialAetherianArchive.lua TrialAsylumSanctorium.lua diff --git a/Settings.lua b/Settings.lua index 1077b82..867b30c 100644 --- a/Settings.lua +++ b/Settings.lua @@ -6,6 +6,8 @@ local tinsert = table.insert local tremove = table.remove local tsort = table.sort +local LAM = LibAddonMenu2 + -- Constants for easy reading RAID_HEL_RA_CITADEL = 1 RAID_AETHERIAN_ARCHIVE = 2 @@ -453,7 +455,6 @@ function RaidNotifier:CreateSettingsMenu() self:TryUpgradeSettings() - local LAM = LibAddonMenu2 self.panelData = { type = "panel", name = self.DisplayName, diff --git a/UltimateHandler.lua b/UltimateHandler.lua index 678d26f..53056cc 100644 --- a/UltimateHandler.lua +++ b/UltimateHandler.lua @@ -4,8 +4,9 @@ -- 1: isFullUpdate - the user is sending cost in addition to percentages in this packet -- 2: requestsFullUpdate - the user does not have all the necessary data and wants to have a full update from everyone (e.g. after reloading the ui) -local LGS = LibStub("LibGroupSocket", true) +local LGS = LibGroupSocket if not LGS then return end + LGS.MESSAGE_TYPE_ULTIMATE = 21 -- aka, the code for 'u' local type, version = LGS.MESSAGE_TYPE_ULTIMATE, 2 local handler, saveData = LGS:RegisterHandler(type, version) diff --git a/libs/LibCSA/LibCSA.lua b/libs/LibCSA/LibCSA.lua index 3e1ac23..b97a494 100644 --- a/libs/LibCSA/LibCSA.lua +++ b/libs/LibCSA/LibCSA.lua @@ -24,9 +24,8 @@ Description: This library serves to provide a global enhancement of the center ]]-- local libLoaded -local LIB_NAME, VERSION = "LibCSA", 2.1 -local lib, oldminor = LibStub:NewLibrary(LIB_NAME, VERSION) -if not lib then return end +local libName, libVersion = "LibCSA", 210 +local lib = {} local CSA = CENTER_SCREEN_ANNOUNCE local CSA_LINE_TYPE_COUNTDOWN = ZO_CenterScreenAnnouncementCountdownLine.GetLineType({}) -- we grab the local variable with this 'hack' @@ -242,3 +241,5 @@ end if(lib.Unload) then lib.Unload() end Load() + +LibCSA = lib diff --git a/libs/LibCSA/LibCSA.txt b/libs/LibCSA/LibCSA.txt new file mode 100644 index 0000000..b43d8e0 --- /dev/null +++ b/libs/LibCSA/LibCSA.txt @@ -0,0 +1,8 @@ +## Title: LibCSA +## APIVersion: 101040 101041 +## Author: andy.s +## AddOnVersion: 210 +## Version: 2.10 +## IsLibrary: true + +LibCSA.lua diff --git a/libs/LibCustomTitles/LibCustomTitles.lua b/libs/LibCustomTitles/LibCustomTitles.lua index c2d029c..1437b3a 100644 --- a/libs/LibCustomTitles/LibCustomTitles.lua +++ b/libs/LibCustomTitles/LibCustomTitles.lua @@ -56,6 +56,7 @@ Changes: Rewrote how custom titles are added and stored to help reduce conflict local libLoaded local LIB_NAME, VERSION = "LibCustomTitlesRN", 20 +if not LibStub then return end local LibCustomTitles, oldminor = LibStub:NewLibrary(LIB_NAME, VERSION) if not LibCustomTitles then return end diff --git a/libs/LibCustomTitles/LibTitleLocale.lua b/libs/LibCustomTitles/LibTitleLocale.lua index 8190ccd..772dfe3 100644 --- a/libs/LibCustomTitles/LibTitleLocale.lua +++ b/libs/LibCustomTitles/LibTitleLocale.lua @@ -7,6 +7,7 @@ Total: 115 titles local libLoaded local LIB_NAME, VERSION = "LibTitleLocale", 4 +if not LibStub then return end local lib, oldminor = LibStub:NewLibrary(LIB_NAME, VERSION) if not lib then return end diff --git a/libs/LibCustomTitles/Titles/Kyoma.lua b/libs/LibCustomTitles/Titles/Kyoma.lua index c0bd23a..5b6030c 100644 --- a/libs/LibCustomTitles/Titles/Kyoma.lua +++ b/libs/LibCustomTitles/Titles/Kyoma.lua @@ -1,6 +1,7 @@ local MY_MODULE_NAME = "Kyoma" local MY_MODULE_VERSION = 10 +if not LibStub then return end local LCC = LibStub('LibCustomTitlesRN') if not LCC then return end diff --git a/libs/LibCustomTitles/Titles/Memus.lua b/libs/LibCustomTitles/Titles/Memus.lua index 70b2e1d..a62745e 100644 --- a/libs/LibCustomTitles/Titles/Memus.lua +++ b/libs/LibCustomTitles/Titles/Memus.lua @@ -1,6 +1,7 @@ local MY_MODULE_NAME = "Memus" local MY_MODULE_VERSION = 11 +if not LibStub then return end local LCC = LibStub('LibCustomTitlesRN') if not LCC then return end diff --git a/libs/LibCustomTitles/Titles/Valve.lua b/libs/LibCustomTitles/Titles/Valve.lua index 19864c4..5b6d8bb 100644 --- a/libs/LibCustomTitles/Titles/Valve.lua +++ b/libs/LibCustomTitles/Titles/Valve.lua @@ -1,6 +1,7 @@ local MY_MODULE_NAME = "Valve" local MY_MODULE_VERSION = 8 +if not LibStub then return end local LCC = LibStub('LibCustomTitlesRN') if not LCC then return end diff --git a/libs/LibCustomTitles/Titles/Woeler.lua b/libs/LibCustomTitles/Titles/Woeler.lua index dad8d9d..1dcb5d2 100644 --- a/libs/LibCustomTitles/Titles/Woeler.lua +++ b/libs/LibCustomTitles/Titles/Woeler.lua @@ -1,6 +1,7 @@ local MY_MODULE_NAME = "Woeler" local MY_MODULE_VERSION = 7 +if not LibStub then return end local LCC = LibStub('LibCustomTitlesRN') if not LCC then return end diff --git a/libs/LibStub/LibStub.lua b/libs/LibStub/LibStub.lua deleted file mode 100644 index 0e6bf67..0000000 --- a/libs/LibStub/LibStub.lua +++ /dev/null @@ -1,38 +0,0 @@ --- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info --- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke --- LibStub developed for World of Warcraft by above members of the WowAce community. --- Ported to Elder Scrolls Online by Seerah - -local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 4 -local LibStub = _G[LIBSTUB_MAJOR] - -local strformat = string.format -if not LibStub or LibStub.minor < LIBSTUB_MINOR then - LibStub = LibStub or {libs = {}, minors = {} } - _G[LIBSTUB_MAJOR] = LibStub - LibStub.minor = LIBSTUB_MINOR - - function LibStub:NewLibrary(major, minor) - assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") - if type(minor) ~= "number" then - minor = assert(tonumber(zo_strmatch(minor, "%d+%.?%d*")), "Minor version must either be a number or contain a number.") - end - - local oldminor = self.minors[major] - if oldminor and oldminor >= minor then return nil end - self.minors[major], self.libs[major] = minor, self.libs[major] or {} - return self.libs[major], oldminor - end - - function LibStub:GetLibrary(major, silent) - if not self.libs[major] and not silent then - error(strformat("Cannot find a library instance of %q.", tostring(major)), 2) - end - return self.libs[major], self.minors[major] - end - - function LibStub:IterateLibraries() return pairs(self.libs) end - setmetatable(LibStub, { __call = LibStub.GetLibrary }) -end - -LibStub.SILENT = true \ No newline at end of file