Version 0.5.0
- add replacements via options UI - restructure debug functions
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
--------------------------------------------------------------------------]] --
|
||||
-----------------------------------------------------------------------------]]
|
||||
|
||||
-- read namespace from global env
|
||||
local AddonName, AddonTable = ...
|
||||
@@ -34,8 +34,12 @@ _G.Grichelde = Grichelde
|
||||
-- Ace3 callbacks
|
||||
function Grichelde:OnInitialize()
|
||||
-- Build Interface Options window
|
||||
self:LoadDatabase()
|
||||
self:SetupOptions()
|
||||
self.db = self:LoadDatabase()
|
||||
self.options, self.dialog = self:SetupOptions()
|
||||
|
||||
self:RefreshOptions("OnProfileChanged")
|
||||
self:DebugPrint(self.db.profile)
|
||||
|
||||
self:SetupSlashCommands()
|
||||
|
||||
-- Watch for WIM and Prat to Load, then integrate
|
||||
@@ -51,22 +55,21 @@ function Grichelde:OnEnable()
|
||||
end
|
||||
|
||||
-- tell the world we are listening
|
||||
self:DebugPrint(self.L.AddonLoaded, self.L.AddonName)
|
||||
self:Print(self.L.AddonLoaded, self.COLOR_CODES.PREFIX .. self.L.AddonName .. " " .. self.L.VersionAbbr .. self.version .. self.COLOR_CODES.CLOSE)
|
||||
end
|
||||
|
||||
function Grichelde:OnDisable()
|
||||
self:Unhook("SendChatMessage")
|
||||
end
|
||||
|
||||
--- register 'grichelde' and 'gri' slash commands
|
||||
--- Register slash commands 'gri' and 'grichelde'
|
||||
function Grichelde:SetupSlashCommands()
|
||||
local function HandleSlashCommand(input)
|
||||
-- Show the GUI if no input is supplied, otherwise handle the chat input.
|
||||
if not input or input:trim() == "" then
|
||||
if self.functions.nilOrEmpty(input) then
|
||||
LibStub("AceConfigDialog-3.0"):Open(self.name)
|
||||
else
|
||||
-- handle slash ourselves
|
||||
self:Print(self.L.AddonName .. " Version " .. self.version)
|
||||
self:Print("Handle slash command: " .. input)
|
||||
end
|
||||
end
|
||||
@@ -75,8 +78,9 @@ function Grichelde:SetupSlashCommands()
|
||||
self:RegisterChatCommand("gri", HandleSlashCommand)
|
||||
end
|
||||
|
||||
--- @param event string
|
||||
--- @param addonName string
|
||||
--- Hook into WIM to catch whisper sending event.
|
||||
-- @param event string
|
||||
-- @param addonName string
|
||||
function Grichelde:HookIntoForOtherChatAddons(event, addonName)
|
||||
if event == "ADDON_LOADED" then
|
||||
if addonName == "WIM" then
|
||||
|
||||
Reference in New Issue
Block a user