| 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/plugins/editor_plugin.h" |
| 35 |
#include "scene/gui/dialogs.h" |
| 36 |
|
| 37 |
class CheckBox; |
| 38 |
class HSplitContainer; |
| 39 |
class VSplitContainer; |
| 40 |
class Tree; |
| 41 |
class TreeItem; |
| 42 |
class AudioStreamInteractive; |
| 43 |
|
| 44 |
class AudioStreamInteractiveTransitionEditor : public AcceptDialog { |
| 45 |
GDCLASS(AudioStreamInteractiveTransitionEditor, AcceptDialog); |
| 46 |
|
| 47 |
AudioStreamInteractive *audio_stream_interactive = nullptr; |
| 48 |
|
| 49 |
HSplitContainer *split = nullptr; |
| 50 |
Tree *tree = nullptr; |
| 51 |
|
| 52 |
Vector<TreeItem *> rows; |
| 53 |
|
| 54 |
CheckBox *transition_enabled = nullptr; |
| 55 |
OptionButton *transition_from = nullptr; |
| 56 |
OptionButton *transition_to = nullptr; |
| 57 |
OptionButton *fade_mode = nullptr; |
| 58 |
SpinBox *fade_beats = nullptr; |
| 59 |
OptionButton *filler_clip = nullptr; |
| 60 |
CheckBox *hold_previous = nullptr; |
| 61 |
|
| 62 |
bool updating_selection = false; |
| 63 |
int order_counter = 0; |
| 64 |
HashMap<Vector2i, int> selection_order; |
| 65 |
|
| 66 |
Vector<Vector2i> selected; |
| 67 |
bool updating = false; |
| 68 |
void _cell_selected(TreeItem *p_item, int p_column, bool p_selected); |
| 69 |
void _update_transitions(); |
| 70 |
|
| 71 |
void _update_selection(); |
| 72 |
void _edited(); |
| 73 |
|
| 74 |
protected: |
| 75 |
void _notification(int p_what); |
| 76 |
static void _bind_methods(); |
| 77 |
|
| 78 |
public: |
| 79 |
void edit(Object *p_obj); |
| 80 |
|
| 81 |
AudioStreamInteractiveTransitionEditor(); |
| 82 |
}; |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
class EditorInspectorPluginAudioStreamInteractive : public EditorInspectorPlugin { |
| 87 |
GDCLASS(EditorInspectorPluginAudioStreamInteractive, EditorInspectorPlugin); |
| 88 |
|
| 89 |
AudioStreamInteractiveTransitionEditor *audio_stream_interactive_transition_editor = nullptr; |
| 90 |
|
| 91 |
void _edit(Object *p_object); |
| 92 |
|
| 93 |
public: |
| 94 |
virtual bool can_handle(Object *p_object) override; |
| 95 |
virtual void parse_end(Object *p_object) override; |
| 96 |
|
| 97 |
EditorInspectorPluginAudioStreamInteractive(); |
| 98 |
}; |
| 99 |
|
| 100 |
class AudioStreamInteractiveEditorPlugin : public EditorPlugin { |
| 101 |
GDCLASS(AudioStreamInteractiveEditorPlugin, EditorPlugin); |
| 102 |
|
| 103 |
public: |
| 104 |
virtual String get_plugin_name() const override { return "AudioStreamInteractive"; } |
| 105 |
|
| 106 |
AudioStreamInteractiveEditorPlugin(); |
| 107 |
}; |