Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions equipviewer/ashita/equipviewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ashita.register_event('command', function(cmd, nType)
return false;
end);



---------------------------------------------------------------------------------------------------
-- func: incoming_packet
-- desc: Called when our addon receives an incoming packet.
Expand Down Expand Up @@ -107,12 +109,26 @@ ashita.register_event('unload', function()
equipViewer:Delete();
end);

ashita.register_event('render', function()
local x = AshitaCore:GetFontManager():Get('__equipViewer_background'):GetPositionX();
local y = AshitaCore:GetFontManager():Get('__equipViewer_background'):GetPositionY();
for k,v in pairs(equipViewerConfig['position']) do
if (k ~= x) or (v ~= y) then
equipViewerConfig['position'] = { x, y };
end
equipViewer:Move(equipViewerConfig['position'][1], equipViewerConfig['position'][2]);
end
end );

-- Functions to work with Font/Primitive Objects
function ashitaPrimitiveCreate(name)
local f = AshitaCore:GetFontManager():Create(name);
f:SetAutoResize(false);
f:SetLocked(true);
if (name == '__equipViewer_background') then
f:SetLocked(false);
else
f:SetLocked(true);
end
end

function ashitaSetText(name, text)
Expand Down Expand Up @@ -195,4 +211,4 @@ function ashitaGetTexturePath(itemId)

return path;
end
end
end