16 Commits

Author SHA1 Message Date
Relationship ea59f09714 Upload files to "/" 2026-07-25 14:46:01 +00:00
Relationship 27dcbb2679 Upload files to "/" 2026-07-25 14:45:53 +00:00
Relationship b7d2d7f9f8 Upload files to "Media" 2026-07-24 12:28:41 +00:00
Relationship 2b8b28757c Delete Spark.blp 2026-07-24 12:28:31 +00:00
Relationship e1f5831d69 Delete ShadowBorder.blp 2026-07-24 12:28:28 +00:00
Relationship 67de1d243a Delete Bar.blp 2026-07-24 12:28:24 +00:00
Relationship 7bcfcfd3d9 Delete BarBG.blp 2026-07-24 12:28:21 +00:00
Relationship ea7388ecce Delete Glow.blp 2026-07-24 12:28:18 +00:00
Relationship 0b8fdd614a Upload files to "/" 2026-07-24 12:27:53 +00:00
Relationship 8ed08f6e0f Upload files to "/" 2026-07-24 12:27:42 +00:00
Relationship 756e42a385 Upload files to "/" 2026-07-24 12:27:13 +00:00
Relationship 55c9b25df7 Update README.md 2026-07-18 18:35:20 +01:00
Relationship 33a9b66aff Update README.md 2026-07-12 20:38:38 +01:00
Relationship 4a2360f813 Update README.md 2026-07-12 20:37:56 +01:00
Relationship c85fea8f30 Update README.md 2026-07-12 20:37:47 +01:00
Relationship dd52e513a4 Update README.md 2026-07-12 15:00:37 +01:00
3 changed files with 57 additions and 26 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<img src="https://cdn.discordapp.com/attachments/1510333697277300856/1522484471616634943/fff.png?ex=6a51de28&is=6a508ca8&hm=63ff5877df99f9df865b93da3528822af42de0d386126f4ccc465c728b00bed1&"/>
<img src="https://i.postimg.cc/gkqNFRGD/fff.png"/><img src="https://i.postimg.cc/DyKBM536/afsa.png"/>
* It's recommended to use the KUI-NAMEPLATES addon as it's designed to work with that.
* You can find it here.
+1 -1
View File
@@ -2,7 +2,7 @@
## Title: RelationshipsThreatPlates - OctoWoW
## Notes: OctoWoW-compatible RelationshipsThreatPlates
## Author: Relationship
## Version: 1.4
## Version: 1.5
## SavedVariables: RelationshipsThreatPlatesDB
## X-Website: https://github.com/Relationship-OctoWoW/RelationshipsThreatPlates
## X-GitHub: https://github.com/Relationship-OctoWoW/RelationshipsThreatPlates
+40 -9
View File
@@ -112,24 +112,45 @@ local function DeepCopy(src)
end
-- ==================================================================
-- Event handling
-- Ensure SavedVariable table exists and has all default keys.
-- Safe to call multiple times.
-- ==================================================================
addon:RegisterEvent("ADDON_LOADED")
addon:RegisterEvent("PLAYER_ENTERING_WORLD")
addon:SetScript("OnEvent", function()
if event == "ADDON_LOADED" and arg1 == TP_ADDON_NAME then
-- Initialize saved variables with defaults
local function EnsureDB()
if not RelationshipsThreatPlatesDB then
RelationshipsThreatPlatesDB = DeepCopy(DEFAULT_CONFIG)
else
-- Merge in any missing keys from defaults
for k, v in pairs(DEFAULT_CONFIG) do
if RelationshipsThreatPlatesDB[k] == nil then
RelationshipsThreatPlatesDB[k] = DeepCopy(v)
end
end
end
end
addon.EnsureDB = EnsureDB
-- In WoW 1.12, SavedVariables are loaded BEFORE the addon's Lua files
-- execute, so it is safe to initialize the DB at file load. Doing this
-- here (in addition to ADDON_LOADED) protects against cases where the
-- installed folder name doesn't match TP_ADDON_NAME exactly
-- (e.g. "RelationshipsThreatPlates-main" from a GitHub zip), which
-- would otherwise cause the ADDON_LOADED arg1 check to fail and leave
-- RelationshipsThreatPlatesDB nil - the root cause of
-- "attempt to index global 'RelationshipsThreatPlatesDB' a nil value"
-- reported at RelationshipsThreatPlates_GUI.lua:320.
EnsureDB()
-- ==================================================================
-- Event handling
-- ==================================================================
addon:RegisterEvent("ADDON_LOADED")
addon:RegisterEvent("PLAYER_ENTERING_WORLD")
local modulesInitialized = false
local function InitializeModules()
if modulesInitialized then return end
modulesInitialized = true
EnsureDB()
-- Ensure media textures
addon.Media.EnsureTextures()
@@ -141,15 +162,25 @@ addon:SetScript("OnEvent", function()
addon.GUI:Initialize()
addon:ui_print("v" .. TP_VERSION .. " loaded! Type /tp for options.")
end
addon:SetScript("OnEvent", function()
if event == "ADDON_LOADED" then
-- Accept any ADDON_LOADED: this script only runs when our addon
-- is loaded, so the first ADDON_LOADED we see is safe to act on.
-- This avoids folder-rename issues where arg1 ~= TP_ADDON_NAME.
InitializeModules()
elseif event == "PLAYER_ENTERING_WORLD" then
-- Force a nameplate scan on entering world
-- Safety net: if ADDON_LOADED was somehow missed, initialize now.
InitializeModules()
if RelationshipsThreatPlatesDB and RelationshipsThreatPlatesDB.enabled then
addon.Nameplates:UpdateAll()
end
end
end)
-- ==================================================================
-- Slash commands
-- ==================================================================