Skip to content

Commit

Permalink
Project cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Apr 25, 2024
1 parent d610a7b commit f8d5f81
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 242 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ name: Release
on:
push:
tags:
- '**'
- "*"

jobs:
release:
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
steps:
- name: Clone project
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Package and release
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Libs/*
!Libs/LibDeflate
desktop.ini
21 changes: 21 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.1",
"diagnostics.globals": [
"BAG_FILTER_TITLE_SORTING",
"CALENDAR_EVENT_NAME",
"RATING",
"CHALLENGES",
"RaiderIO",
"ElvUI",
"GameTooltipHeaderText",
"Settings",
"WeeklyRewardsFrame",
"REKeysFrame"
],
"diagnostics.disable": [
"undefined-field",
"param-type-mismatch",
"redundant-parameter"
]
}
38 changes: 20 additions & 18 deletions .pkgmeta
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
enable-nolib-creation: no

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/LibDataBroker-1.1: https://repos.wowace.com/wow/libdatabroker-1-1
Libs/LibDBIcon-1.0: https://repos.wowace.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0
Libs/LibQTip-1.0: https://repos.wowace.com/wow/libqtip-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
Libs/AceEvent-3.0: https://repos.wowace.com/wow/ace3/trunk/AceEvent-3.0
Libs/AceTimer-3.0: https://repos.wowace.com/wow/ace3/trunk/AceTimer-3.0
Libs/AceBucket-3.0: https://repos.wowace.com/wow/ace3/trunk/AceBucket-3.0
Libs/AceComm-3.0: https://repos.wowace.com/wow/ace3/trunk/AceComm-3.0
Libs/AceSerializer-3.0: https://repos.wowace.com/wow/ace3/trunk/AceSerializer-3.0
Libs/LibOpenRaid: https://github.com/Tercioo/Open-Raid-Library.git
Libs/LibStub: https://repos.curseforge.com/wow/libstub/trunk
Libs/CallbackHandler-1.0: https://repos.curseforge.com/wow/callbackhandler/trunk/CallbackHandler-1.0
Libs/LibDataBroker-1.1: https://repos.curseforge.com/wow/libdatabroker-1-1
Libs/LibDBIcon-1.0: https://repos.curseforge.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0
Libs/LibQTip-1.0: https://repos.curseforge.com/wow/libqtip-1-0
Libs/AceGUI-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceGUI-3.0
Libs/AceConfigDialog-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceConfig-3.0/AceConfigDialog-3.0
Libs/AceConfigRegistry-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceConfig-3.0/AceConfigRegistry-3.0
Libs/AceLocale-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceLocale-3.0
Libs/AceEvent-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceEvent-3.0
Libs/AceTimer-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceTimer-3.0
Libs/AceBucket-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceBucket-3.0
Libs/AceComm-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceComm-3.0
Libs/AceSerializer-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceSerializer-3.0
Libs/LibOpenRaid: https://github.com/Tercioo/Open-Raid-Library
Libs/TaintLess:
url: https://www.townlong-yak.com/addons.git/taintless
commit: default

ignore:
- README.md
- README.md
- Libs/LibStub/tests
1 change: 1 addition & 0 deletions Embeds.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">

<Include file="Libs\TaintLess\TaintLess.xml"/>
<Script file="Libs\LibStub\LibStub.lua"/>
<Script file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
Expand Down
103 changes: 51 additions & 52 deletions REKeys.lua
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
local _G = _G
local _, RE = ...
local LDB = LibStub("LibDataBroker-1.1")
local LOR = LibStub("LibOpenRaid-1.0")
local LDBI = LibStub("LibDBIcon-1.0")
local QTIP = LibStub("LibQTip-1.0")
local BUCKET = LibStub("AceBucket-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("REKeys")
_G.REKeys = RE

local LoadAddOn = _G.LoadAddOn
local CreateFont = _G.CreateFont
local GetServerTime = _G.GetServerTime
local SendChatMessage = _G.SendChatMessage
local GuildRoster = _G.C_GuildInfo.GuildRoster
local GetClassInfo = _G.C_CreatureInfo.GetClassInfo
local GetMapUIInfo = _G.C_ChallengeMode.GetMapUIInfo
local GetAffixInfo = _G.C_ChallengeMode.GetAffixInfo
local GetRunHistory = _G.C_MythicPlus.GetRunHistory
local GetOwnedKeystoneChallengeMapID = _G.C_MythicPlus.GetOwnedKeystoneChallengeMapID
local GetOwnedKeystoneLevel = _G.C_MythicPlus.GetOwnedKeystoneLevel
local GetCurrentAffixes = _G.C_MythicPlus.GetCurrentAffixes
local GetRewardLevelFromKeystoneLevel = _G.C_MythicPlus.GetRewardLevelFromKeystoneLevel
local GetSecondsUntilWeeklyReset = _G.C_DateAndTime.GetSecondsUntilWeeklyReset
local GetContainerNumSlots = _G.C_Container.GetContainerNumSlots
local GetContainerItemInfo = _G.C_Container.GetContainerItemInfo
local RequestMapInfo = _G.C_MythicPlus.RequestMapInfo
local RequestRewards = _G.C_MythicPlus.RequestRewards
local RequestCurrentAffixes = _G.C_MythicPlus.RequestCurrentAffixes
local IsItemKeystoneByID = _G.C_Item.IsItemKeystoneByID
local IsInGroup = _G.IsInGroup
local IsInRaid = _G.IsInRaid
local IsPartyLFG = _G.IsPartyLFG
local After = _G.C_Timer.After
local NewTimer = _G.C_Timer.NewTimer
local NewTicker = _G.C_Timer.NewTicker
local UnitInParty = _G.UnitInParty
local UnitInRaid = _G.UnitInRaid
local UnitFactionGroup = _G.UnitFactionGroup
local ElvUI = _G.ElvUI
local RaiderIO = _G.RaiderIO
REKeys = RE

local LoadAddOn = C_AddOns.LoadAddOn
local CreateFont = CreateFont
local GetServerTime = GetServerTime
local SendChatMessage = SendChatMessage
local GuildRoster = C_GuildInfo.GuildRoster
local GetClassInfo = C_CreatureInfo.GetClassInfo
local GetMapUIInfo = C_ChallengeMode.GetMapUIInfo
local GetAffixInfo = C_ChallengeMode.GetAffixInfo
local GetRunHistory = C_MythicPlus.GetRunHistory
local GetOwnedKeystoneChallengeMapID = C_MythicPlus.GetOwnedKeystoneChallengeMapID
local GetOwnedKeystoneLevel = C_MythicPlus.GetOwnedKeystoneLevel
local GetCurrentAffixes = C_MythicPlus.GetCurrentAffixes
local GetRewardLevelFromKeystoneLevel = C_MythicPlus.GetRewardLevelFromKeystoneLevel
local GetSecondsUntilWeeklyReset = C_DateAndTime.GetSecondsUntilWeeklyReset
local GetContainerNumSlots = C_Container.GetContainerNumSlots
local GetContainerItemInfo = C_Container.GetContainerItemInfo
local RequestMapInfo = C_MythicPlus.RequestMapInfo
local RequestRewards = C_MythicPlus.RequestRewards
local RequestCurrentAffixes = C_MythicPlus.RequestCurrentAffixes
local IsItemKeystoneByID = C_Item.IsItemKeystoneByID
local IsInGroup = IsInGroup
local IsInRaid = IsInRaid
local IsPartyLFG = IsPartyLFG
local After = C_Timer.After
local NewTimer = C_Timer.NewTimer
local NewTicker = C_Timer.NewTicker
local UnitInParty = UnitInParty
local UnitInRaid = UnitInRaid
local UnitFactionGroup = UnitFactionGroup
local ElvUI = ElvUI
local RaiderIO = RaiderIO

RE.Keystone = {["MapID"] = 0, ["Level"] = 0}
RE.RowFill = true
Expand Down Expand Up @@ -103,14 +102,14 @@ RE.AceConfig = {
get = function(_) return RE.Settings.KeyNotification end
},
sorting = {
name = _G.BAG_FILTER_TITLE_SORTING,
name = BAG_FILTER_TITLE_SORTING,
type = "select",
width = "double",
order = 7,
values = {
[1] = _G.CALENDAR_EVENT_NAME,
[2] = _G.RATING,
[3] = _G.CHALLENGES
[1] = CALENDAR_EVENT_NAME,
[2] = RATING,
[3] = CHALLENGES
},
set = function(_, val) RE.Settings.Sorting = val end,
get = function(_) return RE.Settings.Sorting end
Expand Down Expand Up @@ -257,20 +256,20 @@ end

function RE:OnEvent(self, event, name, ...)
if event == "ADDON_LOADED" and name == "REKeys" then
if not _G.REKeysDB2 then _G.REKeysDB2 = {} end
if not _G.REKeysSettings then _G.REKeysSettings = RE.DefaultSettings end
RE.DB = _G.REKeysDB2
RE.Settings = _G.REKeysSettings
if not REKeysDB2 then REKeysDB2 = {} end
if not REKeysSettings then REKeysSettings = RE.DefaultSettings end
RE.DB = REKeysDB2
RE.Settings = REKeysSettings
for key, value in pairs(RE.DefaultSettings) do
if RE.Settings[key] == nil then
RE.Settings[key] = value
end
end
_G.LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("REKeys", RE.AceConfig)
RE.OptionsMenu = _G.LibStub("AceConfigDialog-3.0"):AddToBlizOptions("REKeys", "REKeys")
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("REKeys", RE.AceConfig)
RE.OptionsMenu = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("REKeys", "REKeys")

RE.TooltipHeaderFont = CreateFont("REKeysTooltipHeaderFont")
RE.TooltipHeaderFont:CopyFontObject(_G.GameTooltipHeaderText)
RE.TooltipHeaderFont:CopyFontObject(GameTooltipHeaderText)
RE.TooltipHeaderFont:SetFont(select(1, RE.TooltipHeaderFont:GetFont()), 15, "")

RE.LDB = LDB:NewDataObject("REKeys", {
Expand Down Expand Up @@ -304,18 +303,18 @@ function RE:OnEvent(self, event, name, ...)
function RE.LDB:OnClick(button)
if button == "LeftButton" then
LoadAddOn("Blizzard_WeeklyRewards")
if _G.WeeklyRewardsFrame:IsVisible() then
_G.WeeklyRewardsFrame:Hide()
if WeeklyRewardsFrame:IsVisible() then
WeeklyRewardsFrame:Hide()
else
_G.WeeklyRewardsFrame:Show()
WeeklyRewardsFrame:Show()
end
elseif button == "MiddleButton" then
local keyLink = RE:GetKeystoneLink()
if keyLink ~= "" then
SendChatMessage(keyLink, IsInGroup() and "PARTY" or "GUILD")
end
elseif button == "RightButton" then
_G.Settings.OpenToCategory("REKeys")
Settings.OpenToCategory("REKeys")
end
end
LDBI:Register("REKeys", RE.LDB, RE.Settings.MinimapButtonSettings)
Expand Down Expand Up @@ -437,7 +436,7 @@ function RE:FillTooltip()
RE.Tooltip:AddSeparator()
RE.Tooltip:AddLine()
end
row = RE.Tooltip:AddLine("|c".._G.RAID_CLASS_COLORS[payload.Class].colorStr..strsplit("-", name).."|r", nil, "|cff"..(payload.Fresh and "e6cc80" or "95761d")..RE:GetShortMapName(payload.MapID).." +"..payload.Level.."|r", nil, RE:GetScore(name, payload.Rating, payload.Faction))
row = RE.Tooltip:AddLine("|c"..RAID_CLASS_COLORS[payload.Class].colorStr..strsplit("-", name).."|r", nil, "|cff"..(payload.Fresh and "e6cc80" or "95761d")..RE:GetShortMapName(payload.MapID).." +"..payload.Level.."|r", nil, RE:GetScore(name, payload.Rating, payload.Faction))
RE:GetRowFill(row)
end
end
Expand Down Expand Up @@ -521,7 +520,7 @@ end

function RE:GetKeystoneLink()
local keyLink = ""
for bag = 0, _G.NUM_BAG_SLOTS do
for bag = 0, NUM_BAG_SLOTS do
local bagSlots = GetContainerNumSlots(bag)
for slot = 1, bagSlots do
local info = GetContainerItemInfo(bag, slot)
Expand Down Expand Up @@ -633,7 +632,7 @@ end
function RE:FindKeyDelay()
if not RE.MPlusDataReceived then RequestCurrentAffixes() end
RE:FindKey()
_G.REKeysFrame:RegisterEvent("CHALLENGE_MODE_COMPLETED")
REKeysFrame:RegisterEvent("CHALLENGE_MODE_COMPLETED")
BUCKET:RegisterBucketEvent("BAG_UPDATE", 5, RE.FindKey)
RE:LORSearchStart()
end
Expand Down
1 change: 0 additions & 1 deletion REKeys.toc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
## X-WoWI-ID: 24510
## X-Wago-ID: XrNke8Ka

TaintLess.xml
Embeds.xml
Locale\Locale.xml
REKeys.xml
Loading

0 comments on commit f8d5f81

Please sign in to comment.