Skip to content

Commit

Permalink
Reset DB Command
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoRogai committed Sep 1, 2024
1 parent 072b7a9 commit ec755f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ externals:
Libs/AceAddon-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceAddon-3.0
Libs/AceDB-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceDB-3.0
Libs/AceGUI-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceGUI-3.0
Libs/AceConsole-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceConsole-3.0
Libs/LibDBIcon-1.0: https://repos.curseforge.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0
Libs/lib-st: https://github.com/ddumont/lib-st/
1 change: 1 addition & 0 deletions Libs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Libs\LibDBIcon-1.0\lib.xml"/>
<Include file="Libs\lib-st\lib-st.xml"/>
</Ui>
10 changes: 9 additions & 1 deletion RepHub.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local RepHub = LibStub("AceAddon-3.0"):NewAddon("RepHub")
local RepHub = LibStub("AceAddon-3.0"):NewAddon("RepHub", "AceConsole-3.0")
local AceGUI = LibStub("AceGUI-3.0")
local LibDataBroker = LibStub("LibDataBroker-1.1"):NewDataObject("RepHub", {
type = "data source",
Expand Down Expand Up @@ -26,12 +26,20 @@ function RepHub:OnInitialize()
},
})
LibDBIcon:Register("RepHub", LibDataBroker, self.db.profile.minimap)
RepHub:RegisterChatCommand("rephub", "HandleCommand")
end

function RepHub:OnEnable()
RepHub:RefreshReputationGlobalDB()
end

function RepHub:HandleCommand(input)
if input == "resetdb" then
self.db.global.ReputationList = {}
ReloadUI()
end
end

function RepHub:RefreshReputationGlobalDB()
local characterName = UnitName("player")

Expand Down

0 comments on commit ec755f8

Please sign in to comment.