backing up extra art elsewhere
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
<p>Right-click on an tangible entity or inventory item to open a popup inspect menu with all relevant inspect options. Selecting one will execute a method. Examples are 'follow Chloe' (pathfind after Chloe wherever she moves until action is cancelled), 'pick up clover' (item pickup), and 'examine button' (write a descriptive line about her in Helia's thought bubble) <br></p>
|
||||
<br>
|
||||
<h2>structure </h2>
|
||||
<p>relevant <br></p>
|
||||
<br>
|
||||
<p>Every tangible entity has an exported dictionary of inspect_options: {index: ['tr_key', 'method']}. For example, {0:['tr_pick up','pickup'],1:['tr_extinguish','extinguish']}. Every tangible appends 'examine' at ready. <br></p>
|
||||
<br>
|
||||
<p>The Clickable has a _ready input event signal looking for "right-click." <br></p>
|
||||
@@ -12,7 +14,6 @@
|
||||
<p>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. <br></p>
|
||||
<br>
|
||||
<p>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. <br></p>
|
||||
<br>
|
||||
<h2>challenges/known issues </h2>
|
||||
<p>It's not obvious how to get popupmenus to appear at specific coordinates. I get it to appear at the subject's current location by setting <code>rect_global_position = get_global_mouse_position()</code> the line immediately after <code>popup()</code>. <br></p>
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<p>The inspect menu is a PopupMenu that gives options for interaction with its subject. It rests at res://UI/InspectMenu/InspectMenu.tscn. <br></p>
|
||||
<h3>variables </h3>
|
||||
<p><ul>
|
||||
<li><b>subject</b>: the entity being inspected. Options will be enacted on it. </li>
|
||||
<li><b>is_connected</b>: ensures 'about_to_show' is properly connected. </li>
|
||||
<li><b>label</b>: Label. Holds the subject's display name. </li>
|
||||
</ul><br></p>
|
||||
<br>
|
||||
<h3>methods </h3>
|
||||
<p>void set_subject (Object new_subject) <br></p>
|
||||
<p>setter + subject setup <br></p>
|
||||
<br>
|
||||
<p>void inspect () <br></p>
|
||||
<p>set up inspect menu <br></p>
|
||||
<br>
|
||||
<p>Object make_label () <br></p>
|
||||
<p>returns a label with the name set. (Subject requires write_name()) <br></p>
|
||||
<br>
|
||||
<p>void _about_to_show () <br></p>
|
||||
<p>resets the inspect menu, adds a label, <br></p>
|
||||
<br>
|
||||
Reference in New Issue
Block a user