Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
project_nodes_widget.h
1#pragma once
2
3#include "IconsFontaudio.h"
4#include "gluten/widgets/widget.h"
5#include "imgui.h"
6#include "sound_bakery/pch.h"
7
8namespace sbk::engine
9{
10 class node;
11}
12
13enum class node_creation_type
14{
15 New,
16 NewParent,
17 NewChild
18};
19
20class project_nodes_widget : public gluten::widget
21{
22public:
23 project_nodes_widget(gluten::widget_subsystem* parentSubsystem) : widget(parentSubsystem), m_renameID(0) {}
24
25 project_nodes_widget(widget* parentWidget) : widget(parentWidget), m_renameID(0) {}
26
27public:
28 void render_page(const std::vector<SB_OBJECT_CATEGORY>& categories);
29 void render_objects_page();
30 void render_events_page();
31 void render_soundbank_page();
32
33public:
34 void render_category(SB_OBJECT_CATEGORY category);
35 void render_single_node(rttr::type type, rttr::instance instance);
36 void render_rename_object(sbk::core::database_object* const& object);
37
38 void handle_open_node(sbk::core::database_object* object);
39
40 bool node_has_children(sbk::engine::node* node);
41 bool object_is_renaming(sbk::core::database_object* object);
42
43private:
44 bool render_node_context_menu(rttr::type type, rttr::instance instance);
45
46 void render_create_parent_or_child_menu(SB_OBJECT_CATEGORY category,
47 rttr::instance node,
48 node_creation_type creationType);
49
50 std::string_view create_parent_or_child_menu_name(node_creation_type creationType);
51
52private:
53 void setup_rename_node(sbk::core::database_object* object);
54
55private:
56 sbk_id m_renameID = 0;
57 sbk_id m_nodeToOpen = 0;
58 char m_renameString[255] = "\0";
59};
Definition project_nodes_widget.h:21
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:12
Root node that builds the core graph of sounds and busses.
Definition node.h:64