From 9cf04467a7e627ec87e82b120077049a479a7608 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 5 May 2021 17:55:30 -0300 Subject: [PATCH 1/3] upload files --- code/_onclick/hud/radial.dm | 1 - code/modules/mob/living/carbon/human/human.dm | 11 ++++++++ .../mob/living/carbon/human/human_defines.dm | 2 ++ code/modules/mob/living/silicon/examine.dm | 1 - .../mob/living/silicon/robot/examine.dm | 3 +++ .../modules/mob/living/silicon/robot/robot.dm | 15 +++++++++++ .../mob/living/silicon/robot/robot_defines.dm | 2 ++ code/modules/mob/living/silicon/silicon.dm | 4 +-- code/modules/tooltip/tooltip.dm | 27 +++++++++++++++++-- code/modules/tooltip/tooltip.html | 6 ++--- 10 files changed, 63 insertions(+), 9 deletions(-) diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index 929e01c6d9..7d22b70cbc 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -13,7 +13,6 @@ GLOBAL_LIST_EMPTY(radial_menus) icon_state = "radial_slice" var/choice var/next_page = FALSE - var/tooltips = FALSE /obj/screen/radial/slice/MouseEntered(location, control, params) . = ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c2014cbe41..f636ae76ab 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1083,6 +1083,17 @@ . = ..() set_species(race) +/mob/living/carbon/human/get_tooltip_data() + var/t_He = p_they(TRUE) + var/t_is = p_are() + . = list() + var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) + if(skipface || get_visible_name() == "Unknown") + . += "You can't make out what species they are." + else + . += "[t_He] [t_is] a [dna.custom_species ? dna.custom_species : dna.species.name]" + SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, usr, .) + /mob/living/carbon/human/species/abductor race = /datum/species/abductor diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 9f80b5a933..102f3df65d 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -77,6 +77,8 @@ var/last_fire_update var/hardcore_survival_score = 0 + tooltips = TRUE + /// Unarmed parry data for human /datum/block_parry_data/unarmed/human parry_respect_clickdelay = TRUE diff --git a/code/modules/mob/living/silicon/examine.dm b/code/modules/mob/living/silicon/examine.dm index 7de281de5f..0840ea1191 100644 --- a/code/modules/mob/living/silicon/examine.dm +++ b/code/modules/mob/living/silicon/examine.dm @@ -1,5 +1,4 @@ /mob/living/silicon/examine(mob/user) //Displays a silicon's laws to ghosts - . = ..() if(laws && isobserver(user)) . += "[src] has the following laws:" for(var/law in laws.get_law_list(include_zeroth = TRUE)) diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index 6ac1d410eb..45a3d15635 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -48,6 +48,9 @@ . += "It doesn't seem to be responding." if(DEAD) . += "It looks like its system is corrupted and requires a reset." + + SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, usr, .) + . += "*---------*" . += ..() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 38f93f9ffc..47f9a794cf 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1326,3 +1326,18 @@ var/datum/computer_file/program/robotact/program = modularInterface.get_robotact() if(program) program.force_full_update() + +/mob/living/silicon/robot/get_tooltip_data() + var/t_He = p_they(TRUE) + var/t_is = p_are() + . = list() + var/borg_type = module ? module : "Default" +//This isn't even used normally, but if that ever changes, just uncomment this +/* var/obj/item/borg_chameleon/chameleon = locate() in src + if(!chameleon) + chameleon = locate() in src.module + if(chameleon?.active) + borg_type = "Engineering" +*/ + . += "[t_He] [t_is] a [borg_type] unit" + SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, usr, .) diff --git a/code/modules/mob/living/silicon/robot/robot_defines.dm b/code/modules/mob/living/silicon/robot/robot_defines.dm index f44552f1ab..fe22ec1236 100644 --- a/code/modules/mob/living/silicon/robot/robot_defines.dm +++ b/code/modules/mob/living/silicon/robot/robot_defines.dm @@ -125,3 +125,5 @@ var/sleeper_g var/sleeper_r var/sleeper_nv + + tooltips = TRUE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b2b27c7d70..8af55370bb 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -59,8 +59,8 @@ /mob/living/silicon/ComponentInitialize() . = ..() - AddElement(/datum/element/flavor_text, _name = "Silicon Flavor Text", _save_key = "silicon_flavor_text") - AddElement(/datum/element/flavor_text, "", "Temporary Flavor Text", "This should be used only for things pertaining to the current round!") + AddElement(/datum/element/flavor_text, _name = "Silicon Flavor Text", _always_show = TRUE, _save_key = "silicon_flavor_text") + AddElement(/datum/element/flavor_text, "", "Temporary Flavor Text", "This should be used only for things pertaining to the current round!", _always_show = TRUE) AddElement(/datum/element/flavor_text, _name = "OOC Notes", _addendum = "Put information on ERP/vore/lewd-related preferences here. THIS SHOULD NOT CONTAIN REGULAR FLAVORTEXT!!", _always_show = TRUE, _save_key = "ooc_notes", _examine_no_preview = TRUE) /mob/living/silicon/med_hud_set_health() diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index ab7dc91739..6f29875c20 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -51,7 +51,7 @@ Notes: /datum/tooltip/proc/show(atom/movable/thing, params = null, title = null, content = null, theme = "default", special = "none") if (!thing || !params || (!title && !content) || !owner || !isnum(world.icon_size)) - return 0 + return FALSE if (!init) //Initialize some vars init = 1 @@ -83,7 +83,7 @@ Notes: if (queueHide) hide() - return 1 + return TRUE /datum/tooltip/proc/hide() @@ -122,4 +122,27 @@ Notes: if(user.client && user.client.tooltips) user.client.tooltips.hide() +/atom/movable + var/tooltips = FALSE +/atom/movable/proc/get_tooltip_data() + return + +/atom/movable/MouseEntered(location, control, params) + . = ..() + if(tooltips) + if(!QDELETED(src)) + var/list/examine_list = examine(src) + var/get_tooltip_data = get_tooltip_data() + if(length(get_tooltip_data)) + examine_list = get_tooltip_data + var/examine_data = examine_list.Join("
") + openToolTip(usr, src, params, title = name, content = examine_data) + +/atom/movable/MouseExited(location, control, params) + . = ..() + closeToolTip(usr) + +/client/MouseDown(object, location, control, params) + closeToolTip(usr) + . = ..() diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html index 60bd358031..2743bc03d5 100644 --- a/code/modules/tooltip/tooltip.html +++ b/code/modules/tooltip/tooltip.html @@ -65,12 +65,12 @@ .hisgrace .wrap {border-color: #7C1414;} .hisgrace .content {color: #15D512; border-color: #9D1414; background-color: #861414;} - + /* TG: Themes */ /* ScreenUI */ .midnight .wrap {border-color: #2B2B33;} .midnight .content {color: #6087A0; border-color: #2B2B33; background-color: #36363C;} - + .plasmafire .wrap {border-color: #21213D;} .plasmafire .content {color: #FFA800 ; border-color: #21213D; background-color:#1D1D36;} @@ -85,7 +85,7 @@ .clockwork .wrap {border-color: #170800;} .clockwork .content {color: #B18B25; border-color: #000000; background-color: #5F380E;} - + From 6bd5707a631a80720981d8745d874568947edc4a Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 6 May 2021 02:50:32 -0300 Subject: [PATCH 2/3] found it --- code/game/atoms_movable.dm | 3 +++ code/modules/tooltip/tooltip.dm | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index fbda722e4f..aafa77b878 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -55,6 +55,9 @@ ///Internal holder for emissive blocker object, do not use directly use blocks_emissive var/atom/movable/emissive_blocker/em_block + /// Should we use tooltips, if the thing does not have the code implemented `get_tooltip_data()`, it will default to examine(src) + var/tooltips = FALSE + /atom/movable/Initialize(mapload) . = ..() diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 6f29875c20..1d22af26ac 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -122,9 +122,6 @@ Notes: if(user.client && user.client.tooltips) user.client.tooltips.hide() -/atom/movable - var/tooltips = FALSE - /atom/movable/proc/get_tooltip_data() return From 6414b371f89e2b5e1395f53c1ee146f8fdf7c9d1 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 6 May 2021 03:03:46 -0300 Subject: [PATCH 3/3] fancy description for the proc --- code/modules/tooltip/tooltip.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 1d22af26ac..fd45ea37d9 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -122,6 +122,15 @@ Notes: if(user.client && user.client.tooltips) user.client.tooltips.hide() +/** + * # `get_tooltip_data()` + * + * If set, will return a list for the tooltip (that will also be put together in a `Join()`) + * However, if returning `null`, falls back to default behavior, which is `examine(src)`, and it will definitely include + * images since it is the default behavior + * + * Though no tooltips will be created for atoms that have `tooltips = FALSE` +*/ /atom/movable/proc/get_tooltip_data() return