mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Update radial.dm (#21407)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user