-updated README.md
-fixed shaders for GL2 -added Entity selection tool -throw out tools from "Demo" window to "Tools" window -change ComboBox to Tabs for Tools -Added more verbose tips -Improved and fixed BrickBreaker collisions -fixed simple DUB issue
This commit is contained in:
parent
1acd0df0ef
commit
56f870bac6
21 changed files with 332 additions and 133 deletions
|
|
@ -395,7 +395,7 @@ struct GUIManager
|
|||
}
|
||||
}
|
||||
|
||||
void entityComponentsGUI()
|
||||
void templateComponentsGUI()
|
||||
{
|
||||
if(selected_template >= templates.length)return;
|
||||
EntityTemplate* tmpl = templates[selected_template].tmpl;
|
||||
|
|
@ -408,6 +408,19 @@ struct GUIManager
|
|||
}
|
||||
}
|
||||
|
||||
void entityComponentsGUI(Entity* entity)
|
||||
{
|
||||
if(!entity)return;
|
||||
EntityMeta meta = entity.getMeta();
|
||||
EntityManager.EntityInfo* info = meta.block.type_info;
|
||||
foreach(comp_id; info.components)
|
||||
{
|
||||
// void* data_ptr = tmpl.entity_data.ptr;
|
||||
void* comp_ptr = meta.getComponent(comp_id);//data_ptr + info.tmpl_deltas[comp_id];
|
||||
componentGUI(comp_id, comp_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void toolGui()
|
||||
{
|
||||
ImGuiStyle * style = igGetStyle();
|
||||
|
|
@ -436,7 +449,7 @@ struct GUIManager
|
|||
if(igIsItemHovered(0))igSetTooltip("Select entity to spawn (SHIFT + Scroll)");
|
||||
}
|
||||
style.Colors[ImGuiCol_Header] = col;
|
||||
entityComponentsGUI();
|
||||
templateComponentsGUI();
|
||||
break;
|
||||
case Tool.component_manipulator:
|
||||
if(components.length)
|
||||
|
|
@ -458,6 +471,11 @@ struct GUIManager
|
|||
if(selected_component < components.length)componentGUI(components[selected_component].component_id, components[selected_component].data);
|
||||
break;
|
||||
case Tool.selector:
|
||||
{
|
||||
Entity* entity = gEM.getEntity(launcher.selected_entity);
|
||||
style.Colors[ImGuiCol_Header] = col;
|
||||
entityComponentsGUI(entity);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue