Nuklear renders in GUI pass

This commit is contained in:
John Alanbrook 2023-08-22 22:15:39 +00:00
parent 172af950e8
commit 3f2ae7ff82
5 changed files with 19 additions and 7 deletions

View file

@ -1 +1,2 @@
# Yugine Input Guide # Yugine Input Guide

View file

@ -347,11 +347,15 @@ void openglRender(struct window *window) {
////// TEXT && GUI ////// TEXT && GUI
debug_nextpass(); debug_nextpass();
nuke_start();
call_gui(); call_gui();
debug_flush(&hudproj); debug_flush(&hudproj);
text_flush(&hudproj); text_flush(&hudproj);
nuke_start();
// nuke_start();
call_nk_gui(); call_nk_gui();
nuke_end(); nuke_end();

View file

@ -128,6 +128,7 @@ var editor = {
input_o_pressed() { input_o_pressed() {
if (this.sel_comp) return; if (this.sel_comp) return;
if (Keys.ctrl() && Keys.alt()) { if (Keys.ctrl() && Keys.alt()) {
if (this.selectlist.length === 1 && this.selectlist[0].file) { if (this.selectlist.length === 1 && this.selectlist[0].file) {
if (this.edit_level.dirty) return; if (this.edit_level.dirty) return;
@ -145,8 +146,10 @@ var editor = {
} }
if (Keys.ctrl()) { if (Keys.ctrl()) {
if (this.check_level_nested()) if (this.check_level_nested()) {
Log.warn("Nested level ...");
return; return;
}
if (this.edit_level.dirty) { if (this.edit_level.dirty) {
this.openpanel(gen_notify("Level is changed. Are you sure you want to close it?", function() { this.openpanel(gen_notify("Level is changed. Are you sure you want to close it?", function() {
@ -1341,7 +1344,6 @@ var editor = {
}); });
Debug.draw_grid(1, editor_config.grid_size/editor_camera.zoom); Debug.draw_grid(1, editor_config.grid_size/editor_camera.zoom);
var startgrid = screen2world([-20,Window.height]).map(function(x) { return Math.snap(x, editor_config.grid_size); }, this); var startgrid = screen2world([-20,Window.height]).map(function(x) { return Math.snap(x, editor_config.grid_size); }, this);
var endgrid = screen2world([Window.width, 0]); var endgrid = screen2world([Window.width, 0]);
@ -2530,10 +2532,11 @@ var limited_editor = {
}; };
set_pawn(editor); set_pawn(editor);
Log.warn(`Total pawn count is ${Player.players[0].pawns.length}`);
register_gui(editor.ed_gui, editor); register_gui(editor.ed_gui, editor);
Debug.register_call(editor.ed_debug, editor); Debug.register_call(editor.ed_debug, editor);
if (IO.exists("editor.config")) if (IO.exists("editor.config"))
load_configs("editor.config"); load_configs("editor.config");
editor.edit_level = Level.create(); editor.edit_level = Level.create();
Log.warn('bottom of editor');

View file

@ -1502,8 +1502,9 @@ var Level = {
dup(level) { dup(level) {
level ??= this.level; level ??= this.level;
var n = level.spawn(this.from);
Log.warn("Duplicating a level!"); /* TODO: Assign this's properties to the dup */
return ;n
}, },
create() { create() {
@ -1570,6 +1571,8 @@ var Level = {
newlevel.scriptfile = scriptfile; newlevel.scriptfile = scriptfile;
} }
newlevel.from = scriptfile.replace('.js','');
newlevel.run(); newlevel.run();
return newlevel; return newlevel;

View file

@ -1,5 +1,6 @@
sim_start(); sim_start();
if (!IO.exists("game.js")) if (!IO.exists("game.js"))
load("scripts/nogame.js"); load("scripts/nogame.js");
else else