| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "editor/inspector/editor_inspector.h" |
| 34 |
#include "editor/inspector/editor_properties.h" |
| 35 |
|
| 36 |
class EditorSpinSlider; |
| 37 |
class TextureButton; |
| 38 |
|
| 39 |
class EditorPropertyVectorN : public EditorProperty { |
| 40 |
GDCLASS(EditorPropertyVectorN, EditorProperty); |
| 41 |
|
| 42 |
static const String COMPONENT_LABELS[4]; |
| 43 |
|
| 44 |
int component_count = 0; |
| 45 |
Variant::Type vector_type; |
| 46 |
|
| 47 |
Vector<EditorSpinSlider *> spin_sliders; |
| 48 |
TextureButton *linked = nullptr; |
| 49 |
Vector<double> ratio; |
| 50 |
bool is_grabbed = false; |
| 51 |
|
| 52 |
bool radians_as_degrees = false; |
| 53 |
|
| 54 |
void _update_ratio(); |
| 55 |
void _store_link(bool p_linked); |
| 56 |
void _grab_changed(bool p_grab); |
| 57 |
void _value_changed(double p_val, const String &p_name); |
| 58 |
|
| 59 |
protected: |
| 60 |
virtual void _set_read_only(bool p_read_only) override; |
| 61 |
void _notification(int p_what); |
| 62 |
|
| 63 |
public: |
| 64 |
virtual void update_property() override; |
| 65 |
void setup(const EditorPropertyRangeHint &p_range_hint, bool p_link = false, bool p_is_int = false); |
| 66 |
EditorPropertyVectorN(Variant::Type p_type, bool p_force_wide, bool p_horizontal); |
| 67 |
}; |
| 68 |
|
| 69 |
class EditorPropertyVector2 : public EditorPropertyVectorN { |
| 70 |
GDCLASS(EditorPropertyVector2, EditorPropertyVectorN); |
| 71 |
|
| 72 |
public: |
| 73 |
EditorPropertyVector2(bool p_force_wide = false); |
| 74 |
}; |
| 75 |
|
| 76 |
class EditorPropertyVector2i : public EditorPropertyVectorN { |
| 77 |
GDCLASS(EditorPropertyVector2i, EditorPropertyVectorN); |
| 78 |
|
| 79 |
public: |
| 80 |
EditorPropertyVector2i(bool p_force_wide = false); |
| 81 |
}; |
| 82 |
|
| 83 |
class EditorPropertyVector3 : public EditorPropertyVectorN { |
| 84 |
GDCLASS(EditorPropertyVector3, EditorPropertyVectorN); |
| 85 |
|
| 86 |
public: |
| 87 |
EditorPropertyVector3(bool p_force_wide = false); |
| 88 |
}; |
| 89 |
|
| 90 |
class EditorPropertyVector3i : public EditorPropertyVectorN { |
| 91 |
GDCLASS(EditorPropertyVector3i, EditorPropertyVectorN); |
| 92 |
|
| 93 |
public: |
| 94 |
EditorPropertyVector3i(bool p_force_wide = false); |
| 95 |
}; |
| 96 |
|
| 97 |
class EditorPropertyVector4 : public EditorPropertyVectorN { |
| 98 |
GDCLASS(EditorPropertyVector4, EditorPropertyVectorN); |
| 99 |
|
| 100 |
public: |
| 101 |
EditorPropertyVector4(bool p_force_wide = false); |
| 102 |
}; |
| 103 |
|
| 104 |
class EditorPropertyVector4i : public EditorPropertyVectorN { |
| 105 |
GDCLASS(EditorPropertyVector4i, EditorPropertyVectorN); |
| 106 |
|
| 107 |
public: |
| 108 |
EditorPropertyVector4i(bool p_force_wide = false); |
| 109 |
}; |