Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
ProjectNodesWidget.h
1#pragma once
2
3#include "IconsFontaudio.h"
4#include "Widget.h"
5#include "imgui.h"
6#include "sound_bakery/pch.h"
7
8namespace SB::Engine
9{
10 class Node;
11}
12
13enum class NodeCreationType
14{
15 New,
16 NewParent,
17 NewChild
18};
19
21{
22public:
23 ProjectNodesWidget(WidgetSubsystem* parentSubsystem)
24 : Widget(parentSubsystem), m_renameID(0)
25 {
26 }
27
28 ProjectNodesWidget(Widget* parentWidget)
29 : Widget(parentWidget), m_renameID(0)
30 {
31 }
32
33public:
34 void RenderPage(const std::vector<SB_OBJECT_CATEGORY>& categories);
35 void RenderObjectsPage();
36 void RenderEventsPage();
37 void RenderSoundbankPage();
38
39public:
40 void RenderCategory(SB_OBJECT_CATEGORY category);
41
42 void RenderSingleNode(rttr::type type, rttr::instance instance);
43
44 bool NodeHasChildren(SB::Engine::Node* node);
45
46 void HandleOpenNode(SB::Core::DatabaseObject* object);
47
48 bool ObjectIsRenaming(SB::Core::DatabaseObject* object);
49
50 void RenderRenameObject(SB::Core::DatabaseObject* const& object);
51
52private:
53 bool RenderNodeContextMenu(rttr::type type, rttr::instance instance);
54
55 void RenderCreateParentOrChildMenu(SB_OBJECT_CATEGORY category,
56 rttr::instance node,
57 NodeCreationType creationType);
58
59 std::string_view CreateParentOrChildMenuName(NodeCreationType creationType);
60
61private:
62 void SetupRenameNode(SB::Core::DatabaseObject* object);
63
64private:
65 SB_ID m_renameID = 0;
66 SB_ID m_nodeToOpen = 0;
67 char m_renameString[255] = "\0";
68};
Definition ProjectNodesWidget.h:21
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:22
Root node that builds the core graph of sounds and busses.
Definition node.h:57
Definition WidgetSubsystem.h:7
Definition Widget.h:16