Skip to content

Commit

Permalink
Added option panel
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Feb 7, 2020
1 parent 072a660 commit 63042f0
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
globals = {'LibStub', 'BUTTON_LAG_AUCTIONHOUSE', 'LANDING_PAGE_REPORT', 'COPPER_PER_SILVER', 'SILVER_PER_GOLD', 'GOLD_AMOUNT_TEXTURE_STRING', 'SILVER_AMOUNT_TEXTURE', 'LE_ITEM_CLASS_RECIPE', 'LE_ITEM_RECIPE_BOOK'}
globals = {'LibStub', 'RECrystallize_PriceCheck', 'BUTTON_LAG_AUCTIONHOUSE', 'LANDING_PAGE_REPORT', 'COPPER_PER_SILVER', 'SILVER_PER_GOLD', 'GOLD_AMOUNT_TEXTURE_STRING', 'SILVER_AMOUNT_TEXTURE', 'LE_ITEM_CLASS_RECIPE', 'LE_ITEM_RECIPE_BOOK'}
ignore = {'self'}
max_line_length = false
self = false
2 changes: 2 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ externals:
Libs/LibStub: https://repos.wowace.com/wow/ace3/trunk/LibStub
Libs/CallbackHandler-1.0: https://repos.wowace.com/wow/ace3/trunk/CallbackHandler-1.0
Libs/AceGUI-3.0: https://repos.wowace.com/wow/ace3/trunk/AceGUI-3.0
Libs/AceConfigDialog-3.0: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0/AceConfigDialog-3.0
Libs/AceConfigRegistry-3.0: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0/AceConfigRegistry-3.0
Libs/AceLocale-3.0: https://repos.wowace.com/wow/ace3/trunk/AceLocale-3.0

ignore:
Expand Down
2 changes: 2 additions & 0 deletions Embeds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<Script file="Libs\LibStub\LibStub.lua"/>
<Script file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Libs\AceConfigRegistry-3.0\AceConfigRegistry-3.0.xml"/>
<Include file="Libs\AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/>
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml"/>

</Ui>
8 changes: 8 additions & 0 deletions Locale/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ L["Scan time"] = true
L["New items"] = true
L["Updated items"] = true
L["Removed items"] = true
L["Always display the price of the entire stock"] = true
L["When enabled the functionality of the SHIFT button will be swapped."] = true
L["Data freshness"] = true
L["The number of days after which old data will be deleted."] = true
L["Scanning speed"] = true
L["Setting this value lower might speed up the scanning process but also can cause disconnects."] = true
L["Purge this server database"] = true
L["WARNING! This operation is not reversible!"] = true
57 changes: 53 additions & 4 deletions RECrystallize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,53 @@ RE.TooltipIcon = ""
RE.TooltipItemID = 0
RE.TooltipCount = 0
RE.TooltipCustomCount = -1
RE.AceConfig = {
type = "group",
args = {
minimap = {
name = L["Always display the price of the entire stock"],
desc = L["When enabled the functionality of the SHIFT button will be swapped."],
type = "toggle",
width = "full",
order = 1,
set = function(_, val) RE.Config.AlwaysShowAll = val end,
get = function(_) return RE.Config.AlwaysShowAll end
},
dbcleanup = {
name = L["Data freshness"],
desc = L["The number of days after which old data will be deleted."],
type = "range",
width = "double",
order = 2,
min = 1,
max = 14,
step = 1,
set = function(_, val) RE.Config.DatabaseCleanup = val * 86400 end,
get = function(_) return RE.Config.DatabaseCleanup / 86400 end
},
scanpulse = {
name = L["Scanning speed"],
desc = L["Setting this value lower might speed up the scanning process but also can cause disconnects."],
type = "range",
width = "double",
order = 3,
min = 0.1,
max = 2,
step = 0.1,
set = function(_, val) RE.Config.ScanPulse = val end,
get = function(_) return RE.Config.ScanPulse end
},
dbpurge = {
name = L["Purge this server database"],
desc = L["WARNING! This operation is not reversible!"],
type = "execute",
width = "double",
order = 4,
confirm = true,
func = function() RE.DB[RE.RealmString] = {}; collectgarbage("collect") end
},
}
}

local function ElvUISwag(sender)
if sender == "Livarax-BurningLegion" then
Expand Down Expand Up @@ -186,6 +233,8 @@ function RE:OnEvent(self, event, ...)
if RE.DB[RE.RealmString] == nil then
RE.DB[RE.RealmString] = {}
end
_G.LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("RECrystallize", RE.AceConfig)
_G.LibStub("AceConfigDialog-3.0"):AddToBlizOptions("RECrystallize", "RECrystallize")

if RE.Config.GuildChatPC then
self:RegisterEvent("CHAT_MSG_GUILD")
Expand Down Expand Up @@ -336,10 +385,10 @@ function RE:EndScan()
RE.AHButton:SetText(L["Scan finished!"])
PlaySound(_G.SOUNDKIT.AUCTION_WINDOW_CLOSE)
print("|cFF9D9D9D---|r |cFF74D06CRE|rCrystallize "..LANDING_PAGE_REPORT.." |cFF9D9D9D---|r")
print(L["Scan time"]..": "..SecondsToTime(time() - RE.Config.LastScan))
print(L["New items"]..": "..RE.ScanStats[1])
print(L["Updated items"]..": "..RE.ScanStats[2])
print(L["Removed items"]..": "..RE.ScanStats[3])
print("|cFF74D06C"..L["Scan time"]..":|r "..SecondsToTime(time() - RE.Config.LastScan))
print("|cFF74D06C"..L["New items"]..":|r "..RE.ScanStats[1])
print("|cFF74D06C"..L["Updated items"]..":|r "..RE.ScanStats[2])
print("|cFF74D06C"..L["Removed items"]..":|r "..RE.ScanStats[3])
end

function RE:ParseDatabase()
Expand Down
2 changes: 1 addition & 1 deletion RECrystallize.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 80300
## Title: |cFF74D06CRE|rCrystallize
## Notes: Provide Auction House scanner and add item prices to tooltips.
## Version: 1.4.2
## Version: 1.5.0
## Author: AcidWeb
## SavedVariables: RECrystallizeSettings, RECrystallizeDatabase
## X-Website: https://www.curseforge.com/wow/addons/recrystallize-auction-house-scanner
Expand Down

0 comments on commit 63042f0

Please sign in to comment.