fix(rich_tooltip): use action3 and action4 texts if item in inventory
This commit is contained in:
@@ -144,11 +144,17 @@ func update_tooltip_text():
|
||||
if(current_target_object == null):
|
||||
return
|
||||
|
||||
$tooltip1.visible = current_target_object.action1_text != "";
|
||||
$tooltip1/label.text = current_target_object.action1_text
|
||||
var itemInInventory = escoria.inventory_manager.inventory_has(current_target_object.global_id)
|
||||
|
||||
$tooltip2.visible = current_target_object.action2_text != "";
|
||||
$tooltip2/label.text = current_target_object.action2_text
|
||||
var action1_text = current_target_object.action1_text if !itemInInventory else current_target_object.action3_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 != "";
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user