Skip to reading
Eight Adventure Interface Workshops

Cancel the target as well as the picture

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

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.

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
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 true

The 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.

Page 100 of 119Permalink
Go to page