Skip to content

Commit

Permalink
Add Archaeology for Cataclysm Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevcairiel committed May 3, 2024
1 parent 15d101c commit b92554d
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Collector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ or
[openSpell] = "Treasure",
[openNoTextSpell] = "Treasure",
[pickSpell] = "Treasure",
[archSpell or "Searching for Artifacts"] = "Archaeology",
}
local tooltipLeftText1 = _G["GameTooltipTextLeft1"]
local strfind, stringmatch = string.find, string.match
Expand Down Expand Up @@ -91,7 +92,7 @@ function Collector:UnregisterGatherEvents()
self:UnregisterEvent("UNIT_SPELLCAST_STOP")
self:UnregisterEvent("UNIT_SPELLCAST_FAILED")
self:UnregisterEvent("UNIT_SPELLCAST_INTERRUPTED")
self:UnregisterEvent("CURSOR_CHANGED","CursorChange")
self:UnregisterEvent("CURSOR_CHANGED")
self:UnregisterEvent("UI_ERROR_MESSAGE")
--self:UnregisterEvent("LOOT_CLOSED")
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
Expand Down
102 changes: 100 additions & 2 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ local DataBroker = LibStub:GetLibrary("LibDataBroker-1.1",true)
local WoWClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC)
local WoWBC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC)
local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)
local SaveBindings = SaveBindings or AttemptToSaveBindings

local HiddenArchaeology = (select(4, GetBuildInfo()) < 40400)


--[[
Code here for configuring the mod, and making the minimap button
]]
Expand Down Expand Up @@ -55,7 +59,7 @@ local prof_options3 = {
}
local prof_options4 = { -- For Archaeology, which doesn't have tracking as a skill
always = L["Always show"],
active = L["Only with digsite"],
-- active = L["Only with digsite"],
with_profession = L["Only with profession"],
never = L["Never show"],
}
Expand Down Expand Up @@ -118,6 +122,15 @@ local generalOptions = {
values = prof_options3,
arg = "Treasure"
},
showArchaeology = {
order = 6,
name = L["Show Archaeology Nodes"],
desc = L["Toggle showing archaeology nodes."],
type = "select",
values = prof_options4,
arg = "Archaeology",
hidden = HiddenArchaeology,
},
},
}

Expand Down Expand Up @@ -318,6 +331,15 @@ local minimapOptions = {
hasAlpha = true,
arg = "Treasure",
},
trackingColorArchaelogy = {
order = 7,
name = L["Archaeology"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Archaeology",
hidden = HiddenArchaeology,
},
space = {
order = 10,
name = "",
Expand Down Expand Up @@ -372,6 +394,8 @@ local sortedFilter = setmetatable({}, {__index = function(t, k)
-- skip
elseif WoWWrath and expansion and expansion[map[name]] > 3 then
-- skip
elseif WoWCata and expansion and expansion[map[name]] > 4 then
-- skip
else
local idx = #new+1
new[idx] = name
Expand Down Expand Up @@ -641,6 +665,40 @@ filterOptions.args.treasure = {
},
}

filterOptions.args.archaeology = {
type = "group",
name = L["Archaeology"],
hidden = HiddenArchaeology,
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Archaeology",
},
select_none = {
order = 2,
name = L["Select None"],
desc = L["Clear node selections"],
type = "execute",
func = "SelectNone",
arg = "Archaeology",
},
diglist = {
order = 3,
name = L["Archaeology"],
desc = L["Select the archaeology nodes you wish to display."],
type = "multiselect",
values = sortedFilter["Archaeology"],
set = "SetState",
get = "GetState",
arg = "Archaeology",
},
},
}

local selectedDatabase, selectedNode, selectedZone = "Herb Gathering", 0, nil

-- Cleanup config tree
Expand Down Expand Up @@ -721,6 +779,15 @@ local maintenanceOptions = {
type = "range",
min = 0, max = 30, step = 1,
arg = "Treasure",
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Archaeology",
hidden = HiddenArchaeology,
}
},
},
Expand Down Expand Up @@ -852,6 +919,16 @@ local maintenanceOptions = {
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Archaeology",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
hidden = HiddenArchaeology,
},
},
},
dblocking = {
Expand Down Expand Up @@ -905,6 +982,14 @@ local maintenanceOptions = {
desc = L["Database locking"],
type = "toggle",
arg = "Treasure",
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Database locking"],
type = "toggle",
arg = "Archaeology",
hidden = HiddenArchaeology,
}
}
},
Expand Down Expand Up @@ -932,6 +1017,15 @@ ImportHelper.db_tables = WoWClassic and {
["Fish"] = L["Fishing"],
["Treasure"] = L["Treasure"],
}
or WoWCata and
{
["Herbs"] = L["Herbalism"],
["Mines"] = L["Mining"],
["Gases"] = L["Gas Clouds"],
["Fish"] = L["Fishing"],
["Treasure"] = L["Treasure"],
["Archaeology"] = L["Archaeology"],
}
or
{
["Herbs"] = L["Herbalism"],
Expand All @@ -943,8 +1037,8 @@ or
ImportHelper.expac_data = {
["TBC"] = L["The Burning Crusades"],
["WRATH"] = L["Wrath of the Lich King"],
--[[
["CATACLYSM"] = L["Cataclysm"],
--[[
["MISTS"] = L["Mists of Pandaria"],
["WOD"] = L["Warlords of Draenor"],
["LEGION"] = L["Legion"],
Expand Down Expand Up @@ -1053,9 +1147,13 @@ importOptions.args.GatherMateData = {
if db["importers"]["GatherMate2_Data"].Databases["Mines"] then cm = 1 end
if db["importers"]["GatherMate2_Data"].Databases["Herbs"] then cm = 1 end
if db["importers"]["GatherMate2_Data"].Databases["Fish"] then cm = 1 end
if db["importers"]["GatherMate2_Data"].Databases["Treasure"] then cm = 1 end
if not WoWClassic then
if db["importers"]["GatherMate2_Data"].Databases["Gases"] then cm = 1 end
end
if WoWCata then
if db["importers"]["GatherMate2_Data"].Databases["Archaeology"] then cm = 1 end
end
return imported["GatherMate2_Data"] or (cm == 0 and not imported["GatherMate2_Data"])
end,
}
Expand Down
2 changes: 1 addition & 1 deletion Display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function Display:OnEnable()
ExpandSkillHeader(0)
self:MINIMAP_UPDATE_TRACKING()
self:PlayerZoneChanged()
--self:UpdateMaps() -- already in DigsitesChanged()
--self:UpdateMaps()
fullInit = true
end

Expand Down
12 changes: 8 additions & 4 deletions GatherMate2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GatherMate.HBD = LibStub("HereBeDragons-2.0")
local HBDMigrate = LibStub("HereBeDragons-Migrate")

local WoWClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)

-- locals
local db, gmdbs, filter
Expand Down Expand Up @@ -97,9 +98,8 @@ function GatherMate:OnInitialize()
GatherMate2MineDB = GatherMate2MineDB or {}
GatherMate2FishDB = GatherMate2FishDB or {}
GatherMate2TreasureDB = GatherMate2TreasureDB or {}
if not WoWClassic then
GatherMate2GasDB = GatherMate2GasDB or {}
end
GatherMate2GasDB = GatherMate2GasDB or {}
GatherMate2ArchaeologyDB = GatherMate2ArchaeologyDB or {}
self.gmdbs = {}
self.db_types = {}
gmdbs = self.gmdbs
Expand All @@ -110,6 +110,9 @@ function GatherMate:OnInitialize()
if not WoWClassic then
self:RegisterDBType("Extract Gas", GatherMate2GasDB)
end
if WoWCata then
self:RegisterDBType("Archaeology", GatherMate2ArchaeologyDB)
end
db = self.db.profile
filter = db.filter
-- depractaion scan
Expand Down Expand Up @@ -211,7 +214,8 @@ function GatherMate:ClearDB(dbx)
elseif dbx == "Fishing" then GatherMate2FishDB = {}; gmdbs[dbx] = GatherMate2FishDB
elseif dbx == "Mining" then GatherMate2MineDB = {}; gmdbs[dbx] = GatherMate2MineDB
elseif dbx == "Treasure" then GatherMate2TreasureDB = {}; gmdbs[dbx] = GatherMate2TreasureDB
elseif not WoWClassic and dbx == "Extract Gas" then GatherMate2GasDB = {}; gmdbs[dbx] = GatherMate2GasDB
elseif dbx == "Extract Gas" then GatherMate2GasDB = {}; gmdbs[dbx] = GatherMate2GasDB
elseif dbx == "Archaeology" then GatherMate2ArchaeologyDB = {}; gmdbs[dbx] = GatherMate2ArchaeologyDB
else -- for custom DBs we dont know the global name, so we clear it old-fashion style
local db = gmdbs[dbx]
if not db then error("Trying to clear unknown database: "..dbx) end
Expand Down
2 changes: 1 addition & 1 deletion GatherMate2.toc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## Author: kagaro, xinhuan, nevcairiel
## X-Email: [email protected]
## X-Credits: OttoDeFe for the launher icon.
## SavedVariables: GatherMate2DB, GatherMate2HerbDB, GatherMate2MineDB, GatherMate2FishDB, GatherMate2GasDB, GatherMate2TreasureDB
## SavedVariables: GatherMate2DB, GatherMate2HerbDB, GatherMate2MineDB, GatherMate2FishDB, GatherMate2GasDB, GatherMate2TreasureDB, GatherMate2ArchaeologyDB
## X-Category: Map
## Version: @project-version@
## X-License: ARR
Expand Down

0 comments on commit b92554d

Please sign in to comment.