Skip to content

Commit

Permalink
Ports over HTML interface and playing cards from /tg/
Browse files Browse the repository at this point in the history
  • Loading branch information
Asd396 authored and Asd396 committed Oct 18, 2015
1 parent e6fd653 commit 396e97b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
4 changes: 4 additions & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,14 @@ Class Procs:
if(!anchored && machine_flags & FIXED2WORK)
return user << "<span class='warning'>\The [src] must be anchored first!</span>"

// 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()
3 changes: 3 additions & 0 deletions code/modules/client/client defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

preload_rsc = PRELOAD_RSC
var/global/obj/screen/click_catcher/void

// Used by html_interface module.
var/hi_last_pos
8 changes: 8 additions & 0 deletions code/modules/client/client procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 8 additions & 1 deletion interface/interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,11 @@ Any-Mode: (hotkey doesn't need to be on)
</font>"}

src << hotkey_mode
src << other
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)
5 changes: 5 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 396e97b

Please sign in to comment.