3131#include " audio_stream_interactive_editor_plugin.h"
3232
3333#include " ../audio_stream_interactive.h"
34- #include " core/input/input.h"
35- #include " core/os/keyboard.h"
3634#include " editor/editor_node.h"
37- #include " editor/editor_settings.h"
3835#include " editor/editor_string_names.h"
3936#include " editor/editor_undo_redo_manager.h"
40- #include " editor/themes/editor_scale.h"
4137#include " scene/gui/check_box.h"
4238#include " scene/gui/option_button.h"
4339#include " scene/gui/spin_box.h"
@@ -73,7 +69,7 @@ void AudioStreamInteractiveTransitionEditor::_edited() {
7369 int filler = use_filler ? filler_clip->get_selected () - 1 : 0 ;
7470 bool hold = hold_previous->is_pressed ();
7571
76- EditorUndoRedoManager::get_singleton ()->create_action (" Edit Transitions" );
72+ EditorUndoRedoManager::get_singleton ()->create_action (TTR ( " Edit Transitions" ) );
7773 for (int i = 0 ; i < selected.size (); i++) {
7874 if (!enabled) {
7975 if (audio_stream_interactive->has_transition (selected[i].x , selected[i].y )) {
@@ -177,7 +173,6 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
177173 };
178174 for (int i = 0 ; i <= clip_count; i++) {
179175 for (int j = 0 ; j <= clip_count; j++) {
180- String txt;
181176 int from = i == clip_count ? AudioStreamInteractive::CLIP_ANY : i;
182177 int to = j == clip_count ? AudioStreamInteractive::CLIP_ANY : j;
183178
@@ -187,54 +182,56 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
187182 if (!exists) {
188183 if (audio_stream_interactive->has_transition (AudioStreamInteractive::CLIP_ANY, to)) {
189184 from = AudioStreamInteractive::CLIP_ANY;
190- tooltip = " Using Any Clip -> " + audio_stream_interactive->get_clip_name (to) + " . " ;
185+ tooltip = vformat ( TTR ( " Using Any Clip -> %s. " ), audio_stream_interactive->get_clip_name (to)) ;
191186 } else if (audio_stream_interactive->has_transition (from, AudioStreamInteractive::CLIP_ANY)) {
192187 to = AudioStreamInteractive::CLIP_ANY;
193- tooltip = " Using " + audio_stream_interactive-> get_clip_name (from) + " -> Any Clip." ;
188+ tooltip = vformat ( TTR ( " Using %s -> Any Clip." ), audio_stream_interactive-> get_clip_name (from)) ;
194189 } else if (audio_stream_interactive->has_transition (AudioStreamInteractive::CLIP_ANY, AudioStreamInteractive::CLIP_ANY)) {
195190 from = to = AudioStreamInteractive::CLIP_ANY;
196- tooltip = " Using All CLips -> Any Clip." ;
191+ tooltip = TTR ( " Using All Clips -> Any Clip." ) ;
197192 } else {
198- tooltip = " No transition available." ;
193+ tooltip = TTR ( " No transition available." ) ;
199194 }
200195 }
201196
197+ String from_time;
198+ String to_time;
202199 if (audio_stream_interactive->has_transition (from, to)) {
203200 icon = fade_icons[audio_stream_interactive->get_transition_fade_mode (from, to)];
204201 switch (audio_stream_interactive->get_transition_from_time (from, to)) {
205202 case AudioStreamInteractive::TRANSITION_FROM_TIME_IMMEDIATE: {
206- txt + = TTR (" Immediate" );
203+ from_time = TTR (" Immediate" );
207204 } break ;
208205 case AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BEAT: {
209- txt + = TTR (" Next Beat" );
206+ from_time = TTR (" Next Beat" );
210207 } break ;
211208 case AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BAR: {
212- txt + = TTR (" Next Bar" );
209+ from_time = TTR (" Next Bar" );
213210 } break ;
214211 case AudioStreamInteractive::TRANSITION_FROM_TIME_END: {
215- txt + = TTR (" Clip End" );
212+ from_time = TTR (" Clip End" );
216213 } break ;
217214 default : {
218215 }
219216 }
220217
221218 switch (audio_stream_interactive->get_transition_to_time (from, to)) {
222219 case AudioStreamInteractive::TRANSITION_TO_TIME_SAME_POSITION: {
223- txt + = TTR (L" ⮕ Same" );
220+ to_time = TTR (" Same" , " Transition Time Position " );
224221 } break ;
225222 case AudioStreamInteractive::TRANSITION_TO_TIME_START: {
226- txt + = TTR (L" ⮕ Start" );
223+ to_time = TTR (" Start" , " Transition Time Position " );
227224 } break ;
228225 case AudioStreamInteractive::TRANSITION_TO_TIME_PREVIOUS_POSITION: {
229- txt + = TTR (L" ⮕ Prev" );
226+ to_time = TTR (" Prev" , " Transition Time Position " );
230227 } break ;
231228 default : {
232229 }
233230 }
234231 }
235232
236233 rows[j]->set_icon (i, icon);
237- rows[j]->set_text (i, txt );
234+ rows[j]->set_text (i, to_time. is_empty () ? from_time : vformat ( U" %s ⮕ %s " , from_time, to_time) );
238235 rows[j]->set_tooltip_text (i, tooltip);
239236 if (exists) {
240237 rows[j]->set_custom_color (i, font_color);
@@ -267,10 +264,10 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) {
267264 TreeItem *header = tree->create_item (root); // Header
268265 int header_index = clip_count + 1 ;
269266 header->set_text (header_index, TTR (" From / To" ));
270- header->set_editable ( 0 , false );
267+ header->set_selectable (header_index , false );
271268
272269 filler_clip->clear ();
273- filler_clip->add_item (" Disabled" , -1 );
270+ filler_clip->add_item (TTR ( " Disabled" ) , -1 );
274271
275272 Color header_color = get_theme_color (SNAME (" prop_subsection" ), EditorStringName (Editor));
276273
@@ -280,7 +277,6 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) {
280277 for (int i = 0 ; i <= clip_count; i++) {
281278 int cell_index = i;
282279 int clip_i = i == clip_count ? AudioStreamInteractive::CLIP_ANY : i;
283- header->set_editable (cell_index, false );
284280 header->set_selectable (cell_index, false );
285281 header->set_custom_font (cell_index, header_font);
286282 header->set_custom_font_size (cell_index, header_font_size);
@@ -332,6 +328,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
332328 split = memnew (HSplitContainer);
333329 add_child (split);
334330 tree = memnew (Tree);
331+ tree->set_auto_translate_mode (AUTO_TRANSLATE_MODE_DISABLED);
335332 tree->set_hide_root (true );
336333 tree->add_theme_constant_override (" draw_guides" , 1 );
337334 tree->set_select_mode (Tree::SELECT_MULTI);
@@ -375,6 +372,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
375372
376373 filler_clip = memnew (OptionButton);
377374 edit_vb->add_margin_child (TTR (" Filler Clip:" ), filler_clip);
375+ filler_clip->set_auto_translate_mode (AUTO_TRANSLATE_MODE_DISABLED);
378376 filler_clip->connect (" item_selected" , callable_mp (this , &AudioStreamInteractiveTransitionEditor::_edited).unbind (1 ));
379377
380378 hold_previous = memnew (CheckBox);
0 commit comments