From f56cb42fab8b51a5142f99135a989d4fda9551e9 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sat, 19 Aug 2023 23:54:48 +0200 Subject: [PATCH] Radial Menu Harddels (partial?) resolution (#17096) * sdfsdv * forgot the * for args in dmdoc --- code/_onclick/hud/radial.dm | 28 ++++++++++--- html/changelogs/fluffyghost-radialharddel.yml | 42 +++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/fluffyghost-radialharddel.yml diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index e0b1da41b0c..6138d1c7c7e 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -280,14 +280,32 @@ var/global/list/radial_menus = list() /datum/radial_menu/Destroy() Reset() hide() + close_button.parent = null + menu_holder.vis_contents = null + elements -= src + + for(var/obj/screen/radial/slice/possibly_our_child in elements) + if(possibly_our_child.parent == src) + possibly_our_child.parent = null + + QDEL_NULL(menu_holder) + QDEL_NULL(close_button) QDEL_NULL(custom_check_callback) return ..() -/* - Presents radial menu to user anchored to anchor (or user if the anchor is currently in users screen) - Choices should be a list where list keys are movables or text used for element names and return value - and list values are movables/icons/images used for element icons -*/ +/** + * Presents a radial menu to an user, over an anchor point + * + * * user - A `/mob` whose user to show the radial menu to + * * anchor - An `/atom` to where to overlay the radial menu to + * * choices - A list of choices, where the list keys are movables or text used for element names and return value, and values are movables/icons/images used for element icons + * * uniqueid - An unique ID to identify the radial menu with + * * radius - A radius, aka how big the radial menu is + * * custom_check - A `/datum/callback` to invoke, to validate that the menu should still be waited on + * * require_near - Boolean, if the menu should disappear when the user is not in range anymore + * * tooltips - Boolean, if to show tooltips to the user + * * no_repeat_close - Boolean, if an unique ID is used and this is set, close the menu instead of repeating the displaying of it + */ /proc/show_radial_menu(mob/user, atom/anchor, list/choices, uniqueid, radius, datum/callback/custom_check, require_near = FALSE, tooltips = FALSE, no_repeat_close = FALSE) if(!user || !anchor || !length(choices)) return diff --git a/html/changelogs/fluffyghost-radialharddel.yml b/html/changelogs/fluffyghost-radialharddel.yml new file mode 100644 index 00000000000..d51f1a3e6a1 --- /dev/null +++ b/html/changelogs/fluffyghost-radialharddel.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Resolved (some?) harddels with the radial menu." + - backend: "DMDoc'd the show_radial_menu proc."