Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The War Within - Update #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Package and Release

on:
push:
tags:
- 'v*' # Triggers only on version tags like v1.0.0, v1.0.0-alpha, etc.

env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Clone Project
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git user
run: |
git config --global user.name "donniedice"
git config --global user.email "[email protected]"

- name: Set Release Type
id: set_release_type
run: |
TAG_NAME=${{ github.ref }}
if [[ "$TAG_NAME" == *"beta"* ]]; then
echo "::set-output name=release_type::beta"
elif [[ "$TAG_NAME" == *"alpha"* ]]; then
echo "::set-output name=release_type::alpha"
else
echo "::set-output name=release_type::release"
fi

- name: Extract Version from TOC
id: extract_version
run: |
version=$(grep -oP '^## Version: \K(.*)' ./*.toc)
echo "::set-output name=version::$version"

- name: Package and Release
uses: BigWigsMods/packager@master
with:
release-type: ${{ steps.set_release_type.outputs.release_type }}
2 changes: 2 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-as: QuestPlates
manual-changelog: docs/CHANGES.md
157 changes: 69 additions & 88 deletions QuestPlates.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--------------------
-- ICON SETTINGS

-- Settings can be referenced by typing "QuestPlateSettings." followed by the name of the setting.
-- For example, to move the icon 10 pixels down, you can type the following into the chat:
-- /run QuestPlateSettings.OffsetY = -10
Expand All @@ -11,119 +10,102 @@
-- If you wish to wipe out any changes you've made and return to the default settings, you can type:
-- /run QuestPlateSettings = nil
-- And then /reload your ui

QuestPlateSettings = {
AnchorPoint = 'RIGHT', -- Point of icon to anchor to nameplate (CENTER, LEFT, RIGHT, TOP, BOTTOM)
RelativeTo = 'LEFT', -- Point of nameplate to anchor icon to (CENTER, LEFT, RIGHT, TOP, BOTTOM)
OffsetX = 0, -- Horizontal offset for icon (from anchor point)
OffsetY = 0, -- Vertical offset for icon
IconScale = 1, -- Scale for icon
AnchorPoint = 'RIGHT', -- Point of icon to anchor to nameplate (CENTER, LEFT, RIGHT, TOP, BOTTOM)
RelativeTo = 'LEFT', -- Point of nameplate to anchor icon to (CENTER, LEFT, RIGHT, TOP, BOTTOM)
OffsetX = 0, -- Horizontal offset for icon (from anchor point)
OffsetY = 0, -- Vertical offset for icon
IconScale = 1, -- Scale for icon
}

-- Uncomment these lines if you want to enable them, or set to 0 to turn them off
-- SetCVar('showQuestUnitCircles', 1) -- Enables subtle glow under quest mobs
-- SetCVar('UnitNameFriendlySpecialNPCName', 1) -- Show name for quest objectives, even out of range of nameplates

-- END OF SETTINGS
--------------------

local addonName, addon = ...

local E = addon:Eve()

-- function E:VARIABLES_LOADED()
-- SetCVar('showQuestTrackingTooltips', '1') -- Required for this addon to function, don't turn this off
-- end

local TextureAtlases = {
['item'] = 'Banker', -- bag icon, you have to loot something for this quest
--['monster'] = '', -- you must kill or interact with units for this quest
['item'] = 'Banker', -- bag icon, you have to loot something for this quest
}

-- C_TaskQuest.GetQuestsForPlayerByMapID(GetCurrentMapAreaID())
local ActiveWorldQuests = {
-- [questName] = questID ?
}
local ActiveWorldQuests = {}



do
function E:PLAYER_LOGIN()
-- local areaID = GetCurrentMapAreaID()
local uiMapID = C_Map.GetBestMapForUnit('player')
if uiMapID then
for k, task in pairs(C_TaskQuest.GetQuestsForPlayerByMapID(uiMapID) or {}) do
if task.inProgress then
-- track active world quests
local questID = task.questId
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName then
-- print(k, questID, questName)
ActiveWorldQuests[ questName ] = questID
end
end
end
end
end
function E:PLAYER_LOGIN()
local uiMapID = C_Map.GetBestMapForUnit('player')
if uiMapID then
for _, task in pairs(C_TaskQuest.GetQuestsForPlayerByMapID(uiMapID) or {}) do
if task.inProgress then
local questID = task.questId
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName then
ActiveWorldQuests[questName] = questID
end
end
end
end
end

function E:QUEST_ACCEPTED(questLogIndex, questID, ...)
if questID and C_QuestLog.IsQuestTask(questID) then
-- print('TASK_QUEST_ACCEPTED', questID, questLogIndex, GetQuestLogTitle(questLogIndex))
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName then
ActiveWorldQuests[ questName ] = questID
end
else
-- print('QUEST_ACCEPTED', questID, questLogIndex, GetQuestLogTitle(questLogIndex))
end
E:UNIT_QUEST_LOG_CHANGED()
end

function E:QUEST_REMOVED(questID)
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName and ActiveWorldQuests[ questName ] then
ActiveWorldQuests[ questName ] = nil
-- print('TASK_QUEST_REMOVED', questID, questName)
-- get task progress when it's updated to display on the nameplate
-- C_TaskQuest.GetQuestProgressBarInfo
end
E:UNIT_QUEST_LOG_CHANGED()
end

function E:QUEST_WATCH_LIST_CHANGED(questID, added)
E:QUEST_ACCEPTED(nil, questID)
end
function E:QUEST_ACCEPTED(questLogIndex, questID, ...)
if questID and C_QuestLog.IsQuestTask(questID) then
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName then
ActiveWorldQuests[questName] = questID
end
end
E:UNIT_QUEST_LOG_CHANGED()
end

function E:QUEST_REMOVED(questID)
local questName = C_TaskQuest.GetQuestInfoByQuestID(questID)
if questName and ActiveWorldQuests[questName] then
ActiveWorldQuests[questName] = nil
end
E:UNIT_QUEST_LOG_CHANGED()
end

function E:QUEST_WATCH_LIST_CHANGED(questID, added)
E:QUEST_ACCEPTED(nil, questID)
end
end



local OurName = UnitName('player')
--local QuestPlateTooltip = CreateFrame('GameTooltip', 'QuestPlateTooltip', nil, 'GameTooltipTemplate')
QuestLogIndex = {} -- [questName] = questLogIndex, this is to "quickly" look up quests from its name in the tooltip
QuestLogIndex = {}

function GetQuestProgress(unitID)
-- TODO: Refactor this mess
if not C_QuestLog.UnitIsRelatedToActiveQuest(unitID) then return end

local tooltipData = C_TooltipInfo.GetUnit(unitID)
local progressGlob -- concatenated glob of quest text
local questType -- 1 for player, 2 for group
local progressGlob
local questType
local objectiveCount = 0
local questTexture -- if usable item
local questLogIndex -- should generally be set, index usable with questlog functions
local questLogIndex
local questID

for i = 3, #tooltipData.lines do
local line = tooltipData.lines[i]
TooltipUtil.SurfaceArgs(line)

if line.type == 17 and line.id then -- Tooltip line is a quest header..?
--if not text then return end
-- Check if TooltipUtil.SurfaceArgs exists
if TooltipUtil and TooltipUtil.SurfaceArgs then
TooltipUtil.SurfaceArgs(line)
else
-- Fallback logic if SurfaceArgs is not available
end

if line.type == 17 and line.id then
local text, objectiveType, finished = GetQuestObjectiveInfo(line.id, 1, false)
questID = questID or line.id or text and ActiveWorldQuests[ text ]
--local playerName, progressText = strmatch(text, '^(.-)(.+)$') -- nil or '' if 1 is missing but 2 is there
questID = questID or line.id or text and ActiveWorldQuests[text]
local playerName = ""
local progressText = text
local isQuestText = not not progressText

-- todo: if multiple entries are present, ONLY read the quest objectives for the player
-- if a name is listed in the pattern then we must be in a group
if playerName and playerName ~= '' and playerName ~= OurName then -- quest is for another group member

if playerName and playerName ~= '' and playerName ~= OurName then
if not questType then
questType = 2
end
Expand All @@ -132,26 +114,24 @@ function GetQuestProgress(unitID)
local x, y = strmatch(progressText, '(%d+)/(%d+)')
if x and y then
local numLeft = y - x
if numLeft > objectiveCount then -- track highest number of objectives
if numLeft > objectiveCount then
objectiveCount = numLeft
end
else
local progress = tonumber(strmatch(progressText, '([%d%.]+)%%')) -- tooltip actually contains progress %
local progress = tonumber(strmatch(progressText, '([%d%.]+)%%'))
if progress and progress <= 100 then
local questID = ActiveWorldQuests[ text ] -- not a guarantee
local questType = 3
return text, questType, ceil(100 - progress), questID
end
end
--local x, y = strmatch(progressText, '(%d+)/(%d+)$')

if not x or (x and y and x ~= y) then
progressGlob = progressGlob and progressGlob .. '\n' .. progressText or progressText
end
elseif ActiveWorldQuests[text] then
local questID = ActiveWorldQuests[ text ]
local progress = C_TaskQuest.GetQuestProgressBarInfo(questID) -- or GetQuestProgressBarPercent(questID) -- not sure what the difference is between these functions
local progress = C_TaskQuest.GetQuestProgressBarInfo(questID)
if progress then
local questType = 3 -- progress bar
local questType = 3
return text, questType, ceil(100 - progress), questID
end
elseif QuestLogIndex[text] then
Expand All @@ -164,6 +144,7 @@ function GetQuestProgress(unitID)
return progressGlob, progressGlob and 1 or questType, objectiveCount, questLogIndex, questID
end


local QuestPlates = {} -- [plate] = f
function E:OnNewPlate(f, plate)
local frame = CreateFrame('frame', nil, f)
Expand Down Expand Up @@ -384,4 +365,4 @@ function E:ADDON_LOADED(loadedAddon)
end
self:UnregisterEvent("ADDON_LOADED")
end
end
end
14 changes: 11 additions & 3 deletions QuestPlates.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
## Interface: 100002
## Interface: 110007
## Title: QuestPlates
## Notes: Adds quest progress to nameplates
## Version: 10.0.2.1
## Author: Semlar
## Version: v5.4.6
## Author: Semlar, DonnieDice
## SavedVariables: QuestPlateSettings
## IconTexture: Interface\AddOns\QuestPlates\images\icon

## X-Category: UI Media, Questing & Leveling, Audio & Video, Miscellaneous
## X-Website: https://github.com/donniedice/QuestPlates
## X-Curse-Project-ID: 1110009
## X-Wago-ID:
## X-WoWI-ID:

semlib\semlib.xml
QuestPlates.lua
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[![](https://img.shields.io/static/v1?label=Donate&message=CashApp&color=brightgreen)](https://bit.ly/3fyxxSU)

# QuestPlates (Fork)

## Overview
**QuestPlates** is an addon for World of Warcraft that enhances nameplates by displaying quest objectives directly on enemy health bars. This fork builds upon Simlar’s original addon with performance improvements and updated compatibility for modern WoW expansions.

---

## Features
- **Quest Objectives on Nameplates:** Displays the remaining mobs to kill or items to collect directly on the nameplate.
- **Customizable Settings:** Modify the position, size, and appearance of quest icons using simple commands.
- **Compatibility with Other Nameplate Addons:** Works seamlessly with TidyPlates, KuiNameplates, and Blizzard default nameplates.

---

## Usage

To customize icon position and size, use the following commands:

- Move the quest icon from the left to the right side of the nameplate:
`" /run QuestPlateSettings.AnchorPoint = 'LEFT'; QuestPlateSettings.RelativeTo = 'RIGHT'; ReloadUI() "`

- Adjust the X (horizontal) and Y (vertical) offsets:
`" /run QuestPlateSettings.OffsetX = -10; QuestPlateSettings.OffsetY = 5; ReloadUI() "`

- Reset settings to default:
`" /run QuestPlateSettings = nil; ReloadUI() "`

---

## Compatibility
- **Retail (The War Within)**

---

## Installation
1. Download the addon from [CurseForge](https://legacy.curseforge.com/wow/addons/questplates-tww).
2. Extract the downloaded file into the appropriate World of Warcraft AddOns directory:
- For **Dragonflight**: `World of Warcraft/_retail_/Interface/AddOns`
- For **Classic Cataclysm**: `World of Warcraft/_classic_/Interface/AddOns`
- For **Classic WoW**: `World of Warcraft/_classic_era_/Interface/AddOns`
3. Restart World of Warcraft and enable the addon in the AddOns menu.

---

## Support the Project

### ☕️ Buy Me a Coffee
If you enjoy this addon and would like to support its development, consider buying me a coffee. Your contributions help me maintain and improve this project!

[![Buy Me a Coffee](https://img.shields.io/badge/☕️-Buy%20Me%20a%20Coffee-orange?style=flat-square&logo=buy-me-a-coffee)](https://www.buymeacoffee.com/donniedice)

---

## Stay Connected

### 💸 Support:
[![Donate via CashApp](https://img.shields.io/static/v1?label=Donate&message=CashApp&color=brightgreen)](https://bit.ly/3fyxxSU)

### 💬 Follow:
- Follow me on [GitHub](https://github.com/donniedice)

### ⭐️ Show Your Support:
- Star this project on [GitHub](https://github.com/donniedice/QuestPlates) ⭐️
- Share it with your friends and guildmates 📢
1 change: 1 addition & 0 deletions docs/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated - ToC for _retail_ - [ToC.110007]
Loading