Cancel the target as well as the picture
Record ID: cancel_target_menu. Global Script: off. Use this on the Cancel/Close Button of curse_coin and gem_context instead of hiding only the visible GUI.
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
Runtime.set("verb_direct_target", "")
Runtime.call("clear_selected_inventory_item")
var popup: String = str(GetProjectProperty(
"meta.verbDirectGuiId", ""))
if not popup.is_empty():
await HideGUI({"guiId":popup})
return trueThe visible popup and the stored target are separate state. This script clears the pending target and the selected inventory item, then hides the currently configured Verb Direct Popup GUI.
Use this for cancelling a target-action menu. Do not put it on a chest Close Button when you intentionally want to retain a selected item for world use.
