mirror of
https://github.com/brues-code/Vanilla_MikScrollingBattleText.git
synced 2026-10-30 08:30:49 +00:00
Compare commits
4
Commits
classicapi
..
v4.45
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4931b1ba7 | ||
|
|
73fd6803ab | ||
|
|
496979f486 | ||
|
|
a5e46a62b8 |
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
|||||||
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||||
|
|
||||||
|
<!-- Frame that handles core events -->
|
||||||
|
<Frame name="MCEHEventFrame">
|
||||||
|
<Scripts>
|
||||||
|
<OnEvent>MikCEH.OnEvent();</OnEvent>
|
||||||
|
<OnLoad>MikCEH.OnLoad();</OnLoad>
|
||||||
|
<OnUpdate>MikCEH.OnUpdate();</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
</Ui>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@
|
|||||||
## Title: Mik's Scrolling Battle Text
|
## Title: Mik's Scrolling Battle Text
|
||||||
## Notes: Scrolls battle information around the character model.
|
## Notes: Scrolls battle information around the character model.
|
||||||
## Notes-ruRU: Прокрутка информации боя вокруг модели персонажа.
|
## Notes-ruRU: Прокрутка информации боя вокруг модели персонажа.
|
||||||
## Dependencies: !!!ClassicAPI
|
|
||||||
## OptionalDeps: SW_FixLogStrings
|
## OptionalDeps: SW_FixLogStrings
|
||||||
## SavedVariables: MikSBT_Save
|
## SavedVariables: MikSBT_Save
|
||||||
|
|
||||||
@@ -16,5 +15,8 @@ MikScrollingBattleText-deDE.lua
|
|||||||
MikScrollingBattleText-ruRU.lua
|
MikScrollingBattleText-ruRU.lua
|
||||||
|
|
||||||
localization.lua
|
localization.lua
|
||||||
|
MikTableRecyclerObject.lua
|
||||||
MikCombatEventHelper.lua
|
MikCombatEventHelper.lua
|
||||||
MikScrollingBattleText.lua
|
MikScrollingBattleText.lua
|
||||||
|
MikCombatEventHelper.xml
|
||||||
|
MikScrollingBattleText.xml
|
||||||
@@ -0,0 +1,385 @@
|
|||||||
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||||
|
|
||||||
|
<!-- Frame that handles core events -->
|
||||||
|
<Frame name="MSBTEventFrame">
|
||||||
|
<Scripts>
|
||||||
|
<OnEvent>MikSBT.OnEvent();</OnEvent>
|
||||||
|
<OnLoad>MikSBT.OnLoad();</OnLoad>
|
||||||
|
<OnUpdate>MikSBT.OnUpdate();</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<!-- Tooltip -->
|
||||||
|
<GameTooltip name="MSBT_Tooltip" frameStrata="TOOLTIP" hidden="true" parent="UIParent" inherits="GameTooltipTemplate">
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
this:SetOwner(WorldFrame, "ANCHOR_NONE");
|
||||||
|
</OnLoad>
|
||||||
|
</Scripts>
|
||||||
|
</GameTooltip>
|
||||||
|
|
||||||
|
<!-- Incoming Scroll Area -->
|
||||||
|
<Frame name="MSBTFrameIncoming" toplevel="true" enableMouse="false" parent="UIParent" frameStrata="HIGH" hidden="true">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="24" y="24" />
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" relativePoint="CENTER" relativeTo="UIParent">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="-60" y="-160" />
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="ARTWORK">
|
||||||
|
<FontString name="$parentText1" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText2" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText3" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText4" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText5" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText6" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText7" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText8" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText9" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText10" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText11" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText12" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText13" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText14" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText15" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText16" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText17" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText18" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText19" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText20" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMRIGHT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Scripts>
|
||||||
|
<OnUpdate>MikSBT.OnUpdateAnimationFrame(this);</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<!-- Notification Scroll Area -->
|
||||||
|
<Frame name="MSBTFrameNotification" toplevel="true" enableMouse="false" parent="UIParent" frameStrata="HIGH" hidden="true">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="24" y="25" />
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" relativePoint="CENTER" relativeTo="UIParent">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="0" y="100" />
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="ARTWORK">
|
||||||
|
<FontString name="$parentText1" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText2" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText3" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText4" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText5" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText6" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText7" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText8" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText9" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText10" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText11" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText12" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText13" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText14" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText15" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText16" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText17" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText18" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText19" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText20" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Scripts>
|
||||||
|
<OnUpdate>MikSBT.OnUpdateAnimationFrame(this);</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
|
<!-- Outgoing Scroll Area -->
|
||||||
|
<Frame name="MSBTFrameOutgoing" toplevel="true" enableMouse="false" parent="UIParent" frameStrata="HIGH" hidden="true">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="24" y="24" />
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" relativePoint="CENTER" relativeTo="UIParent">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="60" y="-160" />
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="ARTWORK">
|
||||||
|
<FontString name="$parentText1" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText2" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText3" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText4" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText5" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText6" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText7" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText8" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText9" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText10" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText11" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOM" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText12" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText13" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText14" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText15" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText16" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText17" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText18" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText19" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
<FontString name="$parentText20" inherits="MasterFont">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="BOTTOMLEFT" />
|
||||||
|
</Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Scripts>
|
||||||
|
<OnUpdate>MikSBT.OnUpdateAnimationFrame(this);</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
</Ui>
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
-------------------------------------------------------------------------------------
|
||||||
|
-- Title: Mik's Table Recyler Object
|
||||||
|
-- Author: Mik
|
||||||
|
-- Maintainer: Athene
|
||||||
|
-- Credits:
|
||||||
|
-- Thanks to tekkub, the author of compostLib. I adapted much of his code for
|
||||||
|
-- this object.
|
||||||
|
-------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Create "namespace."
|
||||||
|
MikTRO = {};
|
||||||
|
|
||||||
|
-- Set the __index property to the recycler object namespace so
|
||||||
|
-- when a new recycler object sets it metatable to the namespace
|
||||||
|
-- the recycler object inherits the functions in the namespace.
|
||||||
|
MikTRO.__index = MikTRO;
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Creates a recycler object.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:NewRecyclerObject(maxEntries)
|
||||||
|
-- Create a table to use.
|
||||||
|
recyclerObject = {};
|
||||||
|
|
||||||
|
-- Create a table to hold the cache entries and set its max permanent size.
|
||||||
|
recyclerObject.PrimaryCache = {};
|
||||||
|
recyclerObject.PrimaryCacheSize = 0;
|
||||||
|
recyclerObject.MaxEntries = maxEntries;
|
||||||
|
|
||||||
|
-- Create some variables to hold stats.
|
||||||
|
recyclerObject.NumNew = 0;
|
||||||
|
recyclerObject.NumRecycled = 0;
|
||||||
|
recyclerObject.NumErased = 0;
|
||||||
|
recyclerObject.NumReclaimed = 0;
|
||||||
|
recyclerObject.AmountMemFreed = 0;
|
||||||
|
|
||||||
|
|
||||||
|
-- Create a table to hold overflow entries. If more tables are reclaimed
|
||||||
|
-- than the size of the max primary cache can hold, they will be reclaimed
|
||||||
|
-- into the overflow cache which is a weak table. This allows for spikes
|
||||||
|
-- in cache usage to still be optimized while not preventing garbage
|
||||||
|
-- collection on the extra data once there are no other references to them.
|
||||||
|
recyclerObject.OverflowCache = {};
|
||||||
|
setmetatable(recyclerObject.OverflowCache, {__mode = "v"});
|
||||||
|
|
||||||
|
|
||||||
|
-- Set the meta table for the cache object to the table recycler
|
||||||
|
-- obect's namespace so the cache object inherits the functions of
|
||||||
|
-- table recycler object.
|
||||||
|
setmetatable(recyclerObject, self);
|
||||||
|
|
||||||
|
-- Return the recycler object.
|
||||||
|
return recyclerObject;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Removes a table from the cache and returns it. If there are no tables available
|
||||||
|
-- in the cache a new one is returned.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:AcquireTable()
|
||||||
|
-- Check if there are any tables available in the primary cache and if so
|
||||||
|
-- return one.
|
||||||
|
if (self.PrimaryCacheSize > 0) then
|
||||||
|
-- Increment the number of recycled tables.
|
||||||
|
self.NumRecycled = self.NumRecycled + 1;
|
||||||
|
|
||||||
|
self.PrimaryCacheSize = self.PrimaryCacheSize - 1;
|
||||||
|
return table.remove(self.PrimaryCache);
|
||||||
|
|
||||||
|
-- Check if there are any tables available in the overflow cache and if so
|
||||||
|
-- return one.
|
||||||
|
elseif self:TablesInOverflow() then
|
||||||
|
-- Increment the number of recycled tables.
|
||||||
|
self.NumRecycled = self.NumRecycled + 1;
|
||||||
|
|
||||||
|
-- Loop through the tables in the overflow and return one.
|
||||||
|
for i in pairs(self.OverflowCache) do
|
||||||
|
return table.remove(self.OverflowCache, i);
|
||||||
|
end
|
||||||
|
|
||||||
|
-- No tables available so return a new one.
|
||||||
|
else
|
||||||
|
-- Increment the number of new tables created.
|
||||||
|
self.NumNew = self.NumNew + 1;
|
||||||
|
return {};
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Reclaims a table into the cache.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:ReclaimTable(t)
|
||||||
|
-- Check if the passed value isn't valid.
|
||||||
|
if (type(t) ~= "table") then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Erase the passed table.
|
||||||
|
self:EraseTable(t);
|
||||||
|
|
||||||
|
-- Check if the primary cache is already full.
|
||||||
|
if (self.PrimaryCacheSize >= self.MaxEntries) then
|
||||||
|
-- Insert the table into the overflow cache.
|
||||||
|
table.insert(self.OverflowCache, t);
|
||||||
|
else
|
||||||
|
-- Insert the table into the primary cache.
|
||||||
|
table.insert(self.PrimaryCache, t);
|
||||||
|
self.PrimaryCacheSize = self.PrimaryCacheSize + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Increment the number of reclaimed tables.
|
||||||
|
self.NumReclaimed = self.NumReclaimed + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Erases the passed table. Subtables are NOT erased.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:EraseTable(t)
|
||||||
|
-- Check if the passed value isn't valid.
|
||||||
|
if (type(t) ~= "table") then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Loop through all the keys in the table and clear it.
|
||||||
|
for key in pairs(t) do
|
||||||
|
t[key] = nil;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set the length of the table to 0.
|
||||||
|
table.setn(t, 0);
|
||||||
|
|
||||||
|
-- Increment the number of tables erased.
|
||||||
|
self.NumErased = self.NumErased + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Prints stats.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:PrintStats()
|
||||||
|
local overflowSize = 0;
|
||||||
|
for i in pairs(self.OverflowCache) do
|
||||||
|
overflowSize = overflowSize + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
DEFAULT_CHAT_FRAME:AddMessage(string.format(
|
||||||
|
"|cff00ff00New Tables: %d|r |cffffff00Recycled Tables: %d|r |cff00ffffCached Tables: %d|r |cffff0000Overflow Tables: %d|r |cff888888Erased Tables: %d|r |cffff00ffMemory Saved: %d KiB|r |cffff0088Tables Lost to GC: %d",
|
||||||
|
self.NumNew,
|
||||||
|
self.NumRecycled,
|
||||||
|
self.PrimaryCacheSize,
|
||||||
|
overflowSize,
|
||||||
|
self.NumErased,
|
||||||
|
self.AmountMemFreed + ((32/1024) * self.NumRecycled),
|
||||||
|
self.NumReclaimed - self.NumRecycled - self.PrimaryCacheSize));
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- **********************************************************************************
|
||||||
|
-- Checks if there are any tables in the overflow cache.
|
||||||
|
-- **********************************************************************************
|
||||||
|
function MikTRO:TablesInOverflow()
|
||||||
|
return next(self.OverflowCache) ~= nil;
|
||||||
|
end
|
||||||
@@ -6,26 +6,31 @@
|
|||||||
|
|
||||||
-- Create "namespace."
|
-- Create "namespace."
|
||||||
MikSBT = {};
|
MikSBT = {};
|
||||||
local addonName, addonTable = ...
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- Mod Constants
|
-- Mod Constants
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
MikSBT.MOD_NAME = addonName
|
MikSBT.MOD_NAME = "MikScrollingBattleText"
|
||||||
|
MikSBT.VERSION_NUMBER = 4.43;
|
||||||
-- The packager fills in the .toc version ("v4.45"); an unpackaged checkout still has the
|
MikSBT.VERSION_STRING = "v4.43 beta";
|
||||||
-- "@project-version@" placeholder.
|
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING .. " - \124cffF58CBA\124hAthene Edit\124h\124r";
|
||||||
local version = GetAddOnMetadata(addonName, "Version");
|
|
||||||
MikSBT.VERSION_STRING = string.find(version, "^@") and "dev" or version;
|
|
||||||
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING .. " - \124cffF58CBA\124hClassicAPI Edition\124h\124r";
|
|
||||||
|
|
||||||
MikSBT.COMMAND = "/msbt";
|
MikSBT.COMMAND = "/msbt";
|
||||||
|
|
||||||
local L = AceLibrary("AceLocale-2.2"):new(MikSBT.MOD_NAME)
|
local L = AceLibrary("AceLocale-2.2"):new(MikSBT.MOD_NAME)
|
||||||
|
|
||||||
-- Resolves a spell's localized name from its ID via ClassicAPI (C_Spell), replacing
|
-- Resolves a spell's localized name from its ID via Nampower's GetSpellRecField,
|
||||||
-- the old Babble-Spell localization library. Any rank's spell ID yields the same name.
|
-- replacing the old Babble-Spell library. Falls back to the given English name when
|
||||||
local function SpellName(id) return C_Spell.GetSpellName(id) or "" end
|
-- Nampower is absent (vanilla has no built-in spellId->name lookup). Shared across
|
||||||
|
-- files via the MikSBT namespace; localization.lua loads first per the .toc.
|
||||||
|
function MikSBT.SpellName(id, fallback)
|
||||||
|
if GetSpellRecField then
|
||||||
|
local ok, n = pcall(GetSpellRecField, id, "name")
|
||||||
|
if ok and n and n ~= "" then return n end
|
||||||
|
end
|
||||||
|
return fallback
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- English (Default)
|
-- English (Default)
|
||||||
@@ -51,7 +56,7 @@ MikSBT.COMMAND_USAGE = {
|
|||||||
" " .. MikSBT.COMMAND_DISABLE .. " - Disables the mod.",
|
" " .. MikSBT.COMMAND_DISABLE .. " - Disables the mod.",
|
||||||
" " .. MikSBT.COMMAND_ENABLE .. " - Enables the mod.",
|
" " .. MikSBT.COMMAND_ENABLE .. " - Enables the mod.",
|
||||||
" " .. MikSBT.COMMAND_SHOWVER .. " - Shows the current version.",
|
" " .. MikSBT.COMMAND_SHOWVER .. " - Shows the current version.",
|
||||||
" " .. MikSBT.COMMAND_STATS .. " - Reports how many pooled event tables are in use.",
|
" " .. MikSBT.COMMAND_STATS .. " - Reports stats about table recycling.",
|
||||||
" " .. MikSBT.COMMAND_SEARCH .. " filter - Sets a filter for searching event types.",
|
" " .. MikSBT.COMMAND_SEARCH .. " filter - Sets a filter for searching event types.",
|
||||||
" " .. MikSBT.COMMAND_DEBUG .. " - Toggles debug mode.",
|
" " .. MikSBT.COMMAND_DEBUG .. " - Toggles debug mode.",
|
||||||
" " .. MikSBT.COMMAND_HELP .. " - Show the command usage.",
|
" " .. MikSBT.COMMAND_HELP .. " - Show the command usage.",
|
||||||
@@ -132,7 +137,6 @@ MikSBT.AVAILABLE_FONTS = {
|
|||||||
[30] = {Name="PT-Sans-Narrow-Regular", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\PT-Sans-Narrow-Regular.ttf"},
|
[30] = {Name="PT-Sans-Narrow-Regular", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\PT-Sans-Narrow-Regular.ttf"},
|
||||||
[31] = {Name="Simhei", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\simhei.ttf"},
|
[31] = {Name="Simhei", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\simhei.ttf"},
|
||||||
[32] = {Name="Archangelsk", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\archangelsk.ttf"},
|
[32] = {Name="Archangelsk", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\archangelsk.ttf"},
|
||||||
[32] = {Name="Numen", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\Numen.ttf"},
|
|
||||||
};
|
};
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -209,6 +213,7 @@ MikSBT.DEFAULT_PROFILE_NAME = "Default";
|
|||||||
-- %s = name of the spell, ability, buff, debuff, power type, etc.
|
-- %s = name of the spell, ability, buff, debuff, power type, etc.
|
||||||
-- %t = damage type
|
-- %t = damage type
|
||||||
MikSBT.DEFAULT_CONFIG = {
|
MikSBT.DEFAULT_CONFIG = {
|
||||||
|
CreationVersion = MikSBT.VERSION_NUMBER,
|
||||||
ShowPartialEffects = true,
|
ShowPartialEffects = true,
|
||||||
ShowOverheals = true,
|
ShowOverheals = true,
|
||||||
ShowGameDamage = false,
|
ShowGameDamage = false,
|
||||||
@@ -1140,7 +1145,7 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
MSBT_TRIGGER_EXECUTE = {
|
MSBT_TRIGGER_EXECUTE = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(5308).."!", -- Execute
|
Message = MikSBT.SpellName(5308, "Execute").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1157,7 +1162,7 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
MSBT_TRIGGER_HAMMER_OF_WRATH = {
|
MSBT_TRIGGER_HAMMER_OF_WRATH = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(24275).."!", -- Hammer of Wrath
|
Message = MikSBT.SpellName(24275, "Hammer of Wrath").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1174,7 +1179,7 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
MSBT_TRIGGER_COUNTER_ATTACK = {
|
MSBT_TRIGGER_COUNTER_ATTACK = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(19306).."!", -- Counterattack
|
Message = MikSBT.SpellName(19306, "Counterattack").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1193,7 +1198,7 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
MSBT_TRIGGER_MONGOOSE_BITE = {
|
MSBT_TRIGGER_MONGOOSE_BITE = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(1495).."!", -- Mongoose Bite
|
Message = MikSBT.SpellName(1495, "Mongoose Bite").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1212,7 +1217,7 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
MSBT_TRIGGER_CLEARCAST = {
|
MSBT_TRIGGER_CLEARCAST = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(16246).."!", -- Clearcasting
|
Message = MikSBT.SpellName(16246, "Clearcasting").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1223,14 +1228,14 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
Classes = {MAGE=true,SHAMAN=true},
|
Classes = {MAGE=true,SHAMAN=true},
|
||||||
TriggerType = 6,
|
TriggerType = 6,
|
||||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, SpellName(16246))}, -- Clearcasting (ID verified vs Spell.dbc)
|
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, MikSBT.SpellName(16246, "Clearcasting"))},
|
||||||
},
|
},
|
||||||
Texture = "Interface\\Icons\\spell_shadow_manaburn"
|
Texture = "Interface\\Icons\\spell_shadow_manaburn"
|
||||||
},
|
},
|
||||||
MSBT_TRIGGER_RIPOSTE = {
|
MSBT_TRIGGER_RIPOSTE = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(14251).."!", -- Riposte
|
Message = MikSBT.SpellName(14251, "Riposte").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
@@ -1259,14 +1264,14 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
TriggerSettings = {
|
TriggerSettings = {
|
||||||
TriggerType = 6,
|
TriggerType = 6,
|
||||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(SpellName(8512), "-", "%%-"))}, -- Windfury Totem (ID verified vs Spell.dbc). "Vous gagnez Totem Furie-des-vents" -- escape char !
|
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(MikSBT.SpellName(8512, "Windfury Totem"), "-", "%%-"))}, --"Vous gagnez Totem Furie-des-vents" -- escape char !
|
||||||
},
|
},
|
||||||
Texture = "Interface\\Icons\\spell_nature_cyclone"
|
Texture = "Interface\\Icons\\spell_nature_cyclone"
|
||||||
},
|
},
|
||||||
MSBT_TRIGGER_NIGHTFALL = {
|
MSBT_TRIGGER_NIGHTFALL = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(18094).."!", -- Nightfall (talent)
|
Message = MikSBT.SpellName(18094, "Nightfall").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=0.709, g=0, b=0.709},
|
Color = {r=0.709, g=0, b=0.709},
|
||||||
@@ -1277,14 +1282,14 @@ MikSBT.DEFAULT_CONFIG = {
|
|||||||
Classes = {WARLOCK=true},
|
Classes = {WARLOCK=true},
|
||||||
TriggerType = 6,
|
TriggerType = 6,
|
||||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, SpellName(17941))}, -- Shadow Trance (ID verified vs Spell.dbc)
|
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, MikSBT.SpellName(17941, "Shadow Trance"))},
|
||||||
},
|
},
|
||||||
Texture = "Interface\\Icons\\spell_shadow_twilight"
|
Texture = "Interface\\Icons\\spell_shadow_twilight"
|
||||||
},
|
},
|
||||||
MSBT_TRIGGER_OVERPOWER = {
|
MSBT_TRIGGER_OVERPOWER = {
|
||||||
EventSettings = {
|
EventSettings = {
|
||||||
Show = true,
|
Show = true,
|
||||||
Message = SpellName(7384).."!", -- Overpower
|
Message = MikSBT.SpellName(7384, "Overpower").."!",
|
||||||
IsSticky = true,
|
IsSticky = true,
|
||||||
FontSettings = {
|
FontSettings = {
|
||||||
Color = {r=1, g=1, b=0},
|
Color = {r=1, g=1, b=0},
|
||||||
|
|||||||
@@ -554,7 +554,7 @@ function MikSBTOpt.TriggerTypeDropdownOnClick(frameName)
|
|||||||
UIDropDownMenu_SetSelectedValue(getglobal(frameName), this.value);
|
UIDropDownMenu_SetSelectedValue(getglobal(frameName), this.value);
|
||||||
|
|
||||||
-- Setup the trigger controls appropriately depending on the trigger type.
|
-- Setup the trigger controls appropriately depending on the trigger type.
|
||||||
MikSBTOpt.SetupVariableTriggerControls(getglobal(frameName):GetParent().TriggerKey, this.value == MikSBT.TRIGGERTYPE_SEARCH_PATTERN);
|
MikSBTOpt.SetupVariableTriggerControls(getglobal(frameName):GetParent().TriggerKey, this.value == MikCEH.TRIGGERTYPE_SEARCH_PATTERN);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -3345,7 +3345,7 @@ function MikSBTOpt.ShowTriggerConfig(triggerKey)
|
|||||||
|
|
||||||
MikSBTOpt.PopulateEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. "IconNameEditbox", texture);
|
MikSBTOpt.PopulateEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. "IconNameEditbox", texture);
|
||||||
-- Setup the trigger controls appropriately depending on the trigger type.
|
-- Setup the trigger controls appropriately depending on the trigger type.
|
||||||
MikSBTOpt.SetupVariableTriggerControls(triggerKey, triggerData.TriggerSettings.TriggerType == MikSBT.TRIGGERTYPE_SEARCH_PATTERN);
|
MikSBTOpt.SetupVariableTriggerControls(triggerKey, triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN);
|
||||||
|
|
||||||
-- Show the trigger settings.
|
-- Show the trigger settings.
|
||||||
triggerFrame:Show();
|
triggerFrame:Show();
|
||||||
@@ -3389,7 +3389,7 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
|
|||||||
if (not triggerFrame.SelectedTriggerEvents) then
|
if (not triggerFrame.SelectedTriggerEvents) then
|
||||||
triggerFrame.SelectedTriggerEvents = {};
|
triggerFrame.SelectedTriggerEvents = {};
|
||||||
else
|
else
|
||||||
table.wipe(triggerFrame.SelectedTriggerEvents);
|
MikCEH.EraseTable(triggerFrame.SelectedTriggerEvents);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Loop through all of the trigger events for the trigger.
|
-- Loop through all of the trigger events for the trigger.
|
||||||
@@ -3525,7 +3525,7 @@ function MikSBTOpt.SaveTriggerConfig()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check if the trigger type is search pattern.
|
-- Check if the trigger type is search pattern.
|
||||||
if (triggerData.TriggerSettings.TriggerType == MikSBT.TRIGGERTYPE_SEARCH_PATTERN) then
|
if (triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN) then
|
||||||
-- Clear the threshold field.
|
-- Clear the threshold field.
|
||||||
triggerData.TriggerSettings.Threshold = nil;
|
triggerData.TriggerSettings.Threshold = nil;
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ A World of Warcraft 1.12 (Vanilla) addon that displays scrolling combat text aro
|
|||||||
|
|
||||||
**Interface:** 11200 | **Version:** 4.43
|
**Interface:** 11200 | **Version:** 4.43
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- **ClassicAPI** — a client-side DLL that backports modern WoW API calls to the 1.12 client (no companion addon required). MSBT relies on it for `C_Spell.GetSpellName`, `C_Item.GetItemName`/`GetItemIcon`, `ItemLocation`, and `CreateColor`/`GetRGB` — used for spell-name lookups, item-icon resolution, and damage-type text coloring. These are not optional fast paths; the addon expects them to be present.
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Scrolling combat text across three display areas: **Incoming** (right), **Outgoing** (left), and **Notification** (center)
|
- Scrolling combat text across three display areas: **Incoming** (right), **Outgoing** (left), and **Notification** (center)
|
||||||
@@ -59,50 +55,56 @@ Interface/
|
|||||||
| `/msbt disable` | Disable the addon |
|
| `/msbt disable` | Disable the addon |
|
||||||
| `/msbt enable` | Enable the addon |
|
| `/msbt enable` | Enable the addon |
|
||||||
| `/msbt version` | Show the current version |
|
| `/msbt version` | Show the current version |
|
||||||
| `/msbt stats` | Report how many pooled event tables are in use |
|
| `/msbt stats` | Report table recycling statistics |
|
||||||
| `/msbt search <filter>` | Set a filter for searching event types |
|
| `/msbt search <filter>` | Set a filter for searching event types |
|
||||||
| `/msbt debug` | Toggle debug mode |
|
| `/msbt debug` | Toggle debug mode |
|
||||||
| `/msbt help` | Show command usage |
|
| `/msbt help` | Show command usage |
|
||||||
|
|
||||||
## ClassicAPI Combat Log Integration
|
## Nampower / SuperWoW / UnitXP SP3 Integration
|
||||||
|
|
||||||
MSBT reads structured combat data from ClassicAPI's `COMBAT_LOG_EVENT_UNFILTERED` instead of relying on string-based combat log parsing alone, for significantly better performance in heavy combat scenarios (raids, AoE, battlegrounds).
|
When these enhanced client mods are detected, MSBT automatically switches from string-based combat log parsing to structured event handling for significantly better performance in heavy combat scenarios (raids, AoE, battlegrounds).
|
||||||
|
|
||||||
### What Changes
|
### What Changes
|
||||||
|
|
||||||
- **ClassicAPI combat log**: Registers for the unfiltered combat log (`SPELL_DAMAGE`, `SWING_DAMAGE`, `SPELL_HEAL`, `SPELL_ENERGIZE`, `SPELL_MISSED`, `SPELL_AURA_APPLIED`, `ENVIRONMENTAL_DAMAGE`, `PARTY_KILL`, etc.) which carries pre-parsed amounts, GUIDs, crit flags, miss types and spell info. It is the only source for combat events. No opt-in CVars are needed.
|
- **Nampower**: Registers for structured events (`SPELL_DAMAGE_EVENT_SELF`, `AUTO_ATTACK_SELF`, `SPELL_HEAL_ON_SELF`, etc.) that provide pre-parsed combat data. Redundant `CHAT_MSG_*` events are unregistered to avoid duplicates. Enables `NP_EnableAutoAttackEvents`, `NP_EnableSpellHealEvents`, and `NP_EnableSpellEnergizeEvents` CVars.
|
||||||
- **Spell icons**: combat log events resolve icons from their SpellId with ClassicAPI's `C_Spell.GetSpellTexture`. Events with only a name fall back to the player's auras, spellbook and items; each name is looked up once.
|
- **SuperWoW**: Provides O(1) unit lookups by name via `UnitExists(name)` (replacing O(n) raid/party iteration) and `SpellInfo(spellId)` for spell icon resolution.
|
||||||
|
- **UnitXP SP3**: Detected for compatibility; used for GUID-based unit resolution.
|
||||||
### Removed: SuperWoW / UnitXP SP3 / Nampower
|
|
||||||
|
|
||||||
SuperWoW, UnitXP SP3 and Nampower integration has been removed in favor of ClassicAPI (for spell/item lookups, GUIDs and structured combat events). ClassicAPI is a hard dependency (see the `.toc`).
|
|
||||||
|
|
||||||
### Fallback
|
### Fallback
|
||||||
|
|
||||||
`CHAT_MSG_*` messages are parsed only for what the combat log lacks (honor, reputation, skill, XP, item enchantments, power losses). All of them stay registered because search pattern triggers can match any of them.
|
When none of these mods are present, the addon falls back to the original string-parsing pipeline with no changes in behavior.
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- Check detection status in-game:
|
||||||
|
/run MikSBT.Print("NP="..tostring(MikCEH.hasNampower).." SW="..tostring(MikCEH.hasSuperWoW).." UXP="..tostring(MikCEH.hasUnitXP))
|
||||||
|
```
|
||||||
|
|
||||||
## Performance Optimizations
|
## Performance Optimizations
|
||||||
|
|
||||||
- **Upvalue caching**: Frequently called standard library functions (`string.find`, `string.gsub`, `table.insert`, `table.getn`, `GetTime`, etc.) are cached as local variables
|
- **Upvalue caching**: Frequently called standard library functions (`string.find`, `string.gsub`, `table.insert`, `table.getn`, `GetTime`, etc.) are cached as local variables
|
||||||
- **Dispatch table**: Combat event routing uses O(1) table lookup instead of an if/elseif chain
|
- **Dispatch table**: Combat event routing uses O(1) table lookup instead of an if/elseif chain
|
||||||
- **Unit event filtering**: `UNIT_HEALTH` (player, target, pet) and `UNIT_MANA` (player) use ClassicAPI's `RegisterUnitEvent`, so other units' updates never reach Lua
|
- **SpellId icon cache**: When spellIds are available (via Nampower/SuperWoW), icons are resolved directly and cached, bypassing Babble-Spell dictionary lookups and tooltip scanning
|
||||||
- **Table pooling**: Animation event tables come from a ClassicAPI object pool (`CreateUnsecuredObjectPool`) and are reused, so 1.12's stop-the-world GC runs less often
|
- **Event throttling**: UNIT_HEALTH and UNIT_MANA trigger checks are throttled to 150ms intervals
|
||||||
|
- **Table recycling**: `MikTRO` (Table Recycler Object) pools and reuses table allocations to reduce garbage collection pressure
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
### Namespaces
|
### Global Namespaces
|
||||||
|
|
||||||
| Namespace | Purpose |
|
| Namespace | Purpose |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `MikSBT` | Global. Main addon: display, animation, profiles, event routing, slash commands, and the API the options addon and other addons use |
|
| `MikSBT` | Main addon: display, animation, profiles, event routing, slash commands |
|
||||||
| `MikCEH` | Private, shared through the addon table. Combat Event Helper: parses combat events into structured data |
|
| `MikCEH` | Combat Event Helper: parses combat events into structured data |
|
||||||
|
| `MikTRO` | Table Recycler Object: memory pool for table reuse |
|
||||||
|
|
||||||
### Event Processing Pipeline
|
### Event Processing Pipeline
|
||||||
|
|
||||||
```
|
```
|
||||||
ClassicAPI COMBAT_LOG_EVENT_UNFILTERED (plus CHAT_MSG_* for triggers and non-combat notifications)
|
WoW CHAT_MSG_* events (or Nampower structured events)
|
||||||
-> MikCEH.OnEvent() / MikCEH.OnCombatLogEvent()
|
-> MikCEH.OnEvent() / MikCEH.OnNampowerEvent()
|
||||||
-> ParseCombatEvents() dispatch table (or combat log handler)
|
-> ParseCombatEvents() dispatch table (or Nampower handler)
|
||||||
-> Creates CombatEventData tables
|
-> Creates CombatEventData tables
|
||||||
-> MikSBT.CombatEventsHandler()
|
-> MikSBT.CombatEventsHandler()
|
||||||
-> Formats text with templates (%a=amount, %n=name, %s=spell, %t=type)
|
-> Formats text with templates (%a=amount, %n=name, %s=spell, %t=type)
|
||||||
@@ -114,10 +116,11 @@ ClassicAPI COMBAT_LOG_EVENT_UNFILTERED (plus CHAT_MSG_* for triggers and non-com
|
|||||||
|
|
||||||
- **AceLibrary** — Addon framework skeleton
|
- **AceLibrary** — Addon framework skeleton
|
||||||
- **AceLocale-2.2** — Localization management
|
- **AceLocale-2.2** — Localization management
|
||||||
|
- **Babble-Spell-2.2** — Spell name database for icon lookups (~10K lines)
|
||||||
|
|
||||||
### Saved Variables
|
### Saved Variables
|
||||||
|
|
||||||
`MikSBT_Save` — Stores named profiles containing event settings, triggers, suppressions, display positions, and font settings. On load, settings added in newer versions are filled into existing profiles from the defaults.
|
`MikSBT_Save` — Stores named profiles containing event settings, triggers, suppressions, display positions, and font settings. Profiles support versioning and migration between addon versions.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user