Skip to content

Commit

Permalink
fixes in ui_pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
aduermael authored and gdevillele committed Jan 12, 2024
1 parent 921b6ed commit a9937ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/modules/ui_pointer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pointer.create = function(_, config)
end

local ok = pcall(function()
local targetPos = config.target.pos
local targetPos = config.target.pos:Copy()

if config.target.Width ~= nil and config.target.Height ~= nil then
if config.from == "below" then
Expand Down Expand Up @@ -62,7 +62,7 @@ pointer.create = function(_, config)

if not ok then
ok = pcall(function()
self.pos = config.target.Position
self.pos = config.target.Position:Copy()
end)
end

Expand All @@ -73,7 +73,7 @@ pointer.create = function(_, config)
end

if not ok then
error("pointAt: couldn't point at " .. config.target, 2)
error("pointAt: couldn't point at target", 2)
end

self.LocalPosition.Z = ui.kForegroundDepth
Expand Down Expand Up @@ -125,6 +125,7 @@ pointer.create = function(_, config)

local remove = p.remove
p.remove = function(self)
self.config = nil -- important, otherwise remove can propage to what's within config
ease:cancel(self)
remove(self)
end
Expand Down

0 comments on commit a9937ef

Please sign in to comment.