mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-04-06 18:36:52 +00:00
64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
function init(self)
|
|
|
|
end
|
|
|
|
function final(self)
|
|
-- Add finalization code here
|
|
-- Remove this function if not needed
|
|
end
|
|
|
|
function update(self, dt)
|
|
-- Add update code here
|
|
-- Remove this function if not needed
|
|
end
|
|
|
|
function on_message(self, message_id, message, sender)
|
|
if message_id == hash("hello_gui") then
|
|
gui.set_text(gui.get_node("status"), "Running pods: " .. message.pod_running)
|
|
elseif message_id == hash("howto") then
|
|
gui.set_text(gui.get_node("howto"), message.howto_message)
|
|
elseif message_id == hash("info") then
|
|
gui.set_text(gui.get_node("info"), message.infomessage)
|
|
elseif message_id == hash("pod_log") then
|
|
gui.set_text(gui.get_node("pod_log"), message.infomessage)
|
|
elseif message_id == hash("error") then
|
|
gui.set_text(gui.get_node("error"), message.errormessage)
|
|
elseif message_id == hash("mode") then
|
|
gui.set_text(gui.get_node("mode"), message.mode)
|
|
elseif message_id == hash("open_kubelinter_box") then
|
|
gui.set_position(gui.get_node("kubelinter"), message.position)
|
|
|
|
elseif message_id == hash("set_kubelinter_text") then
|
|
gui.set_text(gui.get_node("kubelinter"), message.kubelintermessage)
|
|
|
|
elseif message_id == hash("help") then
|
|
gui.set_position(gui.get_node("inputs"), message.position)
|
|
elseif message_id == hash("quit_help") then
|
|
gui.set_position(gui.get_node("inputs"), message.position)
|
|
elseif message_id == hash("pod_name") then
|
|
if message.pod_name == false or message.pod_name == nil then
|
|
fake_position = message.position
|
|
fake_position.x = 0
|
|
fake_position.y = 0
|
|
gui.set_text(gui.get_node("pod_name"),'')
|
|
--gui.set_position(gui.get_node("pod_name"), fake_position)
|
|
else
|
|
gui.set_text(gui.get_node("pod_name"), message.pod_name)
|
|
print(message.position_of_pod)
|
|
new_position = message.position
|
|
new_position.y = message.position.y - 25
|
|
gui.set_position(gui.get_node("pod_name"), new_position)
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
function on_input(self, action_id, action)
|
|
|
|
end
|
|
|
|
function on_reload(self)
|
|
-- Add input-handling code here
|
|
-- Remove this function if not needed
|
|
end
|