Radials 0.21.3_c (#19953)

* maybe deity won't needlessly conflict my shit up this time

* fixes tat
This commit is contained in:
I-VAPE-VOX-CLOACA-EVERY-DAY-OF-MY-LIFE
2018-10-09 12:13:14 -03:00
committed by jknpj
parent 5656fbae64
commit 98c788f358
11 changed files with 154 additions and 54 deletions

View File

@@ -11,14 +11,18 @@
icon_state = "radial_slice" icon_state = "radial_slice"
var/choice var/choice
var/next_page = FALSE var/next_page = FALSE
var/tooltip_desc
/obj/screen/radial/slice/MouseEntered(location, control, params) /obj/screen/radial/slice/MouseEntered(location, control, params)
. = ..() . = ..()
icon_state = "radial_slice_focus" 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) /obj/screen/radial/slice/MouseExited(location, control, params)
. = ..() . = ..()
icon_state = "radial_slice" icon_state = "radial_slice"
closeToolTip(usr)
/obj/screen/radial/slice/Click(location, control, params) /obj/screen/radial/slice/Click(location, control, params)
if(usr.client == parent.current_user) if(usr.client == parent.current_user)
@@ -39,8 +43,11 @@
var/list/choices = list() //List of choice id's var/list/choices = list() //List of choice id's
var/list/choices_icons = list() //choice_id -> icon var/list/choices_icons = list() //choice_id -> icon
var/list/choices_values = list() //choice_id -> choice 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/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/selected_choice
var/list/obj/screen/elements = list() var/list/obj/screen/elements = list()
@@ -96,7 +103,7 @@
starting_angle = 180 starting_angle = 180
ending_angle = 45 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) if(ending_angle > starting_angle)
zone = ending_angle - starting_angle zone = ending_angle - starting_angle
else else
@@ -189,16 +196,26 @@
E.next_page = FALSE E.next_page = FALSE
if(choices_icons[choice_id]) if(choices_icons[choice_id])
push(E.overlays,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 = new
close_button.parent = src close_button.parent = src
close_button.icon = icon_file close_button.icon = src.icon_file
/datum/radial_menu/proc/Reset() /datum/radial_menu/proc/Reset()
choices.Cut() choices.Cut()
choices_icons.Cut() choices_icons.Cut()
choices_values.Cut() choices_values.Cut()
choices_tooltips.Cut()
current_page = 1 current_page = 1
/datum/radial_menu/proc/element_chosen(choice_id,mob/user) /datum/radial_menu/proc/element_chosen(choice_id,mob/user)
@@ -207,18 +224,26 @@
/datum/radial_menu/proc/get_next_id() /datum/radial_menu/proc/get_next_id()
return "c_[choices.len]" 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) if(choices.len)
Reset() Reset()
for(var/E in new_choices) for(var/list/E in new_choices)
var/id = get_next_id() var/id = get_next_id()
choices += id choices += id
choices_values[id] = E var/choice_name = E[1]
if(new_choices[E]) choices_values[id] = choice_name
var/I = extract_image(new_choices[E])
if(E.len > 1)
var/choice_iconstate = E[2]
var/I = extract_image(image(icon = icon_file, icon_state = choice_iconstate))
if(I) if(I)
choices_icons[id] = 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) /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 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 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)) if(!user || !anchor || !length(choices))
return return
var/client/current_user = user.client var/client/current_user = user.client
if (anchor in current_user.radial_menus) if(anchor in current_user.radial_menus)
return 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)) if(istype(custom_check))
menu.custom_check = custom_check menu.custom_check = custom_check
menu.anchor = anchor menu.anchor = anchor
menu.check_screen_border(user) //Do what's needed to make it look good near borders or on hud 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.show_to(user)
menu.wait() menu.wait()
if (!menu.gcDestroyed) if(!menu.gcDestroyed)
var/answer = menu.selected_choice var/answer = menu.selected_choice
qdel(menu) qdel(menu)
return answer return answer

View File

@@ -456,21 +456,18 @@ var/list/cult_spires = list()
if (!tattoo_tier) if (!tattoo_tier)
return return
var/list/optionlist = list() var/list/choices = list()
if (stage >= tattoo_tier) if (stage >= tattoo_tier)
for (var/subtype in subtypesof(/datum/cult_tattoo)) for (var/subtype in subtypesof(/datum/cult_tattoo))
var/datum/cult_tattoo/T = new subtype var/datum/cult_tattoo/T = new subtype
if (T.tier == tattoo_tier) 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, "<span class='danger'>[T.name]</span>: [T.desc]") to_chat(H, "<span class='danger'>[T.name]</span>: [T.desc]")
else else
to_chat(user,"<span class='warning'>Come back to acquire another mark once your cult is a step closer to its goal.</span>") to_chat(user,"<span class='warning'>Come back to acquire another mark once your cult is a step closer to its goal.</span>")
return return
for(var/option in optionlist) 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()
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()
for (var/tat in C.tattoos) for (var/tat in C.tattoos)
var/datum/cult_tattoo/CT = C.tattoos[tat] var/datum/cult_tattoo/CT = C.tattoos[tat]
@@ -713,16 +710,15 @@ var/list/cult_spires = list()
forger.client.images |= progbar forger.client.images |= progbar
return 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 ) if (template || !Adjacent(user) || !task )
return return
var/forge_icon = "" var/forge_icon = ""

View File

@@ -592,14 +592,12 @@ var/list/arcane_tomes = list()
to_chat(user,"<span class='warning'>There is a crimson gem encrusted into the blade, but you're not exactly sure how you could remove it.</span>") to_chat(user,"<span class='warning'>There is a crimson gem encrusted into the blade, but you're not exactly sure how you could remove it.</span>")
return return
var/optionlist = list( var/choices = list(
"Give Blood", list("Give Blood", "radial_giveblood", "Deity please add details"),
"Remove Gem" 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) if (user.get_active_hand() != src)
to_chat(user,"<span class='warning'>You must hold the blade in your active hand.</span>") to_chat(user,"<span class='warning'>You must hold the blade in your active hand.</span>")
return return
@@ -1265,4 +1263,3 @@ var/list/arcane_tomes = list()
user.equip_to_slot_or_drop(stored_slot,nslot) user.equip_to_slot_or_drop(stored_slot,nslot)
stored_gear.Remove(slot) stored_gear.Remove(slot)
qdel(src) qdel(src)

View File

@@ -398,6 +398,8 @@
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/dispose() /obj/machinery/microwave/proc/dispose()
if(operating)
return
for (var/obj/O in contents) for (var/obj/O in contents)
O.forceMove(src.loc) O.forceMove(src.loc)
if (src.reagents.total_volume) if (src.reagents.total_volume)
@@ -457,16 +459,50 @@
return ..() return ..()
/obj/machinery/microwave/AltClick(mob/user) /obj/machinery/microwave/AltClick(mob/user)
if(operating) if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>Too late, the microwave is already turned on!</span>") return ..()
return if(!anchored)
return ..()
if(isAdminGhost(user) || (!user.incapacitated() && Adjacent(user) && user.dexterity_check())) if(isAdminGhost(user) || (!user.incapacitated() && Adjacent(user) && user.dexterity_check()))
if(issilicon(user) && !attack_ai(user)) if(issilicon(user) && !attack_ai(user))
return ..() return ..()
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() dispose()
if("Toggle Reagent Disposal")
reagent_disposal = !reagent_disposal
updateUsrDialog()
if("Examine")
usr.examination(src)
return return
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) /obj/machinery/microwave/Topic(href, href_list)
if(..()) if(..())
return return

View File

@@ -22,7 +22,7 @@
var/area = null var/area = null
var/time_died_as_mouse = null //when the client last died as a mouse 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/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// //SOUND STUFF//

View File

@@ -270,11 +270,47 @@ var/global/list/juice_items = list (
update_icon() update_icon()
/obj/machinery/reagentgrinder/AltClick(mob/user) /obj/machinery/reagentgrinder/AltClick(mob/user)
if(!user.incapacitated() && Adjacent(user) && beaker && !(stat & (NOPOWER|BROKEN) && user.dexterity_check()) && !inuse) 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() detach()
return return
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) /obj/machinery/reagentgrinder/CtrlClick(mob/user)
if(!user.incapacitated() && Adjacent(user) && user.dexterity_check() && !inuse && holdingitems.len && anchored) if(!user.incapacitated() && Adjacent(user) && user.dexterity_check() && !inuse && holdingitems.len && anchored)
grind() //Checks for beaker and power/broken internally grind() //Checks for beaker and power/broken internally
@@ -286,6 +322,8 @@ var/global/list/juice_items = list (
return return
if (holdingitems && holdingitems.len == 0) if (holdingitems && holdingitems.len == 0)
return return
if (inuse)
return
for(var/obj/item/O in holdingitems) for(var/obj/item/O in holdingitems)
O.forceMove(src.loc) O.forceMove(src.loc)
@@ -338,6 +376,8 @@ var/global/list/juice_items = list (
power_change() power_change()
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
if(inuse)
return
if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume)) if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return return
playsound(src, speed_multiplier < 2 ? 'sound/machines/juicer.ogg' : 'sound/machines/juicerfast.ogg', 30, 1) 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) remove_object(O)
/obj/machinery/reagentgrinder/proc/grind() /obj/machinery/reagentgrinder/proc/grind()
power_change() power_change()
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
if(inuse)
return
if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume)) if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return return
playsound(src, speed_multiplier < 2 ? 'sound/machines/blender.ogg' : 'sound/machines/blenderfast.ogg', 50, 1) playsound(src, speed_multiplier < 2 ? 'sound/machines/blender.ogg' : 'sound/machines/blenderfast.ogg', 50, 1)

View File

@@ -184,17 +184,20 @@
/obj/machinery/bunsen_burner/AltClick() /obj/machinery/bunsen_burner/AltClick()
if((!usr.Adjacent(src) || usr.incapacitated()) && !isAdminGhost(usr)) if((!usr.Adjacent(src) || usr.incapacitated()) && !isAdminGhost(usr))
return return ..()
var/list/choices = list( var/list/choices = list(
"Turn On/Off" = image(icon = 'icons/mob/radial.dmi', icon_state = (heating == BUNSEN_ON ? "radial_off" : "radial_on")), list("Turn On/Off", (heating == BUNSEN_ON ? "radial_off" : "radial_on")),
"Toggle Fuelport" = image(icon = 'icons/mob/radial.dmi', icon_state = (heating == BUNSEN_OPEN ? "radial_lock" : "radial_unlock")), list("Toggle Fuelport", (heating == BUNSEN_OPEN ? "radial_lock" : "radial_unlock")),
"Examine" = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine"), list("Examine", "radial_examine")
) )
var/event/menu_event = new(owner = usr) var/event/menu_event = new(owner = usr)
menu_event.Add(src, "radial_check_handler") menu_event.Add(src, "radial_check_handler")
var/task = show_radial_menu(usr,loc,choices,custom_check = menu_event) var/task = show_radial_menu(usr,loc,choices,custom_check = menu_event)
if(!radial_check(usr))
return
switch(task) switch(task)
if("Turn On/Off") if("Turn On/Off")
verb_toggle() verb_toggle()

View File

@@ -43,6 +43,12 @@
.colo-pod .wrap {border-color: #256fb9;} .colo-pod .wrap {border-color: #256fb9;}
.colo-pod .content {border-color: #000000; background-color: #000000;} .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 */ /* TG: Themes */
/* ScreenUI */ /* ScreenUI */
.midnight .wrap {border-color: #2B2B33;} .midnight .wrap {border-color: #2B2B33;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB