From 7b0f7b58c4f7469db9b0b004fd9094ba7b0a2a9a Mon Sep 17 00:00:00 2001 From: chimchooree Date: Fri, 11 Nov 2022 00:05:32 -0600 Subject: [PATCH] inspect; item; pathfinding; terms --- src/blessfrey-gdd/inspect | 6 +++++- src/blessfrey-gdd/item | 25 +++++++++++++++++++++++-- src/blessfrey-gdd/pathfinding | 30 ++++++++++++++++++++++++++++++ src/blessfrey-gdd/terms | 9 +++++++++ src/views/bf-gdd.tpl | 2 +- 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 src/blessfrey-gdd/pathfinding diff --git a/src/blessfrey-gdd/inspect b/src/blessfrey-gdd/inspect index 7898d98..fde9b43 100644 --- a/src/blessfrey-gdd/inspect +++ b/src/blessfrey-gdd/inspect @@ -9,7 +9,7 @@

The inspect menu ("res://UI/InspectMenu/InspectMenu.tscn") is instanced at declaration and added as a child at ready in the UI singleton.


logic

-

When tangible entity is right-clicked (@ $Body/Sprite/Clickable), the UI enters InspectMenu with its subject set. The "id_pressed" signal is reset for each subject. InspectMenu connects "about_to_show" the first time it's needed and keeps it forever. Before popup(), it resets, adds a label at an offset with the subject's display name, then adds a UI option for each inspect option.

+

When tangible entity is right-clicked (@ $Body/Sprite/Clickable), the UI enters InspectMenu with its subject set. (The subject setter also sets the player's target.) The "id_pressed" signal is reset for each subject. InspectMenu connects "about_to_show" the first time it's needed and keeps it forever. Before popup(), it resets, adds a label at an offset with the subject's display name, then adds a UI option for each inspect option.


When a selection is made, the "id_pressed" signal calls "id_pressed" on the subject, which calls the method at its inspect_options[pressed_id][1]. So 'examine' calls 'examine,' which is in tangible.gd. Most related methods are on tangible.gd, though they may be at a more specific script.


@@ -20,6 +20,10 @@

Tangibles and inventory items both have inspect menus, but their code has to be separate. They are too different from each other.


+

I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target).

+
+

It doesn't close the inspect menu if pickup is chosen while item out of range, even after item is picked up.

+

works for...