fixes a few radial menus not working (#23495)

* fixes a few radial menus not working

* also this
This commit is contained in:
GDN
2023-12-08 20:59:03 +00:00
committed by GitHub
parent 4ccd0b453f
commit ba96ed4686
5 changed files with 9 additions and 13 deletions
+5 -3
View File
@@ -124,8 +124,9 @@ GLOBAL_LIST_EMPTY(radial_menus)
/datum/radial_menu/proc/update_screen_objects()
var/list/page_choices = page_data[current_page]
var/angle_per_element = round(zone / page_choices.len)
pixel_x_difference = ((world.icon_size * anchor.x) + anchor.step_x + anchor.pixel_x) - ((world.icon_size * current_user.mob.x) + current_user.mob.step_x + current_user.mob.pixel_x)
pixel_y_difference = ((world.icon_size * anchor.y) + anchor.step_y + anchor.pixel_y) - ((world.icon_size * current_user.mob.y) + current_user.mob.step_y + current_user.mob.pixel_y)
if(current_user.mob.z && anchor.z)
pixel_x_difference = ((world.icon_size * anchor.x) + anchor.step_x + anchor.pixel_x) - ((world.icon_size * current_user.mob.x) + current_user.mob.step_x + current_user.mob.pixel_x)
pixel_y_difference = ((world.icon_size * anchor.y) + anchor.step_y + anchor.pixel_y) - ((world.icon_size * current_user.mob.y) + current_user.mob.step_y + current_user.mob.pixel_y)
for(var/i in 1 to elements.len)
var/obj/screen/radial/E = elements[i]
var/angle = WRAP(starting_angle + (i - 1) * angle_per_element, 0, 360)
@@ -225,7 +226,8 @@ GLOBAL_LIST_EMPTY(radial_menus)
var/last_location = user.loc
while(current_user && !finished && !selected_choice)
if(require_near)
if(!user.Adjacent(get_turf(anchor)))
var/turf/our_turf = get_turf(user)
if(!our_turf.Adjacent(get_turf(anchor)))
return
if(last_location != user.loc)
update_screen_objects()
+1 -1
View File
@@ -867,7 +867,7 @@ GLOBAL_LIST_EMPTY(multiverse)
"Welder Fuel" = "a dark, pungent, oily substance",
"Vomit" = "warm chunky vomit")
var/choice = show_radial_menu(user, src, options)
var/choice = show_radial_menu(user, src, options, require_near = TRUE)
if(!choice || user.stat || !in_range(user, src) || QDELETED(src))
return
to_chat(user, "<span class='notice'>The [name] fills to brimming with [options_to_descriptions[choice]].</span>")
+1 -1
View File
@@ -1564,7 +1564,7 @@
choices[MT.name] = MA
choices_to_refs[MT.name] = MT
var/choice = show_radial_menu(L, src, choices, radius = 48, custom_check = CALLBACK(src, PROC_REF(check_menu), L))
var/choice = show_radial_menu(L, L, choices, radius = 48, custom_check = CALLBACK(src, PROC_REF(check_menu), L))
if(!check_menu(L) || choice == "Cancel / No Change")
return
@@ -374,13 +374,7 @@
"Medical" = image(icon = 'icons/obj/clothing/glasses.dmi', icon_state = "healthhud"),
"Diagnostic" = image(icon = 'icons/obj/clothing/glasses.dmi', icon_state = "diagnostichud"),
"None" = image(icon = 'icons/mob/screen_gen.dmi', icon_state = "x"))
var/user_loc
if(isAI(src))
var/mob/living/silicon/ai/eyeloc = src
user_loc = eyeloc.eyeobj
else
user_loc = src
var/sensor_type = show_radial_menu(src, user_loc, sensor_choices)
var/sensor_type = show_radial_menu(src, src, sensor_choices)
if(!sensor_type)
return
remove_med_sec_hud()
+1 -1
View File
@@ -166,7 +166,7 @@
var/list/choices = list()
for(var/obj/I in items_list)
choices["[I.name]"] = image(icon = I.icon, icon_state = I.icon_state)
var/choice = show_radial_menu(user, src, choices, custom_check = CALLBACK(src, PROC_REF(check_menu), user))
var/choice = show_radial_menu(user, user, choices, custom_check = CALLBACK(src, PROC_REF(check_menu), user))
if(!check_menu(user))
return
var/obj/item/selected