mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 22:18:27 +01:00
Merge pull request #9035 from ShadowLarkens/tgui_pda_rebase
TGUI PDAs/Uplink
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,26 +0,0 @@
|
||||
/obj/item/device/pda
|
||||
var/delete_id = FALSE //Guaranteed deletion of ID upon deletion of PDA
|
||||
|
||||
/obj/item/device/pda/multicaster/exploration/New()
|
||||
..()
|
||||
owner = "Exploration Department"
|
||||
name = "Exploration Department (Relay)"
|
||||
cartridges_to_send_to = exploration_cartridges
|
||||
|
||||
/obj/item/device/pda/centcom
|
||||
default_cartridge = /obj/item/weapon/cartridge/captain
|
||||
icon_state = "pda-h"
|
||||
detonate = 0
|
||||
// hidden = 1
|
||||
|
||||
/obj/item/device/pda/pathfinder
|
||||
default_cartridge = /obj/item/weapon/cartridge/explorer
|
||||
icon_state = "pda-lawyer-old"
|
||||
|
||||
/obj/item/device/pda/explorer
|
||||
default_cartridge = /obj/item/weapon/cartridge/explorer
|
||||
icon_state = "pda-det"
|
||||
|
||||
/obj/item/device/pda/sar
|
||||
default_cartridge = /obj/item/weapon/cartridge/sar
|
||||
icon_state = "pda-h"
|
||||
@@ -1,630 +0,0 @@
|
||||
var/list/command_cartridges = list(
|
||||
/obj/item/weapon/cartridge/captain,
|
||||
/obj/item/weapon/cartridge/hop,
|
||||
/obj/item/weapon/cartridge/hos,
|
||||
/obj/item/weapon/cartridge/ce,
|
||||
/obj/item/weapon/cartridge/rd,
|
||||
/obj/item/weapon/cartridge/cmo,
|
||||
/obj/item/weapon/cartridge/head,
|
||||
/obj/item/weapon/cartridge/lawyer // Internal Affaris,
|
||||
)
|
||||
|
||||
var/list/security_cartridges = list(
|
||||
/obj/item/weapon/cartridge/security,
|
||||
/obj/item/weapon/cartridge/detective,
|
||||
/obj/item/weapon/cartridge/hos
|
||||
)
|
||||
|
||||
var/list/engineering_cartridges = list(
|
||||
/obj/item/weapon/cartridge/engineering,
|
||||
/obj/item/weapon/cartridge/atmos,
|
||||
/obj/item/weapon/cartridge/ce
|
||||
)
|
||||
|
||||
var/list/medical_cartridges = list(
|
||||
/obj/item/weapon/cartridge/medical,
|
||||
/obj/item/weapon/cartridge/chemistry,
|
||||
/obj/item/weapon/cartridge/cmo
|
||||
)
|
||||
|
||||
var/list/research_cartridges = list(
|
||||
/obj/item/weapon/cartridge/signal/science,
|
||||
/obj/item/weapon/cartridge/rd
|
||||
)
|
||||
|
||||
var/list/cargo_cartridges = list(
|
||||
/obj/item/weapon/cartridge/quartermaster, // This also covers cargo-techs, apparently,
|
||||
/obj/item/weapon/cartridge/miner,
|
||||
/obj/item/weapon/cartridge/hop
|
||||
)
|
||||
|
||||
var/list/civilian_cartridges = list(
|
||||
/obj/item/weapon/cartridge/janitor,
|
||||
/obj/item/weapon/cartridge/service,
|
||||
/obj/item/weapon/cartridge/hop
|
||||
)
|
||||
|
||||
/obj/item/weapon/cartridge
|
||||
name = "generic cartridge"
|
||||
desc = "A data cartridge for portable microcomputers."
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "cart"
|
||||
item_state = "electronic"
|
||||
w_class = ITEMSIZE_TINY
|
||||
drop_sound = 'sound/items/drop/component.ogg'
|
||||
pickup_sound = 'sound/items/pickup/component.ogg'
|
||||
|
||||
var/obj/item/radio/integrated/radio = null
|
||||
var/access_security = 0
|
||||
var/access_engine = 0
|
||||
var/access_atmos = 0
|
||||
var/access_medical = 0
|
||||
var/access_clown = 0
|
||||
var/access_mime = 0
|
||||
var/access_janitor = 0
|
||||
// var/access_flora = 0
|
||||
var/access_reagent_scanner = 0
|
||||
var/access_remote_door = 0 // Control some blast doors remotely!!
|
||||
var/remote_door_id = ""
|
||||
var/access_status_display = 0
|
||||
var/access_quartermaster = 0
|
||||
var/access_detonate_pda = 0
|
||||
var/access_hydroponics = 0
|
||||
var/charges = 0
|
||||
var/mode = null
|
||||
var/menu
|
||||
var/datum/data/record/active1 = null //General
|
||||
var/datum/data/record/active2 = null //Medical
|
||||
var/datum/data/record/active3 = null //Security
|
||||
var/selected_sensor = null // Power Sensor
|
||||
var/message1 // used for status_displays
|
||||
var/message2
|
||||
var/list/stored_data = list()
|
||||
|
||||
/obj/item/weapon/cartridge/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/cartridge/engineering
|
||||
name = "\improper Power-ON cartridge"
|
||||
icon_state = "cart-e"
|
||||
access_engine = 1
|
||||
|
||||
/obj/item/weapon/cartridge/atmos
|
||||
name = "\improper BreatheDeep cartridge"
|
||||
icon_state = "cart-a"
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/medical
|
||||
name = "\improper Med-U cartridge"
|
||||
icon_state = "cart-m"
|
||||
access_medical = 1
|
||||
|
||||
/obj/item/weapon/cartridge/chemistry
|
||||
name = "\improper ChemWhiz cartridge"
|
||||
icon_state = "cart-chem"
|
||||
access_reagent_scanner = 1
|
||||
access_medical = 1
|
||||
|
||||
/obj/item/weapon/cartridge/security
|
||||
name = "\improper R.O.B.U.S.T. cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
|
||||
/obj/item/weapon/cartridge/security/Initialize()
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/cartridge/detective
|
||||
name = "\improper D.E.T.E.C.T. cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
access_medical = 1
|
||||
|
||||
|
||||
/obj/item/weapon/cartridge/janitor
|
||||
name = "\improper CustodiPRO cartridge"
|
||||
desc = "The ultimate in clean-room design."
|
||||
icon_state = "cart-j"
|
||||
access_janitor = 1
|
||||
|
||||
/obj/item/weapon/cartridge/lawyer
|
||||
name = "\improper P.R.O.V.E. cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
|
||||
/obj/item/weapon/cartridge/clown
|
||||
name = "\improper Honkworks 5.0 cartridge"
|
||||
icon_state = "cart-clown"
|
||||
access_clown = 1
|
||||
charges = 5
|
||||
|
||||
/obj/item/weapon/cartridge/mime
|
||||
name = "\improper Gestur-O 1000 cartridge"
|
||||
icon_state = "cart-mi"
|
||||
access_mime = 1
|
||||
charges = 5
|
||||
/*
|
||||
/obj/item/weapon/cartridge/botanist
|
||||
name = "Green Thumb v4.20"
|
||||
icon_state = "cart-b"
|
||||
access_flora = 1
|
||||
*/
|
||||
|
||||
/obj/item/weapon/cartridge/service
|
||||
name = "\improper Serv-U Pro cartridge"
|
||||
desc = "A data cartridge designed to serve YOU!"
|
||||
|
||||
/obj/item/weapon/cartridge/signal
|
||||
name = "generic signaler cartridge"
|
||||
desc = "A data cartridge with an integrated radio signaler module."
|
||||
var/qdeled = 0
|
||||
|
||||
/obj/item/weapon/cartridge/signal/science
|
||||
name = "\improper Signal Ace 2 cartridge"
|
||||
desc = "Complete with integrated radio signaler!"
|
||||
icon_state = "cart-tox"
|
||||
access_reagent_scanner = 1
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/signal/Initialize()
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/cartridge/quartermaster
|
||||
name = "\improper Space Parts & Space Vendors cartridge"
|
||||
desc = "Perfect for the Quartermaster on the go!"
|
||||
icon_state = "cart-q"
|
||||
access_quartermaster = 1
|
||||
|
||||
/obj/item/weapon/cartridge/miner
|
||||
name = "\improper Drill-Jockey 4.5 cartridge"
|
||||
desc = "It's covered in some sort of sand."
|
||||
icon_state = "cart-q"
|
||||
|
||||
/obj/item/weapon/cartridge/head
|
||||
name = "\improper Easy-Record DELUXE cartridge"
|
||||
icon_state = "cart-h"
|
||||
access_status_display = 1
|
||||
|
||||
/obj/item/weapon/cartridge/hop
|
||||
name = "\improper HumanResources9001 cartridge"
|
||||
icon_state = "cart-h"
|
||||
access_status_display = 1
|
||||
access_quartermaster = 1
|
||||
access_janitor = 1
|
||||
access_security = 1
|
||||
|
||||
/obj/item/weapon/cartridge/hos
|
||||
name = "\improper R.O.B.U.S.T. DELUXE cartridge"
|
||||
icon_state = "cart-hos"
|
||||
access_status_display = 1
|
||||
access_security = 1
|
||||
|
||||
/obj/item/weapon/cartridge/hos/Initialize()
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/cartridge/ce
|
||||
name = "\improper Power-On DELUXE cartridge"
|
||||
icon_state = "cart-ce"
|
||||
access_status_display = 1
|
||||
access_engine = 1
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/cmo
|
||||
name = "\improper Med-U DELUXE cartridge"
|
||||
icon_state = "cart-cmo"
|
||||
access_status_display = 1
|
||||
access_reagent_scanner = 1
|
||||
access_medical = 1
|
||||
|
||||
/obj/item/weapon/cartridge/rd
|
||||
name = "\improper Signal Ace DELUXE cartridge"
|
||||
icon_state = "cart-rd"
|
||||
access_status_display = 1
|
||||
access_reagent_scanner = 1
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/rd/Initialize()
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/cartridge/captain
|
||||
name = "\improper Value-PAK cartridge"
|
||||
desc = "Now with 200% more value!"
|
||||
icon_state = "cart-c"
|
||||
access_quartermaster = 1
|
||||
access_janitor = 1
|
||||
access_engine = 1
|
||||
access_security = 1
|
||||
access_medical = 1
|
||||
access_reagent_scanner = 1
|
||||
access_status_display = 1
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/syndicate
|
||||
name = "\improper Detomatix cartridge"
|
||||
icon_state = "cart"
|
||||
access_remote_door = 1
|
||||
access_detonate_pda = 1
|
||||
remote_door_id = "smindicate" //Make sure this matches the syndicate shuttle's shield/door id!! //don't ask about the name, testing.
|
||||
charges = 4
|
||||
|
||||
/obj/item/weapon/cartridge/proc/post_status(var/command, var/data1, var/data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = TRANSMISSION_RADIO
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
if(loc)
|
||||
var/obj/item/PDA = loc
|
||||
var/mob/user = PDA.fingerprintslast
|
||||
log_admin("STATUS: [user] set status screen with [PDA]. Message: [data1] [data2]")
|
||||
message_admins("STATUS: [user] set status screen with [PDA]. Message: [data1] [data2]")
|
||||
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
|
||||
/*
|
||||
This generates the nano values of the cart menus.
|
||||
Because we close the UI when we insert a new cart
|
||||
we don't have to worry about null values on items
|
||||
the user can't access. Well, unless they are href hacking.
|
||||
But in that case their UI will just lock up.
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/weapon/cartridge/proc/create_NanoUI_values(mob/user as mob)
|
||||
var/values[0]
|
||||
|
||||
/* Signaler (Mode: 40) */
|
||||
|
||||
|
||||
if(istype(radio,/obj/item/radio/integrated/signal) && (mode==40))
|
||||
var/obj/item/radio/integrated/signal/R = radio
|
||||
values["signal_freq"] = format_frequency(R.frequency)
|
||||
values["signal_code"] = R.code
|
||||
|
||||
|
||||
/* Station Display (Mode: 42) */
|
||||
|
||||
if(mode==42)
|
||||
values["message1"] = message1 ? message1 : "(none)"
|
||||
values["message2"] = message2 ? message2 : "(none)"
|
||||
|
||||
|
||||
|
||||
/* Power Monitor (Mode: 43 / 433) */
|
||||
|
||||
if(mode==43 || mode==433)
|
||||
var/list/sensors = list()
|
||||
var/obj/machinery/power/sensor/MS = null
|
||||
var/my_z = get_z(user)
|
||||
var/list/levels = using_map.get_map_levels(my_z)
|
||||
|
||||
for(var/obj/machinery/power/sensor/S in machines)
|
||||
if(!(get_z(S) in levels))
|
||||
continue
|
||||
sensors.Add(list(list("name_tag" = S.name_tag)))
|
||||
if(S.name_tag == selected_sensor)
|
||||
MS = S
|
||||
values["power_sensors"] = sensors
|
||||
if(selected_sensor && MS)
|
||||
values["sensor_reading"] = MS.return_reading_data()
|
||||
|
||||
|
||||
/* General Records (Mode: 44 / 441 / 45 / 451) */
|
||||
if(mode == 44 || mode == 441 || mode == 45 || mode ==451)
|
||||
if(istype(active1, /datum/data/record) && (active1 in data_core.general))
|
||||
values["general"] = active1.fields
|
||||
values["general_exists"] = 1
|
||||
|
||||
else
|
||||
values["general_exists"] = 0
|
||||
|
||||
|
||||
|
||||
/* Medical Records (Mode: 44 / 441) */
|
||||
|
||||
if(mode == 44 || mode == 441)
|
||||
var/medData[0]
|
||||
for(var/datum/data/record/R in sortRecord(data_core.general))
|
||||
medData[++medData.len] = list(Name = R.fields["name"],"ref" = "\ref[R]")
|
||||
values["medical_records"] = medData
|
||||
|
||||
if(istype(active2, /datum/data/record) && (active2 in data_core.medical))
|
||||
values["medical"] = active2.fields
|
||||
values["medical_exists"] = 1
|
||||
else
|
||||
values["medical_exists"] = 0
|
||||
|
||||
/* Security Records (Mode:45 / 451) */
|
||||
|
||||
if(mode == 45 || mode == 451)
|
||||
var/secData[0]
|
||||
for (var/datum/data/record/R in sortRecord(data_core.general))
|
||||
secData[++secData.len] = list(Name = R.fields["name"], "ref" = "\ref[R]")
|
||||
values["security_records"] = secData
|
||||
|
||||
if(istype(active3, /datum/data/record) && (active3 in data_core.security))
|
||||
values["security"] = active3.fields
|
||||
values["security_exists"] = 1
|
||||
else
|
||||
values["security_exists"] = 0
|
||||
|
||||
/* Security Bot Control (Mode: 46) */
|
||||
|
||||
if(mode==46)
|
||||
var/botsData[0]
|
||||
var/beepskyData[0]
|
||||
if(istype(radio,/obj/item/radio/integrated/beepsky))
|
||||
var/obj/item/radio/integrated/beepsky/SC = radio
|
||||
beepskyData["active"] = SC.active
|
||||
if(SC.active && !isnull(SC.botstatus))
|
||||
var/area/loca = SC.botstatus["loca"]
|
||||
var/loca_name = sanitize(loca.name)
|
||||
beepskyData["botstatus"] = list("loca" = loca_name, "mode" = SC.botstatus["mode"])
|
||||
else
|
||||
beepskyData["botstatus"] = list("loca" = null, "mode" = -1)
|
||||
var/botsCount=0
|
||||
if(SC.botlist && SC.botlist.len)
|
||||
for(var/mob/living/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]")
|
||||
|
||||
if(!botsData.len)
|
||||
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
|
||||
|
||||
beepskyData["bots"] = botsData
|
||||
beepskyData["count"] = botsCount
|
||||
|
||||
else
|
||||
beepskyData["active"] = 0
|
||||
botsData[++botsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "ref"= null)
|
||||
beepskyData["botstatus"] = list("loca" = null, "mode" = null)
|
||||
beepskyData["bots"] = botsData
|
||||
beepskyData["count"] = 0
|
||||
|
||||
values["beepsky"] = beepskyData
|
||||
|
||||
|
||||
/* MULEBOT Control (Mode: 48) */
|
||||
|
||||
if(mode==48)
|
||||
var/mulebotsData[0]
|
||||
var/count = 0
|
||||
|
||||
for(var/mob/living/bot/mulebot/M in living_mob_list)
|
||||
if(!M.on)
|
||||
continue
|
||||
++count
|
||||
var/muleData[0]
|
||||
muleData["name"] = M.suffix
|
||||
muleData["location"] = get_area(M)
|
||||
muleData["paused"] = M.paused
|
||||
muleData["home"] = M.homeName
|
||||
muleData["target"] = M.targetName
|
||||
muleData["ref"] = "\ref[M]"
|
||||
muleData["load"] = M.load ? M.load.name : "Nothing"
|
||||
|
||||
mulebotsData[++mulebotsData.len] = muleData.Copy()
|
||||
|
||||
values["mulebotcount"] = count
|
||||
values["mulebots"] = mulebotsData
|
||||
|
||||
|
||||
|
||||
/* Supply Shuttle Requests Menu (Mode: 47) */
|
||||
|
||||
if(mode==47)
|
||||
var/supplyData[0]
|
||||
var/datum/shuttle/autodock/ferry/supply/shuttle = SSsupply.shuttle
|
||||
if (shuttle)
|
||||
supplyData["shuttle_moving"] = shuttle.has_arrive_time()
|
||||
supplyData["shuttle_eta"] = shuttle.eta_minutes()
|
||||
supplyData["shuttle_loc"] = shuttle.at_station() ? "Station" : "Dock"
|
||||
var/supplyOrderCount = 0
|
||||
var/supplyOrderData[0]
|
||||
for(var/S in SSsupply.shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
|
||||
supplyOrderData[++supplyOrderData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "ApprovedBy" = SO.ordered_by, "Comment" = html_encode(SO.comment))
|
||||
if(!supplyOrderData.len)
|
||||
supplyOrderData[++supplyOrderData.len] = list("Number" = null, "Name" = null, "OrderedBy"=null)
|
||||
|
||||
supplyData["approved"] = supplyOrderData
|
||||
supplyData["approved_count"] = supplyOrderCount
|
||||
|
||||
var/requestCount = 0
|
||||
var/requestData[0]
|
||||
for(var/S in SSsupply.order_history)
|
||||
var/datum/supply_order/SO = S
|
||||
if(SO.status != SUP_ORDER_REQUESTED)
|
||||
continue
|
||||
|
||||
requestCount++
|
||||
requestData[++requestData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "OrderedBy" = SO.ordered_by, "Comment" = html_encode(SO.comment))
|
||||
if(!requestData.len)
|
||||
requestData[++requestData.len] = list("Number" = null, "Name" = null, "orderedBy" = null, "Comment" = null)
|
||||
|
||||
supplyData["requests"] = requestData
|
||||
supplyData["requests_count"] = requestCount
|
||||
|
||||
|
||||
values["supply"] = supplyData
|
||||
|
||||
|
||||
|
||||
/* Janitor Supplies Locator (Mode: 49) */
|
||||
if(mode==49)
|
||||
var/JaniData[0]
|
||||
var/turf/cl = get_turf(src)
|
||||
|
||||
if(cl)
|
||||
JaniData["user_loc"] = list("x" = cl.x, "y" = cl.y)
|
||||
else
|
||||
JaniData["user_loc"] = list("x" = 0, "y" = 0)
|
||||
var/MopData[0]
|
||||
for(var/obj/item/weapon/mop/M in all_mops)
|
||||
var/turf/ml = get_turf(M)
|
||||
if(ml)
|
||||
if(ml.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src, M)
|
||||
MopData[++MopData.len] = list ("x" = ml.x, "y" = ml.y, "dir" = uppertext(dir2text(direction)), "status" = M.reagents.total_volume ? "Wet" : "Dry")
|
||||
|
||||
if(!MopData.len)
|
||||
MopData[++MopData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
|
||||
var/BucketData[0]
|
||||
for(var/obj/structure/mopbucket/B in all_mopbuckets)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src,B)
|
||||
BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
|
||||
|
||||
if(!BucketData.len)
|
||||
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
var/CbotData[0]
|
||||
for(var/mob/living/bot/cleanbot/B in mob_list)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src,B)
|
||||
CbotData[++CbotData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.on ? "Online" : "Offline")
|
||||
|
||||
|
||||
if(!CbotData.len)
|
||||
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
var/CartData[0]
|
||||
for(var/obj/structure/janitorialcart/B in all_janitorial_carts)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src,B)
|
||||
var/status = "No Bucket"
|
||||
if(B.mybucket)
|
||||
status = B.mybucket.reagents.total_volume / 100
|
||||
CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = status)
|
||||
if(!CartData.len)
|
||||
CartData[++CartData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
|
||||
|
||||
|
||||
JaniData["mops"] = MopData
|
||||
JaniData["buckets"] = BucketData
|
||||
JaniData["cleanbots"] = CbotData
|
||||
JaniData["carts"] = CartData
|
||||
values["janitor"] = JaniData
|
||||
|
||||
return values
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/cartridge/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
switch(href_list["choice"])
|
||||
if("Medical Records")
|
||||
var/datum/data/record/R = locate(href_list["target"])
|
||||
var/datum/data/record/M = locate(href_list["target"])
|
||||
loc:mode = 441
|
||||
mode = 441
|
||||
if (R in data_core.general)
|
||||
for (var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
break
|
||||
active1 = R
|
||||
active2 = M
|
||||
|
||||
if("Security Records")
|
||||
var/datum/data/record/R = locate(href_list["target"])
|
||||
var/datum/data/record/S = locate(href_list["target"])
|
||||
loc:mode = 451
|
||||
mode = 451
|
||||
if (R in data_core.general)
|
||||
for (var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
S = E
|
||||
break
|
||||
active1 = R
|
||||
active3 = S
|
||||
|
||||
if("Send Signal")
|
||||
if(is_jammed(src))
|
||||
return
|
||||
spawn( 0 )
|
||||
radio:send_signal("ACTIVATE")
|
||||
return
|
||||
|
||||
if("Signal Frequency")
|
||||
var/new_frequency = sanitize_frequency(radio:frequency + text2num(href_list["sfreq"]))
|
||||
radio:set_frequency(new_frequency)
|
||||
|
||||
if("Signal Code")
|
||||
radio:code += text2num(href_list["scode"])
|
||||
radio:code = round(radio:code)
|
||||
radio:code = min(100, radio:code)
|
||||
radio:code = max(1, radio:code)
|
||||
|
||||
if("Status")
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
post_status("message", message1, message2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
if("setmsg1")
|
||||
message1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", message1) as text|null, 40), 40)
|
||||
updateSelfDialog()
|
||||
if("setmsg2")
|
||||
message2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", message2) as text|null, 40), 40)
|
||||
updateSelfDialog()
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
if("Power Select")
|
||||
selected_sensor = href_list["target"]
|
||||
loc:mode = 433
|
||||
mode = 433
|
||||
if("Power Clear")
|
||||
selected_sensor = null
|
||||
loc:mode = 43
|
||||
mode = 43
|
||||
|
||||
if("MULEbot")
|
||||
var/mob/living/bot/mulebot/M = locate(href_list["ref"])
|
||||
if(istype(M))
|
||||
M.obeyCommand(href_list["command"])
|
||||
|
||||
return 1
|
||||
@@ -1,17 +0,0 @@
|
||||
var/list/exploration_cartridges = list(
|
||||
/obj/item/weapon/cartridge/explorer,
|
||||
/obj/item/weapon/cartridge/sar
|
||||
)
|
||||
|
||||
/obj/item/weapon/cartridge/explorer
|
||||
name = "\improper Explorator cartridge"
|
||||
icon_state = "cart-e"
|
||||
access_reagent_scanner = 1
|
||||
access_atmos = 1
|
||||
|
||||
/obj/item/weapon/cartridge/sar
|
||||
name = "\improper Med-Exp cartridge"
|
||||
icon_state = "cart-m"
|
||||
access_medical = 1
|
||||
access_reagent_scanner = 1
|
||||
access_atmos = 1
|
||||
@@ -1,16 +0,0 @@
|
||||
var/list/chatrooms = list()
|
||||
|
||||
/datum/chatroom
|
||||
var/name = "Generic Chatroom"
|
||||
var/list/logged_in = list()
|
||||
var/list/logs = list() // chat logs
|
||||
var/list/banned = list() // banned users
|
||||
var/list/whitelist = list() // whitelisted users
|
||||
var/list/muted = list()
|
||||
var/topic = "" // topic message for the chatroom
|
||||
var/password = "" // blank for no password.
|
||||
var/operator = "" // name of the operator
|
||||
|
||||
/datum/chatroom/proc/attempt_connect(var/obj/item/device/pda/device, var/obj/password)
|
||||
if(!device)
|
||||
return
|
||||
@@ -1,153 +0,0 @@
|
||||
/obj/item/radio/integrated
|
||||
name = "\improper PDA radio module"
|
||||
desc = "An electronic radio system."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
var/obj/item/device/pda/hostpda = null
|
||||
|
||||
var/on = 0 //Are we currently active??
|
||||
var/menu_message = ""
|
||||
|
||||
New()
|
||||
..()
|
||||
if (istype(loc.loc, /obj/item/device/pda))
|
||||
hostpda = loc.loc
|
||||
|
||||
proc/post_signal(var/freq, var/key, var/value, var/key2, var/value2, var/key3, var/value3, s_filter)
|
||||
|
||||
//to_world("Post: [freq]: [key]=[value], [key2]=[value2]")
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.data[key] = value
|
||||
if(key2)
|
||||
signal.data[key2] = value2
|
||||
if(key3)
|
||||
signal.data[key3] = value3
|
||||
|
||||
frequency.post_signal(src, signal, radio_filter = s_filter)
|
||||
|
||||
return
|
||||
|
||||
proc/generate_menu()
|
||||
|
||||
/obj/item/radio/integrated/beepsky
|
||||
var/list/botlist = null // list of bots
|
||||
var/mob/living/bot/secbot/active // the active bot; if null, show bot list
|
||||
var/list/botstatus // the status signal sent by the bot
|
||||
|
||||
var/control_freq = BOT_FREQ
|
||||
|
||||
// create a new QM cartridge, and register to receive bot control & beacon message
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, control_freq, radio_filter = RADIO_SECBOT)
|
||||
|
||||
// receive radio signals
|
||||
// can detect bot status signals
|
||||
// create/populate list as they are recvd
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
// var/obj/item/device/pda/P = src.loc
|
||||
|
||||
/*
|
||||
to_world("recvd:[P] : [signal.source]")
|
||||
for(var/d in signal.data)
|
||||
to_world("- [d] = [signal.data[d]]")
|
||||
*/
|
||||
if (signal.data["type"] == "secbot")
|
||||
if(!botlist)
|
||||
botlist = new()
|
||||
|
||||
if(!(signal.source in botlist))
|
||||
botlist += signal.source
|
||||
|
||||
if(active == signal.source)
|
||||
var/list/b = signal.data
|
||||
botstatus = b.Copy()
|
||||
|
||||
// if (istype(P)) P.updateSelfDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
var/obj/item/device/pda/PDA = src.hostpda
|
||||
|
||||
switch(href_list["op"])
|
||||
|
||||
if("control")
|
||||
active = locate(href_list["bot"])
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
|
||||
if("scanbots") // find all bots
|
||||
botlist = null
|
||||
post_signal(control_freq, "command", "bot_status", s_filter = RADIO_SECBOT)
|
||||
|
||||
if("botlist")
|
||||
active = null
|
||||
|
||||
if("stop", "go")
|
||||
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = RADIO_SECBOT)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
|
||||
if("summon")
|
||||
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
|
||||
|
||||
/obj/item/radio/integrated/beepsky/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, control_freq)
|
||||
return ..()
|
||||
|
||||
/*
|
||||
* Radio Cartridge, essentially a signaler.
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/radio/integrated/signal
|
||||
var/frequency = 1457
|
||||
var/code = 30.0
|
||||
var/last_transmission
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/radio/integrated/signal/Initialize()
|
||||
if(!radio_controller)
|
||||
return
|
||||
|
||||
if (src.frequency < PUBLIC_LOW_FREQ || src.frequency > PUBLIC_HIGH_FREQ)
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/item/radio/integrated/signal/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
/obj/item/radio/integrated/signal/proc/send_signal(message="ACTIVATE")
|
||||
|
||||
if(last_transmission && world.time < (last_transmission + 5))
|
||||
return
|
||||
last_transmission = world.time
|
||||
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
var/turf/T = get_turf(src)
|
||||
lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = message
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/item/radio/integrated/signal/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
return ..()
|
||||
@@ -33,6 +33,24 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
|
||||
QDEL_NULL(radio)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/paicard/attack_ghost(mob/observer/dead/user)
|
||||
if(istype(user) && user.can_admin_interact())
|
||||
switch(alert(user, "Would you like to become a pAI by force? (Admin)", "pAI Creation", "Yes", "No"))
|
||||
if("Yes")
|
||||
// Copied from paiController/Topic
|
||||
var/mob/living/silicon/pai/pai = new(src)
|
||||
pai.name = user.name
|
||||
pai.real_name = pai.name
|
||||
pai.key = user.key
|
||||
|
||||
setPersonality(pai)
|
||||
looking_for_personality = FALSE
|
||||
|
||||
if(pai.mind)
|
||||
update_antag_icons(pai.mind)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/paicard/attack_self(mob/user)
|
||||
if (!in_range(src, user))
|
||||
return
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
GLOBAL_LIST_BOILERPLATE(world_uplinks, /obj/item/device/uplink)
|
||||
|
||||
// I placed this here because of how relevant it is.
|
||||
// You place this in your uplinkable item to check if an uplink is active or not.
|
||||
// If it is, it will display the uplink menu and return 1, else it'll return false.
|
||||
// If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"
|
||||
/obj/item/proc/active_uplink_check(mob/user as mob)
|
||||
// Activates the uplink if it's active
|
||||
if(hidden_uplink)
|
||||
if(hidden_uplink.active)
|
||||
hidden_uplink.trigger(user)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/device/uplink
|
||||
var/welcome = "Welcome, Operative" // Welcoming menu message
|
||||
var/uses // Numbers of crystals
|
||||
var/list/ItemsCategory // List of categories with lists of items
|
||||
var/list/ItemsReference // List of references with an associated item
|
||||
var/list/nanoui_items // List of items for NanoUI use
|
||||
var/nanoui_menu = 0 // The current menu we are in
|
||||
var/list/nanoui_data = new // Additional data for NanoUI use
|
||||
var/faction = "" //Antag faction holder.
|
||||
|
||||
var/list/purchase_log = new
|
||||
@@ -17,9 +27,7 @@ GLOBAL_LIST_BOILERPLATE(world_uplinks, /obj/item/device/uplink)
|
||||
var/next_offer_time
|
||||
var/datum/uplink_item/discount_item //The item to be discounted
|
||||
var/discount_amount //The amount as a percent the item will be discounted by
|
||||
|
||||
/obj/item/device/uplink/nano_host()
|
||||
return loc
|
||||
var/compact_mode = FALSE
|
||||
|
||||
/obj/item/device/uplink/Initialize(var/mapload, var/datum/mind/owner = null, var/telecrystals = DEFAULT_TELECRYSTAL_AMOUNT)
|
||||
. = ..()
|
||||
@@ -53,23 +61,20 @@ GLOBAL_LIST_BOILERPLATE(world_uplinks, /obj/item/device/uplink)
|
||||
name = "hidden uplink"
|
||||
desc = "There is something wrong if you're examining this."
|
||||
var/active = 0
|
||||
var/datum/uplink_category/category = 0 // The current category we are in
|
||||
var/exploit_id // Id of the current exploit record we are viewing
|
||||
var/selected_cat
|
||||
|
||||
// The hidden uplink MUST be inside an obj/item's contents.
|
||||
/obj/item/device/uplink/hidden/Initialize()
|
||||
. = ..()
|
||||
if(!isitem(loc))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
nanoui_data = list()
|
||||
update_nano_data()
|
||||
|
||||
/obj/item/device/uplink/hidden/next_offer()
|
||||
discount_item = default_uplink_selection.get_random_item(INFINITY)
|
||||
discount_amount = pick(90;0.9, 80;0.8, 70;0.7, 60;0.6, 50;0.5, 40;0.4, 30;0.3, 20;0.2, 10;0.1)
|
||||
update_nano_data()
|
||||
SSnanoui.update_uis(src)
|
||||
next_offer_time = world.time + offer_time
|
||||
SStgui.update_uis(src)
|
||||
addtimer(CALLBACK(src, .proc/next_offer), offer_time)
|
||||
|
||||
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
|
||||
@@ -91,136 +96,137 @@ GLOBAL_LIST_BOILERPLATE(world_uplinks, /obj/item/device/uplink)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
NANO UI FOR UPLINK WOOP WOOP
|
||||
*/
|
||||
/obj/item/device/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/title = "Remote Uplink"
|
||||
var/data[0]
|
||||
uses = user.mind.tcrystals
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
faction = H.antag_faction
|
||||
// Legacy
|
||||
/obj/item/device/uplink/hidden/interact(mob/user)
|
||||
tgui_interact(user)
|
||||
|
||||
data["welcome"] = welcome
|
||||
data["crystals"] = uses
|
||||
data["menu"] = nanoui_menu
|
||||
data += nanoui_data
|
||||
/*****************
|
||||
* Uplink TGUI
|
||||
*****************/
|
||||
/obj/item/device/uplink/tgui_host()
|
||||
return loc
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui) // No auto-refresh
|
||||
ui = new(user, src, ui_key, "uplink.tmpl", title, 630, 700, state = inventory_state)
|
||||
data["menu"] = 0
|
||||
ui.set_initial_data(data)
|
||||
/obj/item/device/uplink/hidden/tgui_state(mob/user)
|
||||
return GLOB.tgui_inventory_state
|
||||
|
||||
/obj/item/device/uplink/hidden/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui)
|
||||
if(!active)
|
||||
toggle()
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Uplink", "Remote Uplink")
|
||||
// This UI is only ever opened by one person,
|
||||
// and never is updated outside of user input.
|
||||
ui.set_autoupdate(FALSE)
|
||||
ui.open()
|
||||
|
||||
/obj/item/device/uplink/hidden/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(!user.mind)
|
||||
return
|
||||
|
||||
// Interaction code. Gathers a list of items purchasable from the paren't uplink and displays it. It also adds a lock button.
|
||||
/obj/item/device/uplink/hidden/interact(mob/user)
|
||||
ui_interact(user)
|
||||
var/list/data = ..()
|
||||
|
||||
/obj/item/device/uplink/hidden/CanUseTopic()
|
||||
data["telecrystals"] = uses
|
||||
data["lockable"] = TRUE
|
||||
data["compactMode"] = compact_mode
|
||||
|
||||
data["discount_name"] = discount_item ? discount_item.name : ""
|
||||
data["discount_amount"] = (1-discount_amount)*100
|
||||
data["offer_expiry"] = worldtime2stationtime(next_offer_time)
|
||||
|
||||
data["exploit"] = null
|
||||
data["locked_records"] = null
|
||||
|
||||
if(exploit_id)
|
||||
for(var/datum/data/record/L in data_core.locked)
|
||||
if(L.fields["id"] == exploit_id)
|
||||
data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value.
|
||||
// We trade off being able to automatically add shit for more control over what gets passed to json
|
||||
// and if it's sanitized for html.
|
||||
data["exploit"]["nanoui_exploit_record"] = html_encode(L.fields["exploit_record"]) // Change stuff into html
|
||||
data["exploit"]["nanoui_exploit_record"] = replacetext(data["exploit"]["nanoui_exploit_record"], "\n", "<br>") // change line breaks into <br>
|
||||
data["exploit"]["name"] = html_encode(L.fields["name"])
|
||||
data["exploit"]["sex"] = html_encode(L.fields["sex"])
|
||||
data["exploit"]["age"] = html_encode(L.fields["age"])
|
||||
data["exploit"]["species"] = html_encode(L.fields["species"])
|
||||
data["exploit"]["rank"] = html_encode(L.fields["rank"])
|
||||
data["exploit"]["home_system"] = html_encode(L.fields["home_system"])
|
||||
data["exploit"]["citizenship"] = html_encode(L.fields["citizenship"])
|
||||
data["exploit"]["faction"] = html_encode(L.fields["faction"])
|
||||
data["exploit"]["religion"] = html_encode(L.fields["religion"])
|
||||
data["exploit"]["fingerprint"] = html_encode(L.fields["fingerprint"])
|
||||
if(L.fields["antagvis"] == ANTAG_KNOWN || (faction == L.fields["antagfac"] && (L.fields["antagvis"] == ANTAG_SHARED)))
|
||||
data["exploit"]["antagfaction"] = html_encode(L.fields["antagfac"])
|
||||
else
|
||||
data["exploit"]["antagfaction"] = html_encode("None")
|
||||
break
|
||||
else
|
||||
var/list/permanentData = list()
|
||||
for(var/datum/data/record/L in sortRecord(data_core.locked))
|
||||
permanentData.Add(list(list(
|
||||
"name" = L.fields["name"],
|
||||
"id" = L.fields["id"]
|
||||
)))
|
||||
data["locked_records"] = permanentData
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/device/uplink/hidden/tgui_static_data(mob/user)
|
||||
var/list/data = ..()
|
||||
|
||||
data["categories"] = list()
|
||||
for(var/datum/uplink_category/category in uplink.categories)
|
||||
if(category.can_view(src))
|
||||
var/list/cat = list(
|
||||
"name" = category.name,
|
||||
"items" = (category == selected_cat ? list() : null)
|
||||
)
|
||||
for(var/datum/uplink_item/item in category.items)
|
||||
if(!item.can_view(src))
|
||||
continue
|
||||
var/cost = item.cost(uses, src) || "???"
|
||||
cat["items"] += list(list(
|
||||
"name" = item.name,
|
||||
"cost" = cost,
|
||||
"desc" = item.description(),
|
||||
"ref" = REF(item),
|
||||
))
|
||||
data["categories"] += list(cat)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/device/uplink/hidden/tgui_status(mob/user, datum/tgui_state/state)
|
||||
if(!active)
|
||||
return STATUS_CLOSE
|
||||
return ..()
|
||||
|
||||
// The purchasing code.
|
||||
/obj/item/device/uplink/hidden/Topic(href, href_list)
|
||||
/obj/item/device/uplink/hidden/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
var/mob/user = usr
|
||||
if(href_list["buy_item"])
|
||||
var/datum/uplink_item/UI = (locate(href_list["buy_item"]) in uplink.items)
|
||||
UI.buy(src, usr)
|
||||
else if(href_list["lock"])
|
||||
toggle()
|
||||
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
|
||||
ui.close()
|
||||
else if(href_list["return"])
|
||||
nanoui_menu = round(nanoui_menu/10)
|
||||
else if(href_list["menu"])
|
||||
nanoui_menu = text2num(href_list["menu"])
|
||||
if(href_list["id"])
|
||||
exploit_id = href_list["id"]
|
||||
else if(href_list["category"])
|
||||
category = locate(href_list["category"]) in uplink.categories
|
||||
|
||||
update_nano_data()
|
||||
return 1
|
||||
|
||||
/obj/item/device/uplink/hidden/proc/update_nano_data()
|
||||
if(nanoui_menu == 0)
|
||||
var/categories[0]
|
||||
for(var/datum/uplink_category/category in uplink.categories)
|
||||
if(category.can_view(src))
|
||||
categories[++categories.len] = list("name" = category.name, "ref" = "\ref[category]")
|
||||
nanoui_data["categories"] = categories
|
||||
nanoui_data["discount_name"] = discount_item ? discount_item.name : ""
|
||||
nanoui_data["discount_amount"] = (1-discount_amount)*100
|
||||
nanoui_data["offer_expiry"] = worldtime2stationtime(next_offer_time)
|
||||
|
||||
if(category)
|
||||
nanoui_data["current_category"] = category.name
|
||||
var/items[0]
|
||||
for(var/datum/uplink_item/item in category.items)
|
||||
if(item.can_view(src))
|
||||
var/cost = item.cost(uses, src)
|
||||
if(!cost) cost = "???"
|
||||
items[++items.len] = list("name" = item.name, "description" = replacetext(item.description(), "\n", "<br>"), "can_buy" = item.can_buy(src), "cost" = cost, "ref" = "\ref[item]")
|
||||
nanoui_data["items"] = items
|
||||
|
||||
else if(nanoui_menu == 2)
|
||||
var/permanentData[0]
|
||||
for(var/datum/data/record/L in sortRecord(data_core.locked))
|
||||
permanentData[++permanentData.len] = list(Name = L.fields["name"],"id" = L.fields["id"])
|
||||
nanoui_data["exploit_records"] = permanentData
|
||||
else if(nanoui_menu == 21)
|
||||
nanoui_data["exploit_exists"] = 0
|
||||
|
||||
for(var/datum/data/record/L in data_core.locked)
|
||||
if(L.fields["id"] == exploit_id)
|
||||
nanoui_data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value.
|
||||
// We trade off being able to automatically add shit for more control over what gets passed to json
|
||||
// and if it's sanitized for html.
|
||||
nanoui_data["exploit"]["nanoui_exploit_record"] = html_encode(L.fields["exploit_record"]) // Change stuff into html
|
||||
nanoui_data["exploit"]["nanoui_exploit_record"] = replacetext(nanoui_data["exploit"]["nanoui_exploit_record"], "\n", "<br>") // change line breaks into <br>
|
||||
nanoui_data["exploit"]["name"] = html_encode(L.fields["name"])
|
||||
nanoui_data["exploit"]["sex"] = html_encode(L.fields["sex"])
|
||||
nanoui_data["exploit"]["age"] = html_encode(L.fields["age"])
|
||||
nanoui_data["exploit"]["species"] = html_encode(L.fields["species"])
|
||||
nanoui_data["exploit"]["rank"] = html_encode(L.fields["rank"])
|
||||
nanoui_data["exploit"]["home_system"] = html_encode(L.fields["home_system"])
|
||||
nanoui_data["exploit"]["citizenship"] = html_encode(L.fields["citizenship"])
|
||||
nanoui_data["exploit"]["faction"] = html_encode(L.fields["faction"])
|
||||
nanoui_data["exploit"]["religion"] = html_encode(L.fields["religion"])
|
||||
nanoui_data["exploit"]["fingerprint"] = html_encode(L.fields["fingerprint"])
|
||||
if(L.fields["antagvis"] == ANTAG_KNOWN || (faction == L.fields["antagfac"] && (L.fields["antagvis"] == ANTAG_SHARED)))
|
||||
nanoui_data["exploit"]["antagfaction"] = html_encode(L.fields["antagfac"])
|
||||
else
|
||||
nanoui_data["exploit"]["antagfaction"] = html_encode("None")
|
||||
nanoui_data["exploit_exists"] = 1
|
||||
break
|
||||
|
||||
// I placed this here because of how relevant it is.
|
||||
// You place this in your uplinkable item to check if an uplink is active or not.
|
||||
// If it is, it will display the uplink menu and return 1, else it'll return false.
|
||||
// If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"
|
||||
/obj/item/proc/active_uplink_check(mob/user as mob)
|
||||
// Activates the uplink if it's active
|
||||
if(src.hidden_uplink)
|
||||
if(src.hidden_uplink.active)
|
||||
src.hidden_uplink.trigger(user)
|
||||
return 1
|
||||
return 0
|
||||
switch(action)
|
||||
if("buy")
|
||||
var/datum/uplink_item/UI = (locate(params["ref"]) in uplink.items)
|
||||
UI.buy(src, usr)
|
||||
return TRUE
|
||||
if("lock")
|
||||
toggle()
|
||||
SStgui.close_uis(src)
|
||||
if("select")
|
||||
selected_cat = params["category"]
|
||||
return TRUE
|
||||
if("compact_toggle")
|
||||
compact_mode = !compact_mode
|
||||
return TRUE
|
||||
if("view_exploits")
|
||||
exploit_id = params["id"]
|
||||
return TRUE
|
||||
|
||||
// PRESET UPLINKS
|
||||
// A collection of preset uplinks.
|
||||
//
|
||||
// Includes normal radio uplink, multitool uplink,
|
||||
// implant uplink (not the implant tool) and a preset headset uplink.
|
||||
|
||||
/obj/item/device/radio/uplink/New(atom/loc, datum/mind/target_mind, telecrystals)
|
||||
..(loc)
|
||||
hidden_uplink = new(src, target_mind, telecrystals)
|
||||
|
||||
Reference in New Issue
Block a user