Skip to content

Commit

Permalink
Remove LibStub from LibCustomTitles
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharlikran committed May 26, 2024
1 parent e842ad9 commit 2311b69
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 52 deletions.
12 changes: 7 additions & 5 deletions RaidNotifier.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = RaidNotifier.Util or {}
local LCSA = LibCSA
local LGS = LibGroupSocket
local LUNIT = LibUnits2

local RaidNotifier = RaidNotifier

Expand Down Expand Up @@ -128,7 +131,6 @@ do ---------------------------------
end

local CSA = CENTER_SCREEN_ANNOUNCE
local LCSA = LibStub:GetLibrary("LibCSA")

function RaidNotifier:AddAnnouncement(text, category, setting, interval)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -912,7 +915,6 @@ end

do ---------------------------

local LUNIT = LibUnits2
local Util = RaidNotifier.Util

function RaidNotifier.UnitIdToString(id)
Expand Down
5 changes: 1 addition & 4 deletions RaidNotifier.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
## 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
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
Expand Down
3 changes: 2 additions & 1 deletion Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -453,7 +455,6 @@ function RaidNotifier:CreateSettingsMenu()

self:TryUpgradeSettings()

local LAM = LibAddonMenu2
self.panelData = {
type = "panel",
name = self.DisplayName,
Expand Down
3 changes: 2 additions & 1 deletion UltimateHandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions libs/LibCSA/LibCSA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -242,3 +241,5 @@ end

if(lib.Unload) then lib.Unload() end
Load()

LibCSA = lib
8 changes: 8 additions & 0 deletions libs/LibCSA/LibCSA.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Title: LibCSA
## APIVersion: 101040 101041
## Author: andy.s
## AddOnVersion: 210
## Version: 2.10
## IsLibrary: true

LibCSA.lua
1 change: 1 addition & 0 deletions libs/LibCustomTitles/LibCustomTitles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions libs/LibCustomTitles/LibTitleLocale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions libs/LibCustomTitles/Titles/Kyoma.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions libs/LibCustomTitles/Titles/Memus.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions libs/LibCustomTitles/Titles/Valve.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions libs/LibCustomTitles/Titles/Woeler.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down
38 changes: 0 additions & 38 deletions libs/LibStub/LibStub.lua

This file was deleted.

0 comments on commit 2311b69

Please sign in to comment.