Merge remote-tracking branch 'upstream/master' into rnd-tgui-rebase

This commit is contained in:
nicetoolbox
2020-10-01 22:22:16 -07:00
114 changed files with 3063 additions and 2001 deletions
+6
View File
@@ -263,6 +263,12 @@
if(prob(50 / severity) && severity < 3)
qdel(src)
/obj/machinery/mineral/equipment_vendor/Destroy()
if(inserted_id)
inserted_id.forceMove(loc)
return ..()
/**********************Mining Equiment Vendor (Golem)**************************/
/obj/machinery/mineral/equipment_vendor/golem
@@ -58,6 +58,7 @@
if(INTENT_HELP)
M.visible_message("<span class='notice'>[M] pets [src]!</span>", \
"<span class='notice'>You pet [src]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if("grab")
grabbedby(M)
else
@@ -4,7 +4,7 @@
var/datum/nano_module/atmos_control/atmos_control
var/datum/tgui_module/crew_monitor/crew_monitor
var/datum/nano_module/law_manager/law_manager
var/datum/nano_module/power_monitor/silicon/power_monitor
var/datum/tgui_module/power_monitor/digital/power_monitor
/mob/living/silicon
var/list/silicon_subsystems = list(
@@ -67,5 +67,5 @@
set category = "Subsystems"
set name = "Power Monitor"
power_monitor.ui_interact(usr, state = GLOB.self_state)
power_monitor.tgui_interact(usr, state = GLOB.self_state)
@@ -513,16 +513,16 @@
if(4)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
if(JOB_MINER)
clothes_s = new /icon(uniform_dmi, "miner_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
clothes_s = new /icon(uniform_dmi, "explorer_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "explorer"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY)
if(prob(1))
clothes_s.Blend(new /icon('icons/mob/head.dmi', "bearpelt"), ICON_OVERLAY)
switch(backbag)
if(2)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "explorerpack"), ICON_OVERLAY)
if(3)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-explorer"), ICON_OVERLAY)
if(4)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
if(JOB_LAWYER)
@@ -1,53 +0,0 @@
/datum/nano_module/power_monitor
name = "Power monitor"
var/select_monitor = 0
var/obj/machinery/computer/monitor/powermonitor
/datum/nano_module/power_monitor/silicon
select_monitor = 1
/datum/nano_module/power_monitor/New()
..()
if(!select_monitor)
powermonitor = nano_host()
/datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state)
ui.open()
ui.set_auto_update(1)
/datum/nano_module/power_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
data["powermonitor"] = powermonitor
if(select_monitor)
data["select_monitor"] = 1
data["powermonitors"] = GLOB.powermonitor_repository.powermonitor_data()
if(powermonitor && !isnull(powermonitor.powernet))
if(select_monitor && (powermonitor.stat & (NOPOWER|BROKEN)))
powermonitor = null
return
data["poweravail"] = powermonitor.powernet.avail
data["powerload"] = powermonitor.powernet.viewload
data["powerdemand"] = powermonitor.powernet.load
data["apcs"] = GLOB.apc_repository.apc_data(powermonitor.powernet)
return data
/datum/nano_module/power_monitor/Topic(href, href_list)
if(..())
return 1
if(href_list["selectmonitor"])
if(issilicon(usr))
powermonitor = locate(href_list["selectmonitor"])
powermonitor.powernet = powermonitor.find_powernet() // Refresh the powernet of the monitor
return 1
if(href_list["return"])
if(issilicon(usr))
powermonitor = null
return 1
+11 -156
View File
@@ -1,6 +1,9 @@
//The advanced pea-green monochrome lcd of tomorrow.
// EDIT 2020-09-21: We have had NanoUI PDAs for years, and I am now finally TGUI-ing them
// They arent pea green trash. I DEFY YOU COMMENTS!!! -aa
/// Global list of all PDAs in the world
GLOBAL_LIST_EMPTY(PDAs)
@@ -22,7 +25,6 @@ GLOBAL_LIST_EMPTY(PDAs)
var/obj/item/cartridge/cartridge = null //current cartridge
var/datum/data/pda/app/current_app = null
var/datum/data/pda/app/lastapp = null
var/ui_tick = 0
//Secondary variables
var/model_name = "Thinktronic 5230 Personal Data Assistant"
@@ -47,7 +49,6 @@ GLOBAL_LIST_EMPTY(PDAs)
new/datum/data/pda/app/messenger,
new/datum/data/pda/app/manifest,
new/datum/data/pda/app/atmos_scanner,
new/datum/data/pda/utility/scanmode/notes,
new/datum/data/pda/utility/flashlight)
var/list/shortcut_cache = list()
var/list/shortcut_cat_order = list()
@@ -101,92 +102,11 @@ GLOBAL_LIST_EMPTY(PDAs)
if((!istype(over_object, /obj/screen)) && can_use())
return attack_self(M)
/obj/item/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state)
ui_tick++
var/datum/nanoui/old_ui = SSnanoui.get_open_ui(user, src, "main")
var/auto_update = 1
if(!current_app)
return
if(current_app.update == PDA_APP_NOUPDATE && current_app == lastapp)
auto_update = 0
if(old_ui && (current_app == lastapp && ui_tick % 5 && current_app.update == PDA_APP_UPDATE_SLOW))
return
lastapp = current_app
var/title = "Personal Data Assistant"
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600, state = state)
ui.set_state_key("pda")
// open the new ui window
ui.open()
// auto update every Master Controller tick
ui.set_auto_update(auto_update)
/obj/item/pda/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state)
var/data[0]
data["owner"] = owner // Who is your daddy...
data["ownjob"] = ownjob // ...and what does he do?
// update list of shortcuts, only if they changed
if(!shortcut_cache.len)
shortcut_cache = list()
shortcut_cat_order = list()
var/prog_list = programs.Copy()
if(cartridge)
prog_list |= cartridge.programs
for(var/A in prog_list)
var/datum/data/pda/P = A
if(P.hidden)
continue
var/list/cat
if(P.category in shortcut_cache)
cat = shortcut_cache[P.category]
else
cat = list()
shortcut_cache[P.category] = cat
shortcut_cat_order += P.category
cat |= list(list(name = P.name, icon = P.icon, notify_icon = P.notify_icon, ref = "\ref[P]"))
// force the order of a few core categories
shortcut_cat_order = list("General") \
+ sortList(shortcut_cat_order - list("General", "Scanners", "Utilities")) \
+ list("Scanners", "Utilities")
data["idInserted"] = (id ? 1 : 0)
data["idLink"] = (id ? text("[id.registered_name], [id.assignment]") : "--------")
data["useRetro"] = retro_mode
data["cartridge_name"] = cartridge ? cartridge.name : ""
data["stationTime"] = station_time_timestamp()
data["app"] = list()
current_app.update_ui(user, data)
data["app"] |= list(
"name" = current_app.title,
"icon" = current_app.icon,
"template" = current_app.template,
"has_back" = current_app.has_back)
return data
/obj/item/pda/attack_self(mob/user as mob)
user.set_machine(src)
if(active_uplink_check(user))
return
ui_interact(user) //NanoUI requires this proc
tgui_interact(user)
/obj/item/pda/proc/start_program(datum/data/pda/P)
if(P && ((P in programs) || (cartridge && (P in cartridge.programs))))
@@ -212,79 +132,8 @@ GLOBAL_LIST_EMPTY(PDAs)
var/datum/data/pda/P = A
P.pda = src
/obj/item/pda/Topic(href, href_list)
. = ..()
if(.)
return
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/mob/living/U = usr
if(usr.stat == DEAD)
return 0
if(!can_use()) //Why reinvent the wheel? There's a proc that does exactly that.
U.unset_machine()
if(ui)
ui.close()
return 0
add_fingerprint(U)
U.set_machine(src)
if(href_list["radiomenu"] && !isnull(cartridge) && !isnull(cartridge.radio))
cartridge.radio.Topic(href, href_list)
return 1
. = 1
switch(href_list["choice"])
if("Home")//Go home, largely replaces the old Return
var/datum/data/pda/app/main_menu/A = find_program(/datum/data/pda/app/main_menu)
if(A)
start_program(A)
if("StartProgram")
if(href_list["program"])
var/datum/data/pda/app/A = locate(href_list["program"])
if(A)
start_program(A)
if("Eject")//Ejects the cart, only done from hub.
if(!isnull(cartridge))
var/turf/T = loc
if(ismob(T))
T = T.loc
var/obj/item/cartridge/C = cartridge
C.forceMove(T)
if(scanmode in C.programs)
scanmode = null
if(current_app in C.programs)
start_program(find_program(/datum/data/pda/app/main_menu))
if(C.radio)
C.radio.hostpda = null
for(var/datum/data/pda/P in notifying_programs)
if(P in C.programs)
P.unnotify()
cartridge = null
update_shortcuts()
if("Authenticate")//Checks for ID
id_check(usr, 1)
if("Retro")
retro_mode = !retro_mode
if("Ringtone")
return set_ringtone()
else
if(current_app)
. = current_app.Topic(href, href_list)
//EXTRA FUNCTIONS===================================
if((honkamt > 0) && (prob(60)))//For clown virus.
honkamt--
playsound(loc, 'sound/items/bikehorn.ogg', 30, 1)
return // return 1 tells it to refresh the UI in NanoUI
/obj/item/pda/proc/close(mob/user)
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
ui.close()
SStgui.close_uis(src)
/obj/item/pda/verb/verb_reset_pda()
set category = "Object"
@@ -299,6 +148,7 @@ GLOBAL_LIST_EMPTY(PDAs)
notifying_programs.Cut()
overlays -= image('icons/obj/pda.dmi', "pda-r")
to_chat(usr, "<span class='notice'>You press the reset button on \the [src].</span>")
SStgui.update_uis(src)
else
to_chat(usr, "<span class='notice'>You cannot do this while restrained.</span>")
@@ -327,6 +177,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mob/M = loc
M.put_in_hands(id)
to_chat(user, "<span class='notice'>You remove the ID from the [name].</span>")
SStgui.update_uis(src)
else
id.forceMove(get_turf(src))
overlays -= image('icons/goonstation/objects/pda_overlay.dmi', id.icon_state)
@@ -403,6 +254,7 @@ GLOBAL_LIST_EMPTY(PDAs)
cartridge.update_programs(src)
update_shortcuts()
to_chat(user, "<span class='notice'>You insert [cartridge] into [src].</span>")
SStgui.update_uis(src)
if(cartridge.radio)
cartridge.radio.hostpda = src
@@ -417,6 +269,7 @@ GLOBAL_LIST_EMPTY(PDAs)
ownrank = idcard.rank
name = "PDA-[owner] ([ownjob])"
to_chat(user, "<span class='notice'>Card scanned.</span>")
SStgui.update_uis(src)
else
//Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand.
if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) )
@@ -424,12 +277,14 @@ GLOBAL_LIST_EMPTY(PDAs)
id_check(user, 2)
to_chat(user, "<span class='notice'>You put the ID into \the [src]'s slot.<br>You can remove it with ALT click.</span>")
overlays += image('icons/goonstation/objects/pda_overlay.dmi', C.icon_state)
SStgui.update_uis(src)
else if(istype(C, /obj/item/paicard) && !src.pai)
user.drop_item()
C.forceMove(src)
pai = C
to_chat(user, "<span class='notice'>You slot \the [C] into [src].</span>")
SStgui.update_uis(src)
else if(istype(C, /obj/item/pen))
var/obj/item/pen/O = locate() in src
if(O)
+7 -4
View File
@@ -69,7 +69,8 @@
pda.current_app = src
return 1
/datum/data/pda/app/proc/update_ui(mob/user as mob, list/data)
/datum/data/pda/app/proc/update_ui(mob/user, list/data)
return
// Utilities just have a button on the home screen, but custom code when clicked
@@ -99,8 +100,10 @@
name = "Disable [base_name]"
pda.update_shortcuts()
return 1
return TRUE
/datum/data/pda/utility/scanmode/proc/scan_mob(mob/living/C as mob, mob/living/user as mob)
/datum/data/pda/utility/scanmode/proc/scan_mob(mob/living/C, mob/living/user)
return
/datum/data/pda/utility/scanmode/proc/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob)
/datum/data/pda/utility/scanmode/proc/scan_atom(atom/A, mob/user)
return
-2
View File
@@ -230,7 +230,6 @@
new/datum/data/pda/app/janitor,
new/datum/data/pda/app/supply,
new/datum/data/pda/app/mule_control,
new/datum/data/pda/app/status_display)
@@ -267,7 +266,6 @@
new/datum/data/pda/app/janitor,
new/datum/data/pda/app/supply,
new/datum/data/pda/app/mule_control,
new/datum/data/pda/app/status_display)
+145 -78
View File
@@ -12,20 +12,24 @@
"message1" = message1 ? message1 : "(none)",
"message2" = message2 ? message2 : "(none)")
/datum/data/pda/app/status_display/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/status_display/tgui_act(action, list/params)
if(..())
return
. = TRUE
switch(action)
if("Status")
switch(href_list["statdisp"])
switch(params["statdisp"])
if("message")
post_status("message", message1, message2)
if("alert")
post_status("alert", href_list["alert"])
post_status("alert", params["alert"])
if("setmsg1")
message1 = clean_input("Line 1", "Enter Message Text", message1)
if("setmsg2")
message2 = clean_input("Line 2", "Enter Message Text", message2)
else
post_status(href_list["statdisp"])
post_status(params["statdisp"])
/datum/data/pda/app/status_display/proc/post_status(var/command, var/data1, var/data2)
var/datum/radio_frequency/frequency = SSradio.return_frequency(DISPLAY_FREQ)
@@ -57,75 +61,64 @@
/datum/data/pda/app/signaller
name = "Signaler System"
icon = "rss"
template = "pda_signaller"
template = "pda_signaler"
category = "Utilities"
/datum/data/pda/app/signaller/update_ui(mob/user as mob, list/data)
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/signal))
var/obj/item/integrated_radio/signal/R = pda.cartridge.radio
data["signal_freq"] = format_frequency(R.frequency)
data["signal_code"] = R.code
data["frequency"] = R.frequency
data["code"] = R.code
data["minFrequency"] = PUBLIC_LOW_FREQ
data["maxFrequency"] = PUBLIC_HIGH_FREQ
/datum/data/pda/app/signaller/tgui_act(action, list/params)
if(..())
return
. = TRUE
/datum/data/pda/app/signaller/Topic(href, list/href_list)
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/signal))
var/obj/item/integrated_radio/signal/R = pda.cartridge.radio
switch(href_list["choice"])
if("Send Signal")
switch(action)
if("signal")
spawn(0)
R.send_signal("ACTIVATE")
if("Signal Frequency")
var/new_frequency = sanitize_frequency(R.frequency + text2num(href_list["sfreq"]))
if("freq")
var/new_frequency = sanitize_frequency(text2num(params["freq"]) * 10)
R.set_frequency(new_frequency)
if("Signal Code")
R.code += text2num(href_list["scode"])
R.code = round(R.code)
R.code = min(100, R.code)
R.code = max(1, R.code)
if("code")
R.code = clamp(text2num(params["code"]), 1, 100)
/datum/data/pda/app/power
name = "Power Monitor"
icon = "exclamation-triangle"
icon = "bolt"
template = "pda_power"
category = "Engineering"
update = PDA_APP_UPDATE_SLOW
var/obj/machinery/computer/monitor/powmonitor = null
var/datum/tgui_module/power_monitor/digital/pm = new
/datum/data/pda/app/power/update_ui(mob/user as mob, list/data)
update = PDA_APP_UPDATE_SLOW
data.Add(pm.tgui_data())
if(powmonitor && !isnull(powmonitor.powernet))
data["records"] = list(
"powerconnected" = 1,
"poweravail" = powmonitor.powernet.avail,
"powerload" = num2text(powmonitor.powernet.viewload, 10),
"powerdemand" = powmonitor.powernet.load,
"apcs" = GLOB.apc_repository.apc_data(powmonitor.powernet))
has_back = 1
else
data["records"] = list(
"powerconnected" = 0,
"powermonitors" = GLOB.powermonitor_repository.powermonitor_data())
has_back = 0
// All 4 args are important here because proxying matters
/datum/data/pda/app/power/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
/datum/data/pda/app/power/Topic(href, list/href_list)
switch(href_list["choice"])
if("Power Select")
var/pref = href_list["target"]
powmonitor = locate(pref)
update = PDA_APP_UPDATE
if("Back")
powmonitor = null
update = PDA_APP_UPDATE
. = TRUE
// Observe
pm.tgui_act(action, params, ui, state)
/datum/data/pda/app/crew_records
var/datum/data/record/general_records = null
/datum/data/pda/app/crew_records/update_ui(mob/user as mob, list/data)
var/list/records[0]
var/list/records = list()
if(general_records && (general_records in GLOB.data_core.general))
data["records"] = records
@@ -135,23 +128,31 @@
for(var/A in sortRecord(GLOB.data_core.general))
var/datum/data/record/R = A
if(R)
records += list(list(Name = R.fields["name"], "ref" = "\ref[R]"))
records += list(list(Name = R.fields["name"], "uid" = "[R.UID()]"))
data["recordsList"] = records
data["records"] = null
return null
/datum/data/pda/app/crew_records/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/crew_records/tgui_act(action, list/params)
if(..())
return
. = TRUE
switch(action)
if("Records")
var/datum/data/record/R = locate(href_list["target"])
var/datum/data/record/R = locateUID(params["target"])
if(R && (R in GLOB.data_core.general))
load_records(R)
return
if("Back")
general_records = null
has_back = 0
has_back = FALSE
return
/datum/data/pda/app/crew_records/proc/load_records(datum/data/record/R)
general_records = R
has_back = 1
has_back = TRUE
/datum/data/pda/app/crew_records/medical
name = "Medical Records"
@@ -181,7 +182,7 @@
/datum/data/pda/app/crew_records/security
name = "Security Records"
icon = "tags"
icon = "id-badge"
template = "pda_security"
category = "Security"
@@ -212,8 +213,8 @@
category = "Security"
/datum/data/pda/app/secbot_control/update_ui(mob/user as mob, list/data)
var/botsData[0]
var/beepskyData[0]
var/list/botsData = list()
var/list/beepskyData = list()
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
var/obj/item/integrated_radio/beepsky/SC = pda.cartridge.radio
beepskyData["active"] = SC.active ? sanitize(SC.active.name) : null
@@ -229,17 +230,17 @@
for(var/mob/living/simple_animal/bot/B in SC.botlist)
botsCount++
if(B.loc)
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "ref" = "\ref[B]")
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "uid" = "[B.UID()]")
if(!botsData.len)
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
beepskyData["bots"] = botsData
beepskyData["count"] = botsCount
else
beepskyData["active"] = 0
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
beepskyData["botstatus"] = list("loca" = null, "mode" = null)
beepskyData["bots"] = botsData
beepskyData["count"] = 0
@@ -247,11 +248,42 @@
data["beepsky"] = beepskyData
/datum/data/pda/app/secbot_control/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/secbot_control/tgui_act(action, list/params)
if(..())
return
. = TRUE
// Aight listen up. Its time for a comment rant again.
// The old way of doing this was to proxy things directly from the NanoUI into the PDA's cartridge's radio Topic() function directly
// It was AWFUL and took me 30 minutes to even understand
// This is in no way a good solution, but it works atleast
// Why do we rely on this whole "magical radio system" anyways
// Hell, I would rather take GLOBs with direct interactions over this
// WHYYYYYYYYYYYYYYY -aa07
switch(action)
if("Back")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(radiomenu = "1", op = "botlist"))
pda.cartridge.radio.Topic(null, list(op = "botlist"))
if("Rescan")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "scanbots"))
if("AccessBot")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "control", bot = params["uid"]))
if("Stop")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "stop"))
if("Go")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "go"))
if("Home")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "home"))
if("Summon")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/beepsky))
pda.cartridge.radio.Topic(null, list(op = "summon"))
/datum/data/pda/app/mule_control
name = "Delivery Bot Control"
@@ -260,8 +292,8 @@
category = "Quartermaster"
/datum/data/pda/app/mule_control/update_ui(mob/user as mob, list/data)
var/muleData[0]
var/mulebotsData[0]
var/list/muleData = list()
var/list/mulebotsData = list()
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
var/obj/item/integrated_radio/mule/QC = pda.cartridge.radio
muleData["active"] = QC.active ? sanitize(QC.active.name) : null
@@ -279,10 +311,10 @@
for(var/mob/living/simple_animal/bot/B in QC.botlist)
mulebotsCount++
if(B.loc)
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "ref" = "\ref[B]")
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "uid" = "[B.UID()]")
if(!mulebotsData.len)
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
muleData["bots"] = mulebotsData
muleData["count"] = mulebotsCount
@@ -290,28 +322,63 @@
else
muleData["botstatus"] = list("loca" = null, "mode" = -1,"home"=null,"powr" = null,"retn" =null, "pick"=null, "load" = null, "dest" = null)
muleData["active"] = 0
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
muleData["bots"] = mulebotsData
muleData["count"] = 0
has_back = 0
data["mulebot"] = muleData
/datum/data/pda/app/mule_control/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/mule_control/tgui_act(action, list/params)
if(..())
return
. = TRUE
// Heres the exact same shit as before, but worse
// See L257 to L263 for explanation
switch(action)
if("Back")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(radiomenu = "1", op = "botlist"))
pda.cartridge.radio.Topic(null, list(op = "botlist"))
if("Rescan")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "scanbots"))
if("AccessBot")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "control", bot = params["uid"]))
if("Unload")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "unload"))
if("SetDest")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "setdest"))
if("SetAutoReturn")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = params["autoReturnType"])) // "retoff" or "reton"
if("SetAutoPickup")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = params["autoPickupType"])) // "pickoff" or "pickon"
if("Stop")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "stop"))
if("Start")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "start"))
if("ReturnHome")
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/mule))
pda.cartridge.radio.Topic(null, list(op = "home"))
/datum/data/pda/app/supply
name = "Supply Records"
icon = "file-text-o"
template = "pda_supply"
icon = "archive"
template = "pda_supplyrecords"
category = "Quartermaster"
update = PDA_APP_UPDATE_SLOW
/datum/data/pda/app/supply/update_ui(mob/user as mob, list/data)
var/supplyData[0]
var/list/supplyData = list()
if(SSshuttle.supply.mode == SHUTTLE_CALL)
supplyData["shuttle_moving"] = 1
@@ -324,7 +391,7 @@
supplyData["shuttle_time"] = "([SSshuttle.supply.timeLeft(600)] Mins)"
var/supplyOrderCount = 0
var/supplyOrderData[0]
var/list/supplyOrderData = list()
for(var/S in SSshuttle.shoppinglist)
var/datum/supply_order/SO = S
supplyOrderCount++
@@ -337,7 +404,7 @@
supplyData["approved_count"] = supplyOrderCount
var/requestCount = 0
var/requestData[0]
var/list/requestData = list()
for(var/S in SSshuttle.requestlist)
var/datum/supply_order/SO = S
requestCount++
@@ -353,13 +420,13 @@
/datum/data/pda/app/janitor
name = "Custodial Locator"
icon = "trash-o"
icon = "trash"
template = "pda_janitor"
category = "Utilities"
update = PDA_APP_UPDATE_SLOW
/datum/data/pda/app/janitor/update_ui(mob/user as mob, list/data)
var/JaniData[0]
var/list/JaniData = list()
var/turf/cl = get_turf(pda)
if(cl)
@@ -367,7 +434,7 @@
else
JaniData["user_loc"] = list("x" = 0, "y" = 0)
var/MopData[0]
var/list/MopData = list()
for(var/obj/item/mop/M in GLOB.janitorial_equipment)
var/turf/ml = get_turf(M)
if(ml)
@@ -376,7 +443,7 @@
var/direction = get_dir(pda, M)
MopData[++MopData.len] = list ("x" = ml.x, "y" = ml.y, "dir" = uppertext(dir2text(direction)), "status" = M.reagents.total_volume ? "Wet" : "Dry")
var/BucketData[0]
var/list/BucketData = list()
for(var/obj/structure/mopbucket/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
if(bl)
@@ -385,7 +452,7 @@
var/direction = get_dir(pda,B)
BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "volume" = B.reagents.total_volume, "max_volume" = B.reagents.maximum_volume)
var/CbotData[0]
var/list/CbotData = list()
for(var/mob/living/simple_animal/bot/cleanbot/B in GLOB.bots_list)
var/turf/bl = get_turf(B)
if(bl)
@@ -394,7 +461,7 @@
var/direction = get_dir(pda,B)
CbotData[++CbotData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.on ? "Online" : "Offline")
var/CartData[0]
var/list/CartData = list()
for(var/obj/structure/janitorialcart/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
if(bl)
+43 -32
View File
@@ -6,19 +6,24 @@
/datum/data/pda/app/main_menu/update_ui(mob/user as mob, list/data)
title = pda.name
data["app"]["is_home"] = 1
data["app"]["is_home"] = TRUE
data["apps"] = pda.shortcut_cache
data["categories"] = pda.shortcut_cat_order
data["pai"] = !isnull(pda.pai) // pAI inserted?
var/list/notifying[0]
for(var/P in pda.notifying_programs)
notifying["\ref[P]"] = 1
var/list/notifying = list()
for(var/datum/data/pda/P in pda.notifying_programs)
notifying["[P.UID()]"] = TRUE
data["notifying"] = notifying
/datum/data/pda/app/main_menu/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/main_menu/tgui_act(action, list/params)
if(..())
return
. = TRUE
switch(action)
if("UpdateInfo")
pda.ownjob = pda.id.assignment
pda.ownrank = pda.id.rank
@@ -28,10 +33,10 @@
if(pda.pai.loc != pda)
pda.pai = null
else
switch(href_list["option"])
if("1") // Configure pAI device
switch(text2num(params["option"]))
if(1) // Configure pAI device
pda.pai.attack_self(usr)
if("2") // Eject pAI device
if(2) // Eject pAI device
var/turf/T = get_turf_or_move(pda.loc)
if(T)
pda.pai.loc = T
@@ -40,10 +45,9 @@
/datum/data/pda/app/notekeeper
name = "Notekeeper"
icon = "sticky-note-o"
template = "pda_notekeeper"
template = "pda_notes"
var/note = null
var/notehtml = ""
var/note
/datum/data/pda/app/notekeeper/start()
. = ..()
@@ -51,16 +55,22 @@
note = "Congratulations, your station has chosen the [pda.model_name]!"
/datum/data/pda/app/notekeeper/update_ui(mob/user as mob, list/data)
data["note"] = note // current pda notes
data["note"] = note // current pda notes
/datum/data/pda/app/notekeeper/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/notekeeper/tgui_act(action, params)
if(..())
return
. = TRUE
switch(action)
if("Edit")
var/n = input("Please enter message", name, notehtml) as message
var/n = input("Please enter message", name, note) as message
if(pda.loc == usr)
// TGUI will auto-reject supplied HTML
// However, the admin var-edit window will not
// SANITISATION IS IMPORTANT. DO NOT NEGLECT.
note = adminscrub(n)
notehtml = html_decode(note)
note = replacetext(note, "\n", "<br>")
else
pda.close(usr)
@@ -74,8 +84,6 @@
GLOB.data_core.get_manifest_json()
data["manifest"] = GLOB.PDA_Manifest
/datum/data/pda/app/manifest/Topic(href, list/href_list)
/datum/data/pda/app/atmos_scanner
name = "Atmospheric Scan"
icon = "fire"
@@ -84,6 +92,7 @@
update = PDA_APP_UPDATE_SLOW
/datum/data/pda/app/atmos_scanner/update_ui(mob/user as mob, list/data)
var/list/results = list()
var/turf/T = get_turf(user.loc)
if(!isnull(T))
var/datum/gas_mixture/environment = T.return_air()
@@ -97,15 +106,17 @@
var/co2_level = environment.carbon_dioxide/total_moles
var/plasma_level = environment.toxins/total_moles
var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
data["aircontents"] = list(
"pressure" = pressure,
"nitrogen" = n2_level*100,
"oxygen" = o2_level*100,
"carbon_dioxide" = co2_level*100,
"plasma" = plasma_level*100,
"other" = unknown_level,
"temp" = environment.temperature-T0C,
"reading" = 1
)
if(isnull(data["aircontents"]))
data["aircontents"] = list("reading" = 0)
results = list(
list("entry" = "Pressure", "units" = "kPa", "val" = "[round(pressure,0.1)]", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80),
list("entry" = "Temperature", "units" = "C", "val" = "[round(environment.temperature-T0C,0.1)]", "bad_high" = 35, "poor_high" = 25, "poor_low" = 15, "bad_low" = 5),
list("entry" = "Oxygen", "units" = "%", "val" = "[round(o2_level*100,0.1)]", "bad_high" = 140, "poor_high" = 135, "poor_low" = 19, "bad_low" = 17),
list("entry" = "Nitrogen", "units" = "%", "val" = "[round(n2_level*100,0.1)]", "bad_high" = 105, "poor_high" = 85, "poor_low" = 50, "bad_low" = 40),
list("entry" = "Carbon Dioxide", "units" = "%", "val" = "[round(co2_level*100,0.1)]", "bad_high" = 10, "poor_high" = 5, "poor_low" = 0, "bad_low" = 0),
list("entry" = "Plasma", "units" = "%", "val" = "[round(plasma_level*100,0.01)]", "bad_high" = 0.5, "poor_high" = 0, "poor_low" = 0, "bad_low" = 0),
list("entry" = "Other", "units" = "%", "val" = "[round(unknown_level, 0.01)]", "bad_high" = 1, "poor_high" = 0.5, "poor_low" = 0, "bad_low" = 0)
)
if(isnull(results))
results = list(list("entry" = "pressure", "units" = "%", "val" = "0", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80))
data["aircontents"] = results
+44 -41
View File
@@ -6,24 +6,22 @@
template = "pda_messenger"
var/toff = 0 //If 1, messenger disabled
var/list/tnote[0] //Current Texts
var/list/tnote = list() //Current Texts
var/last_text //No text spamming
var/m_hidden = 0 // Is the PDA hidden from the PDA list?
var/active_conversation = null // New variable that allows us to only view a single conversation.
var/list/conversations = list() // For keeping up with who we have PDA messsages from.
var/latest_post = 0
var/auto_scroll = 1
/datum/data/pda/app/messenger/start()
. = ..()
unnotify()
latest_post = 0
/datum/data/pda/app/messenger/update_ui(mob/user as mob, list/data)
data["silent"] = notify_silent // does the pda make noise when it receives a message?
data["toff"] = toff // is the messenger function turned off?
data["active_conversation"] = active_conversation // Which conversation are we following right now?
// Yes I know convo is awful, but it lets me stay inside the 80 char TGUI line limit
data["active_convo"] = active_conversation // Which conversation are we following right now?
has_back = active_conversation
if(active_conversation)
@@ -33,22 +31,19 @@
data["convo_name"] = sanitize(c["owner"])
data["convo_job"] = sanitize(c["job"])
break
data["auto_scroll"] = auto_scroll
data["latest_post"] = latest_post
latest_post = tnote.len
else
var/convopdas[0]
var/pdas[0]
var/list/convopdas = list()
var/list/pdas = list()
for(var/A in GLOB.PDAs)
var/obj/item/pda/P = A
var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger)
if(!P.owner || PM.toff || P == pda || PM.m_hidden)
continue
if(conversations.Find("\ref[P]"))
convopdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "1")))
if(conversations.Find("[P.UID()]"))
convopdas.Add(list(list("Name" = "[P]", "uid" = "[P.UID()]", "Detonate" = "[P.detonate]", "inconvo" = "1")))
else
pdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "0")))
pdas.Add(list(list("Name" = "[P]", "uid" = "[P.UID()]", "Detonate" = "[P.detonate]", "inconvo" = "0")))
data["convopdas"] = convopdas
data["pdas"] = pdas
@@ -57,28 +52,30 @@
if(pda.cartridge)
for(var/A in pda.cartridge.messenger_plugins)
var/datum/data/pda/messenger_plugin/P = A
plugins += list(list(name = P.name, icon = P.icon, ref = "\ref[P]"))
plugins += list(list(name = P.name, icon = P.icon, uid = "[P.UID()]"))
data["plugins"] = plugins
if(pda.cartridge)
data["charges"] = pda.cartridge.charges ? pda.cartridge.charges : 0
/datum/data/pda/app/messenger/Topic(href, list/href_list)
if(!pda.can_use())
/datum/data/pda/app/messenger/tgui_act(action, list/params)
if(..())
return
unnotify()
switch(href_list["choice"])
. = TRUE
switch(action)
if("Toggle Messenger")
toff = !toff
if("Toggle Ringer")//If viewing texts then erase them, if not then toggle silent status
notify_silent = !notify_silent
if("Clear")//Clears messages
if(href_list["option"] == "All")
if(params["option"] == "All")
tnote.Cut()
conversations.Cut()
if(href_list["option"] == "Convo")
var/new_tnote[0]
if(params["option"] == "Convo")
var/list/new_tnote = list()
for(var/i in tnote)
if(i["target"] != active_conversation)
new_tnote[++new_tnote.len] = i
@@ -86,36 +83,30 @@
conversations.Remove(active_conversation)
active_conversation = null
latest_post = 0
if("Message")
var/obj/item/pda/P = locate(href_list["target"])
var/obj/item/pda/P = locateUID(params["target"])
create_message(usr, P)
if(href_list["target"] in conversations) // Need to make sure the message went through, if not welp.
active_conversation = href_list["target"]
latest_post = 0
if(params["target"] in conversations) // Need to make sure the message went through, if not welp.
active_conversation = params["target"]
if("Select Conversation")
var/P = href_list["convo"]
var/P = params["target"]
for(var/n in conversations)
if(P == n)
active_conversation = P
latest_post = 0
if("Messenger Plugin")
if(!href_list["target"] || !href_list["plugin"])
if(!params["target"] || !params["plugin"])
return
var/obj/item/pda/P = locate(href_list["target"])
var/obj/item/pda/P = locateUID(params["target"])
if(!P)
to_chat(usr, "PDA not found.")
var/datum/data/pda/messenger_plugin/plugin = locate(href_list["plugin"])
var/datum/data/pda/messenger_plugin/plugin = locateUID(params["plugin"])
if(plugin && (plugin in pda.cartridge.messenger_plugins))
plugin.messenger = src
plugin.user_act(usr, P)
if("Back")
active_conversation = null
latest_post = 0
if("Autoscroll")
auto_scroll = !auto_scroll
/datum/data/pda/app/messenger/proc/create_message(var/mob/living/U, var/obj/item/pda/P)
var/t = input(U, "Please enter message", name, null) as text|null
@@ -180,8 +171,8 @@
useMS.send_pda_message("[P.owner]","[pda.owner]","[t]")
tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "\ref[P]")))
PM.tnote.Add(list(list("sent" = 0, "owner" = "[pda.owner]", "job" = "[pda.ownjob]", "message" = "[t]", "target" = "\ref[pda]")))
tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "[P.UID()]")))
PM.tnote.Add(list(list("sent" = 0, "owner" = "[pda.owner]", "job" = "[pda.ownjob]", "message" = "[t]", "target" = "[pda.UID()]")))
pda.investigate_log("<span class='game say'>PDA Message - <span class='name'>[U.key] - [pda.owner]</span> -> <span class='name'>[P.owner]</span>: <span class='message'>[t]</span></span>", "pda")
// Show it to ghosts
@@ -190,13 +181,13 @@
var/ghost_message = "<span class='name'>[pda.owner]</span> ([ghost_follow_link(pda, ghost=M)]) <span class='game say'>PDA Message</span> --> <span class='name'>[P.owner]</span> ([ghost_follow_link(P, ghost=M)]): <span class='message'>[t]</span>"
to_chat(M, "[ghost_message]")
if(!conversations.Find("\ref[P]"))
conversations.Add("\ref[P]")
if(!PM.conversations.Find("\ref[pda]"))
PM.conversations.Add("\ref[pda]")
if(!conversations.Find("[P.UID()]"))
conversations.Add("[P.UID()]")
if(!PM.conversations.Find("[pda.UID()]"))
PM.conversations.Add("[pda.UID()]")
SSnanoui.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message
PM.notify("<b>Message from [pda.owner] ([pda.ownjob]), </b>\"[t]\" (<a href='?src=[PM.UID()];choice=Message;target=\ref[pda]'>Reply</a>)")
SStgui.update_uis(src)
PM.notify("<b>Message from [pda.owner] ([pda.ownjob]), </b>\"[t]\" (<a href='?src=[PM.UID()];choice=Message;target=[pda.UID()]'>Reply</a>)")
log_pda("(PDA: [src.name]) sent \"[t]\" to [P.name]", usr)
else
to_chat(U, "<span class='notice'>ERROR: Messaging server is not responding.</span>")
@@ -230,3 +221,15 @@
/datum/data/pda/app/messenger/proc/can_receive()
return pda.owner && !toff && !hidden
// Handler for the in-chat reply button
/datum/data/pda/app/messenger/Topic(href, href_list)
if(!pda.can_use())
return
unnotify()
switch(href_list["choice"])
if("Message")
var/obj/item/pda/P = locateUID(href_list["target"])
create_message(usr, P)
if(href_list["target"] in conversations) // Need to make sure the message went through, if not welp.
active_conversation = href_list["target"]
+6 -2
View File
@@ -152,8 +152,12 @@
bait = bait.type
new bait(1, get_turf(pda))
/datum/data/pda/app/mob_hunter_game/Topic(href, list/href_list)
switch(href_list["choice"])
/datum/data/pda/app/mob_hunter_game/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
. = TRUE
switch(action)
if("Rename")
assign_nickname()
if("Release")
+106
View File
@@ -0,0 +1,106 @@
// All the TGUI interactions are in their own file to keep things simpler
/obj/item/pda/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "PDA", name, 600, 650, master_ui, state)
ui.open()
/obj/item/pda/tgui_data(mob/user)
var/list/data = list()
data["owner"] = owner
data["ownjob"] = ownjob
// update list of shortcuts, only if they changed
if(!length(shortcut_cache))
shortcut_cache = list()
shortcut_cat_order = list()
var/list/prog_list = programs.Copy()
if(cartridge)
prog_list |= cartridge.programs
for(var/A in prog_list)
var/datum/data/pda/P = A
if(P.hidden)
continue
var/list/cat
if(P.category in shortcut_cache)
cat = shortcut_cache[P.category]
else
cat = list()
shortcut_cache[P.category] = cat
shortcut_cat_order += P.category
cat |= list(list(name = P.name, icon = P.icon, notify_icon = P.notify_icon, uid = "[P.UID()]"))
// force the order of a few core categories
shortcut_cat_order = list("General") \
+ sortList(shortcut_cat_order - list("General", "Scanners", "Utilities")) \
+ list("Scanners", "Utilities")
data["idInserted"] = (id ? TRUE : FALSE)
data["idLink"] = (id ? "[id.registered_name], [id.assignment]" : "--------")
data["cartridge_name"] = cartridge ? cartridge.name : ""
data["stationTime"] = station_time_timestamp()
data["app"] = list()
data["app"] |= list(
"name" = current_app.title,
"icon" = current_app.icon,
"template" = current_app.template,
"has_back" = current_app.has_back)
current_app.update_ui(user, data)
return data
// Yes the stupid amount of args here is important, see L102
/obj/item/pda/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
add_fingerprint(usr)
. = TRUE
switch(action)
if("Home") //Go home, largely replaces the old Return
var/datum/data/pda/app/main_menu/A = find_program(/datum/data/pda/app/main_menu)
if(A)
start_program(A)
if("StartProgram")
if(params["program"])
var/datum/data/pda/app/A = locateUID(params["program"])
if(A)
start_program(A)
if("Eject")//Ejects the cart, only done from hub.
if(!isnull(cartridge))
var/turf/T = loc
if(ismob(T))
T = T.loc
var/obj/item/cartridge/C = cartridge
C.forceMove(T)
if(scanmode in C.programs)
scanmode = null
if(current_app in C.programs)
start_program(find_program(/datum/data/pda/app/main_menu))
if(C.radio)
C.radio.hostpda = null
for(var/datum/data/pda/P in notifying_programs)
if(P in C.programs)
P.unnotify()
cartridge = null
update_shortcuts()
if("Authenticate")//Checks for ID
id_check(usr, 1)
if("Ringtone")
return set_ringtone()
else
if(current_app)
. = current_app.tgui_act(action, params, ui, state) // It needs proxying through down here so apps actually have their interacts called
if((honkamt > 0) && (prob(60)))//For clown virus.
honkamt--
playsound(loc, 'sound/items/bikehorn.ogg', 30, 1)
+1 -1
View File
@@ -69,7 +69,7 @@
..()
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
active = locateUID(href_list["bot"])
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
if("scanbots") // find all bots
+2 -55
View File
@@ -29,7 +29,7 @@
/datum/data/pda/utility/toggle_door
name = "Toggle Door"
icon = "external-link"
icon = "external-link-alt"
var/remote_door_id = ""
/datum/data/pda/utility/toggle_door/start()
@@ -111,7 +111,7 @@
/datum/data/pda/utility/scanmode/gas
base_name = "Gas Scanner"
icon = "tachometer"
icon = "tachometer-alt"
/datum/data/pda/utility/scanmode/gas/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob)
if(istype(A, /obj/item/tank))
@@ -138,56 +138,3 @@
var/obj/machinery/atmospherics/unary/tank/T = A
pda.atmosanalyzer_scan(T.air_contents, user, T)
/datum/data/pda/utility/scanmode/notes
base_name = "Note Scanner"
icon = "clipboard"
var/datum/data/pda/app/notekeeper/notes
/datum/data/pda/utility/scanmode/notes/start()
. = ..()
notes = pda.find_program(/datum/data/pda/app/notekeeper)
/datum/data/pda/utility/scanmode/notes/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob)
if(notes && istype(A, /obj/item/paper))
var/obj/item/paper/P = A
var/list/brlist = list("p", "/p", "br", "hr", "h1", "h2", "h3", "h4", "/h1", "/h2", "/h3", "/h4")
// JMO 20140705: Makes scanned document show up properly in the notes. Not pretty for formatted documents,
// as this will clobber the HTML, but at least it lets you scan a document. You can restore the original
// notes by editing the note again. (Was going to allow you to edit, but scanned documents are too long.)
var/raw_scan = sanitize_simple(P.info, list("\t" = "", "ÿ" = ""))
var/formatted_scan = ""
// Scrub out the tags (replacing a few formatting ones along the way)
// Find the beginning and end of the first tag.
var/tag_start = findtext(raw_scan, "<")
var/tag_stop = findtext(raw_scan, ">")
// Until we run out of complete tags...
while(tag_start && tag_stop)
var/pre = copytext(raw_scan, 1, tag_start) // Get the stuff that comes before the tag
var/tag = lowertext(copytext(raw_scan, tag_start + 1, tag_stop)) // Get the tag so we can do intellegent replacement
var/tagend = findtext(tag, " ") // Find the first space in the tag if there is one.
// Anything that's before the tag can just be added as is.
formatted_scan = formatted_scan + pre
// If we have a space after the tag (and presumably attributes) just crop that off.
if(tagend)
tag = copytext(tag, 1, tagend)
if(tag in brlist) // Check if it's I vertical space tag.
formatted_scan = formatted_scan + "<br>" // If so, add some padding in.
raw_scan = copytext(raw_scan, tag_stop + 1) // continue on with the stuff after the tag
// Look for the next tag in what's left
tag_start = findtext(raw_scan, "<")
tag_stop = findtext(raw_scan, ">")
// Anything that is left in the page. just tack it on to the end as is
formatted_scan = formatted_scan + raw_scan
// If there is something in there already, pad it out.
if(length(notes.note) > 0)
notes.note += "<br><br>"
// Store the scanned document to the notes
notes.note += "Scanned Document. Edit to restore previous notes/delete scan.<br>----------<br>" + formatted_scan + "<br>"
// notehtml ISN'T set to allow user to get their old notes back. A better implementation would add a "scanned documents"
// feature to the PDA, which would better convey the availability of the feature, but this will work for now.
// Inform the user
to_chat(user, "<span class='notice'>Paper scanned and OCRed to notekeeper.</span>")//concept of scanning paper copyright brainoblivion 2009
else
to_chat(user, "<span class='warning'>Error scanning [A].</span>")
@@ -517,3 +517,15 @@
description = "Beloved of children and teetotalers."
color = "#E6CDFF"
taste_description = "grape soda"
/datum/reagent/consumable/drink/coco/icecoco
name = "Iced Cocoa"
id = "icecoco"
description = "Hot cocoa and ice, refreshing and cool."
color = "#102838" // rgb: 16, 40, 56
adj_temp_hot = 0
adj_temp_cool = 5
drink_icon = "icedcoffeeglass"
drink_name = "Iced Cocoa"
drink_desc = "A sweeter drink to perk you up and refresh you!"
taste_description = "refreshingly cold cocoa"
@@ -868,3 +868,11 @@
required_reagents = list("hooch" = 1, "absinthe" = 1, "manlydorf" = 1, "syndicatebomb" = 1)
result_amount = 4
mix_message = "<span class='warning'>The mixture turns to a sickening froth.</span>"
/datum/chemical_reaction/icecoco
name = "Iced Cocoa"
id = "icecoco"
result = "icecoco"
required_reagents = list("ice" = 1, "hot_coco" = 3)
result_amount = 4
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
@@ -0,0 +1,54 @@
/datum/tgui_module/power_monitor
name = "Power monitor"
var/select_monitor = FALSE
var/obj/machinery/computer/monitor/powermonitor
/datum/tgui_module/power_monitor/digital
select_monitor = TRUE
/datum/tgui_module/power_monitor/New()
..()
if(!select_monitor)
powermonitor = tgui_host()
/datum/tgui_module/power_monitor/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "PowerMonitor", name, 600, 650, master_ui, state)
ui.open()
/datum/tgui_module/power_monitor/tgui_data(mob/user)
var/list/data = list()
data["powermonitor"] = powermonitor
if(select_monitor)
data["select_monitor"] = TRUE
data["powermonitors"] = GLOB.powermonitor_repository.powermonitor_data()
if(powermonitor && !isnull(powermonitor.powernet))
if(select_monitor && (powermonitor.stat & (NOPOWER|BROKEN)))
powermonitor = null
return
data["poweravail"] = DisplayPower(powermonitor.powernet.viewavail)
data["powerdemand"] = DisplayPower(powermonitor.powernet.viewload)
data["history"] = powermonitor.history
data["apcs"] = GLOB.apc_repository.apc_data(powermonitor.powernet)
return data
/datum/tgui_module/power_monitor/tgui_act(action, list/params)
if(..())
return
// Dont allow people to break regular ones
if(!select_monitor)
return
. = TRUE
switch(action)
if("selectmonitor")
powermonitor = locateUID(params["selectmonitor"])
powermonitor.powernet = powermonitor.find_powernet() // Refresh the powernet of the monitor
if("return")
powermonitor = null