Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a multitool to find an APC now highlights the APC #7020

Merged
merged 4 commits into from
Aug 24, 2024
Merged
Changes from 3 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
25 changes: 24 additions & 1 deletion code/game/objects/items/devices/multitool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,33 @@

next_scan = world.time + 15
var/area/A = get_area(src)
var/APC = A? A.get_apc() : null
var/atom/APC = A? A.get_apc() : null
if(APC)
to_chat(user, SPAN_NOTICE("The local APC is located at [SPAN_BOLD("[get_dist(src, APC)] units [dir2text(Get_Compass_Dir(src, APC))]")]."))
user.balloon_alert(user, "[get_dist(src, APC)] units [dir2text(Get_Compass_Dir(src, APC))]")
if(user.client)
//Create the appearance so we have something to apply the filter to.
var/mutable_appearance/apc_appearance = new /mutable_appearance()
apc_appearance.appearance = APC
harryob marked this conversation as resolved.
Show resolved Hide resolved
apc_appearance.filters += list("type" = "outline", "size" = 1, "color" = COLOR_GREEN)
//Make it an image we can give to the client
var/image/final_image = image(apc_appearance)

final_image.layer = WALL_OBJ_LAYER
final_image.plane = GAME_PLANE
final_image.loc = get_turf(APC)
final_image.dir = apc_appearance.dir
final_image.alpha = 225
user.client.images += final_image
addtimer(CALLBACK(src, PROC_REF(remove_apc_highlight), user.client, final_image), 1.4 SECONDS)


else
to_chat(user, SPAN_WARNING("ERROR: Could not locate local APC."))
user.balloon_alert(user, "could not locate!")

/obj/item/device/multitool/proc/remove_apc_highlight(client/user_client, image/highlight_image)
if(!user_client)
return
user_client.images -= highlight_image

Loading