Update radial.dm (#21407)

This commit is contained in:
SapphicOverload
2024-02-14 19:01:19 -05:00
committed by GitHub
parent f4dcbd04c0
commit d08cdca399

View File

@@ -326,19 +326,26 @@ GLOBAL_LIST_EMPTY(radial_menus)
return
current_user = M.client
//Blank
menu_holder = image(icon='icons/effects/effects.dmi',loc=anchor,icon_state="nothing",layer = ABOVE_HUD_LAYER)
menu_holder = image(icon='icons/effects/effects.dmi',loc=get_atom_on_turf(anchor),icon_state="nothing",layer = ABOVE_HUD_LAYER)
menu_holder.plane = ABOVE_HUD_PLANE
menu_holder.appearance_flags |= KEEP_APART
menu_holder.vis_contents += elements + close_button
current_user.images += menu_holder
if(ismovable(anchor))
RegisterSignal(anchor, COMSIG_MOVABLE_MOVED, PROC_REF(on_anchor_moved))
/datum/radial_menu/proc/on_anchor_moved()
menu_holder.loc = get_atom_on_turf(anchor)
/datum/radial_menu/proc/hide()
if(ismovable(anchor))
UnregisterSignal(anchor, COMSIG_MOVABLE_MOVED)
if(current_user)
current_user.images -= menu_holder
/datum/radial_menu/proc/wait(atom/user, atom/anchor, require_near = FALSE)
while (current_user && !finished && !selected_choice)
if(require_near && !in_range(anchor, user))
if(require_near && !(in_range(anchor, user) || anchor == user.loc))
return
if(custom_check_callback && next_check < world.time)
if(!custom_check_callback.Invoke())
@@ -387,7 +394,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
var/answer = menu.selected_choice
qdel(menu)
GLOB.radial_menus -= uniqueid
if(require_near && !in_range(anchor, user))
if(require_near && !(in_range(anchor, user)) || anchor == user.loc)
return
if(istype(custom_check))
if(!custom_check.Invoke())