add then to entities

This commit is contained in:
John Alanbrook 2024-09-13 14:34:54 -05:00
parent 01905a26a2
commit 2a8dae2bf6
4 changed files with 6 additions and 5 deletions

View file

@ -118,6 +118,7 @@ actor.kill = function(){
if (typeof this.die === 'function') this.die(); if (typeof this.die === 'function') this.die();
if (typeof this.stop === 'function') this.stop(); if (typeof this.stop === 'function') this.stop();
if (typeof this.garbage === 'function') this.garbage(); if (typeof this.garbage === 'function') this.garbage();
if (typeof this.then === 'function') this.then();
}; };
actor.kill.doc = `Remove this actor and all its padawans from existence.`; actor.kill.doc = `Remove this actor and all its padawans from existence.`;

View file

@ -381,6 +381,7 @@ dup(diff) {
this.clear(); this.clear();
if (this.stop instanceof Function) this.stop(); if (this.stop instanceof Function) this.stop();
if (typeof this.garbage === 'function') this.garbage(); if (typeof this.garbage === 'function') this.garbage();
if (typeof this.then === 'function') this.then();
game.tag_clear_guid(this.guid); game.tag_clear_guid(this.guid);

View file

@ -377,9 +377,6 @@ Register.add_cb("update", true).doc = "Called once per frame.";
Register.add_cb("physupdate", true); Register.add_cb("physupdate", true);
Register.add_cb("gui", true); Register.add_cb("gui", true);
Register.add_cb("hud", true, render.flush); Register.add_cb("hud", true, render.flush);
Register.add_cb("draw_dbg", true);
Register.add_cb("gui_dbg", true);
Register.add_cb("hud_dbg", true);
Register.add_cb("draw", true); Register.add_cb("draw", true);
Register.add_cb("imgui", true); Register.add_cb("imgui", true);

View file

@ -781,8 +781,11 @@ render.text = function(str, pos, size = 1, color = Color.white, wrap = -1, ancho
}; };
render.image = function(tex, pos, scale = [tex.width, tex.height], rotation = 0, color = Color.white) { render.image = function(tex, pos, scale = [tex.width, tex.height], rotation = 0, color = Color.white) {
if (typeof tex === 'string') if (typeof tex === 'string') {
tex = game.texture(tex); tex = game.texture(tex);
scale.x ??= tex.width;
scale.y ??= tex.height;
}
if (!tex) return; if (!tex) return;
flush(); flush();
var t = os.make_transform(); var t = os.make_transform();
@ -1119,7 +1122,6 @@ prosperon.render = function()
mum.style = mum.dbg_style; mum.style = mum.dbg_style;
if (render.draw_gui) prosperon.gui(); if (render.draw_gui) prosperon.gui();
if (mum.drawinput) mum.drawinput(); if (mum.drawinput) mum.drawinput();
prosperon.gui_dbg();
render.flush_text(); render.flush_text();
mum.style = mum.base; mum.style = mum.base;