|
My Project
|
Class responsible for handling editor UI buttons and interactions. Manages project creation/loading, GameObject manipulation, component management, script handling, audio control, and project saving inside the editor. More...
#include <Buttons.hpp>
Public Member Functions | |
| Buttons () | |
| Default constructor. | |
| ~Buttons () | |
| Destructor Clears pointers to the selected entity and component. | |
| void | init () |
| Initializes the editor buttons and UI states. | |
| void | update (AssetManager &manager) |
| Updates editor button logic and interactions. | |
| bool | createProject () |
| Creates a new project. | |
| void | loadProject () |
| Loads an existing project. | |
| void | projectName () |
| Handles project name input and validation. | |
| void | showScriptMenu (ScriptManager &scriptM) |
| Displays the script management menu. | |
| void | AddScript (ScriptManager &scriptM) |
| Adds a new script. | |
| void | deleteScript (ScriptManager &scriptM) |
| Deletes an existing script. | |
| void | editScript (ScriptManager &scriptM) |
| Opens a script for editing. | |
| void | showScripts (ScriptManager &scriptM) |
| Displays the list of available scripts. | |
| bool | CheckScriptNameValid (const std::string &str) |
| Checks whether the script name is valid. | |
| bool | reloadScript () |
| Reloads editor scripts. | |
| void | selectGO (std::shared_ptr< Engine::Scene > &scene) |
| Selects a GameObject from the scene. | |
| void | createGO (std::shared_ptr< Engine::Scene > &scene) |
| Creates a new GameObject in the scene. | |
| void | delGO (std::shared_ptr< Engine::Scene > &scene) |
| Deletes the selected GameObject from the scene. | |
| void | ChangeGOName () |
| Changes the name of the selected GameObject. | |
| bool | CheckGoNameValid (const std::string &str) |
| Checks whether the GameObject name is valid. | |
| bool | CheckCaraterValid (const std::string &str) |
| Checks whether the characters used in a name are valid. | |
| void | showCmpnt (const AssetManager &assetM) |
| Displays all components attached to the selected GameObject. | |
| void | addComponent () |
| Adds a component to the selected GameObject. | |
| void | delComponent () |
| Deletes a component from the selected GameObject. | |
| void | editComponent (const AssetManager &assetM) |
| Edits the selected component values. | |
| void | loadSound (Engine::MiniAudioSystem sound) |
| Loads a sound file into the audio system. | |
| void | playSound (Engine::MiniAudioSystem sound) |
| Plays a loaded sound. | |
| void | stopPlayingSound (Engine::MiniAudioSystem sound) |
| Stops the currently playing sound. | |
| void | Guizmo () |
| Handles editor gizmo manipulation (translate/rotate/scale). | |
| bool | saveProject () |
| Saves the current project. | |
| bool | startRuntime () |
| Starts the runtime mode of the editor. | |
| void | loadAssets (AssetManager &manager) |
| Loads project assets. | |
| std::string | GetSessionName () const |
| Returns the current session name. | |
| std::string | GetSessionNameStatus () const |
| Returns the session status message. | |
| bool | GetLoadProject () const |
| Indicates whether the project load dialog is active. | |
| std::string | GetProjectPath () const |
| Returns the current project path. | |
| bool | GetLoadProjReady () const |
| Indicates if the project is ready to be loaded. | |
| bool | GetLoadAsset () const |
| Indicates if asset loading is requested. | |
| std::string | GetScriptName () const |
| Returns the current script name. | |
| void | SetSessionName (std::string session) |
| Sets the session name. | |
| void | SetSessionNameStatus (std::string txt) |
| Sets the session status message. | |
| void | SetLoadSession (bool activated) |
| Enables or disables the load session dialog. | |
| void | SetProjectPath (std::string path) |
| Sets the project path. | |
| void | SetLoadProjReady (bool ready) |
| Sets the project ready state. | |
| void | SetLoadAsset (bool load) |
| Enables or disables asset loading. | |
| void | SetScriptName (std::string name) |
| Sets the script name. | |
| void | SetSelectedEntity () |
| Clears the selected entity. | |
Protected Attributes | |
| Engine::GameObject * | selectedEntity = nullptr |
| Pointer to the currently selected GameObject. | |
| std::string | currentEntityLabel |
| Label of the currently selected GameObject. | |
| std::string | selectedScript |
| Name of the currently selected script. | |
| std::string | scriptName = "Null" |
| Name of the script being created or edited. | |
| Engine::Component * | selectedComponent = nullptr |
| Pointer to the currently selected component. | |
Class responsible for handling editor UI buttons and interactions. Manages project creation/loading, GameObject manipulation, component management, script handling, audio control, and project saving inside the editor.
|
inline |
Default constructor.
|
inline |
Destructor Clears pointers to the selected entity and component.
| void Editor::Buttons::addComponent | ( | ) |
Adds a component to the selected GameObject.
| void Editor::Buttons::AddScript | ( | ScriptManager & | scriptM | ) |
Adds a new script.
| scriptM | Script manager |
| void Editor::Buttons::ChangeGOName | ( | ) |
Changes the name of the selected GameObject.
| bool Editor::Buttons::CheckCaraterValid | ( | const std::string & | str | ) |
Checks whether the characters used in a name are valid.
| str | String to validate |
| bool Editor::Buttons::CheckGoNameValid | ( | const std::string & | str | ) |
Checks whether the GameObject name is valid.
| str | Name to validate |
| bool Editor::Buttons::CheckScriptNameValid | ( | const std::string & | str | ) |
Checks whether the script name is valid.
| str | Script name to validate |
| void Editor::Buttons::createGO | ( | std::shared_ptr< Engine::Scene > & | scene | ) |
Creates a new GameObject in the scene.
| scene | Active scene |
| bool Editor::Buttons::createProject | ( | ) |
Creates a new project.
| void Editor::Buttons::delComponent | ( | ) |
Deletes a component from the selected GameObject.
| void Editor::Buttons::deleteScript | ( | ScriptManager & | scriptM | ) |
Deletes an existing script.
| scriptM | Script manager |
| void Editor::Buttons::delGO | ( | std::shared_ptr< Engine::Scene > & | scene | ) |
Deletes the selected GameObject from the scene.
| scene | Active scene |
| void Editor::Buttons::editComponent | ( | const AssetManager & | assetM | ) |
Edits the selected component values.
| assetM | Asset manager |
| void Editor::Buttons::editScript | ( | ScriptManager & | scriptM | ) |
Opens a script for editing.
| scriptM | Script manager |
|
inline |
Indicates if asset loading is requested.
|
inline |
Indicates whether the project load dialog is active.
|
inline |
Indicates if the project is ready to be loaded.
|
inline |
Returns the current project path.
|
inline |
Returns the current script name.
|
inline |
Returns the current session name.
|
inline |
Returns the session status message.
| void Editor::Buttons::Guizmo | ( | ) |
Handles editor gizmo manipulation (translate/rotate/scale).
| void Editor::Buttons::init | ( | ) |
Initializes the editor buttons and UI states.
| void Editor::Buttons::loadAssets | ( | AssetManager & | manager | ) |
Loads project assets.
| manager | Asset manager |
| void Editor::Buttons::loadProject | ( | ) |
Loads an existing project.
| void Editor::Buttons::loadSound | ( | Engine::MiniAudioSystem | sound | ) |
Loads a sound file into the audio system.
| sound | MiniAudio sound system |
| void Editor::Buttons::playSound | ( | Engine::MiniAudioSystem | sound | ) |
Plays a loaded sound.
| sound | MiniAudio sound system |
| void Editor::Buttons::projectName | ( | ) |
Handles project name input and validation.
| bool Editor::Buttons::reloadScript | ( | ) |
Reloads editor scripts.
| bool Editor::Buttons::saveProject | ( | ) |
Saves the current project.
| void Editor::Buttons::selectGO | ( | std::shared_ptr< Engine::Scene > & | scene | ) |
Selects a GameObject from the scene.
| scene | Active scene |
|
inline |
Enables or disables asset loading.
|
inline |
Sets the project ready state.
|
inline |
Enables or disables the load session dialog.
|
inline |
Sets the project path.
|
inline |
Sets the script name.
|
inline |
Clears the selected entity.
|
inline |
Sets the session name.
|
inline |
Sets the session status message.
| void Editor::Buttons::showCmpnt | ( | const AssetManager & | assetM | ) |
Displays all components attached to the selected GameObject.
| assetM | Asset manager |
| void Editor::Buttons::showScriptMenu | ( | ScriptManager & | scriptM | ) |
Displays the script management menu.
| scriptM | Script manager |
| void Editor::Buttons::showScripts | ( | ScriptManager & | scriptM | ) |
Displays the list of available scripts.
| scriptM | Script manager |
| bool Editor::Buttons::startRuntime | ( | ) |
Starts the runtime mode of the editor.
| void Editor::Buttons::stopPlayingSound | ( | Engine::MiniAudioSystem | sound | ) |
Stops the currently playing sound.
| sound | MiniAudio sound system |
| void Editor::Buttons::update | ( | AssetManager & | manager | ) |
Updates editor button logic and interactions.
| manager | Asset manager used by the editor |
|
protected |
Label of the currently selected GameObject.
|
protected |
Name of the script being created or edited.
|
protected |
Pointer to the currently selected component.
|
protected |
Pointer to the currently selected GameObject.
|
protected |
Name of the currently selected script.