Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Numynum committed Sep 22, 2022
0 parents commit 7434094
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Replace toc-versions
uses: Numynum/ToCVersions@master

- name: Create Retail Package
uses: BigWigsMods/packager@master
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions TalentTreeTweaks.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Interface: 100000
## Title: Talent Tree Tweaks
## Author: Numy
## Notes: Various improvements and addition to the Dragonflight talent tree UI
## Version: @project-version@
## X-Curse-Project-ID: 678792

core.lua
41 changes: 41 additions & 0 deletions core.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local name, TTT = ...;

--@debug@
_G.TalentTreeTweaks = TTT;
if not _G.TTT then _G.TTT = TTT; end
--@end-debug@

--- @class Main
local Main = {}
if not Main then return; end
TTT.Main = Main;

function Main:AlreadyAdded(textLine, tooltip)
if textLine == nil then
return false
end

for i = 1,15 do
local tooltipFrame = _G[tooltip:GetName() .. "TextLeft" .. i]
local textRight = _G[tooltip:GetName().."TextRight"..i]
local text, right
if tooltipFrame then text = tooltipFrame:GetText() end
if text and string.find(text, textLine, 1, true) then return true end
if textRight then right = textRight:GetText() end
if right and string.find(right, textLine, 1, true) then return true end
end
end

function Main:AddItemToTooltip(name, value, tooltip)
local text = "|cFFEE6161"..name.."|r " .. (value or 'nil')
if(not self:AlreadyAdded(text, tooltip)) then
tooltip:AddLine(text)
end
tooltip:Show()
end

EventRegistry:RegisterCallback("TalentDisplay.TooltipCreated", function(self, button, tooltip)
self:AddItemToTooltip('NodeId', button.GetNodeID and button:GetNodeID() or button:GetNodeInfo().ID, tooltip)
self:AddItemToTooltip('EntryId', button:GetEntryID(), tooltip)
self:AddItemToTooltip('SpellId', button:GetSpellID(), tooltip)
end, Main)

0 comments on commit 7434094

Please sign in to comment.