Hymn to Beauty
C++ 3D Engine
ResourceView.hpp
Go to the documentation of this file.
1#pragma once
2
10#include "../Resources.hpp"
11
12namespace Utility {
13class Window;
14}
15namespace Video {
16class LowLevelRenderer;
17}
18
19namespace GUI {
22 public:
24
28 ResourceView(Utility::Window* window, Video::LowLevelRenderer* lowLevelRenderer);
29
31 void Show();
32
34
37 bool HasMadeChanges() const;
38
40
43 bool IsVisible() const;
44
46
49 void SetVisible(bool visible);
50
52
55 void HideEditors();
56
58 void SaveScene() const;
59
61
64 Json::Value GetSceneJson(std::string* filename) const;
65
67 void ResetScene();
68
70
74
76
79 int GetEditorWidth() const;
80
81 private:
82 bool ShowResourceFolder(ResourceList::ResourceFolder& folder, const std::string& path);
83 bool ShowResource(ResourceList::ResourceFolder& folder, ResourceList::Resource& resource, const std::string& path);
84 void FileNameWindowClosed(const std::string& name);
85
86 Utility::Window* window;
87 Video::LowLevelRenderer* lowLevelRenderer;
88
89 bool visible = false;
90
91 ScriptEditor scriptEditor;
92 SceneEditor sceneEditor;
93 GLTFEditor gltfEditor;
94 TextureEditor textureEditor;
95 SoundEditor soundEditor;
96
97 SavePromptWindow savePromptWindow;
98 FolderNameWindow folderNameWindow;
99
100 bool changeScene = false;
101 std::string resourcePath = "";
102 std::string* scene = nullptr;
103 ResourceList::ResourceFolder* parentFolder;
104
105 static const int splitterSize = 2;
106 int resourceHeight = 250;
107 bool resourceResize = false;
108
109 int sceneWidth = 250;
110 bool sceneResize = false;
111
112 int editorWidth = 250;
113 bool editorResize = false;
114
115 bool scriptPressed;
116 bool texturePressed;
117 bool gltfPressed;
118 bool soundPressed;
119};
120} // namespace GUI
A window that asks the user for the name of the folder to create.
Definition: FolderNameWindow.hpp:8
Used to import GLTF models.
Definition: GLTFEditor.hpp:8
Displays all the hymn's resources.
Definition: ResourceView.hpp:21
bool HasMadeChanges() const
Checks if any changes has been made to the current scene.
Definition: ResourceView.cpp:149
ResourceView(Utility::Window *window, Video::LowLevelRenderer *lowLevelRenderer)
Create new resource view.
Definition: ResourceView.cpp:28
void SetVisible(bool visible)
Set whether the resource list should be visible.
Definition: ResourceView.cpp:179
void ResetScene()
Reset which scene is open.
Definition: ResourceView.cpp:200
bool IsVisible() const
Get whether the resource list is visible.
Definition: ResourceView.cpp:175
SceneEditor & GetScene()
Return Scene Editor.
Definition: ResourceView.cpp:205
void SaveScene() const
Save the currently active scene.
Definition: ResourceView.cpp:191
void Show()
Show the resource list.
Definition: ResourceView.cpp:36
int GetEditorWidth() const
Get the width of the right-side editor (entity, script, etc.).
Definition: ResourceView.cpp:209
Json::Value GetSceneJson(std::string *filename) const
Get a json representing the scene.
Definition: ResourceView.cpp:195
void HideEditors()
Hide all editors.
Definition: ResourceView.cpp:183
A window that asks the user if they want to save before quitting.
Definition: SavePromptWindow.hpp:9
Used to edit a scene.
Definition: SceneEditor.hpp:11
Used to edit a script.
Definition: ScriptEditor.hpp:9
Used to edit a sound.
Definition: SoundEditor.hpp:7
Used to edit a texture.
Definition: TextureEditor.hpp:10
Definition: Window.hpp:14
Low level renderer abstracting the underlaying graphics API (OpenGL or Vulkan).
Definition: LowLevelRenderer.hpp:27
Definition: AssetEditor.hpp:9
Definition: ResourceView.hpp:12
Definition: Editor.hpp:18
A folder containing resources.
Definition: Resources.hpp:50
A resource.
Definition: Resources.hpp:23