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

[MIRROR] Adds radial menu choice for ladders #300

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

GLOBAL_LIST_EMPTY(radial_menus)

/obj/screen/radial/Destroy()
parent = null
return ..()

/obj/screen/radial
icon = 'icons/screen/radial.dmi'
layer = HUD_ABOVE_ITEM_LAYER
Expand Down Expand Up @@ -290,6 +294,8 @@ GLOBAL_LIST_EMPTY(radial_menus)
/datum/radial_menu/Destroy()
Reset()
hide()
QDEL_NULL_LIST(elements)
QDEL_NULL(close_button)
QDEL_NULL(custom_check_callback)
return ..()

Expand Down
7 changes: 6 additions & 1 deletion code/modules/multiz/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
var/climb_time = 2 SECONDS
var/static/list/climbsounds = list('sound/effects/ladder.ogg','sound/effects/ladder2.ogg','sound/effects/ladder3.ogg','sound/effects/ladder4.ogg')

var/static/radial_ladder_down = image(icon = 'icons/screen/radial.dmi', icon_state = "radial_ladder_down")
var/static/radial_ladder_up = image(icon = 'icons/screen/radial.dmi', icon_state = "radial_ladder_up")

var/static/list/radial_options = list("up" = radial_ladder_up, "down" = radial_ladder_down)

/obj/structure/ladder/handle_default_wrench_attackby()
var/last_anchored = anchored
. = ..()
Expand Down Expand Up @@ -186,7 +191,7 @@
if(!target_up && !target_down)
to_chat(M, SPAN_WARNING("\The [src] does not seem to lead anywhere."))
else if(target_down && target_up)
var/direction = input(M,"Do you want to go up or down?", "Up or down the ladder?") as null|anything in list("up", "down")
var/direction = show_radial_menu(M, src, radial_options, require_near = !(isEye(M) || isobserver(M)))
if(!direction)
return
if(!M.may_climb_ladders(src))
Expand Down
Binary file modified icons/screen/radial.dmi
Binary file not shown.