Add XCUI new editor sandbox phase 1
This commit is contained in:
44
new_editor/src/panels/Panel.cpp
Normal file
44
new_editor/src/panels/Panel.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "Panel.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace NewEditor {
|
||||
|
||||
Panel::Panel(std::string name, bool visible)
|
||||
: m_name(std::move(name))
|
||||
, m_visible(visible) {
|
||||
}
|
||||
|
||||
Panel::~Panel() = default;
|
||||
|
||||
const std::string& Panel::GetName() const {
|
||||
return m_name;
|
||||
}
|
||||
|
||||
void Panel::SetName(const std::string& name) {
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
bool Panel::IsVisible() const {
|
||||
return m_visible;
|
||||
}
|
||||
|
||||
void Panel::SetVisible(bool visible) {
|
||||
m_visible = visible;
|
||||
}
|
||||
|
||||
void Panel::ToggleVisible() {
|
||||
m_visible = !m_visible;
|
||||
}
|
||||
|
||||
void Panel::RenderIfVisible() {
|
||||
if (!m_visible) {
|
||||
return;
|
||||
}
|
||||
|
||||
Render();
|
||||
}
|
||||
|
||||
} // namespace NewEditor
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user