@@ -6,6 +6,7 @@ signal drag_started(offset: Vector2)
6
6
const Constants = preload ("res://addons/block_code/ui/constants.gd" )
7
7
const OptionData = preload ("res://addons/block_code/code_generation/option_data.gd" )
8
8
const Types = preload ("res://addons/block_code/types/types.gd" )
9
+ const Option_Theme = preload ("res://addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.tscn::StyleBoxFlat_7m75r" )
9
10
10
11
signal modified
11
12
@@ -286,6 +287,24 @@ func _switch_input(node: Node):
286
287
c .visible = c == node
287
288
_background .visible = node not in [_option_input , null ]
288
289
_background .is_pointy_value = node == _bool_input
290
+ if option_data :
291
+ _option_input .add_theme_stylebox_override ("focus" , Option_Theme )
292
+ _option_input .add_theme_stylebox_override ("hover" , Option_Theme )
293
+ _option_input .add_theme_stylebox_override ("pressed" , Option_Theme )
294
+ _option_input .add_theme_stylebox_override ("normal" , Option_Theme )
295
+ var raw_input = get_raw_input ()
296
+ var data = str_to_var ("" if raw_input == null or raw_input is Block else raw_input )
297
+ if typeof (data ):
298
+ var empty_theme = StyleBoxEmpty .new ()
299
+ _option_input .add_theme_stylebox_override ("focus" , empty_theme )
300
+ _option_input .add_theme_stylebox_override ("hover" , empty_theme )
301
+ _option_input .add_theme_stylebox_override ("pressed" , empty_theme )
302
+ _option_input .add_theme_stylebox_override ("normal" , empty_theme )
303
+ variant_type = typeof (data )
304
+ _background .visible = true
305
+ _background .is_pointy_value = variant_type == TYPE_BOOL
306
+ snap_point .visible = true
307
+ snap_point .variant_type = variant_type
289
308
290
309
291
310
func _update_option_input (current_value : Variant = null ):
@@ -350,6 +369,7 @@ func _update_background_color(new_color):
350
369
func _on_option_input_item_selected (index ):
351
370
if not editable :
352
371
return
372
+ _update_visible_input ()
353
373
modified .emit ()
354
374
355
375
0 commit comments