diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index f34209354606f..a6881e97fb61b 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -208,6 +208,10 @@ var/datum/subsystem/ticker/ticker //Plus it provides an easy way to make cinematics for other events. Just use this as a template /datum/subsystem/ticker/proc/station_explosion_cinematic(var/station_missed=0, var/override = null) if( cinematic ) return //already a cinematic in progress! + + for (var/datum/html_interface/hi in html_interfaces) + hi.closeAll() + auto_toggle_ooc(1) // Turn it on //initialise our cinematic screen object cinematic = new /obj/screen{icon='icons/effects/station_explosion.dmi';icon_state="station_intact";layer=20;mouse_opacity=0;screen_loc="1,0";}(src) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 936dc2de86cc9..5f1d44e009701 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -662,3 +662,14 @@ Class Procs: if(!anchored && machine_flags & FIXED2WORK) return user << "\The [src] must be anchored first!" +// Hook for html_interface module to prevent updates to clients who don't have this as their active machine. +/obj/machinery/proc/hiIsValidClient(datum/html_interface_client/hclient, datum/html_interface/hi) + if (hclient.client.mob && hclient.client.mob.stat == 0) + if (isAI(hclient.client.mob)) return TRUE + else return hclient.client.mob.machine == src && src.Adjacent(hclient.client.mob) + else + return FALSE + +// Hook for html_interface module to unset the active machine when the window is closed by the player. +/obj/machinery/proc/hiOnHide(datum/html_interface_client/hclient) + if (hclient.client.mob && hclient.client.mob.machine == src) hclient.client.mob.unset_machine() diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 537c98b844873..746fa333c6c33 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -39,3 +39,6 @@ preload_rsc = PRELOAD_RSC var/global/obj/screen/click_catcher/void + + // Used by html_interface module. + var/hi_last_pos \ No newline at end of file diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index ed013e81744b5..53735ba53fce5 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -278,6 +278,14 @@ var/next_external_rsc = 0 //send resources to the client. It's here in its own proc so we can move it around easiliy if need be /client/proc/send_resources() + + spawn + // Preload the HTML interface. This needs to be done due to BYOND bug http://www.byond.com/forum/?post=1487244 + var/datum/html_interface/hi + for (var/type in typesof(/datum/html_interface)) + hi = new type(null) + hi.sendResources(src) + //Send nanoui files to client SSnano.send_resources(src) getFiles( diff --git a/interface/interface.dm b/interface/interface.dm index 42dee8ba64c8f..2c6a2b39f5577 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -171,4 +171,11 @@ Any-Mode: (hotkey doesn't need to be on) "} src << hotkey_mode - src << other \ No newline at end of file + src << other + +// Needed to circumvent a bug where .winset does not work when used on the window.on-size event in skins. +// Used by /datum/html_interface/nanotrasen (code/modules/html_interface/nanotrasen/nanotrasen.dm) +/client/verb/_swinset(var/x as text) + set name = ".swinset" + set hidden = 1 + winset(src, null, x) \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index ad2c8f423ad5e..34b0bf6094f0a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1070,7 +1070,12 @@ #include "code\modules\food&drinks\recipes\tablecraft\recipes_sandwich.dm" #include "code\modules\food&drinks\recipes\tablecraft\recipes_soup.dm" #include "code\modules\food&drinks\recipes\tablecraft\recipes_spaghetti.dm" +#include "code\modules\games\cards.dm" #include "code\modules\holiday\holidays.dm" +#include "code\modules\html_interface\html_interface.dm" +#include "code\modules\html_interface\html_interface_client.dm" +#include "code\modules\html_interface\cards\cards.dm" +#include "code\modules\html_interface\nanotrasen\nanotrasen.dm" #include "code\modules\hydroponics\biogenerator.dm" #include "code\modules\hydroponics\grown.dm" #include "code\modules\hydroponics\growninedible.dm"