载入中...
搜索中...
未找到
PcgPhotoModeRuntimeUI.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Result.h"
6
7#include <cstdint>
8#include <string>
9
10namespace ssq { class Table; }
11
12namespace eve::ui {
13
16 Field = 0, Slider = 1, IntSlider = 2, DisplaySlider = 3, DisplayIntSlider = 4,
17 Toggle = 5, Header = 6, Dropdown = 7, Label = 8, Button = 9, Color = 10,
18 BannerImage = 11, Vector2 = 12, Vector3 = 13
19};
20
22enum class PcgPhotoModeInputStatus { Ignored = 0, Applied = 1 };
23
26public:
28 [[nodiscard]] Result<void> configure(int kind, const std::string &name, const std::string &value,
29 float sliderValue, float minimum, float maximum,
30 bool bannerImageFound = true);
32 void markSliderUsed(bool value = true) noexcept { isUsingSlider_ = value; }
34 [[nodiscard]] Result<void> setSliderValue(float value);
36 PcgPhotoModeInputStatus applyFloatInput(const std::string &value) noexcept;
38 static std::string updateWrap(const std::string &value);
39
41 int getKind() const noexcept { return static_cast<int>(kind_); }
43 const std::string &getName() const noexcept { return name_; }
45 const std::string &getValueText() const noexcept { return valueText_; }
47 float getValue() const noexcept { return value_; }
49 float getMinimum() const noexcept { return minimum_; }
51 float getMaximum() const noexcept { return maximum_; }
53 bool getWholeNumbers() const noexcept { return wholeNumbers_; }
55 bool getUsingSlider() const noexcept { return isUsingSlider_; }
57 bool getInputRefresh() const noexcept { return inputRefresh_; }
59 bool getLabelVisible() const noexcept { return labelVisible_; }
61 bool getSecondLabelVisible() const noexcept { return secondLabelVisible_; }
63 bool getSliderVisible() const noexcept { return sliderVisible_; }
65 bool getInputVisible() const noexcept { return inputVisible_; }
67 bool getToggleVisible() const noexcept { return toggleVisible_; }
69 bool getButtonVisible() const noexcept { return buttonVisible_; }
71 bool getDropdownVisible() const noexcept { return dropdownVisible_; }
73 bool getImageVisible() const noexcept { return imageVisible_; }
75 bool getHeaderVisible() const noexcept { return headerVisible_; }
77 bool getColorVisible() const noexcept { return colorVisible_; }
79 bool getVector2Visible() const noexcept { return vector2Visible_; }
81 bool getVector3Visible() const noexcept { return vector3Visible_; }
83 uint64_t getInitialCallbackRevision() const noexcept { return initialCallbackRevision_; }
84
85private:
86 PcgPhotoModeWidgetKind kind_ = PcgPhotoModeWidgetKind::Field;
87 std::string name_;
88 std::string valueText_;
89 float value_ = 0.0f, minimum_ = 0.0f, maximum_ = 0.0f;
90 bool wholeNumbers_ = false, isUsingSlider_ = true, inputRefresh_ = false;
91 bool labelVisible_ = false, secondLabelVisible_ = false, sliderVisible_ = false;
92 bool inputVisible_ = false, toggleVisible_ = false, buttonVisible_ = false;
93 bool dropdownVisible_ = false, imageVisible_ = false, headerVisible_ = false;
94 bool colorVisible_ = false, vector2Visible_ = false, vector3Visible_ = false;
95 uint64_t initialCallbackRevision_ = 0;
96};
97
99void exposePcgPhotoModeRuntimeUIBindings(ssq::Table &table);
100
101} // namespace eve::ui
double value
#define EVENGINE_API_WORLD
Definition Export.h:109
float maximum[3]
float minimum[3]
TokenKind kind
std::string name
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Backend-neutral state of one Pcg PhotoModeUIHelper prefab instance.
bool getVector2Visible() const noexcept
Returns the vector 2 visible.
bool getWholeNumbers() const noexcept
Returns the whole numbers.
bool getUsingSlider() const noexcept
Returns the using slider.
uint64_t getInitialCallbackRevision() const noexcept
Returns the initial callback revision.
float getMaximum() const noexcept
Returns the maximum.
int getKind() const noexcept
Returns the kind.
const std::string & getName() const noexcept
Returns the name.
bool getImageVisible() const noexcept
Returns the image visible.
bool getHeaderVisible() const noexcept
Returns the header visible.
bool getToggleVisible() const noexcept
Returns the toggle visible.
bool getColorVisible() const noexcept
Returns the color visible.
void markSliderUsed(bool value=true) noexcept
Mark that the next slider update also refreshes its input text.
bool getButtonVisible() const noexcept
Returns the button visible.
bool getLabelVisible() const noexcept
Returns the label visible.
bool getSliderVisible() const noexcept
Returns the slider visible.
const std::string & getValueText() const noexcept
Returns the value text.
float getValue() const noexcept
Returns the value.
bool getDropdownVisible() const noexcept
Returns the dropdown visible.
bool getInputVisible() const noexcept
Returns the input visible.
bool getVector3Visible() const noexcept
Returns the vector 3 visible.
bool getInputRefresh() const noexcept
Returns the input refresh.
bool getSecondLabelVisible() const noexcept
Returns the second label visible.
float getMinimum() const noexcept
Returns the minimum.
PcgPhotoModeWidgetKind
Widget families created by Pcg PhotoModeUtils.
void exposePcgPhotoModeRuntimeUIBindings(ssq::Table &table)
Register Pcg photo-mode runtime UI bindings.
PcgPhotoModeInputStatus
Result of parsing one Pcg photo-mode numeric input field.
glm::vec4 Color
Render-neutral RGBA color shared by graphics-facing modules.
Definition RenderTypes.h:8
enum EVENGINE_API_FOUNDATION Table
OT_TABLE (editable via Runtime table APIs / ReflectedPropertyModel).
Definition Runtime.h:121
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:14