Update for queue events

This commit is contained in:
Insality 2025-05-28 23:21:00 +03:00
parent 350770ba9e
commit 16a5d9936a
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
local component = require("druid.component")
local helper = require("druid.helper")
local defer = require("event.defer")
local queues = require("event.queues")
---@class druid.tiling_node: druid.component
---@field animation table
@ -28,7 +28,7 @@ function M:init(node)
print("The druid.script is not found, please add it nearby to the GUI collection", msg.url())
end)
defer.push("druid.get_atlas_path", {
queues.push("druid.get_atlas_path", {
texture_name = gui.get_texture(self.node),
sender = msg.url(),
}, self.on_get_atlas_path, self)

View File

@ -3,7 +3,7 @@
-- This one is a required to make a unified "Shaders" pipeline in the GUI scripts
-- This required to grab a texture data with `go.get` function
local defer = require("event.defer")
local queues = require("event.queues")
---Usage: defer.push("druid.get_atlas_path", {
--- texture_name = gui.get_texture(self.node),
@ -35,10 +35,10 @@ end
function init(self)
defer.subscribe(MESSAGE_GET_ATLAS_PATH, get_atlas_path, self)
queues.subscribe(MESSAGE_GET_ATLAS_PATH, get_atlas_path, self)
end
function final(self)
defer.unsubscribe(MESSAGE_GET_ATLAS_PATH, get_atlas_path, self)
queues.unsubscribe(MESSAGE_GET_ATLAS_PATH, get_atlas_path, self)
end