fix(rich_tooltip): use action3 and action4 texts if item in inventory

This commit is contained in:
2023-03-03 19:46:43 +01:00
parent 5b482d99d1
commit 63cf13a452
3 changed files with 19 additions and 14 deletions

View File

@@ -144,11 +144,17 @@ func update_tooltip_text():
if(current_target_object == null): if(current_target_object == null):
return return
$tooltip1.visible = current_target_object.action1_text != ""; var itemInInventory = escoria.inventory_manager.inventory_has(current_target_object.global_id)
$tooltip1/label.text = current_target_object.action1_text
$tooltip2.visible = current_target_object.action2_text != ""; var action1_text = current_target_object.action1_text if !itemInInventory else current_target_object.action3_text
$tooltip2/label.text = current_target_object.action2_text var action2_text = current_target_object.action2_text if !itemInInventory else current_target_object.action4_text
$tooltip1/label.text = action1_text
$tooltip1.visible = action1_text != "";
$tooltip2/label.text = action2_text
$tooltip2.visible = action2_text != "";

View File

@@ -10,6 +10,6 @@ inventory_add i_bombona2
say player "Es el segundo bolsillo más grande que he visto nunca" say player "Es el segundo bolsillo más grande que he visto nunca"
:action4 :action4
say player "Antes era una bombona pero ahora es una llave inglesa." say player "Tiene pinta de dibujo animado"
say player "¿Esto es real?" say player "¿Esto es real?"
say player "¿Vivo en Matrix?" say player "¿Vivo en Matrix?"

View File

@@ -86,15 +86,15 @@ position = Vector2( 583, 414 )
script = ExtResource( 28 ) script = ExtResource( 28 )
global_id = "i_bombona" global_id = "i_bombona"
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona.esc" esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona.esc"
tooltip_name = "TT Mirar bombona" tooltip_name = "Mirar bombona"
combine_when_selected_action_is_in = [ ] combine_when_selected_action_is_in = [ ]
inventory_texture = ExtResource( 29 ) inventory_texture = ExtResource( 29 )
dialog_color = Color( 1, 1, 1, 1 ) dialog_color = Color( 1, 1, 1, 1 )
action1_text = "TT Mirar bombona" action1_text = "Mirar bombona"
action2_text = "TT2 Coger bombona" action2_text = "Coger bombona"
action3_text = "¿Cómo ha entrado en mi bolsillo?" action3_text = "¿Cómo ha entrado en mi bolsillo?"
action4_text = "¿Por qué es una llave inglesa?" action4_text = "¿Por qué es una llave inglesa?"
tooltip2_name = "TT2 Coger bombona" tooltip2_name = "Coger bombona"
animations = null animations = null
[node name="bombona2" parent="Hotspots" instance=ExtResource( 27 )] [node name="bombona2" parent="Hotspots" instance=ExtResource( 27 )]
@@ -102,16 +102,15 @@ position = Vector2( 355, 409 )
script = ExtResource( 28 ) script = ExtResource( 28 )
global_id = "i_bombona2" global_id = "i_bombona2"
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona2.esc" esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona2.esc"
tooltip_name = "TT Mirar bombona"
combine_when_selected_action_is_in = [ "action1", "action3" ] combine_when_selected_action_is_in = [ "action1", "action3" ]
use_from_inventory_only = true use_from_inventory_only = true
inventory_texture = ExtResource( 29 ) inventory_texture = ExtResource( 29 )
dialog_color = Color( 1, 1, 1, 1 ) dialog_color = Color( 1, 1, 1, 1 )
action1_text = "TT Mirar bombona" action1_text = "Mirar bombona"
action2_text = "TT2 Coger bombona" action2_text = "Coger bombona"
action3_text = "Usar" action3_text = "Usar"
action4_text = "¿Por qué es una llave inglesa?" action4_text = "¿Por qué es un dibujo animado?"
tooltip2_name = "TT Mirar bombona" tooltip2_name = "Mirar bombona"
animations = null animations = null
[node name="Columna" type="Sprite" parent="."] [node name="Columna" type="Sprite" parent="."]