fix getactioncooldown hook for blizzard ui users

This commit is contained in:
jrc13245
2026-01-19 12:07:56 -05:00
parent 8f1e2166b1
commit ef8481f37d
4 changed files with 2094 additions and 1 deletions
+2 -1
View File
@@ -4098,7 +4098,8 @@ function GetActionCooldown(slot)
return GetInventoryItemCooldown("player", a.item.inventoryID)
end
end
return 0, 0, 0
-- Fallback to original function (preserves SuperWoW's #showtooltip handling)
return CleveRoids.Hooks.GetActionCooldown(slot)
else
return CleveRoids.Hooks.GetActionCooldown(slot)
end
+1833
View File
File diff suppressed because it is too large Load Diff
+70
View File
@@ -0,0 +1,70 @@
SuperWoW features list as of 11/04/2024:
Healing appears on floating combat text.
Chatbubbles appear at 60 yard range instead of 20, and they can appear with nameplates activated
Chatbubbles work for raid, bg, whisper chat
Chat links of spells & crafting recipes now supported by client, can be grabbed directly from wowhead.
Fully absorbed damage is now correctly shown in combat log instead of saying "unit absorbs the attack".
Macros character limit increased from 255 to 510.
Your personal buff bar now shows all your buffs including ones that don't normally have an icon.
Added "UNIT_CASTEVENT" event that tracks units cast starts, finishes, interrupts, channels, and swings (differentiates mainhand & offhand) arg1: casterGUID. arg2: targetGUID. arg3: event type ("START", "CAST", "FAIL", "CHANNEL", "MAINHAND", "OFFHAND"). arg4: spell id. arg5: cast duration.
Added "RAW_COMBATLOG" event that signals the RAW version of all combat log events. arg1: original event name. arg2: event text with GUIDs
Raw combat log events are logged into WoWRawCombatLog.txt concurrently with original WoWCombatLog.txt if logging is enabled.
Combat log now appends owner name to combat log messages that have a owned unit such as a pet or totem.
The default event SPELLCAST_START now triggers on ranged weapon abilities like Aimed Shot & Multishot.
Removed range limit on seeing friendly players equipped items. This is to allow addons such as AdvancedVanillaCombatLog to build profiles of raid members without requiring every individual raid member to download a helper addon and communicate the information to each other.
Targeting circle spells such as Blizzard or Flamestrike no longer show the "I can't cast this ability while moving error" to stop from entering their targeting circle mode.
New CVar "BackgroundSound" to enable or disable background sound while tabbed out (default = "0", can be "0" or "1")
New CVar "UncapSounds". set to "1" to remove the hardcoded soundchannels limit. If you want true uncapped sound experience you still have accompany this CVAR with setting "SoundSoftwareChannels" and "SoundMaxHardwareChannels" to a high number (either by lua function, config.wtf edit or using VanillaTweaks)
New CVar "FoV" to set camera field of view (default = "1.57", can be any value from "0.1" to "3.14")
New CVar "SelectionCircleStyle" to set a different appearance for the target circle.
New CVar "LootSparkle" to toggle Sparkling effect on lootable treasure.
Function changes:
CastSpellByName function now can take unit as 2nd argument in addition to true/false OnSelf flag
UnitExists now also returns GUID of unit
UnitDebuff and UnitBuff now additionally return the id of the aura
Using UnitMana("player") as a druid now always returns your current form power and caster form mana at the same time.
frame:GetName(1) can now be used on nameplate frames to return the GUID of the attached unit.
SetRaidTarget now accepts 3rd argument "local" flag to assign a mark to your own client. This allows using target markers while solo.
LootSlot(slotid) that was previously used only to confirm "are you sure you want to loot this item" now has the usage format LootSlot(slotid [, forceloot]). LootSlot(slotid, 1) can now be used to actually loot a slot.
GetContainerItemInfo now returns item's charges instead of stacks if the item is not stackable & has charges. Charges are given as a negative number.
GetWeaponEnchantInfo() now can accept a friendly player (ex: party1) as argument. If used in this way, it gives the name of the temporary enchant on that player's mainhand & offhand. Old functionality is preserved for own player's enchant duration & stacks.
Macros can now be treated by the game as an item or a spell action by starting the macro with: "/tooltip spell:spellid" or "/tooltip item:itemid" respectively.
GetActionCount, GetActionCooldown, and ActionIsConsumable now work for macros returning the result of the linked spell or item. For example, you can create a macro that starts with "/tooltip item:18641" and all of these functions will treat it as if it's the item 18641 (dense dynamite), even if the macro will cast a different action on press.
GetActionText(actionButton) now additionally returns action type ("MACRO", "ITEM", "SPELL") and its id, or for macro, its index. a macro's index is the value used by GetMacroInfo(index). This allows you to differentiate between two macros on your actionbar that have the same name, or to find the id of an item or spell that is on your bar.
New functions:
GetPlayerBuffID(buffindex) function that returns id of the aura.
CombatLogAdd("text"[, addToRawLog]) function that prints a message directly to the combatlog file. If flag is set, prints the message to the raw combatlog file instead.
SpellInfo(spellid) function that returns information about a spell id (name, rank, texture file, minrange, max range to target).
TrackUnit(unitid) function that adds a friendly unit to the minimap.
UnitPosition(unitid) function that returns coordinates of a friendly unit.
SetMouseoverUnit(unitid) function that sets as current hovered unit. Usage for unitframe addon makers: do SetMouseoverUnit(frameUnit) on enter, and SetMouseoverUnit() on leave to clear. This allows "mouseover" of other functions to work on that currently hovered frame's unit.
Clickthrough(0/1) to turn off/on Clickthrough mode, Clickthrough() to simply return whether it's on. Clickthrough mode allows you to click through creature corpses that have no loot, to loot the creatures that are under them & covered by them.
SetAutoloot(0/1) to turn off/on autoloot, SetAutoloot() to simply return whether it's on. The hardcoded activation of autoloot by holding shift has been removed. You now turn it on or off through this function).
ImportFile("filename") reads a txt file in gamedirectory\imports and returns a string of its contents.
ExportFile("filename", "text") creates a txt file in gamedirectory\imports and writes text in it.
all functions that accept a unit as argument ("player", "target", "mouseover") now can accept an additional suffix "owner" which returns the owner of the unit (example, if you target a totem and do UnitName("targetowner") you'll get the name of the shaman).
all functions taht accept a unit as argument ("player, "target", "mouseover") now can accept "mark1" to "mark8" as argument which returns the unit with the corresponding marker index.
all functions that accept a unit as argument ("player", "target", "mouseover") now can accept the GUID of the unit, which can be obtained from UnitExists or GetName(1) on its nameplate. Suffixes can still be appended at the end of that string.
Global variables SUPERWOW_STRING and SUPERWOW_VERSION give mod info for addons.
+189
View File
@@ -0,0 +1,189 @@
UnitXP Service Pack 3
Making Vanilla 1.12 better:
Nameplates would consider line of sight.
Better targeting functions for your TAB key.
Being able to adjust camera height/placement.
In-game Frame-per-second limiter.
Flash taskbar icon when receiving whisper.
High quality floating combat texts.
Screenshot generates JPEG instead of TGA.
Step by step debugger for Lua addon.
And more...
UnitXP Service Pack 3 (abbr. xp3) is a game mod for Vanilla 1.12 which aims to bring the game modern and better experience.
Installation
Downloads from https://codeberg.org/konaka/UnitXP_SP3/releases
To setup the DLL file:
Put all files under the same folder with the game
Edit your loader's list (which might be dlls.txt) to include UnitXP_SP3.dll
Start the game
To setup the Lua addon:
Move UnitXP_SP3_Addon folder into Interface/AddOns/
Then in-game there is a minimap button to open its config interface.
UnitXP_SP3_Addon
When both the DLL and Lua addon are installed and loaded, there would be a minimap button to open up config interface.
Also the command /unitxp would open it either. Most functions could be configured here.
Targeting functions could be bound to keys via in-game Key Bindings menu.
Addon preview
Additional Lua functions
Line of sight
local bool_abc = UnitXP("inSight", UNIT_ID_1, UNIT_ID_2);
This would return TRUE if UNIT_ID_1 is in sight of UNIT_ID_2.
Distance
local double_abc = UnitXP("distanceBetween", UNIT_ID_1, UNIT_ID_2);
This would return the distance between UNIT_ID_1 and UNIT_ID_2. The default meter is accurate for ranged spell like bolts or heals.
local double_abc = UnitXP("distanceBetween", UNIT_ID_1, UNIT_ID_2, "AoE");
The AoE meter is accurate for novas.
local double_abc = UnitXP("distanceBetween", UNIT_ID_1, UNIT_ID_2, "meleeAutoAttack");
The meleeAutoAttack meter is accurate for melee weapon swings. Beware that melee spell cast is not the same as melee weapon swings: Taunt has a different range than auto-attack.
Behind
local bool_abc = UnitXP("behind", UNIT_ID_1, UNIT_ID_2);
This would return TRUE if UNIT_ID_1 is behind UNIT_ID_2.
There are some strange mobs whose back is not the π radian half of its back. You could set the range smaller by local back = UnitXP("behindThreshold", "set", 2); The third parameter by default is π/2 and it ranges from 0 to π the bigger of it, the smaller radian range would be judged as back.
Timer
local timer_id = UnitXP("timer", "arm", 1000, 2000, callback_function_name);
Arm a new timer which would trigger after 1000 milliseconds and would repeat every 2000 milliseconds to execute callback_function_name. You could pass 0 to stop repeating.
The timer ID would be passed into callback function as 1st parameter.
The xp3 timers run in a different thread from the game so that they would not cost game time to maintain. And they would trigger only when the time comes, rather than every frame.
UnitXP("timer", "disarm", TIMER_ID);
As xp3 timers are in a different thread, they would not be stopped when the game reload. Addon author needs to react to PLAYER_LOGOUT event and disarm running timers.
local total = UnitXP("timer", "size");
Return total count of running timers.
OS notifications
UnitXP("notify", "taskbarIcon");
UnitXP("notify", "systemSound");
Trigger a taskbar icon flash or a sound alert in operating system. These functions only effective when the game is in background.
Advanced Lua debugger
The xp3 provides a step by step debugger for in-game Lua. The debugger program is in UnitXP_SP3-debug packages.
To use the debugger:
Run Demo Lua Debugger.exe. It is a C# program which would work on Windows (via .NET framework) and Linux (via Mono).
In the Lua code, add a breakpoint as UnitXP("debug", "breakpoint");
Start the game and run the Lua code.
The xp3 would connect to debugger via TCP port 2323. Lua source preview requires Demo Lua Debugger.exe being placed in game's folder.
Version and existence
To tell if xp3 is exist in the game:
local xp3 = pcall(UnitXP, "nop", "nop");
Returns TRUE for existing.
local xp3exist, xp3buildTime = pcall(UnitXP, "version", "coffTimeDateStamp");
xp3buildTime is the time when xp3 is compiled and built. It is a UNIX timestamp so that you could compare as number to tell which one is newer.
local xp3exist, xp3info = pcall(UnitXP, "version", "additionalInformation");
xp3info is a string contains some description about the version. It meant to be used by different xp3 maintainer to distinguish bloodline.
Performance profile
local performance = UnitXP("performanceProfile", "get");
performance would be a string that shows performance factors of xp3.
Targeting
These functions could be bound to keys via in-game Key Bindings menu. Also they could be called via Lua.
Most targeting functions follow rules:
When there is no selected target, select the nearest enemy.
Select enemies in line of sight of player character.
Select enemies in front of camera. It is possbile to narrow the targeting cone to be smaller than camera sight by UnitXP("target", "rangeCone", 2.5); The third parameter ranges from 2.0 to infinate, the bigger of it, the narrower targeting cone.
The fartherest range (farRange) by default is 41, which could be adjusted in range 26 to 60 by UnitXP("target", "farRange", 60);.
When the player is in-combat, only select enemies who is in-combat either. This limitation could be lifted by UnitXP("target", "disableInCombatFilter");.
Totems, Pets and Critters would be ignored.
Targeting functions return TRUE when they found a target, so that you could chain multiple functions.
local found = UnitXP("target", "nearestEnemy");
Target the nearest enemy. It is the only one, no cycling.
local found = UnitXP("target", "mostHP");
Target the enemy with most HP. It is the only one, no cycling.
local found = UnitXP("target", "worldBoss");
Cycling around world bosses.
local found = UnitXP("target", "nextEnemyInCycle");
local found = UnitXP("target", "previousEnemyInCycle");
Cycling around enemies. It is gurandteed that when repeatly trigger this function, all enemies in range would be selected for once.
Ranged class might prefer this function as TAB key.
local found = UnitXP("target", "nextEnemyConsideringDistance");
local found = UnitXP("target", "previousEnemyConsideringDistance");
Cycling around enemies. Enemies are classified into 3 range buckets 0 to 8, 8 to 25, 25 to farRange. This function would give priority to enemies in the near bucket, so that when there is a targetable enemy in near bucket, the rest is ignored.
In 0 to 8 range the function cycling around all in-range enemies.
In 8 to 25 range the function cycling around 3 nearest in-range enemies.
In 25 to farRange range the function cycling around 5 nearest in-range enemies.
local found = UnitXP("target", "nextMarkedEnemyInCycle");
local found = UnitXP("target", "previousMarkedEnemyInCycle");
Cycling around raid marked enemies. By default the order is:
White Skull
Red Cross (X)
Blue Square
White Moon
Green Triangle
Purple Diamond
Orange Circle
Yellow Star
You could supply a third parameter to reorder or limit to specific marks:
local found = UnitXP("target", "nextMarkedEnemyInCycle", "138"); would cycle in order:
Yellow Star which is index 1
Purple Diamond which is index 3
White Skull which is index 8