2026-04-08 02:52:28 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-04-21 00:57:14 +08:00
|
|
|
#include <XCEditor/Fields/UIEditorEditableFieldCore.h>
|
2026-04-10 00:41:28 +08:00
|
|
|
#include <XCEditor/Fields/UIEditorVector2Field.h>
|
2026-04-08 02:52:28 +08:00
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
|
|
|
|
|
|
struct UIEditorVector2FieldInteractionState {
|
2026-04-21 00:57:14 +08:00
|
|
|
UIEditorEditableFieldSession session = {};
|
2026-04-08 02:52:28 +08:00
|
|
|
Widgets::UIEditorVector2FieldState vector2FieldState = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorVector2FieldInteractionResult {
|
|
|
|
|
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::UIEditorVector2FieldHitTarget hitTarget = {};
|
|
|
|
|
std::size_t selectedComponentIndex = Widgets::UIEditorVector2FieldInvalidComponentIndex;
|
|
|
|
|
std::size_t changedComponentIndex = Widgets::UIEditorVector2FieldInvalidComponentIndex;
|
|
|
|
|
std::array<double, 2u> valuesBefore = { 0.0, 0.0 };
|
|
|
|
|
std::array<double, 2u> valuesAfter = { 0.0, 0.0 };
|
|
|
|
|
double stepDelta = 0.0;
|
|
|
|
|
std::string committedText = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorVector2FieldInteractionFrame {
|
|
|
|
|
Widgets::UIEditorVector2FieldLayout layout = {};
|
|
|
|
|
UIEditorVector2FieldInteractionResult result = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UIEditorVector2FieldInteractionFrame UpdateUIEditorVector2FieldInteraction(
|
|
|
|
|
UIEditorVector2FieldInteractionState& state,
|
|
|
|
|
Widgets::UIEditorVector2FieldSpec& spec,
|
|
|
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
|
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
|
|
|
|
const Widgets::UIEditorVector2FieldMetrics& metrics = {});
|
|
|
|
|
|
|
|
|
|
} // namespace XCEngine::UI::Editor
|