diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index e66b916d2b2..3cdea6b1106 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -11,14 +11,18 @@ icon_state = "radial_slice" var/choice var/next_page = FALSE + var/tooltip_desc /obj/screen/radial/slice/MouseEntered(location, control, params) . = ..() icon_state = "radial_slice_focus" + if(tooltip_desc) + openToolTip(usr,src,params,title = src.name,content = tooltip_desc,theme = parent.tooltip_theme) /obj/screen/radial/slice/MouseExited(location, control, params) . = ..() icon_state = "radial_slice" + closeToolTip(usr) /obj/screen/radial/slice/Click(location, control, params) if(usr.client == parent.current_user) @@ -39,8 +43,11 @@ var/list/choices = list() //List of choice id's var/list/choices_icons = list() //choice_id -> icon var/list/choices_values = list() //choice_id -> choice + var/list/choices_tooltips = list() //choice_id -> tooltip var/list/page_data = list() //list of choices per page + var/icon_file = 'icons/mob/radial.dmi' + var/tooltip_theme = "radial-default" var/selected_choice var/list/obj/screen/elements = list() @@ -96,7 +103,7 @@ starting_angle = 180 ending_angle = 45 -/datum/radial_menu/proc/setup_menu(var/icon_file = 'icons/mob/radial.dmi') +/datum/radial_menu/proc/setup_menu() if(ending_angle > starting_angle) zone = ending_angle - starting_angle else @@ -189,16 +196,26 @@ E.next_page = FALSE if(choices_icons[choice_id]) push(E.overlays,choices_icons[choice_id]) + if(choices_tooltips[choice_id]) + E.tooltip_desc = choices_tooltips[choice_id] + +/datum/radial_menu/New(var/icon_file, var/tooltip_theme, var/radius) + if(icon_file) + src.icon_file = icon_file + if(tooltip_theme) + src.tooltip_theme = tooltip_theme + if(radius) + src.radius = radius -/datum/radial_menu/New(var/icon_file = 'icons/mob/radial.dmi') close_button = new close_button.parent = src - close_button.icon = icon_file + close_button.icon = src.icon_file /datum/radial_menu/proc/Reset() choices.Cut() choices_icons.Cut() choices_values.Cut() + choices_tooltips.Cut() current_page = 1 /datum/radial_menu/proc/element_chosen(choice_id,mob/user) @@ -207,18 +224,26 @@ /datum/radial_menu/proc/get_next_id() return "c_[choices.len]" -/datum/radial_menu/proc/set_choices(var/list/new_choices,var/icon_file = 'icons/mob/radial.dmi') +/datum/radial_menu/proc/set_choices(var/list/new_choices) if(choices.len) Reset() - for(var/E in new_choices) + for(var/list/E in new_choices) var/id = get_next_id() choices += id - choices_values[id] = E - if(new_choices[E]) - var/I = extract_image(new_choices[E]) + var/choice_name = E[1] + choices_values[id] = choice_name + + if(E.len > 1) + var/choice_iconstate = E[2] + var/I = extract_image(image(icon = icon_file, icon_state = choice_iconstate)) if(I) choices_icons[id] = I - setup_menu(icon_file) + + if(E.len > 2) + var/choice_tooltip = E[3] + choices_tooltips[id] = choice_tooltip + + setup_menu() /datum/radial_menu/proc/extract_image(E) @@ -272,28 +297,25 @@ 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 */ -/proc/show_radial_menu(mob/user,atom/anchor,list/choices,var/icon_file = 'icons/mob/radial.dmi',var/event/custom_check,var/uniqueid,var/radius) +/proc/show_radial_menu(mob/user,atom/anchor,list/choices,var/icon_file,var/tooltip_theme,var/event/custom_check,var/uniqueid,var/radius) if(!user || !anchor || !length(choices)) return var/client/current_user = user.client - if (anchor in current_user.radial_menus) + if(anchor in current_user.radial_menus) return - current_user.radial_menus += anchor + current_user.radial_menus += anchor //This should probably be done in the menu's New() + + var/datum/radial_menu/menu = new(icon_file, tooltip_theme, radius) - var/datum/radial_menu/menu = new (icon_file) - if(!user) - user = usr - if(radius) - menu.radius = radius if(istype(custom_check)) menu.custom_check = custom_check menu.anchor = anchor menu.check_screen_border(user) //Do what's needed to make it look good near borders or on hud - menu.set_choices(choices,icon_file) + menu.set_choices(choices) menu.show_to(user) menu.wait() - if (!menu.gcDestroyed) + if(!menu.gcDestroyed) var/answer = menu.selected_choice qdel(menu) return answer diff --git a/code/datums/gamemode/factions/bloodcult/bloodcult_buildings.dm b/code/datums/gamemode/factions/bloodcult/bloodcult_buildings.dm index 8fd67556e7a..8edf73394f8 100644 --- a/code/datums/gamemode/factions/bloodcult/bloodcult_buildings.dm +++ b/code/datums/gamemode/factions/bloodcult/bloodcult_buildings.dm @@ -456,21 +456,18 @@ var/list/cult_spires = list() if (!tattoo_tier) return - var/list/optionlist = list() + var/list/choices = list() if (stage >= tattoo_tier) for (var/subtype in subtypesof(/datum/cult_tattoo)) var/datum/cult_tattoo/T = new subtype if (T.tier == tattoo_tier) - optionlist.Add(T.name) + choices += list(list(T.name, "radial_[T.icon_state]", T.desc)) //According to BYOND docs, when adding to a list, "If an argument is itself a list, each item in the list will be added." My solution to that, because I am a genius, is to add a list within a list. to_chat(H, "[T.name]: [T.desc]") else to_chat(user,"Come back to acquire another mark once your cult is a step closer to its goal.") return - for(var/option in optionlist) - optionlist[option] = image(icon = 'icons/obj/cult_radial2.dmi', icon_state = "[option]") - - var/tattoo = show_radial_menu(user,loc,optionlist,'icons/obj/cult_radial2.dmi')//spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() + var/tattoo = show_radial_menu(user,loc,choices,'icons/obj/cult_radial2.dmi',"radial-cult")//spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() for (var/tat in C.tattoos) var/datum/cult_tattoo/CT = C.tattoos[tat] @@ -713,16 +710,15 @@ var/list/cult_spires = list() forger.client.images |= progbar return - var/optionlist = list( - "Forge Blade", - "Forge Construct Shell", - "Forge Helmet", - "Forge Armor" - ) - for(var/option in optionlist) - optionlist[option] = image(icon = 'icons/obj/cult_radial.dmi', icon_state = "radial_[option]") - var/task = show_radial_menu(user,loc,optionlist,'icons/obj/cult_radial.dmi')//spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() + var/list/choices = list( + list("Forge Blade", "radial_blade", "Deity please add details"), + list("Forge Construct Shell", "radial_constructshell", "Deity please add details"), + list("Forge Helmet", "radial_helmet", "Deity please add details"), + list("Forge Armor", "radial_armor", "The quote originates from the Spider-Man 2 video game released in June 2004. Near the beginning of the game, Peter Parker as Spider-Man is given free roam through New York City. The first mission is to make it to Doctor Connors' class on time, which is emphasized in a quote spoken by Parker before having to get to class.") + ) + + var/task = show_radial_menu(user,loc,choices,'icons/obj/cult_radial.dmi',"radial-cult") //deity please customize "radial-cult" in tooltip.html //spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() if (template || !Adjacent(user) || !task ) return var/forge_icon = "" diff --git a/code/datums/gamemode/factions/bloodcult/bloodcult_items.dm b/code/datums/gamemode/factions/bloodcult/bloodcult_items.dm index 2c3d34667a0..8d52f7cb6a5 100644 --- a/code/datums/gamemode/factions/bloodcult/bloodcult_items.dm +++ b/code/datums/gamemode/factions/bloodcult/bloodcult_items.dm @@ -592,14 +592,12 @@ var/list/arcane_tomes = list() to_chat(user,"There is a crimson gem encrusted into the blade, but you're not exactly sure how you could remove it.") return - var/optionlist = list( - "Give Blood", - "Remove Gem" + var/choices = list( + list("Give Blood", "radial_giveblood", "Deity please add details"), + list("Remove Gem", "radial_removegem", "Deity please add details"), ) - for(var/option in optionlist) - optionlist[option] = image(icon = 'icons/obj/cult_radial.dmi', icon_state = "radial_[option]") - var/task = show_radial_menu(user,user,optionlist,'icons/obj/cult_radial.dmi')//spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() + var/task = show_radial_menu(user,user,choices,'icons/obj/cult_radial.dmi',"radial-cult")//spawning on loc so we aren't offset by pixel_x/pixel_y, or affected by animate() if (user.get_active_hand() != src) to_chat(user,"You must hold the blade in your active hand.") return @@ -1265,4 +1263,3 @@ var/list/arcane_tomes = list() user.equip_to_slot_or_drop(stored_slot,nslot) stored_gear.Remove(slot) qdel(src) - diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index ba3415efb8d..a79b5aceab7 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -398,6 +398,8 @@ src.updateUsrDialog() /obj/machinery/microwave/proc/dispose() + if(operating) + return for (var/obj/O in contents) O.forceMove(src.loc) if (src.reagents.total_volume) @@ -457,16 +459,50 @@ return ..() /obj/machinery/microwave/AltClick(mob/user) - if(operating) - to_chat(user, "Too late, the microwave is already turned on!") - return + if(stat & (NOPOWER|BROKEN)) + return ..() + if(!anchored) + return ..() if(isAdminGhost(user) || (!user.incapacitated() && Adjacent(user) && user.dexterity_check())) if(issilicon(user) && !attack_ai(user)) return ..() - dispose() + var/list/choices = list( + list("Cook", "radial_cook"), + list("Eject Ingredients", "radial_eject"), + list("Toggle Reagent Disposal", (reagent_disposal ? "radial_chem_notrash" : "radial_chem_trash")), + list("Examine", "radial_examine") + ) + var/event/menu_event = new(owner = usr) + menu_event.Add(src, "radial_check_handler") + + var/task = show_radial_menu(usr,loc,choices,custom_check = menu_event) + if(!radial_check(usr)) + return + + switch(task) + if("Cook") + cook() + if("Eject Ingredients") + dispose() + if("Toggle Reagent Disposal") + reagent_disposal = !reagent_disposal + updateUsrDialog() + if("Examine") + usr.examination(src) return return ..() +/obj/machinery/microwave/proc/radial_check_handler(list/arguments) + var/event/E = arguments["event"] + return radial_check(E.holder) + +/obj/machinery/microwave/proc/radial_check(mob/living/user) + if(!istype(user)) + return FALSE + if(user.incapacitated() || !user.Adjacent(src)) + return FALSE + return TRUE + /obj/machinery/microwave/Topic(href, href_list) if(..()) return diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 2aa09fb626b..3350c931dd7 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -22,7 +22,7 @@ var/area = null var/time_died_as_mouse = null //when the client last died as a mouse var/datum/tooltip/tooltips //datum that controls the displaying and hiding of tooltips - var/list/radial_menus = list()//keeping track of open menus so we're not gonna have several on top of each others. + var/list/radial_menus = list() //keeping track of open menus so we're not gonna have several on top of each other. /////////////// //SOUND STUFF// diff --git a/code/modules/reagents/machinery/reagentgrinder.dm b/code/modules/reagents/machinery/reagentgrinder.dm index b6fd2d4660c..b3436427b17 100644 --- a/code/modules/reagents/machinery/reagentgrinder.dm +++ b/code/modules/reagents/machinery/reagentgrinder.dm @@ -270,11 +270,47 @@ var/global/list/juice_items = list ( update_icon() /obj/machinery/reagentgrinder/AltClick(mob/user) - if(!user.incapacitated() && Adjacent(user) && beaker && !(stat & (NOPOWER|BROKEN) && user.dexterity_check()) && !inuse) - detach() + if(stat & (NOPOWER|BROKEN)) + return ..() + if(!anchored) + return ..() + if(!user.incapacitated() && Adjacent(user) && user.dexterity_check()) + var/list/choices = list( + list("Grind", "radial_grind"), + list("Juice", "radial_juice"), + list("Eject Ingredients", "radial_eject"), + list("Detach Beaker", "radial_detachbeaker") + ) + var/event/menu_event = new(owner = usr) + menu_event.Add(src, "radial_check_handler") + + var/task = show_radial_menu(usr,loc,choices,custom_check = menu_event) + if(!radial_check(usr)) + return + + switch(task) + if("Grind") + grind() + if("Juice") + juice() + if("Eject Ingredients") + eject() + if("Detach Beaker") + detach() return return ..() +/obj/machinery/reagentgrinder/proc/radial_check_handler(list/arguments) + var/event/E = arguments["event"] + return radial_check(E.holder) + +/obj/machinery/reagentgrinder/proc/radial_check(mob/living/user) + if(!istype(user)) + return FALSE + if(user.incapacitated() || !user.Adjacent(src)) + return FALSE + return TRUE + /obj/machinery/reagentgrinder/CtrlClick(mob/user) if(!user.incapacitated() && Adjacent(user) && user.dexterity_check() && !inuse && holdingitems.len && anchored) grind() //Checks for beaker and power/broken internally @@ -286,6 +322,8 @@ var/global/list/juice_items = list ( return if (holdingitems && holdingitems.len == 0) return + if (inuse) + return for(var/obj/item/O in holdingitems) O.forceMove(src.loc) @@ -338,6 +376,8 @@ var/global/list/juice_items = list ( power_change() if(stat & (NOPOWER|BROKEN)) return + if(inuse) + return if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume)) return playsound(src, speed_multiplier < 2 ? 'sound/machines/juicer.ogg' : 'sound/machines/juicerfast.ogg', 30, 1) @@ -367,11 +407,11 @@ var/global/list/juice_items = list ( remove_object(O) /obj/machinery/reagentgrinder/proc/grind() - - power_change() if(stat & (NOPOWER|BROKEN)) return + if(inuse) + return if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume)) return playsound(src, speed_multiplier < 2 ? 'sound/machines/blender.ogg' : 'sound/machines/blenderfast.ogg', 50, 1) diff --git a/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm b/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm index c4e2ff79093..82fa51c71ec 100644 --- a/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm +++ b/code/modules/research/xenoarchaeology/tools/bunsen_burner.dm @@ -184,17 +184,20 @@ /obj/machinery/bunsen_burner/AltClick() if((!usr.Adjacent(src) || usr.incapacitated()) && !isAdminGhost(usr)) - return + return ..() var/list/choices = list( - "Turn On/Off" = image(icon = 'icons/mob/radial.dmi', icon_state = (heating == BUNSEN_ON ? "radial_off" : "radial_on")), - "Toggle Fuelport" = image(icon = 'icons/mob/radial.dmi', icon_state = (heating == BUNSEN_OPEN ? "radial_lock" : "radial_unlock")), - "Examine" = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine"), + list("Turn On/Off", (heating == BUNSEN_ON ? "radial_off" : "radial_on")), + list("Toggle Fuelport", (heating == BUNSEN_OPEN ? "radial_lock" : "radial_unlock")), + list("Examine", "radial_examine") ) var/event/menu_event = new(owner = usr) menu_event.Add(src, "radial_check_handler") var/task = show_radial_menu(usr,loc,choices,custom_check = menu_event) + if(!radial_check(usr)) + return + switch(task) if("Turn On/Off") verb_toggle() diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html index a383eb4a583..475c5590b53 100644 --- a/code/modules/tooltip/tooltip.html +++ b/code/modules/tooltip/tooltip.html @@ -43,6 +43,12 @@ .colo-pod .wrap {border-color: #256fb9;} .colo-pod .content {border-color: #000000; background-color: #000000;} + /* Radial Tooltips */ + .radial-default .wrap {border-color: #2B2B33;} + .radial-default .content {color: #6087A0; border-color: #2B2B33; background-color: #36363C;} + .radial-cult .wrap {border-color: #2f0000;} + .radial-cult .content {font-family: 'Comic Sans MS'; color: #940000 ; border-color: #000000; background-color:#221817;} + /* TG: Themes */ /* ScreenUI */ .midnight .wrap {border-color: #2B2B33;} diff --git a/icons/mob/radial.dmi b/icons/mob/radial.dmi index 54804a2480a..cd6078f0678 100644 Binary files a/icons/mob/radial.dmi and b/icons/mob/radial.dmi differ diff --git a/icons/obj/cult_radial.dmi b/icons/obj/cult_radial.dmi index e49d9428152..b4f2d68f48d 100644 Binary files a/icons/obj/cult_radial.dmi and b/icons/obj/cult_radial.dmi differ diff --git a/icons/obj/cult_radial2.dmi b/icons/obj/cult_radial2.dmi index a7b6d2c0c93..b0f11346ca3 100644 Binary files a/icons/obj/cult_radial2.dmi and b/icons/obj/cult_radial2.dmi differ