diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index fa6db81352b..a8653369af1 100644
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -66,6 +66,7 @@ var/datum/subsystem/ticker/ticker
timeLeft = config.lobby_countdown * 10
world << "Welcome to the pre-game lobby!"
world << "Please, setup your character and select ready. Game will start in [config.lobby_countdown] seconds"
+ crewmonitor.generateMiniMaps() // start generating minimaps (this is a background process)
current_state = GAME_STATE_PREGAME
if(GAME_STATE_PREGAME)
@@ -200,6 +201,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/data_huds.dm b/code/game/data_huds.dm
index 688ae0c3b3f..edd4d2ad81b 100644
--- a/code/game/data_huds.dm
+++ b/code/game/data_huds.dm
@@ -93,6 +93,9 @@
var/datum/atom_hud/data/medical/basic/B = huds[DATA_HUD_MEDICAL_BASIC]
B.update_suit_sensors(src)
+ var/turf/T = get_turf(src)
+ if (T) crewmonitor.queueUpdate(T.z)
+
//called when a carbon changes health
/mob/living/carbon/proc/med_hud_set_health()
var/image/holder = hud_list[HEALTH_HUD]
@@ -101,6 +104,9 @@
else
holder.icon_state = "hud[RoundHealth(health)]"
+ var/turf/T = get_turf(src)
+ if (T) crewmonitor.queueUpdate(T.z)
+
//called when a carbon changes stat, virus or XENO_HOST
/mob/living/carbon/proc/med_hud_set_status()
var/image/holder = hud_list[STATUS_HUD]
@@ -126,6 +132,9 @@
if(wear_id)
holder.icon_state = "hud[ckey(wear_id.GetJobName())]"
+ var/turf/T = get_turf(src)
+ if (T) crewmonitor.queueUpdate(T.z)
+
/mob/living/carbon/human/proc/sec_hud_set_implants()
var/image/holder
for(var/i in list(IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD))
diff --git a/code/game/machinery/computer/crew.css b/code/game/machinery/computer/crew.css
new file mode 100644
index 00000000000..175735be66e
--- /dev/null
+++ b/code/game/machinery/computer/crew.css
@@ -0,0 +1,100 @@
+body
+{
+ padding-left: 490px;
+ cursor: default;
+}
+
+#ntbgcenter
+{
+ background-position: 550px 0px !important;
+}
+
+#minimap
+{
+ position: fixed;
+ top: 8px;
+ left: 8px;
+ border: 2px inset #888;
+}
+
+#textbased
+{
+ width: 100%;
+}
+
+#textbased table
+{
+ min-width: 380px;
+ width: 100%;
+ table-layout: fixed;
+}
+
+#textbased td
+{
+ vertical-align: top;
+ padding: 2px;
+}
+
+#textbased tbody tr:hover td, #textbased tbody tr.hover td
+{
+ background-color: #434343;
+}
+
+#textarea:after
+{
+ content: "";
+ clear: both;
+}
+
+a { display: none; }
+
+.health
+{
+ width: 16px;
+ background-color: #FFF;
+ border: 1px solid #434343;
+ position: relative;
+ top: 2px;
+}
+
+.health-5 { background-color: #17d568; }
+.health-4 { background-color: #2ecc71; }
+.health-3 { background-color: #e67e22; }
+.health-2 { background-color: #ed5100; }
+.health-1 { background-color: #e74c3c; }
+.health-0 { background-color: #ed2814; }
+
+.tt
+{
+ position: relative;
+ display: inline-block;
+ height: 16px;
+}
+
+.tt > div
+{
+ display: none;
+}
+
+.tt:hover > div
+{
+ position: absolute;
+ bottom: -30px;
+ left: 50%;
+ margin-left: -64px;
+
+ display: block;
+ width: 128px;
+ height: 24px;
+ border: 1px solid #313131;
+ background-color: #434343;
+ padding: 4px;
+ z-index: 999;
+ text-align: center;
+}
+
+.tt > div > span
+{
+ position: relative;
+ top: -2px;
+}
\ No newline at end of file
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index e97ad9e0182..9b82de94c35 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -20,23 +20,15 @@
return
crewmonitor.show(user)
-/obj/machinery/computer/crew/Topic(href, href_list)
- if(..()) return
- if (src.z > 6)
- usr << "Unable to establish a connection: \black You're too far away from the station!"
- return
- if( href_list["close"] )
- usr << browse(null, "window=crewcomp")
- usr.unset_machine()
- return
- if(href_list["update"])
- src.updateDialog()
- return
-
var/global/datum/crewmonitor/crewmonitor = new
-/datum/crewmonitor/var/list/jobs
-/datum/crewmonitor/var/list/interfaces
+/datum/crewmonitor
+ var/list/jobs
+ var/list/interfaces
+ var/list/data
+ var/const/MAX_ICON_DIMENSION = 1024
+ var/const/ICON_SIZE = 4
+ var/initialized = FALSE
/datum/crewmonitor/New()
. = ..()
@@ -84,6 +76,7 @@ var/global/datum/crewmonitor/crewmonitor = new
src.jobs = jobs
src.interfaces = list()
+ src.data = list()
/datum/crewmonitor/Destroy()
if (src.interfaces)
@@ -97,28 +90,53 @@ var/global/datum/crewmonitor/crewmonitor = new
if (!z) z = mob.z
if (z > 0 && src.interfaces)
- if (!src.interfaces["[mob.z]"])
- src.interfaces["[mob.z]"] = new/datum/html_interface/nanotrasen(src, "Crew Monitoring", 900, 600)
+ var/datum/html_interface/hi
- src.update()
+ if (!src.interfaces["[z]"])
+ src.interfaces["[z]"] = new/datum/html_interface/nanotrasen(src, "Crew Monitoring", 900, 540, "")
- var/datum/html_interface/hi = src.interfaces["[z]"]
+ hi = src.interfaces["[z]"]
+
+ hi.updateContent("content", "Switch to mini mapSwitch to text-based
")
+
+ src.update(z, TRUE)
+ else
+ hi = src.interfaces["[z]"]
+
+ hi = src.interfaces["[z]"]
hi.show(mob)
+ src.updateFor(mob, hi, z)
-/datum/crewmonitor/proc/update(z)
+/datum/crewmonitor/proc/updateFor(hclient_or_mob, datum/html_interface/hi, z)
+ // This check will succeed if updateFor is called after showing to the player, but will fail
+ // on regular updates. Since we only really need this once we don't care if it fails.
+ var/list/parameters = list(ismob(hclient_or_mob) && isAI(hclient_or_mob) ? "true" : "false")
+
+ hi.callJavaScript("clearAll", parameters, hclient_or_mob)
+
+ for (var/list/L in data)
+ hi.callJavaScript("add", L, hclient_or_mob)
+
+/datum/crewmonitor/proc/update(z, ignore_unused = FALSE)
if (src.interfaces["[z]"])
var/datum/html_interface/hi = src.interfaces["[z]"]
- if (hi.isUsed())
- var/t = "
Name
Vitals
Position
"
- var/list/logs = list()
+ if (ignore_unused || hi.isUsed())
+ var/list/results = list()
var/obj/item/clothing/under/U
var/obj/item/weapon/card/id/I
- var/log
var/turf/pos
- var/style
var/ijob
- var/damage_report
+ var/name
+ var/assignment
+ var/dam1
+ var/dam2
+ var/dam3
+ var/dam4
+ var/area
+ var/pos_x
+ var/pos_y
+ var/life_status
for(var/mob/living/carbon/human/H in mob_list)
// Check if their z-level is correct and if they are wearing a uniform.
@@ -133,61 +151,47 @@ var/global/datum/crewmonitor/crewmonitor = new
// Special case: If the mob is inside an object confirm the z-level on turf level.
if (H.z == 0 && (!pos || pos.z != z)) continue
- log = ""
I = H.wear_id ? H.wear_id.GetID() : null
- var/life_status = (H.stat > 1 ? "Deceased" : "Living")
-
if (I)
- style = null
+ name = I.registered_name
+ assignment = I.assignment
ijob = jobs[I.assignment]
-
- if (ijob % 10 == 0) style += "font-weight: bold; " // head roles always end in 0
- if (ijob >= 10 && ijob < 20) style += "color: #E74C3C; " // security
- if (ijob >= 20 && ijob < 30) style += "color: #3498DB; " // medical
- if (ijob >= 30 && ijob < 40) style += "color: #9B59B6; " // science
- if (ijob >= 40 && ijob < 50) style += "color: #F1C40F; " // engineering
- if (ijob >= 50 && ijob < 60) style += "color: #F39C12; " // cargo
- if (ijob >= 200 && ijob < 230) style += "color: #00C100; " // Centcom
-
- // ijob does not get displayed, nor does it take up space, it's just used for the positioning of an entry
- log += "[ijob]