Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 51 additions & 50 deletions Checklist.lua

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local Main = addon.Main
local Checklist = addon.Checklist
local LibDataBroker = LibStub("LibDataBroker-1.1")
local LibDBIcon = LibStub("LibDBIcon-1.0")
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)

local Core = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceConsole-3.0", "AceTimer-3.0", "AceEvent-3.0", "AceBucket-3.0")
addon.Core = Core
Expand Down Expand Up @@ -37,20 +38,20 @@ function Core:HandleCommand(message)
if cmd:lower() == "minimap" then
Data.db.global.minimap.hide = not Data.db.global.minimap.hide
LibDBIcon:Refresh(addonName, Data.db.global.minimap)
self:Print("Minimap button " .. (Data.db.global.minimap.hide and "hidden" or "shown") .. ".")
self:Print(format(L["command_minimap_status"], L[Data.db.global.minimap.hide and "command_hidden" or "command_shown"]))
self:Render()
return
end
if cmd:lower() == "toggle" then
Main:ToggleWindow()
return
end
self:Print("Usage: /wk [checklist | minimap]")
self:Print(L["command_usage"])
end

function Core:OnInitialize()
_G["BINDING_NAME_WEEKLYKNOWLEDGE_MAIN"] = "Toggle WeeklyKnowledge window"
_G["BINDING_NAME_WEEKLYKNOWLEDGE_CHECKLIST"] = "Toggle Checklist window"
_G["BINDING_NAME_WEEKLYKNOWLEDGE_MAIN"] = L["binding_toggle_main"]
_G["BINDING_NAME_WEEKLYKNOWLEDGE_CHECKLIST"] = L["binding_toggle_checklist"]
_G["WEEKLYKNOWLEDGE_TOGGLE_MAIN"] = function()
if addon and addon.Main then addon.Main:ToggleWindow() end
end
Expand All @@ -63,7 +64,7 @@ function Core:OnInitialize()
Data:InitDB()
Data:MigrateDB()
if Data:TaskWeeklyReset() then
self:Print("Weekly Reset: Good job! Progress of your characters have been reset for a new week.")
self:Print(L["prompt_weekly_reset"])
end

local WKLDB = LibDataBroker:NewDataObject(addonName, {
Expand All @@ -80,11 +81,11 @@ function Core:OnInitialize()
end,
OnTooltipShow = function(tooltip)
tooltip:SetText(addonName, 1, 1, 1)
tooltip:AddLine("|cff00ff00Left click|r to open WeeklyKnowledge.", NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
tooltip:AddLine("|cff00ff00Right click|r to open the Checklist.", NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
local dragText = "|cff00ff00Drag|r to move this icon"
tooltip:AddLine(GREEN_FONT_COLOR:WrapTextInColorCode(L["command_left_click"]) .. " " .. L["tooltip_left_click_open"], NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
tooltip:AddLine(GREEN_FONT_COLOR:WrapTextInColorCode(L["command_right_click"]) .. " " .. L["tooltip_right_click_open"], NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
local dragText = GREEN_FONT_COLOR:WrapTextInColorCode(L["command_drag"]) .. " " .. L["tooltip_drag_minimap"]
if Data.db.global.minimap.lock then
dragText = dragText .. " |cffff0000(locked)|r"
dragText = dragText .. " " .. RED_FONT_COLOR:WrapTextInColorCode(L["command_locked"])
end
tooltip:AddLine(dragText .. ".", NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
end
Expand Down
7 changes: 4 additions & 3 deletions Data/Expansions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ local addon = select(2, ...)

---@class WK_Data
local Data = addon.Data
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)

---@type WK_Expansion[]
Data.Expansions = {
{id = Enum.ExpansionLevel.Dragonflight, enabled = false, abbr = "DF", name = "Dragonflight"}, -- Disable for now since it's not set up yet.
{id = Enum.ExpansionLevel.WarWithin, enabled = true, abbr = "TWW", name = "The War Within"},
{id = Enum.ExpansionLevel.Midnight, enabled = true, abbr = "Midnight", name = "Midnight"},
{id = Enum.ExpansionLevel.Dragonflight, enabled = false, abbr = "DF", name = L["expansion_dragonflight"]}, -- Disable for now since it's not set up yet.
{id = Enum.ExpansionLevel.WarWithin, enabled = true, abbr = "TWW", name = L["expansion_war_within"]},
{id = Enum.ExpansionLevel.Midnight, enabled = true, abbr = "Midnight", name = L["expansion_midnight"]},
}
17 changes: 9 additions & 8 deletions Data/ObjectiveCategories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ local addon = select(2, ...)

---@class WK_Data
local Data = addon.Data
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)

---@type WK_ObjectiveCategory[]
Data.ObjectiveCategories = {
{id = Enum.WK_ObjectiveCategory.Unique, name = "Uniques", description = "These are one-time items found in treasures around the world and sold by vendors.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("No"), type = "item", repeatable = "No",},
{id = Enum.WK_ObjectiveCategory.FirstCraft, name = "First Craft", description = "These are your first craft or first gathering bonuses.\n\nNote: Not every profession or expansion is updated yet.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("No"), type = "recipe", repeatable = "No",},
{id = Enum.WK_ObjectiveCategory.Treatise, name = "Treatise", description = "These can be crafted with Inscription. Send a Crafting Order if you don't have the profession.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Weekly"), type = "item", repeatable = "Weekly", hint = true,},
{id = Enum.WK_ObjectiveCategory.WeeklyQuest, name = "Weekly Quest", description = "Complete a quest from your profession trainer or from the Artisan's Consortium.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Weekly"), type = "quest", repeatable = "Weekly",},
{id = Enum.WK_ObjectiveCategory.Treasure, name = "Treasure", description = "These are randomly looted from treasures around the world.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Weekly"), type = "item", repeatable = "Weekly", hint = true,},
{id = Enum.WK_ObjectiveCategory.Gathering, name = "Gathering", description = "These are randomly looted from gathering nodes around the world.\n\nFor Enchanting these are looted from Disenchanting.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Weekly"), type = "item", repeatable = "Weekly",},
{id = Enum.WK_ObjectiveCategory.DarkmoonQuest, name = "Darkmoon", description = "Complete a quest at the Darkmoon Faire.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Monthly"), type = "quest", repeatable = "Monthly",},
{id = Enum.WK_ObjectiveCategory.CatchUp, name = "Catch-Up", description = "Keep track of your catch-up points.\n\nYou will be able to gain these points once you've completed some of the other objectives.\n\nRepeatable: " .. WHITE_FONT_COLOR:WrapTextInColorCode("Yes"), type = "item", repeatable = "Yes",},
{id = Enum.WK_ObjectiveCategory.Unique, name = L["category_uniques"], description = format(L["objective_desc_uniques"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_no"])), type = "item", repeatable = L["label_no"],},
{id = Enum.WK_ObjectiveCategory.FirstCraft, name = L["category_first_craft"], description = format(L["objective_desc_first_craft"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_no"])), type = "recipe", repeatable = L["label_no"],},
{id = Enum.WK_ObjectiveCategory.Treatise, name = L["category_treatise"], description = format(L["objective_desc_treatise"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_weekly"])), type = "item", repeatable = L["label_weekly"], hint = true,},
{id = Enum.WK_ObjectiveCategory.WeeklyQuest, name = L["category_weekly_quest"], description = format(L["objective_desc_weekly_quest"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_weekly"])), type = "quest", repeatable = L["label_weekly"],},
{id = Enum.WK_ObjectiveCategory.Treasure, name = L["category_treasure"], description = format(L["objective_desc_treasure"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_weekly"])), type = "item", repeatable = L["label_weekly"], hint = true,},
{id = Enum.WK_ObjectiveCategory.Gathering, name = L["category_gathering"], description = format(L["objective_desc_gathering"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_weekly"])), type = "item", repeatable = L["label_weekly"],},
{id = Enum.WK_ObjectiveCategory.DarkmoonQuest, name = L["category_darkmoon"], description = format(L["objective_desc_darkmoon"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_monthly"])), type = "quest", repeatable = L["label_monthly"],},
{id = Enum.WK_ObjectiveCategory.CatchUp, name = L["category_catch_up"], description = format(L["objective_desc_catch_up"], WHITE_FONT_COLOR:WrapTextInColorCode(L["label_yes"])), type = "item", repeatable = L["label_yes"],},
}
Loading