From da6cc8ebe549773ddaa6cadebd1ad5fcdbe8115e Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 10 Dec 2017 11:07:26 +0100 Subject: [PATCH] src cleanup --- code/modules/tooltip/tooltip.dm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 64c586a9145..5110b98e8ee 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -41,21 +41,21 @@ Notes: /datum/tooltip/New(client/C) if (C) - src.owner = C - src.owner << browse(file2text('code/modules/tooltip/tooltip.html'), "window=[src.control]") + owner = C + owner << browse(file2text('code/modules/tooltip/tooltip.html'), "window=[control]") ..() /datum/tooltip/proc/show(atom/movable/thing, params = null, title = null, content = null, theme = "default", special = "none") - if (!thing || !params || (!title && !content) || !src.owner || !isnum(world.icon_size)) + if (!thing || !params || (!title && !content) || !owner || !isnum(world.icon_size)) return 0 - if (!src.init) + if (!init) //Initialize some vars - src.init = 1 - src.owner << output(list2params(list(world.icon_size, src.control)), "[src.control]:tooltip.init") + init = 1 + owner << output(list2params(list(world.icon_size, control)), "[control]:tooltip.init") - src.showing = 1 + showing = 1 if (title && content) title = "

[title]

" @@ -74,18 +74,18 @@ Notes: //Send stuff to the tooltip var/view_size = getviewsize(owner.view) - owner << output(list2params(list(params, view_size[1] , view_size[2], "[title][content]", theme, special)), "[src.control]:tooltip.update") + owner << output(list2params(list(params, view_size[1] , view_size[2], "[title][content]", theme, special)), "[control]:tooltip.update") //If a hide() was hit while we were showing, run hide() again to avoid stuck tooltips - src.showing = 0 - if (src.queueHide) - src.hide() + showing = 0 + if (queueHide) + hide() return 1 /datum/tooltip/proc/hide() - if (src.queueHide) + if (queueHide) addtimer(CALLBACK(src, .proc/do_hide), 1) else do_hide()