Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
/// (DATUM) Similar to above, but largely used by /turf/wall, /obj/structure and /obj/item/stack/material
var/decl/material/reinf_material

/// (BOOLEAN) Set to TRUE to prioritise this atom when using the interact hotkey.
var/interaction_priority

/atom/proc/get_max_health()
return max_health

Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Class Procs:
)
temperature_sensitive = TRUE
abstract_type = /obj/machinery
interaction_priority = TRUE

var/stat = 0
var/waterproof = TRUE
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/doors/_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
uncreated_component_parts = null
required_interaction_dexterity = DEXTERITY_SIMPLE_MACHINES
max_health = 300
interaction_priority = TRUE

var/can_open_manually = TRUE

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
pass_flags = PASS_FLAG_TABLE
abstract_type = /obj/item
temperature_sensitive = TRUE
interaction_priority = TRUE

/// Set to prefix name with this string ('woven' for 'woven basket' etc)
var/name_prefix
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/doors/_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
anchored = TRUE
opacity = TRUE
structure_flags = STRUCTURE_FLAG_THROWN_DAMAGE
interaction_priority = TRUE
var/has_window = FALSE
var/changing_state = FALSE
var/door_sound_volume = 25
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/fences/_fences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
name = "fence gate"
desc = "Much like a regular door, but thinner."
icon_state = "door-closed"
interaction_priority = TRUE

/obj/structure/fence/door/can_install_lock()
return TRUE
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/inflatable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
density = TRUE
anchored = TRUE
opacity = FALSE
interaction_priority = TRUE

icon_state = "door_closed"
undeploy_path = /obj/item/inflatable/door
Expand Down
1 change: 1 addition & 0 deletions code/modules/atmospherics/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Pipelines + Other Objects -> Pipe network
idle_power_usage = 0
active_power_usage = 0
power_channel = ENVIRON
interaction_priority = null

var/power_rating //the maximum amount of power the machine can use to do work, affects how powerful the machine is, in Watts

Expand Down
39 changes: 39 additions & 0 deletions code/modules/keybindings/binds/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,42 @@
/datum/keybinding/mob/minimal_hud/down(client/user)
user.mob.minimize_hud()
return TRUE

/datum/keybinding/mob/interact
hotkey_keys = list("Enter")
name = "interact"
full_name = "Interact"
description = "Interact with the turf directly in front of you."

/datum/keybinding/mob/interact/down(client/user)
user.mob.interact_with_facing()
return TRUE

/mob/proc/interact_with_facing()

var/turf/facing = get_step(get_turf(src), dir)
if(!istype(facing))
return

var/atom/click_on
if(length(facing.contents))
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

// Try to click something.
for(var/atom/clickable as anything in atoms)
if(!clickable.simulated)
continue
if(clickable.invisibility > see_invisible)
continue
click_on = clickable
break
else
click_on = facing

click_on?.Click()
1 change: 1 addition & 0 deletions code/modules/lights/light_fixture_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
idle_power_usage = 2
active_power_usage = 20
power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
interaction_priority = null

uncreated_component_parts = list(
/obj/item/stock_parts/power/apc
Expand Down
Loading