| 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 "../action_map/openxr_action_map.h" |
| 34 |
#include "../action_map/openxr_action_set.h" |
| 35 |
#include "openxr_action_editor.h" |
| 36 |
|
| 37 |
class EditorSpinSlider; |
| 38 |
class BoxContainer; |
| 39 |
class Button; |
| 40 |
class LineEdit; |
| 41 |
class PanelContainer; |
| 42 |
class TextEdit; |
| 43 |
|
| 44 |
class OpenXRActionSetEditor : public HBoxContainer { |
| 45 |
GDCLASS(OpenXRActionSetEditor, HBoxContainer); |
| 46 |
|
| 47 |
private: |
| 48 |
EditorUndoRedoManager *undo_redo; |
| 49 |
Ref<OpenXRActionMap> action_map; |
| 50 |
Ref<OpenXRActionSet> action_set; |
| 51 |
|
| 52 |
bool is_expanded = true; |
| 53 |
|
| 54 |
PanelContainer *panel = nullptr; |
| 55 |
Button *fold_btn = nullptr; |
| 56 |
VBoxContainer *main_vb = nullptr; |
| 57 |
HBoxContainer *action_set_hb = nullptr; |
| 58 |
LineEdit *action_set_name = nullptr; |
| 59 |
LineEdit *action_set_localized_name = nullptr; |
| 60 |
EditorSpinSlider *action_set_priority = nullptr; |
| 61 |
Button *add_action = nullptr; |
| 62 |
Button *rem_action_set = nullptr; |
| 63 |
VBoxContainer *actions_vb = nullptr; |
| 64 |
|
| 65 |
void _set_fold_icon(); |
| 66 |
void _theme_changed(); |
| 67 |
OpenXRActionEditor *_add_action_editor(const Ref<OpenXRAction> &p_action); |
| 68 |
|
| 69 |
void _on_toggle_expand(); |
| 70 |
void _on_action_set_name_changed(const String &p_new_text); |
| 71 |
void _on_action_set_localized_name_changed(const String &p_new_text); |
| 72 |
void _on_action_set_priority_changed(const double p_new_value); |
| 73 |
void _on_add_action(); |
| 74 |
void _on_remove_action_set(); |
| 75 |
|
| 76 |
void _on_remove_action(Object *p_action_editor); |
| 77 |
|
| 78 |
protected: |
| 79 |
static void _bind_methods(); |
| 80 |
void _notification(int p_what); |
| 81 |
|
| 82 |
|
| 83 |
void _do_set_name(const String &p_new_text); |
| 84 |
void _do_set_localized_name(const String &p_new_text); |
| 85 |
void _do_set_priority(int64_t value); |
| 86 |
void _do_add_action_editor(OpenXRActionEditor *p_action_editor); |
| 87 |
void _do_remove_action_editor(OpenXRActionEditor *p_action_editor); |
| 88 |
|
| 89 |
public: |
| 90 |
Ref<OpenXRActionSet> get_action_set() { return action_set; } |
| 91 |
void set_focus_on_entry(); |
| 92 |
|
| 93 |
void remove_all_actions(); |
| 94 |
|
| 95 |
OpenXRActionSetEditor(const Ref<OpenXRActionMap> &p_action_map, const Ref<OpenXRActionSet> &p_action_set); |
| 96 |
}; |