Apply Patch

This commit is contained in:
2026-10-30 20:06:32 +00:00
parent 439156479a
commit 48d45f8fe6
57 changed files with 862 additions and 15212 deletions
+8
View File
@@ -0,0 +1,8 @@
* text=auto eol=lf
*.tga -text
*.blp -text
*.jpg -text
*.jpeg -text
*.png -text
*.gif -text
*.zip -text
+4
View File
@@ -0,0 +1,4 @@
*.bak
*.tmp
.DS_Store
Thumbs.db
+73
View File
@@ -0,0 +1,73 @@
# ClassicAPI integration updates
These changes use newer ClassicAPI features while retaining older fallback paths.
ClassicAPI v1.17.6 was the latest release reviewed on 2026-10-24. Update both
ClassicAPI's DLL and its bundled `!!!ClassicAPI` addon together, following its
installation instructions; a DLL update needs a full client restart.
## Changes
- **Health correctness:** `UnitHealthMissing` returns a deficit in the same units
as the health getters. It can be a percentage, so it is no longer used to infer
absolute health. Direct health and the existing combat-estimation cache remain.
- **Chat identity:** `GetPlayerInfoByGUID` supplies the name in return position 6.
The synchronous class fallback now checks that name against the requested player.
- **Cooldown rendering:** Target Debuff Timer creates native `Cooldown` frames on
ClassicAPI 1.17.1+, retaining `Model` frames on older builds. Numeric timers and
the existing timer dispatcher are preserved.
- **Unit event filtering:** health/power overlays register only player, target and
pet unit events; the health estimator and target castbar register only target
unit events. Older clients without `RegisterUnitEvent` use plain registration
and their existing handler-side checks.
- **Chat payload:** spam filtering and passive sender collection read
`GetCurrentChatEvent` when available. The filter uses local payload values and
does not overwrite shared `arg1`/`arg2` globals. The older global path remains.
- **Player-cache duplication:** when native persistence is already enabled and
`C_PlayerCache.RememberPlayer` succeeds, new chat-only sightings do not also
create ShaguTweaks SavedVariables records. Native class-only lookups can avoid
creating another record. Existing records, raw levels and social history stay
intact. With persistence off or native storage unavailable, the original Lua
cache behavior remains. The addon never enables native persistence itself.
## Measuring performance
On current ClassicAPI, the following prints ShaguTweaks' Lua memory in KiB:
```lua
/script UpdateAddOnMemoryUsage(); DEFAULT_CHAT_FRAME:AddMessage(GetAddOnMemoryUsage("ShaguTweaks"))
```
Memory readings include uncollected objects. For comparisons, collect through
GentleGC first and measure at the same point after login and after playing.
Texture/native allocations are not equivalent to this Lua-memory counter.
For a short CPU investigation:
1. Run `/console scriptProfile 1`, then `/reload`.
2. Run `/script ResetCPUUsage()` and play through a representative encounter.
3. Read the total CPU time in milliseconds:
`/script UpdateAddOnCPUUsage(); DEFAULT_CHAT_FRAME:AddMessage(GetAddOnCPUUsage("ShaguTweaks"))`
4. Run `/console scriptProfile 0`, then `/reload` when finished.
Profiling adds overhead. Compare the same workload and measurement duration;
the cumulative CPU number alone is not an FPS measurement. Profiling is not
turned on by this addon.
## Verification
Lua 5.1 syntax checks cover all addon Lua files. Mocked regression checks cover:
unknown percentage health, valid cached estimates, direct health, native and
fallback unit-event registration, sixth-return chat identity and name mismatch,
native chat payload with corrupted globals, duplicate filtering, native/legacy
cooldown creation, and persistence enabled/disabled while retaining levels and
history. Existing health overlays and English-only load-list checks also pass.
These checks do not replace in-game rendering, event-order and combat testing;
no memory/FPS improvement is claimed without a live measurement.
## Primary references
- [ClassicAPI v1.17.6](https://github.com/brues-code/ClassicAPI/releases/tag/v1.17.6)
- [API reference](https://github.com/brues-code/ClassicAPI/blob/v1.17.6/docs/API.md)
- [Native cooldown rendering](https://github.com/brues-code/ClassicAPI/commit/b83bb5b52b11ffd51dd59aa7465b1185222f2bd4)
- [Reliable chat payload](https://github.com/brues-code/ClassicAPI/commit/b5aed30a5db5ef033dd9a6619d8f74310787c4c9)
- [Native player-name lookup](https://github.com/brues-code/ClassicAPI/commit/c7bb90895f8802ba837833d5ad1f9acbe0afece4)
+55
View File
@@ -0,0 +1,55 @@
# Modern power bars
Modern Class Colors uses precolored retail resource fills, with frame-specific variants of ModernPowerMana.tga, ModernPowerRage.tga, ModernPowerFocus.tga and ModernPowerEnergy.tga. Each bar uses white vertex tint (1, 1, 1), preserving the native artwork's colors and gradient. Flat PowerBarColor tints multiplied by the old grayscale texture made mana too dark.
## Verified source
- Blizzard client build 12.1.5.70448, interface/hud/uiunitframe2x.blp, FileDataID 4642466.
- Download: https://wago.tools/api/casc/4642466?version=12.1.5.70448
- Atlas coordinates: https://github.com/Ketho/BlizzardInterfaceResources/blob/f3b334b33bd19fa6a0250f7922ecfa83db7fe356/Resources/AtlasInfo.lua
- Retail application uses the resource atlas and white tint: https://github.com/Gethe/wow-ui-source/blob/live/Interface/AddOns/Blizzard_UnitFrame/Mainline/UnitFrame.lua
## Frame-specific fitting
Player bars use the player artwork. Warlock mana uses the rectangular ClassResource variant seen in retail warlock frames; rogue/druid energy uses the corresponding energy variant. Other player resources retain the standard player artwork. These are visual choices for the Vanilla client; retail specialization/resource mechanics are not imported.
Target bars use Target artwork. Pet and target-of-target bars use the smaller TargetofTarget artwork. Party bars use Party artwork from interface/hud/uipartyframe.blp (FileDataID 4681512), downloaded from https://wago.tools/api/casc/4681512?version=12.1.5.70448 . Both sheets use the same build and pinned atlas metadata above.
The crops include the native dark edges and endcaps. Bilinear resizing (instead of Lanczos) avoids sharpening overshoot, and export dimensions are closer to the smaller Vanilla bars. White vertex tint is retained. A solid black BACKGROUND texture behind each styled power bar prevents the underlying Vanilla backing from tinting transparent edges and provides a neutral empty portion; it hides for missing units and unknown resource types. Frame sizes, positions, health artwork and gold text are unchanged. Animated retail sparks, retail frame borders and masks are not included, so a pixel-perfect match to every BetterBlizzFrames profile is not promised.
Exact source crops use exclusive right/bottom edges:
| Asset | Sheet | Left | Top | Right | Bottom | Export |
| --- | --- | --- | --- | --- | --- | --- |
| ModernPowerEnergy.tga | uiunitframe2x | 1667 | 479 | 1915 | 499 | 128x16 |
| ModernPowerFocus.tga | uiunitframe2x | 387 | 501 | 635 | 521 | 128x16 |
| ModernPowerMana.tga | uiunitframe2x | 637 | 501 | 885 | 521 | 128x16 |
| ModernPowerRage.tga | uiunitframe2x | 1137 | 501 | 1385 | 521 | 128x16 |
| ModernPowerEnergyClass.tga | uiunitframe2x | 1637 | 501 | 1885 | 521 | 128x16 |
| ModernPowerManaClass.tga | uiunitframe2x | 387 | 523 | 635 | 543 | 128x16 |
| ModernPowerEnergyTarget.tga | uiunitframe2x | 1666 | 415 | 1934 | 435 | 256x16 |
| ModernPowerFocusTarget.tga | uiunitframe2x | 387 | 457 | 655 | 477 | 256x16 |
| ModernPowerManaTarget.tga | uiunitframe2x | 657 | 457 | 925 | 477 | 256x16 |
| ModernPowerRageTarget.tga | uiunitframe2x | 1197 | 457 | 1465 | 477 | 256x16 |
| ModernPowerEnergySmall.tga | uiunitframe2x | 1607 | 151 | 1755 | 165 | 128x16 |
| ModernPowerFocusSmall.tga | uiunitframe2x | 1757 | 151 | 1905 | 165 | 128x16 |
| ModernPowerManaSmall.tga | uiunitframe2x | 1857 | 337 | 2005 | 351 | 128x16 |
| ModernPowerRageSmall.tga | uiunitframe2x | 1163 | 441 | 1311 | 455 | 128x16 |
| ModernPowerEnergyParty.tga | uipartyframe | 70 | 179 | 144 | 186 | 128x8 |
| ModernPowerFocusParty.tga | uipartyframe | 146 | 179 | 220 | 186 | 128x8 |
| ModernPowerManaParty.tga | uipartyframe | 1 | 191 | 75 | 198 | 128x8 |
| ModernPowerRageParty.tga | uipartyframe | 153 | 191 | 227 | 198 | 128x8 |
BetterBlizzFrames can retain the native game artwork when custom power textures are disabled, or replace it with a user-selected SharedMedia texture. These assets reproduce native retail fills, not an arbitrary BetterBlizzFrames saved profile.
Unknown/custom resource types retain their original texture and tint. Shapeshifts and target changes reselect the appropriate resource texture. Disabling Modern and reloading restores stock behavior. Gold numbers are unchanged.
Restart WoW after installation so new texture files are available. Lua 5.1 mock checks cover all four resource transitions, frame-family and class-variant selection, white tint enforcement, pet/party bars, missing-unit and unknown-resource background cleanup, disabled behavior and repeated initialization. Actual in-game rendering remains to be checked.
## Rectangular mana slots
All Modern mana bars now use ModernPowerManaClass.tga, the native rectangular retail mana fill. The regular retail target/small/party art has angled transparent corners that leave wedges inside Vanilla's rectangular mana slots. Sharing the rectangular fill fixes that gap for all classes and supported frames, while preserving white tint, the retail blue gradient, frame dimensions and text. Other resources retain their frame-specific variants.
## Druid secondary mana bar
PlayerFrameAlternatePowerBar uses the same rectangular light-blue mana fill and white tint. Its resource type is fixed to mana while the primary player bar changes to rage or energy. This is independent of the white-number option. The temporary deep-blue tint experiment was reverted.
+187
View File
@@ -0,0 +1,187 @@
# 🧩 ShaguTweaks — ClassicAPI
A lightweight fork of [ShaguTweaks](https://github.com/shagu/ShaguTweaks) for **Turtle WoW-like servers**.
Focused on **stability, compatibility and performance** while keeping the original ShaguTweaks experience.
> This fork requires ClassicAPI and targets **Turtle WoW-like server/client environments**.
## 🔌 Requirements
- **[ClassicAPI](https://github.com/brues-code/ClassicAPI) — required**
- **[SuperWoW](https://github.com/balakethelock/SuperWoW) — optional / recommended**
ClassicAPI is the main API layer. SuperWoW is only used as an additional fallback for some cast/GUID information.
## 📦 Installation
1. Install **ClassicAPI**.
2. Optionally install **SuperWoW**.
3. Rename the addon folder to `ShaguTweaks`.
4. Copy it to `World of Warcraft\Interface\AddOns\ShaguTweaks`.
5. Restart the game.
Settings: **Esc → Advanced Options**.
## ✨ Main changes
- ClassicAPI-backed integration for casts, auras, items and unit data.
- Reduced per-frame work, tooltip scans and repeated UI updates.
- Event-driven target and nameplate castbars where possible.
- Safer GUID-based handling for same-name enemies.
- Better Turtle WoW-like server compatibility for custom items, spells and UI changes.
- Safer hooks and fewer destructive global overrides.
- Expanded Item Rarity Borders support for merchant, quest, mail, trade, crafting and loot frames.
- Added independent Item Rarity Glows using the shared item rarity engine.
- Expanded Movable Unit Frames to handle Player, Target, Party, Minimap, Buffs, Debuffs and Weapon Buffs through one shared Ctrl+Shift mover and alignment grid.
- Restored Real Health Numbers as an independent module, with direct values when available and a lazy Vanilla health estimator fallback for percentage-only targets.
- Unit Frame Big Health is presentation-only again and no longer forces numeric health/power text.
- Various stability fixes across legacy ShaguTweaks modules.
## 🔷 Mods using ClassicAPI directly
- Actionbar Range Color
- AoE Loot
- Auto Dismount
- Chat Tweaks
- Equip Compare
- Free Slots
- Improved Castbar
- Item Rarity Borders
- Item Rarity Glows
- Movable Unit Frames
- Real Health Numbers
- Nameplate Class Colors
- Nameplate Castbar
- No Toggle
- Sell Junk
- Skip Gossip Text
- Enemy Target Castbar
- Tooltip Details
- WorldMap Window
Other modules can also benefit indirectly from ClassicAPI through shared ShaguTweaks libraries and caches.
## ⚙️ Modules
### Action Bar
- Auto Dismount
- Auto Stance
- Actionbar Range Color
- Cooldown Numbers
- Hide Gryphons
- Improved Castbar
- No Toggle Auto-Attack
- Reduced Actionbar
### Unit Frames
- Big Health
- Class Colors
- Class Portraits
- Energy & Mana Tick
- Health Colors
- Movable Unit Frames
- Real Health Numbers
- Enemy Target Castbar
- Target Debuff Timer
### Nameplates
- Nameplate Scale
- Nameplate Class Colors
- Nameplate Castbar
### Tooltip & Items
- Equip Compare
- Free Slots
- Item Rarity Borders
- Item Rarity Glows
- Sell Junk
- Tooltip Details
- Vendor Values
### Chat & Social
- Blue Shaman Class Colors
- Chat Tweaks
- Chat Levels
- Chat Spam Filter
- Social Colors
### Minimap & World Map
- Clean Minimap
- Minimap Clock
- Minimap Square
- Minimap Tweaks
- Minimap Zoom
- Hide Tracking Icon
- WorldMap Class Colors
- WorldMap Coordinates
- WorldMap Window
### Loot
- AoE Loot
- Improved Roll Frames
- Loot Cursor
### Interface
- Darkened UI
- Hide Errors
- Smaller Error Frame
- XP Bar Text
### General
- Super WoW Compatibility
- Turtle WoW Compatibility
- Skip Gossip Text
## 🔧 Compatibility
- ClassicAPI integration
- Turtle WoW-like server integration
- SuperWoW integration
## 🧹 Removed / integrated modules
The following original ShaguTweaks modules are not included as standalone modules because their functionality is either integrated elsewhere or no longer required:
- **Chat Links** → integrated into **Chat Tweaks**
- **Movable Unit Frames Extended** → integrated into **Movable Unit Frames**
## 📜 Project identity & licensing
This is an independent community project. Compatibility with **World of Warcraft**, **Turtle WoW-like environments**, **ClassicAPI**, **SuperWoW**, or other referenced projects does not imply affiliation, endorsement, sponsorship, or ownership by their respective rights holders or maintainers.
**World of Warcraft** and **Blizzard Entertainment** names, marks, and game assets remain the property of their respective rights holders.
For detailed provenance and licensing information, see:
- [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)
- [PROJECT_IDENTITY.md](PROJECT_IDENTITY.md)
- [Docs/ASSET_PROVENANCE.md](Docs/ASSET_PROVENANCE.md)
- [LICENSES/](LICENSES/)
## 🙏 Credits
Original addon and modules by **Shagu**.
Additional maintenance and Turtle WoW work by **paokkerkir**.
ClassicAPI compatibility fork maintained by **Dusk-92**.
Special thanks to **Sandrea** for providing **AoELoot**, adapted here as the **AoE Loot** module.
Special thanks to **Jesper_92** for reporting issues that helped improve the addon.
Additional code and ideas from **pfUI** and **zUI**.
Extended Movable Unit Frames support adapted from **TokensWorth/ShaguTweaks-mods**, originally released under MIT by **GryllsAddons**. See `THIRD_PARTY_NOTICES.md`.
Released under the original **MIT License**.
-14
View File
@@ -9,23 +9,10 @@
## SavedVariablesPerCharacter: ShaguTweaks_config, ShaguTweaks_cache
# locales
locales\locales_deDE.lua
locales\locales_enUS.lua
locales\locales_esES.lua
locales\locales_frFR.lua
locales\locales_koKR.lua
locales\locales_ruRU.lua
locales\locales_zhCN.lua
# translations
locales\translations_deDE.lua
locales\translations_enUS.lua
locales\translations_esES.lua
locales\translations_frFR.lua
locales\translations_koKR.lua
locales\translations_ruRU.lua
locales\translations_zhCN.lua
locales\translations_zhTW.lua
# basic
main.lua
@@ -72,7 +59,6 @@ mods\target-castbar.lua
mods\target-debufftimer.lua
mods\social-colors.lua
mods\item-colors.lua
mods\health-color.lua
mods\auto-dismount.lua
mods\auto-stance.lua
mods\tooltip-details.lua
+34
View File
@@ -127,3 +127,37 @@ documentation summarizes them.
When replacing or substantially rewriting third-party-derived material, update
the provenance record rather than erasing the earlier history.
## OEVG2 customization and BetterBlizzFrames texture
This repository imports a source snapshot of Dusk/ShaguTweaks-ClassicAPI downloaded on 2026-10-24 and adds English-only loading and unit-frame customizations described in README.md.
`img/BlizzardRetailBar.tga` was obtained from:
https://github.com/Bodify/BetterBlizzFrames/blob/main/media/blizzTex/BlizzardRetailBar.tga
BetterBlizzFrames' repository license states **All Rights Reserved**, copyright (c) 2023-2026 Bodify. This asset is not covered by this repository's original ShaguTweaks MIT license. The source project's notice does not establish separate provenance or permissions for any underlying game artwork.
## Modern mana bar texture
`img/BlizzardRetailBarCrop2.tga` is copied unchanged from BetterBlizzFrames:
https://github.com/Bodify/BetterBlizzFrames/blob/main/media/blizzTex/BlizzardRetailBarCrop2.tga
Source Git blob: `bb412b3fa538a6c91671d06ccbfd1e820f4c2876`.
BetterBlizzFrames: All Rights Reserved, Copyright (c) 2023-2026 Bodify.
This asset retains its original rights and is not relicensed under MIT.
The mana tint follows BetterBlizzFrames' default `PowerBarColor.MANA` lookup:
RGB `(0, 0, 1)`. The selected texture is its `Blizzard Retail Bar Crop 2` preset.
## Native retail resource artwork
`img/ModernPowerMana.tga`, `img/ModernPowerRage.tga`, `img/ModernPowerFocus.tga` and `img/ModernPowerEnergy.tga` are cropped/resized exports of Blizzard's `interface/hud/uiunitframe2x.blp` (FileDataID 4642466), client build 12.1.5.70448, retrieved from https://wago.tools/api/casc/4642466?version=12.1.5.70448 .
Matching atlas metadata and conversion details are recorded in `Docs/MODERN_MANA.md`. These are Blizzard game assets, not original artwork or assets relicensed under the software's MIT license. The previous BetterBlizzFrames grayscale asset attribution remains part of the history.
### Frame-specific resource exports
Additional img/ModernPower*Class.tga, *Target.tga, *Small.tga and *Party.tga variants use the matching Blizzard atlas crops documented in Docs/MODERN_MANA.md. Player/target/small variants come from FileDataID 4642466; party variants come from FileDataID 4681512, interface/hud/uipartyframe.blp. Both were retrieved for build 12.1.5.70448 from wago.tools. All resource exports now use bilinear resizing to compact power-of-two TGA dimensions. These remain Blizzard game artwork; no MIT relicensing is asserted.
+31
View File
@@ -824,3 +824,34 @@ API.UnitInRange = function(unit)
return false, false
end
-- Native cooldown rendering landed in ClassicAPI v1.17.1.
API.nativecooldowns = API.classicapi_version >= 11701
API.RegisterUnitEvent = function(frame, eventName, unit1, unit2, unit3)
if type(frame.RegisterUnitEvent) == "function" then
return frame:RegisterUnitEvent(eventName, unit1, unit2, unit3)
end
return frame:RegisterEvent(eventName)
end
API.GetCurrentChatEvent = function()
if type(_G.GetCurrentChatEvent) == "function" then
return _G.GetCurrentChatEvent()
end
end
-- Never opt into persistent storage on the user's behalf.
API.HasPersistentPlayerCache = function()
return API.playercache and type(_G.C_PlayerCache.IsEnabled) == "function"
and type(_G.C_PlayerCache.RememberPlayer) == "function"
and _G.C_PlayerCache.IsEnabled()
end
API.RememberPlayerInfo = function(name, class, guid)
if API.HasPersistentPlayerCache() and name and class and guid then
return _G.C_PlayerCache.RememberPlayer(guid, name, class) and true or false
end
return false
end
-1
View File
@@ -105,7 +105,6 @@ Block("Real Health Numbers")
Block("Unit Frame Big Health")
Block("Reduced Actionbar Size")
Block("Unit Frame Class Colors")
Block("Unit Frame Health Colors")
Block("Unit Frame Class Portraits")
Block("Enemy Castbars")
+13 -1
View File
@@ -234,7 +234,19 @@ settings.load = function(self)
settings.category[category].text:SetAllPoints()
settings.category[category].text:SetText(category)
for title, module in ShaguTweaks.spairs(entries) do
local orderedTitles = {}
for title in ShaguTweaks.spairs(entries) do
if title ~= "Modern Class Colors" then table.insert(orderedTitles, title) end
end
if entries["Modern Class Colors"] then
local position = table.getn(orderedTitles) + 1
for i, title in ipairs(orderedTitles) do
if title == T["Unit Frame Class Colors"] then position = math.min(i + 2, position); break end
end
table.insert(orderedTitles, position, "Modern Class Colors")
end
for _, title in ipairs(orderedTitles) do
local module = entries[title]
if not settings.entries[title] then
settings.entries[title] = CreateFrame("CheckButton", "AdvancedSettingsGUI" .. title, settings.category[category], "OptionsCheckButtonTemplate")
settings.entries[title]:SetHeight(24)
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+4 -29
View File
@@ -39,8 +39,8 @@ local function StopSampling()
end
local function StartSampling()
libhealth:RegisterEvent("UNIT_COMBAT")
libhealth:RegisterEvent("UNIT_HEALTH")
ShaguTweaks.API.RegisterUnitEvent(libhealth, "UNIT_COMBAT", "target")
ShaguTweaks.API.RegisterUnitEvent(libhealth, "UNIT_HEALTH", "target")
end
local function SelectTarget()
@@ -76,27 +76,8 @@ local function GetCachedHealth(unitstr, cur, max)
return cur, max
end
-- ClassicAPI can expose the real health deficit even when stock UnitHealth()
-- still reports a percentage. Use that as an immediate estimate when possible.
-- At 100% there is no deficit to derive a maximum from, so the historical
-- combat estimator/cache remains useful.
local function GetMissingHealthEstimate(unitstr, cur, max)
if max ~= 100 or cur >= 100 then return end
if type(_G.UnitHealthMissing) ~= "function" then return end
local missing = _G.UnitHealthMissing(unitstr)
local lostPercent = 100 - cur
if not missing or missing <= 0 or lostPercent <= 0 then return end
local estimatedMax = ceil(missing / lostPercent * 100)
if estimatedMax < 100 then return end
local estimatedCur = estimatedMax - missing
if estimatedCur < 0 then estimatedCur = 0 end
return estimatedCur, estimatedMax, true
end
-- UnitHealthMissing follows the same units as UnitHealth/UnitHealthMax.
-- A percentage deficit cannot establish absolute HP; use the combat cache.
function libhealth:GetUnitHealth(unitstr)
-- Preserve the old public library behavior for external consumers while
-- keeping the estimator lazy: the first actual query activates it.
@@ -112,12 +93,6 @@ function libhealth:GetUnitHealth(unitstr)
return cur, max, true
end
local missingCur, missingMax, missingKnown =
GetMissingHealthEstimate(unitstr, cur, max)
if missingKnown then
return missingCur, missingMax, true
end
return GetCachedHealth(unitstr, cur, max)
end
+23 -2
View File
@@ -316,7 +316,7 @@ local function EnrichPlayerFromCurrentChat(name)
local guid = API.GetCurrentChatGUID()
if not guid or guid == "" then return end
local apiName, class = API.GetPlayerInfoByGUID(guid)
local _, class, _, _, _, apiName = API.GetPlayerInfoByGUID(guid)
class = class and class ~= "" and class or nil
if not apiName or apiName == "" or not class then return end
if string.lower(apiName) ~= string.lower(name) then return end
@@ -333,6 +333,19 @@ function ShaguTweaks.GetUnitData(name, active)
EnsurePlayerCache()
-- Persistent ClassicAPI data can answer class-only queries without making
-- another SavedVariables record. Keep our level and social history fields.
if (not units.players[name] or not units.players[name].class)
and API and API.HasPersistentPlayerCache and API.HasPersistentPlayerCache() then
local _, class, _, _, _, resolvedName, _, guid = API.GetCachedPlayerInfoByName(name)
if class and class ~= "" and resolvedName
and string.lower(resolvedName) == string.lower(name)
and API.RememberPlayerInfo(resolvedName, class, guid) then
local data = units.players[name]
return class, data and data.level, data and data.elite, true
end
end
if not units["players"][name] then
EnrichPlayerFromClassicAPI(name)
if not units["players"][name] then
@@ -386,6 +399,11 @@ local function RememberPlayer(name)
class = apiClass and apiClass ~= "" and apiClass or nil
end
-- Skip only NEW chat-only records after native persistent storage succeeds.
-- Existing records may contain levels/history and must retain timestamps.
if not units.players[name] and API and API.RememberPlayerInfo
and API.RememberPlayerInfo(name, class, guid) then return end
units.players[name] = units.players[name] or {}
units.players[name].class = class or units.players[name].class
units.players[name].guid = guid or units.players[name].guid
@@ -446,6 +464,9 @@ for chatEvent in pairs(passiveChatEvents) do
end
libunitscan:SetScript("OnEvent", function()
local event = event
local chatEvent, _, chatSender = API.GetCurrentChatEvent()
if chatEvent then event = chatEvent end
if event == "PLAYER_LOGOUT" then
-- SavedVariables are written after this event. Re-run the migration here so
-- even a legacy addon path that recreated ShaguTweaks_cache.players during
@@ -488,7 +509,7 @@ libunitscan:SetScript("OnEvent", function()
elseif passiveChatEvents[event] then
-- Passive cache only: remember speakers already delivered by the client.
-- No /who, no TargetByName queue, no timer and no additional server query.
RememberPlayer(arg2)
RememberPlayer(chatSender or arg2)
elseif event == "FRIENDLIST_UPDATE" then
local name, class, level
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["deDE"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = nil,
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil,
["Adds a small 24h clock to the mini map."] = nil,
["Adds class colors to the player, target and party unit frames."] = nil,
["Adds compatibility to Turtle WoW's custom changes."] = nil,
["Adds coordinates to the bottom of the World Map."] = nil,
["Advanced Options"] = nil,
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil,
["Auto Dismount"] = nil,
["Automatically dismounts whenever a spell is casted."] = nil,
["Automatically switch to the required warrior or druid stance on spell cast."] = nil,
["Auto Stance"] = nil,
["Blue Shaman Class Colors"] = nil,
["Change health text color based on its value."] = nil,
["Changes the class color code of shamans to blue, as known from TBC+."] = nil,
["Changes the nameplate health bar color to the class color."] = nil,
["Chat Hyperlinks"] = nil,
["Chat Tweaks"] = nil,
["Clock"] = nil,
["Cooldown Numbers"] = nil,
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil,
["Cursor"] = nil,
["Darkened UI"] = nil,
["Debuff Timer"] = nil,
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil,
["Display the remaining duration as text on every cooldown."] = nil,
["Draw the mini map in a squared shape instead of a round one."] = nil,
["Enemy Castbars"] = nil,
["Equip Compare"] = nil,
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil,
["General"] = nil,
["Hide Errors"] = nil,
["Hide Gryphons"] = nil,
["Hides and ignores all Lua errors produced by broken addons."] = nil,
["Hides the gryphons left and right of the action bar."] = nil,
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil,
["Increases the healthbar of the player and target unitframe."] = nil,
["Item Rarity Borders"] = nil,
["Localtime"] = nil,
["Makes all nameplates honor the UI-Scale setting."] = nil,
["MiniMap Clock"] = nil,
["MiniMap Square"] = nil,
["MiniMap Tweaks"] = nil,
["Movable Unit Frames"] = nil,
["N/A"] = nil,
["Nameplate Castbar"] = nil,
["Nameplate Class Colors"] = nil,
["Nameplate Scale"] = nil,
["Nameplates"] = nil,
["Player"] = nil,
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = nil,
["Real Health Numbers"] = nil,
["Reduced Actionbar Size"] = nil,
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil,
["Replace unitframe portraits with class icons."] = nil,
["Sell Grey Items"] = nil,
["Sell Junk"] = nil,
["Servertime"] = nil,
["Show class colored circles on world and battlefield map."] = nil,
["Show class colors in Who, Guild, Friends and Chat."] = nil,
["Show debuff durations on the target unit frame."] = nil,
["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil,
["Shows an enemy castbar on target unit frame."] = nil,
["Shows currently equipped items on tooltips while the shift key is pressed."] = nil,
["Shows the vendor sell values on all item tooltips."] = nil,
["Social & Chat"] = nil,
["Social Colors"] = nil,
["Tooltip Details"] = nil,
["Tooltip & Items"] = nil,
["Turns the entire interface into darker colors."] = nil,
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = nil,
["Turtle WoW Compatibility"] = nil,
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
["WorldMap Coordinates"] = nil,
["WorldMap Window"] = nil,
["World & MiniMap"] = nil,
["Your vendor trash has been sold and you earned"] = nil,
}
-1
View File
@@ -75,7 +75,6 @@ ShaguTweaks_translation["enUS"] = {
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["esES"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = nil,
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil,
["Adds a small 24h clock to the mini map."] = nil,
["Adds class colors to the player, target and party unit frames."] = nil,
["Adds compatibility to Turtle WoW's custom changes."] = nil,
["Adds coordinates to the bottom of the World Map."] = nil,
["Advanced Options"] = nil,
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil,
["Auto Dismount"] = nil,
["Automatically dismounts whenever a spell is casted."] = nil,
["Automatically switch to the required warrior or druid stance on spell cast."] = nil,
["Auto Stance"] = nil,
["Blue Shaman Class Colors"] = nil,
["Change health text color based on its value."] = nil,
["Changes the class color code of shamans to blue, as known from TBC+."] = nil,
["Changes the nameplate health bar color to the class color."] = nil,
["Chat Hyperlinks"] = nil,
["Chat Tweaks"] = nil,
["Clock"] = nil,
["Cooldown Numbers"] = nil,
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil,
["Cursor"] = nil,
["Darkened UI"] = nil,
["Debuff Timer"] = nil,
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil,
["Display the remaining duration as text on every cooldown."] = nil,
["Draw the mini map in a squared shape instead of a round one."] = nil,
["Enemy Castbars"] = nil,
["Equip Compare"] = nil,
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil,
["General"] = nil,
["Hide Errors"] = nil,
["Hide Gryphons"] = nil,
["Hides and ignores all Lua errors produced by broken addons."] = nil,
["Hides the gryphons left and right of the action bar."] = nil,
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil,
["Increases the healthbar of the player and target unitframe."] = nil,
["Item Rarity Borders"] = nil,
["Localtime"] = nil,
["Makes all nameplates honor the UI-Scale setting."] = nil,
["MiniMap Clock"] = nil,
["MiniMap Square"] = nil,
["MiniMap Tweaks"] = nil,
["Movable Unit Frames"] = nil,
["N/A"] = nil,
["Nameplate Castbar"] = nil,
["Nameplate Class Colors"] = nil,
["Nameplate Scale"] = nil,
["Nameplates"] = nil,
["Player"] = nil,
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = nil,
["Real Health Numbers"] = nil,
["Reduced Actionbar Size"] = nil,
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil,
["Replace unitframe portraits with class icons."] = nil,
["Sell Grey Items"] = nil,
["Sell Junk"] = nil,
["Servertime"] = nil,
["Show class colored circles on world and battlefield map."] = nil,
["Show class colors in Who, Guild, Friends and Chat."] = nil,
["Show debuff durations on the target unit frame."] = nil,
["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil,
["Shows an enemy castbar on target unit frame."] = nil,
["Shows currently equipped items on tooltips while the shift key is pressed."] = nil,
["Shows the vendor sell values on all item tooltips."] = nil,
["Social & Chat"] = nil,
["Social Colors"] = nil,
["Tooltip Details"] = nil,
["Tooltip & Items"] = nil,
["Turns the entire interface into darker colors."] = nil,
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = nil,
["Turtle WoW Compatibility"] = nil,
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
["WorldMap Coordinates"] = nil,
["WorldMap Window"] = nil,
["World & MiniMap"] = nil,
["Your vendor trash has been sold and you earned"] = nil,
}
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["frFR"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = nil,
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil,
["Adds a small 24h clock to the mini map."] = nil,
["Adds class colors to the player, target and party unit frames."] = nil,
["Adds compatibility to Turtle WoW's custom changes."] = nil,
["Adds coordinates to the bottom of the World Map."] = nil,
["Advanced Options"] = nil,
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil,
["Auto Dismount"] = nil,
["Automatically dismounts whenever a spell is casted."] = nil,
["Automatically switch to the required warrior or druid stance on spell cast."] = nil,
["Auto Stance"] = nil,
["Blue Shaman Class Colors"] = nil,
["Change health text color based on its value."] = nil,
["Changes the class color code of shamans to blue, as known from TBC+."] = nil,
["Changes the nameplate health bar color to the class color."] = nil,
["Chat Hyperlinks"] = nil,
["Chat Tweaks"] = nil,
["Clock"] = nil,
["Cooldown Numbers"] = nil,
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil,
["Cursor"] = nil,
["Darkened UI"] = nil,
["Debuff Timer"] = nil,
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil,
["Display the remaining duration as text on every cooldown."] = nil,
["Draw the mini map in a squared shape instead of a round one."] = nil,
["Enemy Castbars"] = nil,
["Equip Compare"] = nil,
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil,
["General"] = nil,
["Hide Errors"] = nil,
["Hide Gryphons"] = nil,
["Hides and ignores all Lua errors produced by broken addons."] = nil,
["Hides the gryphons left and right of the action bar."] = nil,
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil,
["Increases the healthbar of the player and target unitframe."] = nil,
["Item Rarity Borders"] = nil,
["Localtime"] = nil,
["Makes all nameplates honor the UI-Scale setting."] = nil,
["MiniMap Clock"] = nil,
["MiniMap Square"] = nil,
["MiniMap Tweaks"] = nil,
["Movable Unit Frames"] = nil,
["N/A"] = nil,
["Nameplate Castbar"] = nil,
["Nameplate Class Colors"] = nil,
["Nameplate Scale"] = nil,
["Nameplates"] = nil,
["Player"] = nil,
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = nil,
["Real Health Numbers"] = nil,
["Reduced Actionbar Size"] = nil,
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil,
["Replace unitframe portraits with class icons."] = nil,
["Sell Grey Items"] = nil,
["Sell Junk"] = nil,
["Servertime"] = nil,
["Show class colored circles on world and battlefield map."] = nil,
["Show class colors in Who, Guild, Friends and Chat."] = nil,
["Show debuff durations on the target unit frame."] = nil,
["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil,
["Shows an enemy castbar on target unit frame."] = nil,
["Shows currently equipped items on tooltips while the shift key is pressed."] = nil,
["Shows the vendor sell values on all item tooltips."] = nil,
["Social & Chat"] = nil,
["Social Colors"] = nil,
["Tooltip Details"] = nil,
["Tooltip & Items"] = nil,
["Turns the entire interface into darker colors."] = nil,
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = nil,
["Turtle WoW Compatibility"] = nil,
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
["WorldMap Coordinates"] = nil,
["WorldMap Window"] = nil,
["World & MiniMap"] = nil,
["Your vendor trash has been sold and you earned"] = nil,
}
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["koKR"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = nil,
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil,
["Adds a small 24h clock to the mini map."] = nil,
["Adds class colors to the player, target and party unit frames."] = nil,
["Adds compatibility to Turtle WoW's custom changes."] = nil,
["Adds coordinates to the bottom of the World Map."] = nil,
["Advanced Options"] = nil,
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil,
["Auto Dismount"] = nil,
["Automatically dismounts whenever a spell is casted."] = nil,
["Automatically switch to the required warrior or druid stance on spell cast."] = nil,
["Auto Stance"] = nil,
["Blue Shaman Class Colors"] = nil,
["Change health text color based on its value."] = nil,
["Changes the class color code of shamans to blue, as known from TBC+."] = nil,
["Changes the nameplate health bar color to the class color."] = nil,
["Chat Hyperlinks"] = nil,
["Chat Tweaks"] = nil,
["Clock"] = nil,
["Cooldown Numbers"] = nil,
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil,
["Cursor"] = nil,
["Darkened UI"] = nil,
["Debuff Timer"] = nil,
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil,
["Display the remaining duration as text on every cooldown."] = nil,
["Draw the mini map in a squared shape instead of a round one."] = nil,
["Enemy Castbars"] = nil,
["Equip Compare"] = nil,
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil,
["General"] = nil,
["Hide Errors"] = nil,
["Hide Gryphons"] = nil,
["Hides and ignores all Lua errors produced by broken addons."] = nil,
["Hides the gryphons left and right of the action bar."] = nil,
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil,
["Increases the healthbar of the player and target unitframe."] = nil,
["Item Rarity Borders"] = nil,
["Localtime"] = nil,
["Makes all nameplates honor the UI-Scale setting."] = nil,
["MiniMap Clock"] = nil,
["MiniMap Square"] = nil,
["MiniMap Tweaks"] = nil,
["Movable Unit Frames"] = nil,
["N/A"] = nil,
["Nameplate Castbar"] = nil,
["Nameplate Class Colors"] = nil,
["Nameplate Scale"] = nil,
["Nameplates"] = nil,
["Player"] = nil,
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = nil,
["Real Health Numbers"] = nil,
["Reduced Actionbar Size"] = nil,
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil,
["Replace unitframe portraits with class icons."] = nil,
["Sell Grey Items"] = nil,
["Sell Junk"] = nil,
["Servertime"] = nil,
["Show class colored circles on world and battlefield map."] = nil,
["Show class colors in Who, Guild, Friends and Chat."] = nil,
["Show debuff durations on the target unit frame."] = nil,
["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil,
["Shows an enemy castbar on target unit frame."] = nil,
["Shows currently equipped items on tooltips while the shift key is pressed."] = nil,
["Shows the vendor sell values on all item tooltips."] = nil,
["Social & Chat"] = nil,
["Social Colors"] = nil,
["Tooltip Details"] = nil,
["Tooltip & Items"] = nil,
["Turns the entire interface into darker colors."] = nil,
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = nil,
["Turtle WoW Compatibility"] = nil,
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
["WorldMap Coordinates"] = nil,
["WorldMap Window"] = nil,
["World & MiniMap"] = nil,
["Your vendor trash has been sold and you earned"] = nil,
}
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["ruRU"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = "Добавляет панель применения к индикатору здоровья на основе оценок журнала боя.",
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = "Добавляет кнопку «Продать серые предметы» в каждое окно торговца, в котором продаются все серые предметы.",
["Adds a small 24h clock to the mini map."] = "Добавляет небольшие 24-часовые часы на мини-карту.",
["Adds class colors to the player, target and party unit frames."] = "Добавить цвета классов к окнам игрока, цели и отряда группы.",
["Adds compatibility to Turtle WoW's custom changes."] = "Добавляет совместимость с пользовательскими изменениями Turtle WoW.",
["Adds coordinates to the bottom of the World Map."] = "Добавляет координаты внизу карты мира.",
["Advanced Options"] = "Расширенные настройки",
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = "Позволяет прокручивать колесо мыши, включает закрепленные каналы чата и повторяет сообщение при нажатии стрелки вверх.",
["Auto Dismount"] = "Авто-спешивание",
["Automatically dismounts whenever a spell is casted."] = "Автоматическое спешивание при каждом произнесении заклинания.",
["Automatically switch to the required warrior or druid stance on spell cast."] = "Автоматически переключаться на нужную стойку воина или друида при произнесении заклинания.",
["Auto Stance"] = "Авто-стойка",
["Blue Shaman Class Colors"] = "Синий класс шамана",
["Change health text color based on its value."] = "Изменить цвет текста о состоянии здоровья в зависимости от его значения.",
["Changes the class color code of shamans to blue, as known from TBC+."] = "Изменяет цветовой код класса шаманов на синий, как известно из TBC+.",
["Changes the nameplate health bar color to the class color."] = "Изменяет цвет индикатора здоровья на цвет класса.",
["Chat Hyperlinks"] = "Гиперссылки чата",
["Chat Tweaks"] = "Улучшения чата",
["Clock"] = "Часы",
["Cooldown Numbers"] = "Продолжительность перезарядки",
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = "Копирование URL-адреса веб-сайтов из чата, преобразование CLINKов в реальные предметы и обрабатывание ссылок на квесты и игроков.",
["Cursor"] = "Курсор",
["Darkened UI"] = "Затемненный интерфейс",
["Debuff Timer"] = "Таймер дебаффов",
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = "Отображение здоровья, цвета класса, названия гильдии, ранга гильдии и текущей цели во всплывающих подсказках юнитов.",
["Display the remaining duration as text on every cooldown."] = "Отображать оставшуюся продолжительность в виде текста при перезарядке.",
["Draw the mini map in a squared shape instead of a round one."] = "Мини-карта квадратной формы вместо круглой.",
["Enemy Castbars"] = "Панель применения противника",
["Equip Compare"] = "Сравнение экипировки",
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = "Оценивает количество здоровья и показывает цифры на окнах игрока, питомца и цели.",
["General"] = "Общие",
["Hide Errors"] = "Скрыть ошибки",
["Hide Gryphons"] = "Спрятать грифонов",
["Hides and ignores all Lua errors produced by broken addons."] = "Скрывает и игнорирует все ошибки Lua, вызванные неработающими аддонами.",
["Hides the gryphons left and right of the action bar."] = "Скрывает грифонов слева и справа от панели действий.",
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = "Скрывает ненужные кнопки мини-карты и позволяет масштабировать ее с помощью колеса мыши.",
["Increases the healthbar of the player and target unitframe."] = "Увеличивает полосу здоровья игрока и цели.",
["Item Rarity Borders"] = "Границы редкости предметов",
["Localtime"] = "Местное время",
["Makes all nameplates honor the UI-Scale setting."] = "Все индикаторы здоровья будут соответствовать настройке UI-Scale.",
["MiniMap Clock"] = "Часы на мини-карте",
["MiniMap Square"] = "Квадратная мини-карта",
["MiniMap Tweaks"] = "Улучшения мини-карты",
["Movable Unit Frames"] = "Передвижные окна",
["N/A"] = "Н/Д",
["Nameplate Castbar"] = "Панель применения индикатора здоровья",
["Nameplate Class Colors"] = "Классы индикатора здоровья",
["Nameplate Scale"] = "Масштаб индикаторов здоровья",
["Nameplates"] = nil,
["Player"] = "Игрок",
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = "Окна игрока и цели можно перемещать, удерживая клавиши <Shift> и <Ctrl> вместе.",
["Real Health Numbers"] = "Реальные цифры здоровья",
["Reduced Actionbar Size"] = "Уменьшить панель действий",
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = "Уменьшает размер панели действий за счет удаления нескольких элементов, таких как панель сумки и микропанель.",
["Replace unitframe portraits with class icons."] = "Заменить портреты окон юнитов значками классов.",
["Sell Grey Items"] = "Продать серые предметы",
["Sell Junk"] = "Продать серые предметы",
["Servertime"] = "Серверное время",
["Show class colored circles on world and battlefield map."] = "Показать цветные круги классов на карте мира и поле боя.",
["Show class colors in Who, Guild, Friends and Chat."] = "Показать цвета классов в разделах «Кто», «Гильдия», «Друзья» и «Чат».",
["Show debuff durations on the target unit frame."] = "Показать продолжительность дебаффов в окне цели.",
["Show item rarity as the border color on bags, bank, character and inspect frames."] = "Показать редкость предмета в качестве цвета рамки на сумках, банке, окне персонажа и осмотра.",
["Shows an enemy castbar on target unit frame."] = "Показать панель применения противника в окне юнита цели.",
["Shows currently equipped items on tooltips while the shift key is pressed."] = "Показывает экипированные в данный момент предметы во всплывающих подсказках, пока нажата клавиша Shift.",
["Shows the vendor sell values on all item tooltips."] = "Показывает стоимость продажи продавцу во всплывающих подсказках ко всем предметам.",
["Social & Chat"] = "Общение и чат",
["Social Colors"] = "Социальные цвета",
["Tooltip Details"] = "Подробные подсказки",
["Tooltip & Items"] = "Подсказки и предметы",
["Turns the entire interface into darker colors."] = "Меняет весь интерфейс в более темные цвета.",
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = "Превращает карту мира в подвижное окно. Карту можно масштабировать с помощью <Ctrl> + Колесо мыши.",
["Turtle WoW Compatibility"] = "Совместимость с Turtle WoW",
["Unit Frame Big Health"] = "Большое здоровье",
["Unit Frame Class Colors"] = "Цветные классы",
["Unit Frame Class Portraits"] = "Классовые портреты",
["Unit Frame Health Colors"] = "Цветное здоровье",
["Unit Frames"] = "Окна юнитов",
["Vendor Values"] = "Стоимость продажи",
["WorldMap Class Colors"] = "Классы на карте мира",
["WorldMap Coordinates"] = "Координаты на карте мира",
["WorldMap Window"] = "Окно карты мира",
["World & MiniMap"] = "Карта мира и мини-карта",
["Your vendor trash has been sold and you earned"] = "Ваш хлам продан, и вы заработали",
}
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["zhCN"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = "添加基于战斗日志的施法条。",
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = "商人窗口添加:“出售垃圾”按钮,将灰色物品出售给商人。",
["Adds a small 24h clock to the mini map."] = "添加一个24小时的时钟到小地图。",
["Adds class colors to the player, target and party unit frames."] = "添加玩家、目标和队伍单位的职业颜色。",
["Adds compatibility to Turtle WoW's custom changes."] = "添加乌龟服的兼容修改。",
["Adds coordinates to the bottom of the World Map."] = "添加坐标到世界地图的底部。",
["Advanced Options"] = "高级选项",
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = "允许使用鼠标滚轮,启用粘性频道,向上箭头重复消息。",
["Auto Dismount"] = "自动下坐骑",
["Automatically dismounts whenever a spell is casted."] = "当施放任何法术时自动取消坐骑。",
["Automatically switch to the required warrior or druid stance on spell cast."] = "自动切换技能所需姿态(战士/德鲁伊)。",
["Auto Stance"] = "自动切换姿态",
["Blue Shaman Class Colors"] = "蓝色萨满职业颜色",
["Change health text color based on its value."] = "根据值改变血量文本颜色。",
["Changes the class color code of shamans to blue, as known from TBC+."] = "修改了萨满职业的颜色为蓝色,与TBC+相同。",
["Changes the nameplate health bar color to the class color."] = "修改姓名板的血量条颜色为职业颜色。",
["Chat Hyperlinks"] = "聊天超链接",
["Chat Tweaks"] = "聊天增强",
["Clock"] = "时钟",
["Cooldown Numbers"] = "冷却倒计时",
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = "复制聊天中的网址,将CLINK转换为实际的物品、任务和玩家链接。",
["Cursor"] = "鼠标指针",
["Darkened UI"] = "黑暗风格UI",
["Debuff Timer"] = "Debuff计时",
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = "提示框显示当前目标血量、职业颜色、公会名称、公会等级、荣誉排名。",
["Display the remaining duration as text on every cooldown."] = "显示剩余时间的文本,如:10s,1m,1h,1d。",
["Draw the mini map in a squared shape instead of a round one."] = "小地图以方形显示,而不是圆形。",
["Enemy Castbars"] = "敌对目标施法条",
["Equip Compare"] = "装备比较",
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = "显示玩家、宠物和目标单位的血量。",
["General"] = "常规",
["Hide Errors"] = "隐藏LUA错误",
["Hide Gryphons"] = "隐藏动作条狮鹫",
["Hides and ignores all Lua errors produced by broken addons."] = "隐藏并忽略所有插件脚本产生的LUA错误。",
["Hides the gryphons left and right of the action bar."] = "隐藏动作条左右两边狮鹫。",
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = "隐藏小地图缩放按钮,改用使用鼠标滚轮进行缩放。",
["Increases the healthbar of the player and target unitframe."] = "增加玩家和目标单位的血量条的宽度。",
["Item Rarity Borders"] = "物品品质边框着色",
["Localtime"] = "本地时间",
["Makes all nameplates honor the UI-Scale setting."] = "名字板跟随UI缩放设置。",
["MiniMap Clock"] = "小地图时钟",
["MiniMap Square"] = "方形小地图",
["MiniMap Tweaks"] = "小地图增强",
["Movable Unit Frames"] = "头像框架可移动",
["N/A"] = "N/A",
["Nameplate Castbar"] = "姓名板施法条",
["Nameplate Class Colors"] = "姓名板职业着色",
["Nameplate Scale"] = "姓名板缩放",
["Nameplates"] = nil,
["Player"] = "玩家",
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = "当<Shift>和<Ctrl>键同时按下时,玩家与目标单位的头像可移动。",
["Real Health Numbers"] = "显示预估生命值",
["Reduced Actionbar Size"] = "减少动作条大小",
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = "减少底部动作条大小,移除动作条上的按钮。",
["Replace unitframe portraits with class icons."] = "单位头像替换为职业图标。",
["Sell Grey Items"] = "售卖灰色物品",
["Sell Junk"] = "售卖垃圾物品",
["Servertime"] = "服务器时间",
["Show class colored circles on world and battlefield map."] = "在世界地图和战场地图上显示团队成员职业颜色的圆圈。",
["Show class colors in Who, Guild, Friends and Chat."] = "显示职业颜色在Who、公会、好友和聊天等列表中。",
["Show debuff durations on the target unit frame."] = "目标单位显示debuff的持续时间。",
["Show item rarity as the border color on bags, bank, character and inspect frames."] = "在背包、银行、角色、查看窗口中显示物品品质边框颜色。",
["Shows an enemy castbar on target unit frame."] = "显示敌对目标单位的施法条。",
["Shows currently equipped items on tooltips while the shift key is pressed."] = "按下<Shift>键时与当前与装备物品在进行比较。",
["Shows the vendor sell values on all item tooltips."] = "物品的提示框中显示物品的售价。",
["Social & Chat"] = "社交&聊天",
["Social Colors"] = "显示职业颜色",
["Tooltip Details"] = "提示框详情",
["Tooltip & Items"] = "提示框&物品",
["Turns the entire interface into darker colors."] = "将整个用户界面元素改为暗黑向。",
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = "让世界地图窗口可移动,可以按住<Ctrl>并滚动鼠标滚轮进行缩放。",
["Turtle WoW Compatibility"] = "乌龟服兼容修改",
["Unit Frame Big Health"] = "单位框架大生命文本",
["Unit Frame Class Colors"] = "单位框架职业着色",
["Unit Frame Class Portraits"] = "单位框架职业图标头像",
["Unit Frame Health Colors"] = "单位框架血条颜色",
["Unit Frames"] = "单位框架",
["Vendor Values"] = "售卖价格",
["WorldMap Class Colors"] = "世界地图职业着色",
["WorldMap Coordinates"] = "世界地图显示坐标",
["WorldMap Window"] = "世界地图窗口",
["World & MiniMap"] = "地图&小地图",
["Your vendor trash has been sold and you earned"] = "你的垃圾物品已出售,你获得了:",
}
-86
View File
@@ -1,86 +0,0 @@
ShaguTweaks_translation = ShaguTweaks_translation or {}
ShaguTweaks_translation["zhTW"] = {
["Adds a castbar to the nameplate based on combat log estimations."] = nil,
["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil,
["Adds a small 24h clock to the mini map."] = nil,
["Adds class colors to the player, target and party unit frames."] = nil,
["Adds compatibility to Turtle WoW's custom changes."] = nil,
["Adds coordinates to the bottom of the World Map."] = nil,
["Advanced Options"] = nil,
["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil,
["Auto Dismount"] = nil,
["Automatically dismounts whenever a spell is casted."] = nil,
["Automatically switch to the required warrior or druid stance on spell cast."] = nil,
["Auto Stance"] = nil,
["Blue Shaman Class Colors"] = nil,
["Change health text color based on its value."] = nil,
["Changes the class color code of shamans to blue, as known from TBC+."] = nil,
["Changes the nameplate health bar color to the class color."] = nil,
["Chat Hyperlinks"] = nil,
["Chat Tweaks"] = nil,
["Clock"] = nil,
["Cooldown Numbers"] = nil,
["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil,
["Cursor"] = nil,
["Darkened UI"] = nil,
["Debuff Timer"] = nil,
["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil,
["Display the remaining duration as text on every cooldown."] = nil,
["Draw the mini map in a squared shape instead of a round one."] = nil,
["Enemy Castbars"] = nil,
["Equip Compare"] = nil,
["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil,
["General"] = nil,
["Hide Errors"] = nil,
["Hide Gryphons"] = nil,
["Hides and ignores all Lua errors produced by broken addons."] = nil,
["Hides the gryphons left and right of the action bar."] = nil,
["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil,
["Increases the healthbar of the player and target unitframe."] = nil,
["Item Rarity Borders"] = nil,
["Localtime"] = nil,
["Makes all nameplates honor the UI-Scale setting."] = nil,
["MiniMap Clock"] = nil,
["MiniMap Square"] = nil,
["MiniMap Tweaks"] = nil,
["Movable Unit Frames"] = nil,
["N/A"] = nil,
["Nameplate Castbar"] = nil,
["Nameplate Class Colors"] = nil,
["Nameplate Scale"] = nil,
["Nameplates"] = nil,
["Player"] = nil,
["Player and Target unit frames can be moved while <Shift> and <Ctrl> are pressed together."] = nil,
["Real Health Numbers"] = nil,
["Reduced Actionbar Size"] = nil,
["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil,
["Replace unitframe portraits with class icons."] = nil,
["Sell Grey Items"] = nil,
["Sell Junk"] = nil,
["Servertime"] = nil,
["Show class colored circles on world and battlefield map."] = nil,
["Show class colors in Who, Guild, Friends and Chat."] = nil,
["Show debuff durations on the target unit frame."] = nil,
["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil,
["Shows an enemy castbar on target unit frame."] = nil,
["Shows currently equipped items on tooltips while the shift key is pressed."] = nil,
["Shows the vendor sell values on all item tooltips."] = nil,
["Social & Chat"] = nil,
["Social Colors"] = nil,
["Tooltip Details"] = nil,
["Tooltip & Items"] = nil,
["Turns the entire interface into darker colors."] = nil,
["Turns the world map into a movable window. The map can be scaled with <Ctrl> + Mousewheel."] = nil,
["Turtle WoW Compatibility"] = nil,
["Unit Frame Big Health"] = nil,
["Unit Frame Class Colors"] = nil,
["Unit Frame Class Portraits"] = nil,
["Unit Frame Health Colors"] = nil,
["Unit Frames"] = nil,
["Vendor Values"] = nil,
["WorldMap Class Colors"] = nil,
["WorldMap Coordinates"] = nil,
["WorldMap Window"] = nil,
["World & MiniMap"] = nil,
["Your vendor trash has been sold and you earned"] = nil,
}
+3
View File
@@ -54,6 +54,9 @@ ShaguTweaks:SetScript("OnEvent", function()
-- initialize empty config
if not ShaguTweaks_config then ShaguTweaks_config = {} end
-- Gold numbers belong to Real Health Numbers; retire the duplicate toggle.
ShaguTweaks_config["Unit Frame Health Colors"] = nil
-- initialize overwrites
ShaguTweaks_config.overwrites = ShaguTweaks_config.overwrites or {}
+41 -18
View File
@@ -11,29 +11,43 @@ local module = ShaguTweaks:register({
enabled = nil,
})
-- Modern APIs return booleans; legacy range APIs return 1/0/nil.
-- In Lua, numeric zero is truthy, so normalize both contracts explicitly.
local function NormalizeRange(value)
if value == true or value == 1 then return 1 end
if value == false or value == 0 then return 0 end
end
local function GetActionRange(action)
-- ClassicAPI can resolve a real spell/item action and run the same
-- range-only engine test directly against the target unit. This avoids
-- relying on the old action-slot heuristic for normal spell buttons.
if not UnitExists("target") then return nil end
if API and API.GetActionInfo then
local actionType, id = API.GetActionInfo(action)
if actionType == "spell" and id and API.IsSpellInRange then
local inRange = API.IsSpellInRange(id, "target")
if inRange ~= nil then
return inRange and 1 or 0
end
elseif actionType == "item" and id and API.IsItemInRange then
local inRange = API.IsItemInRange(id, "target")
if inRange ~= nil then
return inRange and 1 or 0
if actionType == "spell" and id and API.spellrange
and API.IsSpellInRange then
-- ClassicAPI's check is geometric: it does not reject the wrong
-- faction. A friendly buff should not turn red against an enemy.
local spells = _G.C_Spell
if spells then
if type(spells.IsSpellHelpful) == "function"
and spells.IsSpellHelpful(id) and type(UnitCanAssist) == "function"
and not UnitCanAssist("player", "target") then return nil end
if type(spells.IsSpellHarmful) == "function"
and spells.IsSpellHarmful(id) and type(UnitCanAttack) == "function"
and not UnitCanAttack("player", "target") then return nil end
end
-- nil is authoritative: self/rangeless spells have no range to
-- fail. Never turn it into an old action-slot false result.
return NormalizeRange(API.IsSpellInRange(id, "target"))
elseif actionType == "item" and id and API.itemrange
and API.IsItemInRange then
return NormalizeRange(API.IsItemInRange(id, "target"))
end
end
-- Macros, unresolved bag-item actions and older ClassicAPI versions keep
-- Vanilla's native action-slot range check as the compatibility fallback.
return IsActionInRange(action)
-- Macros, unresolved actions and clients without the native capability
-- retain the action-slot compatibility fallback.
return NormalizeRange(IsActionInRange(action))
end
module.enable = function(self)
@@ -51,8 +65,17 @@ module.enable = function(self)
this.r, this.g, this.b, this.a = 0.85, 0.18, 0.18, 1
end
icon:SetVertexColor(this.r, this.g, this.b, this.a)
elseif IsUsableAction(action) then
icon:SetVertexColor(1, 1, 1, 1)
else
-- Restore the normal usability tint even if the old
-- red action is now unusable or short of mana.
local usable, noMana = IsUsableAction(action)
if usable and usable ~= 0 then
icon:SetVertexColor(1, 1, 1, 1)
elseif noMana and noMana ~= 0 then
icon:SetVertexColor(0.5, 0.5, 1, 1)
else
icon:SetVertexColor(0.4, 0.4, 0.4, 1)
end
end
end
+10 -5
View File
@@ -91,24 +91,29 @@ module.enable = function(self)
local Original_ChatFrame_OnEvent = ChatFrame_OnEvent
ChatFrame_OnEvent = function(event)
local message, sender = arg1, arg2
local chatEvent, chatMessage, chatSender = API.GetCurrentChatEvent()
if chatEvent then
event, message, sender = chatEvent, chatMessage, chatSender
end
-- suppress "#showtooltip" macro errors leaking into chat
if strfind(arg1 or "", "^#showtooltip") then
if strfind(message or "", "^#showtooltip") then
return
end
-- suppress BigWigs "Casted X on Y" cast announcements
if event == "CHAT_MSG_SAY" and strfind(arg1 or "", "^Casted %u[%a%s]+ on %u[%a%s]+") then
if event == "CHAT_MSG_SAY" and strfind(message or "", "^Casted %u[%a%s]+ on %u[%a%s]+") then
return
end
-- hide repeated messages in say/yell/channel chat, and emotes from
-- strangers (guildmates/friends are never filtered on emote)
if arg1 and arg2 and arg2 ~= GetPlayerName("player") then
if message and sender and sender ~= GetPlayerName("player") then
local isChatType = event == "CHAT_MSG_SAY" or event == "CHAT_MSG_CHANNEL" or event == "CHAT_MSG_YELL"
local isStrangerEmote = canFilterEmotes and event == "CHAT_MSG_EMOTE"
and not (IsGuildMate(arg2) or IsFriendOf(arg2))
and not (IsGuildMate(sender) or IsFriendOf(sender))
if (isChatType or isStrangerEmote) and IsDuplicate(this, arg1) then
if (isChatType or isStrangerEmote) and IsDuplicate(this, message) then
return
end
end
-53
View File
@@ -1,53 +0,0 @@
local T = ShaguTweaks.T
local GetColorGradient = ShaguTweaks.GetColorGradient
local hooksecurefunc = hooksecurefunc or ShaguTweaks.hooksecurefunc
local module = ShaguTweaks:register({
title = T["Unit Frame Health Colors"],
description = T["Change health text color based on its value."],
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = nil,
})
local function SetTextColorIfChanged(fontString, r, g, b, a)
local cr, cg, cb, ca = fontString:GetTextColor()
if cr ~= r or cg ~= g or cb ~= b or ca ~= a then
fontString:SetTextColor(r, g, b, a)
end
end
module.enable = function(self)
local function UpdateManaTextColor(uf)
if not uf then uf = this end
if not uf or not uf.manabar or not uf.manabar.TextString then return end
local name = uf.manabar:GetName()
if name and not strfind(name, "Health") then
local r, g, b = uf.manabar:GetStatusBarColor()
SetTextColorIfChanged(uf.manabar.TextString,
(r + 2) / 3, (g + 2) / 3, (b + 2) / 3, 1)
end
end
local function UpdateHealthTextColor(sb)
if not sb then sb = this end
if not sb or not sb.TextString or not sb.unit then return end
local name = sb:GetName()
if not name or not strfind(name, "Health") then return end
local _, max = sb:GetMinMaxValues()
local cur = sb:GetValue()
local percent = max > 0 and floor(cur / max * 100) or 0
local r, g, b = GetColorGradient(percent / 100)
SetTextColorIfChanged(sb.TextString,
(r + 1) / 2, (g + 1) / 2, (b + 1) / 2, .75)
end
-- Append our color adjustments instead of replacing Blizzard's global
-- functions. This keeps the module cooperative with other UI addons.
hooksecurefunc("UnitFrame_UpdateManaType", UpdateManaTextColor)
hooksecurefunc("TextStatusBar_UpdateTextString", UpdateHealthTextColor)
end
+107 -21
View File
@@ -11,6 +11,14 @@ local module = ShaguTweaks:register({
enabled = nil,
})
local function SetNumberColor(text)
if ShaguTweaks.WhiteUnitFrameNumbers then
text:SetTextColor(1, 1, 1, 1)
else
text:SetTextColor(1, 0.82, 0, 1)
end
end
module.enable = function(self)
if ShaguTweaks.RealHealthNumbersInstalled then return end
ShaguTweaks.RealHealthNumbersInstalled = true
@@ -47,10 +55,11 @@ module.enable = function(self)
if not parent then return end
local text = parent:CreateFontString(nil, "OVERLAY", "GameFontWhite")
text:SetFont(STANDARD_TEXT_FONT, fontSize or 10, "OUTLINE")
-- Match the character name: plain glyphs instead of a heavy black outline.
text:SetFont(STANDARD_TEXT_FONT, fontSize or 10, "")
text:SetHeight(32)
text:SetJustifyH("CENTER")
text:SetTextColor(1, 1, 1, 1)
SetNumberColor(text)
return text
end
@@ -100,15 +109,47 @@ module.enable = function(self)
end
end
local function AnchorHealth(text, bar, y)
if not text or not bar then return end
if not text.percentText then
text.percentText = CreateValueText(text:GetParent(), select(2, text:GetFont()))
end
text:ClearAllPoints()
text:SetJustifyH("RIGHT")
text:SetPoint("RIGHT", bar, "RIGHT", -4, y or 0)
text.percentText:ClearAllPoints()
text.percentText:SetJustifyH("LEFT")
text.percentText:SetPoint("LEFT", bar, "LEFT", 4, y or 0)
end
local function MatchNameStyle(text, name)
if not text or not name or not name.GetFont then return end
local font, size, flags = name:GetFont()
if font and size then text:SetFont(font, size, flags or "") end
if name.GetShadowColor then
text:SetShadowColor(name:GetShadowColor())
end
if name.GetShadowOffset then
text:SetShadowOffset(name:GetShadowOffset())
end
if text.percentText then MatchNameStyle(text.percentText, name) end
end
local function PositionTexts()
-- Keep the stock/modern texture choice with the numeric frame overlays.
local texture = (ShaguTweaks.ModernClassColors and "Interface\\AddOns\\ShaguTweaks\\img\\BlizzardRetailBar" or "Interface\\TargetingFrame\\UI-StatusBar")
for _, name in ipairs({"PlayerFrameHealthBar", "TargetFrameHealthBar", "PetFrameHealthBar"}) do
local bar = _G[name]
if bar then bar:SetStatusBarTexture(texture) end
end
local playerHealthY = PlayerFrameHealthBar:GetHeight() >= 20 and -7 or 0.5
local targetHealthY = TargetFrameHealthBar:GetHeight() >= 20 and -7 or 0.5
AnchorText(self.valueTexts.playerHealth, PlayerFrameHealthBar, playerHealthY)
AnchorHealth(self.valueTexts.playerHealth, PlayerFrameHealthBar, playerHealthY)
AnchorText(self.valueTexts.playerMana, PlayerFrameManaBar, 0.5)
AnchorText(self.valueTexts.targetHealth, TargetFrameHealthBar, targetHealthY)
AnchorHealth(self.valueTexts.targetHealth, TargetFrameHealthBar, targetHealthY)
AnchorText(self.valueTexts.targetMana, TargetFrameManaBar, 0.5)
AnchorText(self.valueTexts.petHealth, PetFrameHealthBar, 0)
AnchorHealth(self.valueTexts.petHealth, PetFrameHealthBar, 0)
AnchorText(self.valueTexts.petMana, PetFrameManaBar, -2)
if _G.PlayerFrameAlternatePowerBar then
@@ -118,6 +159,17 @@ module.enable = function(self)
0
)
end
-- Read final name styling after other unit-frame modules initialize.
local playerName = (PlayerFrame and PlayerFrame.name) or _G.PlayerName
local targetName = (TargetFrame and TargetFrame.name) or _G.TargetFrameName
local petName = (PetFrame and PetFrame.name) or _G.PetName or playerName
MatchNameStyle(self.valueTexts.playerHealth, playerName)
MatchNameStyle(self.valueTexts.playerMana, playerName)
MatchNameStyle(self.valueTexts.playerAlternatePower, playerName)
MatchNameStyle(self.valueTexts.targetHealth, targetName)
MatchNameStyle(self.valueTexts.targetMana, targetName)
MatchNameStyle(self.valueTexts.petHealth, petName)
MatchNameStyle(self.valueTexts.petMana, petName)
end
local function SetValue(text, value)
@@ -129,12 +181,15 @@ module.enable = function(self)
return
end
SetNumberColor(text)
text:SetText(tostring(Abbreviate(value)))
text:Show()
end
local function UpdateHealth(text, unit, useEstimator)
if not text then return end
local percentText = text.percentText
if percentText then percentText:SetText(""); percentText:Hide() end
if not UnitExists(unit) then
text:SetText("")
@@ -164,12 +219,24 @@ module.enable = function(self)
end
if useEstimator and not known and max == 100 then
text:SetText(tostring(cur or 0) .. "%")
text:Show()
text:SetText("")
text:Hide()
if percentText then
percentText:SetText(tostring(cur or 0) .. "%")
percentText:Show()
end
return
end
SetValue(text, cur or 0)
local percent = math.floor(math.max(0, math.min(1, (cur or 0) / max)) * 100 + 0.5)
SetNumberColor(text)
text:SetText(tostring(Abbreviate(cur or 0)))
if percentText then
SetNumberColor(percentText)
percentText:SetText(percent .. "%")
percentText:Show()
end
text:Show()
end
local function UpdatePower(text, unit)
@@ -234,19 +301,19 @@ module.enable = function(self)
events:RegisterEvent("PLAYER_ENTERING_WORLD")
events:RegisterEvent("PLAYER_TARGET_CHANGED")
events:RegisterEvent("PET_UI_UPDATE")
events:RegisterEvent("UNIT_HEALTH")
events:RegisterEvent("UNIT_MAXHEALTH")
events:RegisterEvent("UNIT_MANA")
events:RegisterEvent("UNIT_MAXMANA")
events:RegisterEvent("UNIT_RAGE")
events:RegisterEvent("UNIT_MAXRAGE")
events:RegisterEvent("UNIT_ENERGY")
events:RegisterEvent("UNIT_MAXENERGY")
events:RegisterEvent("UNIT_FOCUS")
events:RegisterEvent("UNIT_MAXFOCUS")
events:RegisterEvent("UNIT_HAPPINESS")
events:RegisterEvent("UNIT_MAXHAPPINESS")
events:RegisterEvent("UNIT_DISPLAYPOWER")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_HEALTH", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXHEALTH", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MANA", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXMANA", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_RAGE", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXRAGE", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_ENERGY", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXENERGY", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_FOCUS", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXFOCUS", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_HAPPINESS", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_MAXHAPPINESS", "player", "target", "pet")
ShaguTweaks.API.RegisterUnitEvent(events, "UNIT_DISPLAYPOWER", "player", "target", "pet")
events:SetScript("OnEvent", function()
if event == "PLAYER_ENTERING_WORLD" then
@@ -296,3 +363,22 @@ module.enable = function(self)
UpdateAlternatePower()
end)
end
-- Kept separate from Modern Class Colors so either texture style can use white.
local whiteNumbers = ShaguTweaks:register({
title = T["White Unit Frame Numbers"],
description = T["Use white instead of the default gold for health, percentage and power numbers. Requires Real Health Numbers."],
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = nil,
})
whiteNumbers.enable = function(self)
ShaguTweaks.WhiteUnitFrameNumbers = true
-- Module initialization order is unspecified. Existing texts are recolored
-- here; texts created later read the flag through SetNumberColor.
for _, text in pairs(module.valueTexts or {}) do
SetNumberColor(text)
if text.percentText then SetNumberColor(text.percentText) end
end
end
+2 -2
View File
@@ -8,7 +8,7 @@ local API = ShaguTweaks.API
local module = ShaguTweaks:register({
title = T["Movable Unit Frames"],
description = T["Player, Target, Party, Minimap, Clock, Timer, Buffs, Weapon Buffs and Debuffs can be moved while <Shift> and <Ctrl> are pressed together. Right-click a frame to reset its position."],
description = T["Player, Target, Party, Minimap, Clock, Timer, Buffs, Weapon Buffs and Debuffs can be moved while <Ctrl>, <Shift> and <Alt> are pressed together. Right-click a frame to reset its position."],
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = true,
@@ -631,7 +631,7 @@ module.enable = function(self)
end
local function UpdateLockState()
if API.IsShiftKeyDown() and API.IsControlKeyDown() then
if API.IsShiftKeyDown() and API.IsControlKeyDown() and API.IsAltKeyDown() then
UnlockAll()
else
LockAll()
+1 -1
View File
@@ -252,7 +252,7 @@ module.enable = function(self)
listener:RegisterEvent("PLAYER_TARGET_CHANGED")
for index = 1, table.getn(castEvents) do
listener:RegisterEvent(castEvents[index])
API.RegisterUnitEvent(listener, castEvents[index], "target")
end
listener:SetScript("OnEvent", function()
+2 -1
View File
@@ -202,7 +202,8 @@ module.enable = function(self)
local button = _G["TargetFrameDebuff"..i]
if button and not button.cd then
button.cd = CreateFrame("Model", "TargetFrameDebuff"..i.."Cooldown", button, "CooldownFrameTemplate")
local frameType = API.nativecooldowns and "Cooldown" or "Model"
button.cd = CreateFrame(frameType, "TargetFrameDebuff"..i.."Cooldown", button, "CooldownFrameTemplate")
button.cd.noCooldownCount = true
button.cd:SetAllPoints()
button.cd:SetScale(.6)
+89 -20
View File
@@ -5,12 +5,35 @@ local rgbhex = ShaguTweaks.rgbhex
local Abbreviate = ShaguTweaks.Abbreviate
local API = ShaguTweaks.API
local DEFAULT_HEALTH_TEXTURE = "Interface\\TargetingFrame\\UI-StatusBar"
local MODERN_HEALTH_TEXTURE = "Interface\\AddOns\\ShaguTweaks\\img\\BlizzardRetailBar"
local function SetTooltipHealthTexture(texture)
GameTooltipStatusBar:SetStatusBarTexture(texture)
if GameTooltipStatusBar.bg then
GameTooltipStatusBar.bg:SetTexture(texture)
end
end
local tooltipSetStatusBarColor
local function GetUnit()
local guid = API.GetTooltipUnitGUID(GameTooltip)
if not guid then return end
return API.UnitTokenFromGUID(guid)
local unit = API.UnitTokenFromGUID(guid)
-- Positional tokens can be recycled between tooltip and unit queries.
if unit and API.UnitGUID and API.UnitGUID(unit) ~= guid then return end
return unit
end
local function GetTargetUnit(unit)
-- The interaction-only NPC token has no valid "npctarget" derivative.
if unit == "npc" then return end
local targetUnit = unit .. "target"
-- A valid base token need not support target suffixes. Probe defensively
-- before passing a derived token to the rest of the unit API.
local ok, exists = pcall(UnitExists, targetUnit)
if ok and exists then return targetUnit end
end
local function ClearTooltipBarColor()
@@ -55,6 +78,7 @@ end
local function ResetTooltipState()
ClearTooltipBarColor()
SetTooltipHealthTexture(DEFAULT_HEALTH_TEXTURE)
if GameTooltipStatusBar.bg then
GameTooltipStatusBar.bg:SetVertexColor(.1, .1, 0, .8)
@@ -68,29 +92,36 @@ end
local updating = false
local function UpdateTooltip()
if updating then return end
updating = true
local function UpdateTooltipContents()
-- ClassicAPI keeps the exact tooltip GUID and resolves it back to a live
-- unit token natively. No party/raid scans or display-name fallback.
local unit = GetUnit()
if not unit then
updating = false
ResetTooltipState()
return
end
-- Resolve at display time because module initialization order is unspecified.
SetTooltipHealthTexture(ShaguTweaks.ModernClassColors
and MODERN_HEALTH_TEXTURE or DEFAULT_HEALTH_TEXTURE)
-- A newly resolved unit chooses its own class/reaction color below. Clear the
-- previous enforcement first so a stale color cannot leak between tooltips.
ClearTooltipBarColor()
local pvpname = UnitPVPName(unit)
local name = UnitName(unit)
local target = UnitName(unit .. "target")
local _, targetClass = UnitClass(unit .. "target")
local targetReaction = UnitReaction("player", unit .. "target")
local targetUnit = GetTargetUnit(unit)
local target, targetClass, targetReaction
if targetUnit then
target = UnitName(targetUnit)
local ignored
ignored, targetClass = UnitClass(targetUnit)
targetReaction = UnitReaction("player", targetUnit)
end
local _, class = UnitClass(unit)
local guild = GetGuildInfo(unit)
local guild, rankstr, rankid = GetGuildInfo(unit)
local reaction = UnitReaction(unit, "player")
local pvptitle = name and gsub(pvpname or name, " " .. name, "", 1) or nil
@@ -98,9 +129,13 @@ local function UpdateTooltip()
if UnitIsPlayer(unit) and class then
local color = RAID_CLASS_COLORS[class]
if color then
SetTooltipBarColor(color.r, color.g, color.b, 1)
-- Match the optional unit-frame palette without changing name text
-- or NPC reaction colors. The health-bar background follows its tint.
local modern = ShaguTweaks.ModernClassColors
local barColor = (modern and modern[class]) or color
SetTooltipBarColor(barColor.r, barColor.g, barColor.b, 1)
GameTooltipStatusBar.bg:SetVertexColor(
color.r * 0.15, color.g * 0.15, color.b * 0.15, 0.8)
barColor.r * 0.15, barColor.g * 0.15, barColor.b * 0.15, 0.8)
GameTooltipTextLeft1:SetText(
rgbhex(color.r, color.g, color.b, color.a) .. name)
else
@@ -120,18 +155,35 @@ local function UpdateTooltip()
end
end
-- Guild name only (no rank)
if guild then
local guildAlready = false
-- Restore the original guild rank and guild-leader marker. Replace the
-- native/existing guild line so repeated refreshes do not duplicate it.
if guild and guild ~= "" then
local guildName = "<" .. guild .. ">"
local guildText = guildName
if rankid == 0 then guildText = guildText .. "|cffffcc00*|r" end
if rankstr and rankstr ~= "" then
guildText = guildText .. " |cffaaaaaa(" .. rankstr .. ")|r"
end
local guildLine
for i = 2, GameTooltip:NumLines() do
local left = _G["GameTooltipTextLeft" .. i]
if left and left:GetText() == "<" .. guild .. ">" then
guildAlready = true
break
local text = left and left:GetText()
if text then
local plain = string.gsub(text, "|c%x%x%x%x%x%x%x%x", "")
plain = string.gsub(plain, "|r", "")
if plain == guild or string.sub(plain, 1, string.len(guildName)) == guildName then
guildLine = left
break
end
end
end
if not guildAlready then
GameTooltip:AddLine("<" .. guild .. ">", 0.3, 1, 0.5)
if guildLine then
guildLine:SetText(guildText)
guildLine:SetTextColor(0.3, 1, 0.5)
else
GameTooltip:AddLine(guildText, 0.3, 1, 0.5)
end
end
@@ -148,7 +200,7 @@ local function UpdateTooltip()
end
if target and not alreadyAdded then
if UnitIsPlayer(unit .. "target") and targetClass then
if UnitIsPlayer(targetUnit) and targetClass then
local color = RAID_CLASS_COLORS[targetClass]
if color then
GameTooltip:AddLine(target, color.r, color.g, color.b)
@@ -167,7 +219,24 @@ local function UpdateTooltip()
UpdateHealthText()
GameTooltip:Show()
end
local function UpdateTooltip()
if updating then return end
updating = true
local ok, err = pcall(UpdateTooltipContents)
-- Always release the guard before cleanup/error reporting. One bad unit or
-- addon hook must not disable tooltip updates for the rest of the session.
updating = false
if not ok then
ResetTooltipState()
local handler = geterrorhandler and geterrorhandler()
if type(handler) == "function" then
handler(err)
else
error(err)
end
end
end
local module = ShaguTweaks:register({
+34
View File
@@ -62,6 +62,40 @@ module.enable = function(self)
PlayerStatusTexture:SetTexture(addonpath .. "\\img\\UI-Player-Status")
-- The additive status artwork contains both the portrait ring and bar edge.
-- Crop only the latter while resting, shrinking the displayed width by the
-- same ratio so the portrait ring keeps its original size and position.
-- Native status code continues to own visibility, tint, alpha and pulsing.
local statusCoords = {PlayerStatusTexture:GetTexCoord()}
local statusWidth = PlayerStatusTexture:GetWidth()
local portraitRight = 72 / 256 -- right edge of the portrait in UI-Player-Status
local restingCrop = false
local function UpdateRestingGlow()
local resting = IsResting()
and not UnitAffectingCombat("player")
local left, right = statusCoords[1], statusCoords[5]
if not left or not right or right <= left
or portraitRight <= left or portraitRight >= right then return end
if resting and not restingCrop then
PlayerStatusTexture:SetTexCoord(
left, portraitRight, statusCoords[2], statusCoords[4])
PlayerStatusTexture:SetWidth(
statusWidth * (portraitRight - left) / (right - left))
restingCrop = true
elseif not resting and restingCrop then
PlayerStatusTexture:SetTexCoord(
left, right, statusCoords[2], statusCoords[4])
PlayerStatusTexture:SetWidth(statusWidth)
restingCrop = false
end
end
hooksecurefunc("PlayerFrame_UpdateStatus", UpdateRestingGlow)
UpdateRestingGlow()
TargetFrameTexture:SetTexture(normalTexture)
TargetFrameHealthBar:SetPoint("TOPRIGHT", -106, -22)
TargetFrameHealthBar:SetHeight(30)
+141 -1
View File
@@ -14,7 +14,8 @@ local module = ShaguTweaks:register({
local function GetUnitClassColor(unit)
local _, class = UnitClass(unit)
return RAID_CLASS_COLORS[class] or FALLBACK_CLASS_COLOR
local palette = ShaguTweaks.ModernClassColors or RAID_CLASS_COLORS
return palette[class] or FALLBACK_CLASS_COLOR
end
local function SetTextColorIfChanged(fontString, r, g, b, a)
@@ -98,3 +99,142 @@ module.enable = function(self)
UpdateTargetClassColor()
UpdatePartyColors()
end
-- Retail resource artwork contains its own colors, including light-blue mana.
-- A white tint preserves those native colors and gradients.
local MODERN_POWER_TEXTURES = {
[0] = "Interface\\AddOns\\ShaguTweaks\\img\\ModernPowerMana",
[1] = "Interface\\AddOns\\ShaguTweaks\\img\\ModernPowerRage",
[2] = "Interface\\AddOns\\ShaguTweaks\\img\\ModernPowerFocus",
[3] = "Interface\\AddOns\\ShaguTweaks\\img\\ModernPowerEnergy",
}
local DEFAULT_BAR_TEXTURE = "Interface\\TargetingFrame\\UI-StatusBar"
local function SetupModernPowerBars()
local bars = {}
local function ApplyPowerStyle(bar)
local state = bars[bar]
if not state then return end
local unit = bar.unit or state.unit
if not ShaguTweaks.ModernClassColors or not UnitExists(unit) then
state.background:Hide()
return
end
-- The druid's secondary bar stays mana while the primary bar is rage/energy.
local powerType = state.powerType
if powerType == nil then powerType = UnitPowerType(unit) end
local texture = MODERN_POWER_TEXTURES[powerType]
if texture then
local suffix = state.family
if suffix == "Player" then
suffix = ""
local _, class = UnitClass(unit)
-- Keep the retail energy variant for combo-point users.
if powerType == 3 and (class == "ROGUE" or class == "DRUID") then
suffix = "Class"
end
end
-- Vanilla mana slots are rectangular. Retail target/small-frame fills
-- have cut-out corners that leave a visible wedge inside those slots.
-- Use the native rectangular mana artwork for every mana frame.
if powerType == 0 then suffix = "Class" end
bar:SetStatusBarTexture(texture .. suffix)
state.background:Show()
-- Call the method captured before our hook to avoid recursive updates.
state.setColor(bar, 1, 1, 1, 1)
else
-- Unknown/custom power types retain their original texture and tint.
bar:SetStatusBarTexture(state.originalTexture)
state.background:Hide()
end
end
local definitions = {
{"PlayerFrameManaBar", "player", "Player"},
{"PlayerFrameAlternatePowerBar", "player", "Player", 0},
{"TargetFrameManaBar", "target", "Target"},
{"PetFrameManaBar", "pet", "Small"},
{"TargetofTargetManaBar", "targettarget", "Small"},
}
for id = 1, MAX_PARTY_MEMBERS do
table.insert(definitions, {"PartyMemberFrame" .. id .. "ManaBar", "party" .. id, "Party"})
end
for _, definition in ipairs(definitions) do
local bar = _G[definition[1]]
if bar then
local texture = bar:GetStatusBarTexture()
-- Opaque black behind the native alpha edges prevents the old frame's
-- colored backing from changing the retail gradient's apparent color.
local background = bar:CreateTexture(nil, "BACKGROUND")
background:SetAllPoints(bar)
background:SetTexture(0, 0, 0)
background:Hide()
bars[bar] = {
unit = definition[2],
family = definition[3],
powerType = definition[4],
background = background,
setColor = bar.SetStatusBarColor,
originalTexture = (texture and texture:GetTexture()) or DEFAULT_BAR_TEXTURE,
}
hooksecurefunc(bar, "SetStatusBarColor", function() ApplyPowerStyle(bar) end)
end
end
local function RefreshPowerBars()
for bar in pairs(bars) do ApplyPowerStyle(bar) end
end
-- Vanilla refreshes power type here. Appending preserves the normal frame
-- updates, including shapeshifts and targets with a different power type.
hooksecurefunc("UnitFrame_UpdateManaType", RefreshPowerBars)
RefreshPowerBars()
return RefreshPowerBars
end
local modern = ShaguTweaks:register({
title = "Modern Class Colors",
description = "Use modern class colors and retail health/power textures. Enable Unit Frame Class Colors for class-colored unit frames.",
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = nil,
})
modern.enable = function(self)
if self.installed then return end
self.installed = true
ShaguTweaks.ModernClassColors = {
DRUID = {r=1, g=0.49, b=0.04},
HUNTER = {r=0.67, g=0.83, b=0.45},
MAGE = {r=0.25, g=0.78, b=0.92},
PALADIN = {r=0.96, g=0.55, b=0.73},
PRIEST = {r=1, g=1, b=1},
ROGUE = {r=1, g=0.96, b=0.41},
SHAMAN = {r=0, g=0.44, b=0.87},
WARLOCK = {r=0.53, g=0.53, b=0.93},
WARRIOR = {r=0.78, g=0.61, b=0.43},
}
local RefreshPowerBars = SetupModernPowerBars()
-- Refresh after every module has initialized, regardless of enable order.
local deferred = CreateFrame("Frame")
deferred:SetScript("OnUpdate", function()
this:SetScript("OnUpdate", nil)
this:Hide()
RefreshPowerBars()
for _, prefix in ipairs({"PlayerFrame", "TargetFrame", "PetFrame", "TargetofTarget", "PartyMemberFrame1", "PartyMemberFrame2", "PartyMemberFrame3", "PartyMemberFrame4"}) do
local bar = _G[prefix .. "HealthBar"]
if bar then bar:SetStatusBarTexture("Interface\\AddOns\\ShaguTweaks\\img\\BlizzardRetailBar") end
end
if not PlayerFrameNameBackground then return end
local color = GetUnitClassColor("player")
PlayerFrameNameBackground:SetVertexColor(color.r, color.g, color.b, 1)
if TargetFrame_CheckFaction then TargetFrame_CheckFaction() end
UpdatePartyColors()
-- Big Health reads its tint from the name background.
if PlayerFrameHealthBar then
local r, g, b, a = PlayerFrameHealthBar:GetStatusBarColor()
PlayerFrameHealthBar:SetStatusBarColor(r, g, b, a)
end
end)
end