48 lines
1.6 KiB
C++
48 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <XCEditor/Fields/UIEditorEditableFieldCore.h>
|
|
#include <XCEditor/Fields/UIEditorVector3Field.h>
|
|
|
|
#include <array>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
struct UIEditorVector3FieldInteractionState {
|
|
UIEditorEditableFieldSession session = {};
|
|
Widgets::UIEditorVector3FieldState vector3FieldState = {};
|
|
};
|
|
|
|
struct UIEditorVector3FieldInteractionResult {
|
|
bool consumed = false;
|
|
bool focusChanged = false;
|
|
bool valueChanged = false;
|
|
bool stepApplied = false;
|
|
bool selectionChanged = false;
|
|
bool editStarted = false;
|
|
bool editCommitted = false;
|
|
bool editCommitRejected = false;
|
|
bool editCanceled = false;
|
|
Widgets::UIEditorVector3FieldHitTarget hitTarget = {};
|
|
std::size_t selectedComponentIndex = Widgets::UIEditorVector3FieldInvalidComponentIndex;
|
|
std::size_t changedComponentIndex = Widgets::UIEditorVector3FieldInvalidComponentIndex;
|
|
std::array<double, 3u> valuesBefore = { 0.0, 0.0, 0.0 };
|
|
std::array<double, 3u> valuesAfter = { 0.0, 0.0, 0.0 };
|
|
double stepDelta = 0.0;
|
|
std::string committedText = {};
|
|
};
|
|
|
|
struct UIEditorVector3FieldInteractionFrame {
|
|
Widgets::UIEditorVector3FieldLayout layout = {};
|
|
UIEditorVector3FieldInteractionResult result = {};
|
|
};
|
|
|
|
UIEditorVector3FieldInteractionFrame UpdateUIEditorVector3FieldInteraction(
|
|
UIEditorVector3FieldInteractionState& state,
|
|
Widgets::UIEditorVector3FieldSpec& spec,
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
|
const Widgets::UIEditorVector3FieldMetrics& metrics = {});
|
|
|
|
} // namespace XCEngine::UI::Editor
|