feat(new_editor): add standalone add-component utility window
This commit is contained in:
26
new_editor/app/State/EditorUtilityWindowRequestState.cpp
Normal file
26
new_editor/app/State/EditorUtilityWindowRequestState.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "State/EditorUtilityWindowRequestState.h"
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
void ResetEditorUtilityWindowRequestState(EditorUtilityWindowRequestState& state) {
|
||||
state = {};
|
||||
}
|
||||
|
||||
void RequestEditorUtilityWindow(
|
||||
EditorUtilityWindowRequestState& state,
|
||||
EditorUtilityWindowKind kind) {
|
||||
if (kind == EditorUtilityWindowKind::None) {
|
||||
return;
|
||||
}
|
||||
|
||||
state.pendingKind = kind;
|
||||
}
|
||||
|
||||
std::optional<EditorUtilityWindowKind> ConsumeEditorUtilityWindowRequest(
|
||||
EditorUtilityWindowRequestState& state) {
|
||||
const std::optional<EditorUtilityWindowKind> requestedKind = state.pendingKind;
|
||||
state.pendingKind.reset();
|
||||
return requestedKind;
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user