Skip to content

Commit

Permalink
display_parts() no longer displays itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Feb 9, 2025
1 parent 14d7f0c commit e821679
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
var/obj/item/part_replacer/replacer = I
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
machine.display_parts(user, show_directly = TRUE)
for(var/line in machine.get_part_info_strings(user))
to_chat(user, line)
return TRUE
return FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
var/obj/item/part_replacer/replacer = I
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
machine.display_parts(user, show_directly = TRUE)
for(var/line in machine.get_part_info_strings(user))
to_chat(user, line)
return TRUE
return FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
var/obj/item/part_replacer/replacer = I
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
machine.display_parts(user, show_directly = TRUE)
for(var/line in machine.get_part_info_strings(user))
to_chat(user, line)
return TRUE
return down_interaction(I, user, machine)

Expand Down
6 changes: 2 additions & 4 deletions code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Class Procs:
/datum/proc/remove_visual(mob/M)
return

/obj/machinery/proc/display_parts(mob/user, show_directly)
/obj/machinery/proc/get_part_info_strings(mob/user)
. = list()
. += SPAN_NOTICE("The following parts are detected in \the [src]:")
for(var/obj/item/C in component_parts)
Expand All @@ -416,13 +416,11 @@ Class Procs:
for(var/path in uncreated_component_parts)
var/obj/item/thing = path
. += SPAN_NOTICE(" [initial(thing.name)] ([uncreated_component_parts[path] || 1])")
if(length(.) && show_directly)
to_chat(user, jointext(., "<br/>"))

/obj/machinery/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
if(component_parts && (hasHUD(user, HUD_SCIENCE) || (construct_state && construct_state.visible_components)))
. += display_parts(user)
. += get_part_info_strings(user)
if(stat & NOSCREEN)
. += SPAN_WARNING("It is missing a screen, making it hard to interact with.")
else if(stat & NOINPUT)
Expand Down

0 comments on commit e821679

Please sign in to comment.