mirror of
https://github.com/brues-code/Vanilla_MikScrollingBattleText.git
synced 2026-11-06 03:08:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a506dcf7d2 | ||
|
|
6f50252d8e | ||
|
|
b50ce60ec6 | ||
|
|
0fbff6f767 | ||
|
|
3c6420b22b | ||
|
|
86b71cec9f | ||
|
|
c187c92106 | ||
|
|
9bf7e51f76 | ||
|
|
a36912af47 | ||
|
|
4b09ebc3f7 | ||
|
|
862ac4c56a | ||
|
|
ea79f083f3 | ||
|
|
0229b07122 | ||
|
|
615c074a3f | ||
|
|
dc88b69103 | ||
|
|
9f88f0bf32 | ||
|
|
9d0f945c59 | ||
|
|
8c35b8b6ad | ||
|
|
6418359865 | ||
|
|
f42c2cf6ca | ||
|
|
c095b76d10 | ||
|
|
e8b3b81241 | ||
|
|
d13a4102b8 | ||
|
|
dce8df9e12 | ||
|
|
7502df37cf | ||
|
|
bf5be40e78 | ||
|
|
6a9dd18ce0 | ||
|
|
3f08a237de |
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
<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,12 +3,12 @@
|
||||
## Title: Mik's Scrolling Battle Text
|
||||
## Notes: Scrolls battle information around the character model.
|
||||
## Notes-ruRU: Прокрутка информации боя вокруг модели персонажа.
|
||||
## Dependencies: !!!ClassicAPI
|
||||
## OptionalDeps: SW_FixLogStrings
|
||||
## SavedVariables: MikSBT_Save
|
||||
|
||||
Libs\AceLibrary\AceLibrary.lua
|
||||
Libs\AceLocale-2.2\AceLocale-2.2.lua
|
||||
Libs\BabbleSpell-2.2\Babble-Spell-2.2.lua
|
||||
|
||||
MikScrollingBattleText-enUS.lua
|
||||
MikScrollingBattleText-frFR.lua
|
||||
@@ -16,8 +16,5 @@ MikScrollingBattleText-deDE.lua
|
||||
MikScrollingBattleText-ruRU.lua
|
||||
|
||||
localization.lua
|
||||
MikTableRecyclerObject.lua
|
||||
MikCombatEventHelper.lua
|
||||
MikScrollingBattleText.lua
|
||||
MikCombatEventHelper.xml
|
||||
MikScrollingBattleText.xml
|
||||
@@ -1,385 +0,0 @@
|
||||
<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>
|
||||
@@ -1,168 +0,0 @@
|
||||
-------------------------------------------------------------------------------------
|
||||
-- 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,21 +6,27 @@
|
||||
|
||||
-- Create "namespace."
|
||||
MikSBT = {};
|
||||
|
||||
local addonName, addonTable = ...
|
||||
-------------------------------------------------------------------------------
|
||||
-- Mod Constants
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
MikSBT.MOD_NAME = "MikScrollingBattleText"
|
||||
MikSBT.VERSION_NUMBER = 4.43;
|
||||
MikSBT.VERSION_STRING = "v4.43 beta";
|
||||
MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING .. " - \124cffF58CBA\124hAthene Edit\124h\124r";
|
||||
MikSBT.MOD_NAME = addonName
|
||||
|
||||
-- The packager fills in the .toc version ("v4.45"); an unpackaged checkout still has the
|
||||
-- "@project-version@" placeholder.
|
||||
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";
|
||||
|
||||
local BS = AceLibrary("Babble-Spell-2.2")
|
||||
local L = AceLibrary("AceLocale-2.2"):new(MikSBT.MOD_NAME)
|
||||
|
||||
-- Resolves a spell's localized name from its ID via ClassicAPI (C_Spell), replacing
|
||||
-- the old Babble-Spell localization library. Any rank's spell ID yields the same name.
|
||||
local function SpellName(id) return C_Spell.GetSpellName(id) or "" end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- English (Default)
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -45,7 +51,7 @@ MikSBT.COMMAND_USAGE = {
|
||||
" " .. MikSBT.COMMAND_DISABLE .. " - Disables the mod.",
|
||||
" " .. MikSBT.COMMAND_ENABLE .. " - Enables the mod.",
|
||||
" " .. MikSBT.COMMAND_SHOWVER .. " - Shows the current version.",
|
||||
" " .. MikSBT.COMMAND_STATS .. " - Reports stats about table recycling.",
|
||||
" " .. MikSBT.COMMAND_STATS .. " - Reports how many pooled event tables are in use.",
|
||||
" " .. MikSBT.COMMAND_SEARCH .. " filter - Sets a filter for searching event types.",
|
||||
" " .. MikSBT.COMMAND_DEBUG .. " - Toggles debug mode.",
|
||||
" " .. MikSBT.COMMAND_HELP .. " - Show the command usage.",
|
||||
@@ -126,6 +132,7 @@ MikSBT.AVAILABLE_FONTS = {
|
||||
[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"},
|
||||
[32] = {Name="Archangelsk", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\archangelsk.ttf"},
|
||||
[32] = {Name="Numen", Path="Interface\\Addons\\MikScrollingBattleText\\Fonts\\Numen.ttf"},
|
||||
};
|
||||
end
|
||||
|
||||
@@ -202,10 +209,9 @@ MikSBT.DEFAULT_PROFILE_NAME = "Default";
|
||||
-- %s = name of the spell, ability, buff, debuff, power type, etc.
|
||||
-- %t = damage type
|
||||
MikSBT.DEFAULT_CONFIG = {
|
||||
CreationVersion = MikSBT.VERSION_NUMBER,
|
||||
ShowPartialEffects = true,
|
||||
ShowOverheals = true,
|
||||
ShowGameDamage = true,
|
||||
ShowGameDamage = false,
|
||||
UseStickyCrits = true,
|
||||
ShowAllManaGains = false,
|
||||
LowHealthSound = true,
|
||||
@@ -1134,7 +1140,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_EXECUTE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Execute"].."!",
|
||||
Message = SpellName(5308).."!", -- Execute
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1151,7 +1157,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_HAMMER_OF_WRATH = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Hammer of Wrath"].."!",
|
||||
Message = SpellName(24275).."!", -- Hammer of Wrath
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1168,7 +1174,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_COUNTER_ATTACK = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Counterattack"].."!",
|
||||
Message = SpellName(19306).."!", -- Counterattack
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1187,7 +1193,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_MONGOOSE_BITE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Mongoose Bite"].."!",
|
||||
Message = SpellName(1495).."!", -- Mongoose Bite
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1206,7 +1212,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_CLEARCAST = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Clearcasting"].."!",
|
||||
Message = SpellName(16246).."!", -- Clearcasting
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1217,14 +1223,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
Classes = {MAGE=true,SHAMAN=true},
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Clearcasting"])},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, SpellName(16246))}, -- Clearcasting (ID verified vs Spell.dbc)
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_shadow_manaburn"
|
||||
},
|
||||
MSBT_TRIGGER_RIPOSTE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Riposte"].."!",
|
||||
Message = SpellName(14251).."!", -- Riposte
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1253,14 +1259,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
TriggerSettings = {
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(BS["Windfury Totem"], "-", "%%-"))}, --"Vous gagnez Totem Furie-des-vents" -- escape char !
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(SpellName(8512), "-", "%%-"))}, -- Windfury Totem (ID verified vs Spell.dbc). "Vous gagnez Totem Furie-des-vents" -- escape char !
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_nature_cyclone"
|
||||
},
|
||||
MSBT_TRIGGER_NIGHTFALL = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Nightfall"].."!",
|
||||
Message = SpellName(18094).."!", -- Nightfall (talent)
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=0.709, g=0, b=0.709},
|
||||
@@ -1271,14 +1277,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
Classes = {WARLOCK=true},
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Shadow Trance"])},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, SpellName(17941))}, -- Shadow Trance (ID verified vs Spell.dbc)
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_shadow_twilight"
|
||||
},
|
||||
MSBT_TRIGGER_OVERPOWER = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Overpower"].."!",
|
||||
Message = SpellName(7384).."!", -- Overpower
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
|
||||
@@ -554,7 +554,7 @@ function MikSBTOpt.TriggerTypeDropdownOnClick(frameName)
|
||||
UIDropDownMenu_SetSelectedValue(getglobal(frameName), this.value);
|
||||
|
||||
-- Setup the trigger controls appropriately depending on the trigger type.
|
||||
MikSBTOpt.SetupVariableTriggerControls(getglobal(frameName):GetParent().TriggerKey, this.value == MikCEH.TRIGGERTYPE_SEARCH_PATTERN);
|
||||
MikSBTOpt.SetupVariableTriggerControls(getglobal(frameName):GetParent().TriggerKey, this.value == MikSBT.TRIGGERTYPE_SEARCH_PATTERN);
|
||||
end
|
||||
|
||||
|
||||
@@ -3345,7 +3345,7 @@ function MikSBTOpt.ShowTriggerConfig(triggerKey)
|
||||
|
||||
MikSBTOpt.PopulateEditbox(TRIGGER_CONFIGURATION_FRAME_NAME .. "IconNameEditbox", texture);
|
||||
-- Setup the trigger controls appropriately depending on the trigger type.
|
||||
MikSBTOpt.SetupVariableTriggerControls(triggerKey, triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN);
|
||||
MikSBTOpt.SetupVariableTriggerControls(triggerKey, triggerData.TriggerSettings.TriggerType == MikSBT.TRIGGERTYPE_SEARCH_PATTERN);
|
||||
|
||||
-- Show the trigger settings.
|
||||
triggerFrame:Show();
|
||||
@@ -3389,7 +3389,7 @@ function MikSBTOpt.SetupVariableTriggerControls(triggerKey, showSearch)
|
||||
if (not triggerFrame.SelectedTriggerEvents) then
|
||||
triggerFrame.SelectedTriggerEvents = {};
|
||||
else
|
||||
MikCEH.EraseTable(triggerFrame.SelectedTriggerEvents);
|
||||
table.wipe(triggerFrame.SelectedTriggerEvents);
|
||||
end
|
||||
|
||||
-- Loop through all of the trigger events for the trigger.
|
||||
@@ -3525,7 +3525,7 @@ function MikSBTOpt.SaveTriggerConfig()
|
||||
end
|
||||
|
||||
-- Check if the trigger type is search pattern.
|
||||
if (triggerData.TriggerSettings.TriggerType == MikCEH.TRIGGERTYPE_SEARCH_PATTERN) then
|
||||
if (triggerData.TriggerSettings.TriggerType == MikSBT.TRIGGERTYPE_SEARCH_PATTERN) then
|
||||
-- Clear the threshold field.
|
||||
triggerData.TriggerSettings.Threshold = nil;
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ A World of Warcraft 1.12 (Vanilla) addon that displays scrolling combat text aro
|
||||
|
||||
**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
|
||||
|
||||
- Scrolling combat text across three display areas: **Incoming** (right), **Outgoing** (left), and **Notification** (center)
|
||||
@@ -55,56 +59,50 @@ Interface/
|
||||
| `/msbt disable` | Disable the addon |
|
||||
| `/msbt enable` | Enable the addon |
|
||||
| `/msbt version` | Show the current version |
|
||||
| `/msbt stats` | Report table recycling statistics |
|
||||
| `/msbt stats` | Report how many pooled event tables are in use |
|
||||
| `/msbt search <filter>` | Set a filter for searching event types |
|
||||
| `/msbt debug` | Toggle debug mode |
|
||||
| `/msbt help` | Show command usage |
|
||||
|
||||
## Nampower / SuperWoW / UnitXP SP3 Integration
|
||||
## ClassicAPI Combat Log Integration
|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
### What Changes
|
||||
|
||||
- **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.
|
||||
- **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.
|
||||
- **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.
|
||||
- **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.
|
||||
|
||||
### 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
|
||||
|
||||
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))
|
||||
```
|
||||
`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.
|
||||
|
||||
## Performance Optimizations
|
||||
|
||||
- **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
|
||||
- **SpellId icon cache**: When spellIds are available (via Nampower/SuperWoW), icons are resolved directly and cached, bypassing Babble-Spell dictionary lookups and tooltip scanning
|
||||
- **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
|
||||
- **Unit event filtering**: `UNIT_HEALTH` (player, target, pet) and `UNIT_MANA` (player) use ClassicAPI's `RegisterUnitEvent`, so other units' updates never reach Lua
|
||||
- **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
|
||||
|
||||
## Architecture
|
||||
|
||||
### Global Namespaces
|
||||
### Namespaces
|
||||
|
||||
| Namespace | Purpose |
|
||||
|---|---|
|
||||
| `MikSBT` | Main addon: display, animation, profiles, event routing, slash commands |
|
||||
| `MikCEH` | Combat Event Helper: parses combat events into structured data |
|
||||
| `MikTRO` | Table Recycler Object: memory pool for table reuse |
|
||||
| `MikSBT` | Global. Main addon: display, animation, profiles, event routing, slash commands, and the API the options addon and other addons use |
|
||||
| `MikCEH` | Private, shared through the addon table. Combat Event Helper: parses combat events into structured data |
|
||||
|
||||
### Event Processing Pipeline
|
||||
|
||||
```
|
||||
WoW CHAT_MSG_* events (or Nampower structured events)
|
||||
-> MikCEH.OnEvent() / MikCEH.OnNampowerEvent()
|
||||
-> ParseCombatEvents() dispatch table (or Nampower handler)
|
||||
ClassicAPI COMBAT_LOG_EVENT_UNFILTERED (plus CHAT_MSG_* for triggers and non-combat notifications)
|
||||
-> MikCEH.OnEvent() / MikCEH.OnCombatLogEvent()
|
||||
-> ParseCombatEvents() dispatch table (or combat log handler)
|
||||
-> Creates CombatEventData tables
|
||||
-> MikSBT.CombatEventsHandler()
|
||||
-> Formats text with templates (%a=amount, %n=name, %s=spell, %t=type)
|
||||
@@ -116,11 +114,10 @@ WoW CHAT_MSG_* events (or Nampower structured events)
|
||||
|
||||
- **AceLibrary** — Addon framework skeleton
|
||||
- **AceLocale-2.2** — Localization management
|
||||
- **Babble-Spell-2.2** — Spell name database for icon lookups (~10K lines)
|
||||
|
||||
### Saved Variables
|
||||
|
||||
`MikSBT_Save` — Stores named profiles containing event settings, triggers, suppressions, display positions, and font settings. Profiles support versioning and migration between addon versions.
|
||||
`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.
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user