diff options
Diffstat (limited to 'src/editor/properties.cpp')
| -rw-r--r-- | src/editor/properties.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/editor/properties.cpp b/src/editor/properties.cpp index fa3a117..ac21bb0 100644 --- a/src/editor/properties.cpp +++ b/src/editor/properties.cpp @@ -1,6 +1,7 @@ #include "editor.h" #include "../render/gl.h" #include "../game/assets.h" +#include "../game/object.h" const I32 PROPVIEW_TITLE_OFFSET = 15; const I32 PROPVIEW_PAD = 10; @@ -211,6 +212,7 @@ void gui_editor_propview_create_mapprops( GUI_EDITOR_PROPVIEW* view ) { y += space; } ); gui_label( x, y, "sprites: %d", m->sprites.size ); y += space; + gui_label( x, y, "entities: %d", m->entities.size ); y += space; gui_label( x, y, "loaded textures: %d", m->textures.size ); y += space; gui_vectorinput( x, y, propview_input_width( view ), "spawn position", (F32*)&m->startpos, 3, -INFINITY, INFINITY, step ); y += (space+18); GUI_FLOATINPUT* ang = gui_floatinput( x, y, propview_input_width( view ), "spawn angle", &m->startang, -180.f, 180.f, 1.f ); y += (space+18); @@ -318,7 +320,21 @@ void gui_editor_propview_create_surfprops( GUI_EDITOR_PROPVIEW* view ) { } void gui_editor_propview_create_entprops( GUI_EDITOR_PROPVIEW* view ) { + MAP_ENTITY* e = (MAP_ENTITY*)view->curselect; + WORLD_MAP* m = editor->map; + + I32 x = 10, y = 10; + I32 space = 20; + F32 step = editor->propgrid ? editor->grid : 0.25f; + + I32 ent_idx = m->entities.idx_where( fn( MAP_ENTITY* me ) { + return me == e; + } ); + gui_label( x, y, "idx: %d", ent_idx ); y += space; + gui_label( x, y, "class: %s", obj_classid_to_name( e->classid ) ); y += space; + gui_label( x, y, "class id: %u", e->classid ); y += space; + gui_vectorinput( x, y, propview_input_width( view ), "position", (F32*)&e->pos, 3, -INFINITY, INFINITY, step ); y += (space+18); } void gui_editor_propview_update( GUI_EDITOR_PROPVIEW* view ) { |
