Skip to content

Adding an Interact hotkey.#5364

Open
MistakeNot4892 wants to merge 1 commit into
NebulaSS13:devfrom
MistakeNot4892:tweak/interact_key
Open

Adding an Interact hotkey.#5364
MistakeNot4892 wants to merge 1 commit into
NebulaSS13:devfrom
MistakeNot4892:tweak/interact_key

Conversation

@MistakeNot4892

@MistakeNot4892 MistakeNot4892 commented May 13, 2026

Copy link
Copy Markdown
Contributor
  • Adds an Interact hotkey that attempts to click on the turf you are facing.
  • Adds interaction_priority to mark atoms that we are most interested in interacting with (so that lights above airlocks do not block interacting with the airlock).

@MistakeNot4892 MistakeNot4892 added the ready for review This PR is ready for review and merge. label May 13, 2026

@out-of-phaze out-of-phaze left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good except for some nitpicks

Comment on lines +205 to +211
var/list/atoms = sortTim(facing.contents.Copy(), /proc/cmp_planelayer)

// Move non-prioritised atoms to the end of the list (to avoid burning our hands on lights when trying to open a closet)
for(var/atom/clickable as anything in atoms)
if(!clickable.interaction_priority)
atoms -= clickable
atoms += clickable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if it might be faster to create a custom comparator that's cmp_planelayer but anything with interaction_priority is sorted lower. that'd lower the number of times we need to loop over the contents list at least. not blocking but i'd at least like to consider it


// Try to click something.
for(var/atom/clickable as anything in atoms)
if(!clickable.simulated)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use facing.get_contained_external_atoms() instead of just facing.contents we can skip the simulated check and probably some other things we want to avoid here too

@out-of-phaze out-of-phaze added awaiting author This PR is awaiting action from the author before it can be merged. and removed ready for review This PR is ready for review and merge. labels Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting author This PR is awaiting action from the author before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants