Added status bar

dev
Shariq Shah 6 years ago
parent 817340c9bf
commit df19ee5e70
  1. 23
      src/game/editor.c
  2. 4
      todo.txt

@ -348,6 +348,28 @@ void editor_update(struct Editor* editor, float dt)
} }
nk_end(context); nk_end(context);
/* Status Bar */
if(nk_begin(context, "Status Bar", nk_recti(0, win_height - editor->top_panel_height, win_width, editor->top_panel_height), NK_WINDOW_NO_SCROLLBAR))
{
nk_layout_row_begin(context, NK_DYNAMIC, editor->top_panel_height - 5, 5);
nk_layout_row_push(context, 0.1f);
nk_labelf(context, NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE, "Cursor: %.1f %.1f %.1f", editor->tool_mesh_position.x, editor->tool_mesh_position.y, editor->tool_mesh_position.z);
nk_layout_row_push(context, 0.1f);
nk_checkbox_label(context, "Snap to grid ", &editor->tool_snap_enabled);
nk_layout_row_push(context, 0.1f);
nk_labelf(context, NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE, "Grid Scale: %.1f", editor->grid_scale);
nk_layout_row_push(context, 0.1f);
nk_labelf(context, NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE, "Grid Length: %d", editor->grid_num_lines);
nk_layout_row_push(context, 0.6f);
nk_spacing(context, 1);
}
nk_end(context);
if(editor->window_scene_heirarchy) editor_window_scene_heirarchy(context, editor, game_state); if(editor->window_scene_heirarchy) editor_window_scene_heirarchy(context, editor, game_state);
if(editor->window_debug_variables) editor_window_debug_variables(context, editor); if(editor->window_debug_variables) editor_window_debug_variables(context, editor);
if(editor->window_property_inspector) editor_window_property_inspector(context, editor, game_state); if(editor->window_property_inspector) editor_window_property_inspector(context, editor, game_state);
@ -556,6 +578,7 @@ void editor_entity_select(struct Editor* editor, struct Entity* entity)
{ {
editor->selected_entity->editor_selected = false; editor->selected_entity->editor_selected = false;
editor->selected_entity = NULL; editor->selected_entity = NULL;
vec3_fill(&editor->tool_mesh_position, 0.f, 0.f, 0.f);
} }
else if(entity) // Select else if(entity) // Select
{ {

@ -1,6 +1,7 @@
Todo: Todo:
- Display editor camera information and speed adjustment in status bar or top bar
- Add pre-render/post-render steps to deal with render order issues and culling lights before rendering
- Immediate mode render order, drawing axis and helpers on top of grid - Immediate mode render order, drawing axis and helpers on top of grid
- Display tool/cursor location in editor statusbar
- Better, more accurate picking - Better, more accurate picking
- Highlight if we are about to select an entity or perform the tool action like translate when mouse is hovered and an entity can be selected at that location - Highlight if we are about to select an entity or perform the tool action like translate when mouse is hovered and an entity can be selected at that location
- Display the projected position if we perform the action for example display what the new location would be right next to the tool mesh - Display the projected position if we perform the action for example display what the new location would be right next to the tool mesh
@ -230,4 +231,5 @@ Done:
* Vertical translation in translate mode * Vertical translation in translate mode
* Axis selection/cycling * Axis selection/cycling
* Axis switching and returning back to previously selected axis after releasing alt in translate mode * Axis switching and returning back to previously selected axis after releasing alt in translate mode
* Display tool/cursor location in editor statusbar

Loading…
Cancel
Save