Skip to content

Commit

Permalink
Updated Readme and new debug commands
Browse files Browse the repository at this point in the history
  • Loading branch information
derfloh205 committed Jan 30, 2024
1 parent 7b70520 commit 71de999
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
32 changes: 31 additions & 1 deletion Main/LoadoutReminder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,45 @@ function LoadoutReminder.MAIN:InitializeSlashCommands()
LoadoutReminder.NEWS:ShowNews(true)
end

if command == "npc" then
local npcID = LoadoutReminder.UTIL:GetTargetNPCID()
if npcID then
print(GUTIL:ColorizeText("/lor npc", GUTIL.COLORS.BRIGHT_BLUE))
print("NPC: " .. select(1, UnitName("target")))
print("- id: " .. npcID)
end
end

if command == "instance" then
local raid = LoadoutReminder.UTIL:GetCurrentRaid()
local instance = LoadoutReminder.UTIL:GetCurrentInstanceType()
local difficulty = LoadoutReminder.UTIL:GetInstanceDifficulty()
print(GUTIL:ColorizeText("/lor instance", GUTIL.COLORS.BRIGHT_BLUE))
print("InstanceType: " .. tostring(instance))
print("IsInInstance: " .. tostring(IsInInstance()))
print("- id: " .. tostring(select(8, GetInstanceInfo())))
print("- Raid: " .. tostring(raid))
print("Difficulty: " .. tostring(difficulty))
print("- id: " .. tostring(select(3, GetInstanceInfo())))
end

if command == "" then
print("LoadoutReminder Help")
print("/lor or /loadoutreminder can be used for following commands")
print("/lor -> show help text")
print("/lor news -> show last update news")
print("/lor config -> show options panel")
print("/lor check -> if configured check current player situation and reset session pause")
print("/lor npc -> show npc id for target (useful for developer)")
print("/lor instance -> show instance info (useful for developer)")
end
end
end

function LoadoutReminder.MAIN:InitializeMinimapButton()
local LibIcon = LibStub("LibDBIcon-1.0")
local ldb = LibStub("LibDataBroker-1.1"):NewDataObject("LoadoutReminder", {
local libDB = LibStub("LibDataBroker-1.1")
local ldb = libDB:NewDataObject("LoadoutReminder", {
type = "data source",
label = "LoadoutReminder",
tocname = "LoadoutReminder",
Expand All @@ -101,6 +126,11 @@ function LoadoutReminder.MAIN:InitializeMinimapButton()
end,
})

function ldb.OnTooltipShow(tt)
tt:AddLine("LoadoutReminder\n")
tt:AddLine(GUTIL:ColorizeText("Click to Configure!", GUTIL.COLORS.WHITE))
end

LoadoutReminderLibIconDB = LoadoutReminderLibIconDB or {}

LibIcon:Register("LoadoutReminder", ldb, LoadoutReminderLibIconDB)
Expand Down
10 changes: 6 additions & 4 deletions Modules/News/News.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ LoadoutReminder.NEWS = {}

function LoadoutReminder.NEWS:Init()
-- create news frame
local sizeX = 400
local sizeY = 100
local sizeX = 420
local sizeY = 120

local newsFrame = LoadoutReminder.GGUI.Frame({
parent = UIParent,
Expand All @@ -24,7 +24,6 @@ function LoadoutReminder.NEWS:Init()
title = LoadoutReminder.GUTIL:ColorizeText(
"LoadoutReminder " .. C_AddOns.GetAddOnMetadata(LoadoutReminderAddonName, "Version"),
LoadoutReminder.GUTIL.COLORS.BRIGHT_BLUE),
collapseable = true,
closeable = true,
moveable = true,
})
Expand All @@ -44,7 +43,10 @@ function LoadoutReminder.NEWS:GET_NEWS()
local d = LoadoutReminder.GUTIL:ColorizeText("-", LoadoutReminder.GUTIL.COLORS.GREEN)
return string.format(
[[
%1$s Fixed an error when difficulty is not yet loaded
%1$s Refactored options by using tabs instead of buttons
%1$s Added a little pause button to pause reminders for the
current session
%1$s Added debug commands /lor npc and /lor instance
]], d)
end

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ Shows the last update news

/loadoutreminder check
/lor check
Makes an immediate check for the corresponding loadouts based on your current situation
Makes an immediate check for the corresponding loadouts based on your current situation and reset session pause


/loadoutreminder config
/lor config
Opens the addon options

/loadoutreminder npc
/lor npc
show npc id for target (useful for developer)

/loadoutreminder instance
/lor instance
show instance info (useful for developer)

0 comments on commit 71de999

Please sign in to comment.