| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
| __ |
" - - t += "Generated power : [round(lastgen)] W
" - + t += "Generated power : [DisplayPower(lastgen)]
" t += "Turbine: [round(compressor.rpm)] RPM
" - t += "Starter: [ compressor.starter ? "Off On" : "Off On"]" - t += "
[content]
" + else if (title && !content) + title = "[title]
" + else if (!title && content) + content = "[content]
" + + // Strip macros from item names + title = replacetext(title, "\proper", "") + title = replacetext(title, "\improper", "") + + //Make our dumb param object + if(params[1] != "i") //Byond Bug: http://www.byond.com/forum/?post=2352648 + params = "icon-x=16;icon-y=16;[params]" //Put in some placeholders + params = {"{ "cursor": "[params]", "screenLoc": "[thing.screen_loc]" }"} + + //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)), "[control]:tooltip.update") + + //If a hide() was hit while we were showing, run hide() again to avoid stuck tooltips + showing = 0 + if (queueHide) + hide() + + return 1 + + +/datum/tooltip/proc/hide() + if (queueHide) + schedule_task_with_source_in(1, src, .proc/do_hide) + else + do_hide() + + queueHide = showing ? TRUE : FALSE + + return TRUE + +/datum/tooltip/proc/do_hide() + winshow(owner, control, FALSE) + +/* TG SPECIFIC CODE */ + + +//Open a tooltip for user, at a location based on params +//Theme is a CSS class in tooltip.html, by default this wrapper chooses a CSS class based on the user's UI_style (Midnight, Plasmafire, Retro, etc) +//Includes sanity.checks +/proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null, title = "", content = "", theme = "") + if(istype(user)) + if(user.client && user.client.tooltips) + if(!theme && user.client.prefs && user.client.prefs.tooltipstyle) + theme = lowertext(user.client.prefs.tooltipstyle) + if(!theme) + theme = "midnight" + user.client.tooltips.show(tip_src, params, title, content, theme) + + +//Arbitrarily close a user's tooltip +//Includes sanity checks. +/proc/closeToolTip(mob/user) + if(istype(user)) + if(user.client && user.client.tooltips) + user.client.tooltips.hide() + + diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html new file mode 100644 index 00000000000..67fb8a77f10 --- /dev/null +++ b/code/modules/tooltip/tooltip.html @@ -0,0 +1,249 @@ + + + +| {{:value.cat}} | ||
|---|---|---|
| {{:itemValue.name}} | +{{:itemValue.rank}} | +{{:itemValue.active}} | +
- Thank you for your patience! -
++ Thank you for your patience! +
{{else}} - {{:helper.link('Access Modification', 'home', {'choice' : 'mode', 'mode_target' : 0}, !data.mode ? 'disabled' : null)}} - {{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 1}, data.mode ? 'disabled' : null)}} - {{:helper.link('Print', 'print', {'choice' : 'print'}, (data.mode || data.has_modify) ? null : 'disabled')}} + {{:helper.link('Access Modification', 'home', {'choice' : 'mode', 'mode_target' : 0}, !data.mode ? 'disabled' : null)}} + {{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 1}, data.mode ? 'disabled' : null)}} + {{:helper.link('Print', 'print', {'choice' : 'print'}, (data.mode || data.has_modify) ? null : 'disabled')}} - {{if data.mode}} -| {{:value.cat}} | ||
|---|---|---|
| {{:itemValue.name}} | +{{:itemValue.rank}} | +{{:itemValue.active}} | +
| Command | ||
|---|---|---|
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Security | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Engineering | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Medical | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Science | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Civilian | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |
| Misc | ||
| {{:value.name}} | {{:value.rank}} | {{:value.active}} |