aboutsummaryrefslogtreecommitdiff
path: root/lua/pets
diff options
context:
space:
mode:
Diffstat (limited to 'lua/pets')
-rw-r--r--lua/pets/pet.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/pets/pet.lua b/lua/pets/pet.lua
index 0b191c9..f0e6cfa 100644
--- a/lua/pets/pet.lua
+++ b/lua/pets/pet.lua
@@ -11,17 +11,22 @@ function M.Pet.new(name, type, style)
instance.name = name
instance.type = type
instance.style = style
+
local wd = debug.getinfo(1).source:sub(2):match("(.*nvim/)") .. "media/"
instance.sourcedir = wd .. type .. "/" .. style .. "/"
+
instance.animation = require("pets.animations").Animation.new(instance.sourcedir, type, style)
+ instance.popup = require("pets.popup").popup
return instance
end
-function M.Pet:animate(bufnr)
- self.animation:start(bufnr)
+function M.Pet:animate()
+ self.popup:mount()
+ self.animation:start(self.popup.bufnr)
end
function M.Pet:kill()
+ self.popup:unmount()
self.animation:stop()
end