mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Cargo interface overhaul
This commit is contained in:
+44
-44
@@ -31,7 +31,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
if(5)
|
||||
return "Science"
|
||||
if(6)
|
||||
return "Food & Livestock"
|
||||
return "Food and Livestock"
|
||||
if(7)
|
||||
return "Raw Materials"
|
||||
if(8)
|
||||
@@ -75,7 +75,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
|
||||
|
||||
/datum/supply_packs/emergency/evac
|
||||
name = "Emergency equipment"
|
||||
name = "Emergency Equipment Crate"
|
||||
contains = list(/obj/machinery/bot/floorbot,
|
||||
/obj/machinery/bot/floorbot,
|
||||
/obj/machinery/bot/medbot,
|
||||
@@ -125,7 +125,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "firefighting crate"
|
||||
|
||||
/datum/supply_packs/emergency/atmostank
|
||||
name = "Firefighting Watertank"
|
||||
name = "Firefighting Watertank Crate"
|
||||
contains = list(/obj/item/weapon/watertank/atmos)
|
||||
cost = 10
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
@@ -144,7 +144,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
access = access_hydroponics
|
||||
|
||||
/datum/supply_packs/emergency/specialops
|
||||
name = "Special Ops supplies"
|
||||
name = "Special Ops Supplies"
|
||||
contains = list(/obj/item/weapon/storage/box/emps,
|
||||
/obj/item/weapon/grenade/smokebomb,
|
||||
/obj/item/weapon/grenade/smokebomb,
|
||||
@@ -413,7 +413,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "insulated gloves crate"
|
||||
|
||||
/datum/supply_packs/engineering/power
|
||||
name = "Powercell Crate"
|
||||
name = "Power Cell Crate"
|
||||
contains = list(/obj/item/weapon/stock_parts/cell/high, //Changed to an extra high powercell because normal cells are useless
|
||||
/obj/item/weapon/stock_parts/cell/high,
|
||||
/obj/item/weapon/stock_parts/cell/high)
|
||||
@@ -524,7 +524,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/obj/item/weapon/storage/briefcase/inflatable,
|
||||
/obj/item/weapon/storage/briefcase/inflatable)
|
||||
cost = 20
|
||||
containername = "Inflatable Barrier Crate"
|
||||
containername = "inflatable barrier crate"
|
||||
|
||||
/datum/supply_packs/engineering/engine/supermatter_shard
|
||||
name = "Supermatter Shard Crate"
|
||||
@@ -543,7 +543,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
)
|
||||
cost = 25
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Thermo-Electric Generator Components"
|
||||
containername = "thermo-electric generator crate"
|
||||
access = access_ce
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -586,21 +586,21 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "first aid kits crate"
|
||||
|
||||
/datum/supply_packs/medical/firstaidadv
|
||||
name = "Advaced First Aid Kits Crate"
|
||||
name = "Advanced First Aid Kits Crate"
|
||||
contains = list(/obj/item/weapon/storage/firstaid/adv,
|
||||
/obj/item/weapon/storage/firstaid/adv,
|
||||
/obj/item/weapon/storage/firstaid/adv,
|
||||
/obj/item/weapon/storage/firstaid/adv)
|
||||
cost = 10
|
||||
containername = "advaced first aid kits crate"
|
||||
containername = "advanced first aid kits crate"
|
||||
|
||||
/datum/supply_packs/medical/firstaibrute
|
||||
name = "Brute Trauma Treatment Kits Crate"
|
||||
name = "Brute Treatment Kits Crate"
|
||||
contains = list(/obj/item/weapon/storage/firstaid/brute,
|
||||
/obj/item/weapon/storage/firstaid/brute,
|
||||
/obj/item/weapon/storage/firstaid/brute)
|
||||
cost = 10
|
||||
containername = "brute trauma treatment kit"
|
||||
containername = "brute first aid kits crate"
|
||||
|
||||
/datum/supply_packs/medical/firstaidburns
|
||||
name = "Burns Treatment Kits Crate"
|
||||
@@ -619,12 +619,12 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "toxin first aid kits crate"
|
||||
|
||||
/datum/supply_packs/medical/firstaidoxygen
|
||||
name = "Oxygen Deprivation Kits Crate"
|
||||
name = "Oxygen Treatment Kits Crate"
|
||||
contains = list(/obj/item/weapon/storage/firstaid/o2,
|
||||
/obj/item/weapon/storage/firstaid/o2,
|
||||
/obj/item/weapon/storage/firstaid/o2)
|
||||
cost = 10
|
||||
containername = "oxygen deprivation kits crate"
|
||||
containername = "oxygen first aid kits crate"
|
||||
|
||||
/datum/supply_packs/medical/virus
|
||||
name = "Virus Crate"
|
||||
@@ -657,11 +657,11 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
contains = list(/obj/machinery/iv_drip)
|
||||
cost = 30
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "iv drip crate"
|
||||
containername = "IV drip crate"
|
||||
access = access_cmo
|
||||
|
||||
/datum/supply_packs/medical/surgery
|
||||
name = "Surgery crate"
|
||||
name = "Surgery Crate"
|
||||
contains = list(/obj/item/weapon/cautery,
|
||||
/obj/item/weapon/surgicaldrill,
|
||||
/obj/item/clothing/mask/breath/medical,
|
||||
@@ -675,7 +675,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/obj/item/weapon/circular_saw)
|
||||
cost = 25
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "Surgery crate"
|
||||
containername = "surgery crate"
|
||||
access = access_medical
|
||||
|
||||
|
||||
@@ -703,7 +703,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
access = access_robotics
|
||||
|
||||
/datum/supply_packs/science/robotics/mecha_ripley
|
||||
name = "Circuit Crate (\"Ripley\" APLU)"
|
||||
name = "Circuit Crate (Ripley APLU)"
|
||||
contains = list(/obj/item/weapon/book/manual/ripley_build_and_repair,
|
||||
/obj/item/weapon/circuitboard/mecha/ripley/main, //TEMPORARY due to lack of circuitboard printer
|
||||
/obj/item/weapon/circuitboard/mecha/ripley/peripherals) //TEMPORARY due to lack of circuitboard printer
|
||||
@@ -712,7 +712,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "\improper APLU \"Ripley\" circuit crate"
|
||||
|
||||
/datum/supply_packs/science/robotics/mecha_odysseus
|
||||
name = "Circuit Crate (\"Odysseus\")"
|
||||
name = "Circuit Crate (Odysseus)"
|
||||
contains = list(/obj/item/weapon/circuitboard/mecha/odysseus/peripherals, //TEMPORARY due to lack of circuitboard printer
|
||||
/obj/item/weapon/circuitboard/mecha/odysseus/main) //TEMPORARY due to lack of circuitboard printer
|
||||
cost = 25
|
||||
@@ -740,7 +740,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
group = supply_science
|
||||
|
||||
/datum/supply_packs/science/shieldwalls
|
||||
name = "Shield Generators"
|
||||
name = "Shield Generators Crate"
|
||||
contains = list(/obj/machinery/shieldwallgen,
|
||||
/obj/machinery/shieldwallgen,
|
||||
/obj/machinery/shieldwallgen,
|
||||
@@ -752,12 +752,12 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
|
||||
|
||||
/datum/supply_packs/science/transfer_valves
|
||||
name = "Tank Transfer Valves"
|
||||
name = "Tank Transfer Valves Crate"
|
||||
contains = list(/obj/item/device/transfer_valve,
|
||||
/obj/item/device/transfer_valve)
|
||||
cost = 60
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
containername = "transfer valves crate"
|
||||
containername = "tank transfer valves crate"
|
||||
access = access_rd
|
||||
|
||||
|
||||
@@ -805,33 +805,33 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "monkey crate"
|
||||
|
||||
/datum/supply_packs/organic/farwa
|
||||
name = "Farwa crate"
|
||||
name = "Farwa Crate"
|
||||
contains = list (/obj/item/weapon/storage/box/farwacubes)
|
||||
cost = 30
|
||||
containername = "farwa crate"
|
||||
|
||||
|
||||
/datum/supply_packs/organic/wolpin
|
||||
name = "Wolpin crate"
|
||||
name = "Wolpin Crate"
|
||||
contains = list (/obj/item/weapon/storage/box/wolpincubes)
|
||||
cost = 30
|
||||
containername = "wolpin crate"
|
||||
|
||||
|
||||
/datum/supply_packs/organic/skrell
|
||||
name = "Neaera crate"
|
||||
name = "Neaera Crate"
|
||||
contains = list (/obj/item/weapon/storage/box/neaeracubes)
|
||||
cost = 30
|
||||
containername = "neaera crate"
|
||||
|
||||
/datum/supply_packs/organic/stok
|
||||
name = "Stok crate"
|
||||
name = "Stok Crate"
|
||||
contains = list (/obj/item/weapon/storage/box/stokcubes)
|
||||
cost = 30
|
||||
containername = "stok crate"
|
||||
|
||||
/datum/supply_packs/organic/party
|
||||
name = "Party equipment"
|
||||
name = "Party Equipment Crate"
|
||||
contains = list(/obj/item/weapon/storage/box/drinkingglasses,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/patron,
|
||||
@@ -923,7 +923,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "hydroponics crate"
|
||||
|
||||
/datum/supply_packs/misc/hydroponics/hydrotank
|
||||
name = "Hydroponics Watertank Backpack Crate"
|
||||
name = "Hydroponics Watertank Crate"
|
||||
contains = list(/obj/item/weapon/watertank)
|
||||
cost = 10
|
||||
containertype = /obj/structure/closet/crate/secure
|
||||
@@ -995,42 +995,42 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
|
||||
|
||||
/datum/supply_packs/materials/metal50
|
||||
name = "50 Metal Sheets"
|
||||
name = "50 Metal Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/metal)
|
||||
amount = 50
|
||||
cost = 10
|
||||
containername = "metal sheets crate"
|
||||
|
||||
/datum/supply_packs/materials/plasteel20
|
||||
name = "20 Plasteel Sheets"
|
||||
name = "20 Plasteel Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/plasteel)
|
||||
amount = 20
|
||||
cost = 30
|
||||
containername = "plasteel sheets crate"
|
||||
|
||||
/datum/supply_packs/materials/plasteel50
|
||||
name = "50 Plasteel Sheets"
|
||||
name = "50 Plasteel Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/plasteel)
|
||||
amount = 50
|
||||
cost = 50
|
||||
containername = "plasteel sheets crate"
|
||||
|
||||
/datum/supply_packs/materials/glass50
|
||||
name = "50 Glass Sheets"
|
||||
name = "50 Glass Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/glass)
|
||||
amount = 50
|
||||
cost = 10
|
||||
containername = "glass sheets crate"
|
||||
|
||||
/datum/supply_packs/materials/cardboard50
|
||||
name = "50 Cardboard Sheets"
|
||||
name = "50 Cardboard Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/cardboard)
|
||||
amount = 50
|
||||
cost = 10
|
||||
containername = "cardboard sheets crate"
|
||||
|
||||
/datum/supply_packs/materials/sandstone30
|
||||
name = "30 Sandstone Blocks"
|
||||
name = "30 Sandstone Blocks Crate"
|
||||
contains = list(/obj/item/stack/sheet/mineral/sandstone)
|
||||
amount = 30
|
||||
cost = 20
|
||||
@@ -1038,7 +1038,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
|
||||
|
||||
/datum/supply_packs/materials/plastic30
|
||||
name = "30 Plastic Sheets"
|
||||
name = "30 Plastic Sheets Crate"
|
||||
contains = list(/obj/item/stack/sheet/mineral/plastic)
|
||||
amount = 30
|
||||
cost = 25
|
||||
@@ -1057,7 +1057,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
contains = list(/obj/machinery/bot/mulebot)
|
||||
cost = 20
|
||||
containertype = /obj/structure/largecrate/mule
|
||||
containername = "\improper MULEbot Crate"
|
||||
containername = "\improper MULEbot crate"
|
||||
|
||||
/datum/supply_packs/misc/watertank
|
||||
name = "Water Tank Crate"
|
||||
@@ -1120,7 +1120,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "bureaucracy crate"
|
||||
|
||||
/datum/supply_packs/misc/toner
|
||||
name = "Toner Cartridges crate"
|
||||
name = "Toner Cartridges Crate"
|
||||
contains = list(/obj/item/device/toner,
|
||||
/obj/item/device/toner,
|
||||
/obj/item/device/toner,
|
||||
@@ -1131,7 +1131,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "toner cartridges crate"
|
||||
|
||||
/datum/supply_packs/misc/artscrafts
|
||||
name = "Arts and Crafts supplies"
|
||||
name = "Arts and Crafts Supplies Crate"
|
||||
contains = list(/obj/item/weapon/storage/fancy/crayons,
|
||||
/obj/item/device/camera,
|
||||
/obj/item/device/camera_film,
|
||||
@@ -1151,7 +1151,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/obj/item/stack/wrapping_paper,
|
||||
/obj/item/stack/wrapping_paper)
|
||||
cost = 10
|
||||
containername = "Arts and Crafts crate"
|
||||
containername = "arts and crafts crate"
|
||||
|
||||
/datum/supply_packs/misc/posters
|
||||
name = "Corporate Posters Crate"
|
||||
@@ -1161,7 +1161,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/obj/item/weapon/contraband/poster/legit,
|
||||
/obj/item/weapon/contraband/poster/legit)
|
||||
cost = 8
|
||||
containername = "Corporate Posters Crate"
|
||||
containername = "corporate posters crate"
|
||||
|
||||
///////////// Janitor Supplies
|
||||
|
||||
@@ -1200,12 +1200,12 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
access = access_janitor
|
||||
|
||||
/datum/supply_packs/misc/janitor/lightbulbs
|
||||
name = "Replacement Lights"
|
||||
name = "Replacement Lights Crate"
|
||||
contains = list(/obj/item/weapon/storage/box/lights/mixed,
|
||||
/obj/item/weapon/storage/box/lights/mixed,
|
||||
/obj/item/weapon/storage/box/lights/mixed)
|
||||
cost = 10
|
||||
containername = "replacement lights"
|
||||
containername = "replacement lights crate"
|
||||
|
||||
///////////// Costumes
|
||||
|
||||
@@ -1239,7 +1239,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "wizard costume crate"
|
||||
|
||||
/datum/supply_packs/misc/mafia
|
||||
name = "Mafia Supply crate"
|
||||
name = "Mafia Supply Crate"
|
||||
contains = list(/obj/item/clothing/suit/browntrenchcoat =1,/obj/item/clothing/suit/blacktrenchcoat =1,/obj/item/clothing/head/fedora/whitefedora =1,
|
||||
/obj/item/clothing/head/fedora/brownfedora =1,/obj/item/clothing/head/fedora =1,/obj/item/clothing/under/flappers =1,/obj/item/clothing/under/mafia =1,/obj/item/clothing/under/mafia/vest =1,/obj/item/clothing/under/mafia/white =1,
|
||||
/obj/item/clothing/under/mafia/sue =1,/obj/item/clothing/under/mafia/tan =1, /obj/item/toy/crossbow/tommygun =2)
|
||||
@@ -1268,7 +1268,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/obj/item/clothing/head/collectable/slime,
|
||||
/obj/item/clothing/head/collectable/xenom,
|
||||
/obj/item/clothing/head/collectable/petehat)
|
||||
name = "Collectable hat crate!"
|
||||
name = "Collectible Hats Crate"
|
||||
cost = 200
|
||||
containername = "collectable hats crate! Brought to you by Bass.inc!"
|
||||
|
||||
@@ -1289,7 +1289,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
contraband = 1
|
||||
|
||||
/datum/supply_packs/misc/formalwear //This is a very classy crate.
|
||||
name = "Formal-wear Crate"
|
||||
name = "Formal Wear Crate"
|
||||
contains = list(/obj/item/clothing/under/blacktango,
|
||||
/obj/item/clothing/under/assistantformal,
|
||||
/obj/item/clothing/under/assistantformal,
|
||||
|
||||
+260
-296
@@ -3,6 +3,8 @@
|
||||
#define SUPPLY_STATIONZ 1 //Z-level of the Station.
|
||||
#define SUPPLY_STATION_AREATYPE "/area/supply/station" //Type of the supply shuttle area for station
|
||||
#define SUPPLY_DOCK_AREATYPE "/area/supply/dock" //Type of the supply shuttle area for dock
|
||||
#define COMP_SCREEN_WIDTH 580 //width of supply.order computer interaction window
|
||||
#define COMP_SCREEN_HEIGHT 555 //height of supply order computer interaction window
|
||||
|
||||
var/datum/controller/supply/supply_controller = new()
|
||||
|
||||
@@ -104,22 +106,23 @@ var/list/mechtoys = list(
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_screen = "supply"
|
||||
req_access = list(access_cargo)
|
||||
circuit = "/obj/item/weapon/circuitboard/supplycomp"
|
||||
circuit = /obj/item/weapon/circuitboard/supplycomp
|
||||
var/temp = null
|
||||
var/reqtime = 0 //Cooldown for requisitions - Quarxink
|
||||
var/hacked = 0
|
||||
var/can_order_contraband = 0
|
||||
var/last_viewed_group = "categories"
|
||||
var/datum/supply_packs/content_pack
|
||||
|
||||
/obj/machinery/computer/ordercomp
|
||||
name = "Supply Ordering Console"
|
||||
desc = "Used to order supplies from cargo staff."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_screen = "request"
|
||||
circuit = "/obj/item/weapon/circuitboard/ordercomp"
|
||||
var/temp = null
|
||||
circuit = /obj/item/weapon/circuitboard/ordercomp
|
||||
var/reqtime = 0 //Cooldown for requisitions - Quarxink
|
||||
var/last_viewed_group = "categories"
|
||||
var/datum/supply_packs/content_pack
|
||||
|
||||
/*
|
||||
/obj/effect/marker/supplymarker
|
||||
@@ -261,7 +264,7 @@ var/list/mechtoys = list(
|
||||
var/datum/supply_packs/SP = SO.object
|
||||
|
||||
var/atom/A = new SP.containertype(pickedloc)
|
||||
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
|
||||
A.name = "[SP.containername]"// [SO.comment ? "([SO.comment])":"" ]"
|
||||
|
||||
//supply manifest generation begin
|
||||
|
||||
@@ -312,96 +315,102 @@ var/list/mechtoys = list(
|
||||
/obj/item/weapon/paper/manifest
|
||||
name = "Supply Manifest"
|
||||
|
||||
|
||||
/obj/machinery/computer/ordercomp/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/computer/supplycomp/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/computer/ordercomp/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = temp
|
||||
else
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
if (shuttle)
|
||||
dat += {"<BR><B>Supply shuttle</B><HR>
|
||||
Location: [shuttle.has_arrive_time() ? "Moving to station ([shuttle.eta_minutes()] Mins.)":shuttle.at_station() ? "Docked":"Away"]<BR>
|
||||
<HR>Supply points: [supply_controller.points]<BR>
|
||||
<BR>\n<A href='?src=\ref[src];order=categories'>Request items</A><BR><BR>
|
||||
<A href='?src=\ref[src];vieworders=1'>View approved orders</A><BR><BR>
|
||||
<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR><BR>
|
||||
<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
user << browse(dat, "window=computer;size=575x450")
|
||||
onclose(user, "computer")
|
||||
ui_interact(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/ordercomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
// data to send to ui
|
||||
var/data[0]
|
||||
data["last_viewed_group"] = last_viewed_group
|
||||
|
||||
var/category_list[0]
|
||||
for(var/category in all_supply_groups)
|
||||
category_list.Add(list(list("name" = get_supply_group_name(category), "category" = category)))
|
||||
data["categories"] = category_list
|
||||
|
||||
var/cat = text2num(last_viewed_group)
|
||||
var/packs_list[0]
|
||||
for(var/set_name in supply_controller.supply_packs)
|
||||
var/datum/supply_packs/pack = supply_controller.supply_packs[set_name]
|
||||
if(!pack.contraband && !pack.hidden && pack.group == cat)
|
||||
// 0/1 after the pack name (set_name) is a boolean for ordering multiple crates
|
||||
packs_list.Add(list(list("name" = pack.name, "amount" = pack.amount, "cost" = pack.cost, "command1" = list("doorder" = "[set_name]0"), "command2" = list("doorder" = "[set_name]1"), "command3" = list("contents" = set_name))))
|
||||
|
||||
data["supply_packs"] = packs_list
|
||||
if(content_pack)
|
||||
var/pack_name = sanitize(content_pack.name)
|
||||
data["contents_name"] = pack_name
|
||||
data["contents"] = content_pack.manifest
|
||||
data["contents_access"] = get_access_desc(content_pack.access)
|
||||
|
||||
var/requests_list[0]
|
||||
for(var/set_name in supply_controller.requestlist)
|
||||
var/datum/supply_order/SO = set_name
|
||||
if(SO)
|
||||
// Check if the usr owns the request, so they can cancel requests
|
||||
var/obj/item/weapon/card/id/I = usr.get_id_card()
|
||||
var/owned = 0
|
||||
if(I && SO.orderedby == I.registered_name)
|
||||
owned = 1
|
||||
requests_list.Add(list(list("ordernum" = SO.ordernum, "supply_type" = SO.object.name, "orderedby" = SO.orderedby, "owned" = owned, "command1" = list("rreq" = SO.ordernum))))
|
||||
data["requests"] = requests_list
|
||||
|
||||
var/orders_list[0]
|
||||
for(var/set_name in supply_controller.shoppinglist)
|
||||
var/datum/supply_order/SO = set_name
|
||||
if(SO)
|
||||
orders_list.Add(list(list("ordernum" = SO.ordernum, "supply_type" = SO.object.name, "orderedby" = SO.orderedby)))
|
||||
data["orders"] = orders_list
|
||||
|
||||
data["points"] = supply_controller.points
|
||||
data["send"] = list("send" = 1)
|
||||
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
data["moving"] = shuttle.has_arrive_time()
|
||||
data["at_station"] = shuttle.at_station()
|
||||
data["timeleft"] = shuttle.eta_minutes()
|
||||
if(shuttle.docking_controller)
|
||||
data["docked"] = capitalize(shuttle.docking_controller.get_docking_status())
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "order_console.tmpl", name, COMP_SCREEN_WIDTH, COMP_SCREEN_HEIGHT)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/ordercomp/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
return 1
|
||||
|
||||
if( isturf(loc) && (in_range(src, usr) || istype(usr, /mob/living/silicon)) )
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["order"])
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
last_viewed_group = "categories"
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><HR><BR><BR>"
|
||||
temp += "<b>Select a category</b><BR><BR>"
|
||||
for(var/cat in all_supply_groups )
|
||||
temp += "<A href='?src=\ref[src];order=[cat]'>[get_supply_group_name(cat)]</A><BR>"
|
||||
else
|
||||
last_viewed_group = href_list["order"]
|
||||
var/cat = text2num(last_viewed_group)
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><HR><BR><BR>"
|
||||
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
|
||||
for(var/supply_type in supply_controller.supply_packs )
|
||||
var/datum/supply_packs/N = supply_controller.supply_packs[supply_type]
|
||||
if(N.hidden || N.contraband || N.group != cat) continue
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A>" //Have to send the type instead of a reference to the obj because it would get caught by the garbage
|
||||
temp += " (<A href='?src=\ref[src];see_contents=[supply_type]'>contents</A>)"
|
||||
temp += " Cost: [N.cost]<BR>"
|
||||
|
||||
else if (href_list["see_contents"])
|
||||
//Find the correct supply_pack datum
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[href_list["see_contents"]]
|
||||
if(!istype(P)) return
|
||||
|
||||
var/cat = P.group
|
||||
var/tempaccess = get_access_desc(P.access)
|
||||
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=[cat]'>Back to [get_supply_group_name(cat)]</A><HR><BR><BR>"
|
||||
temp += "Access restriction: [tempaccess ? tempaccess : "None"]<br><br>"
|
||||
temp += "Contents of <b>[P.name]</b>:<BR>"
|
||||
temp += P.manifest
|
||||
|
||||
else if (href_list["doorder"])
|
||||
if (href_list["doorder"])
|
||||
if(world.time < reqtime)
|
||||
for(var/mob/V in hearers(src))
|
||||
V.show_message("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
|
||||
visible_message("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
//Find the correct supply_pack datum
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[href_list["doorder"]]
|
||||
if(!istype(P)) return
|
||||
|
||||
var/index = copytext(href_list["doorder"], 1, lentext(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1))
|
||||
var/multi = text2num(copytext(href_list["doorder"], -1))
|
||||
if(!isnum(multi))
|
||||
return
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[index]
|
||||
if(!istype(P))
|
||||
return
|
||||
var/crates = 1
|
||||
if(multi)
|
||||
var/num_input = input(usr, "Amount:", "How many crates?", "") as num
|
||||
crates = Clamp(round(text2num(num_input)), 1, 20)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
if(world.time > timeout || !reason || ..())
|
||||
return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
if(ishuman(usr))
|
||||
@@ -413,13 +422,14 @@ var/list/mechtoys = list(
|
||||
|
||||
supply_controller.ordernum++
|
||||
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(loc)
|
||||
reqform.name = "Requisition Form - [P.name]"
|
||||
reqform.name = "Requisition Form - [crates] '[P.name]' for [idname]"
|
||||
reqform.info += "<h3>[station_name] Supply Requisition Form</h3><hr>"
|
||||
reqform.info += "INDEX: #[supply_controller.ordernum]<br>"
|
||||
reqform.info += "REQUESTED BY: [idname]<br>"
|
||||
reqform.info += "RANK: [idrank]<br>"
|
||||
reqform.info += "REASON: [reason]<br>"
|
||||
reqform.info += "SUPPLY CRATE TYPE: [P.name]<br>"
|
||||
reqform.info += "NUMBER OF CRATES: [crates]<br>"
|
||||
reqform.info += "ACCESS RESTRICTION: [replacetext(get_access_desc(P.access))]<br>"
|
||||
reqform.info += "CONTENTS:<br>"
|
||||
reqform.info += P.manifest
|
||||
@@ -429,130 +439,154 @@ var/list/mechtoys = list(
|
||||
reqform.update_icon() //Fix for appearing blank when printed.
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
|
||||
//make our supply_order datum
|
||||
var/datum/supply_order/O = new /datum/supply_order()
|
||||
O.ordernum = supply_controller.ordernum
|
||||
O.object = P
|
||||
O.orderedby = idname
|
||||
supply_controller.requestlist += O
|
||||
//make our supply_order datums
|
||||
for(var/i = 1; i <= crates; i++)
|
||||
supply_controller.ordernum++
|
||||
var/datum/supply_order/O = new /datum/supply_order()
|
||||
O.ordernum = supply_controller.ordernum
|
||||
O.object = P
|
||||
O.orderedby = idname
|
||||
O.comment = reason
|
||||
supply_controller.requestlist += O
|
||||
|
||||
temp = "Thanks for your request. The cargo team will process it as soon as possible.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
else if (href_list["rreq"])
|
||||
var/ordernum = text2num(href_list["rreq"])
|
||||
var/obj/item/weapon/card/id/I = usr.get_id_card()
|
||||
for(var/i=1, i<=supply_controller.requestlist.len, i++)
|
||||
var/datum/supply_order/SO = supply_controller.requestlist[i]
|
||||
if(SO.ordernum == ordernum && (I && SO.orderedby == I.registered_name))
|
||||
supply_controller.requestlist.Cut(i,i+1)
|
||||
break
|
||||
|
||||
else if (href_list["vieworders"])
|
||||
temp = "Current approved orders: <BR><BR>"
|
||||
for(var/S in supply_controller.shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
temp += "[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
|
||||
else if (href_list["viewrequests"])
|
||||
temp = "Current requests: <BR><BR>"
|
||||
for(var/S in supply_controller.requestlist)
|
||||
var/datum/supply_order/SO = S
|
||||
temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
temp = null
|
||||
else if (href_list["last_viewed_group"])
|
||||
content_pack = null
|
||||
last_viewed_group = text2num(href_list["last_viewed_group"])
|
||||
|
||||
else if (href_list["contents"])
|
||||
var/topic = href_list["contents"]
|
||||
if(topic == 1)
|
||||
content_pack = null
|
||||
else
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[topic]
|
||||
content_pack = P
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/supplycomp/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/supplycomp/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied."
|
||||
if(!allowed(user) && !isobserver(user))
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
post_signal("supply")
|
||||
var/dat
|
||||
if (temp)
|
||||
dat = temp
|
||||
else
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
if (shuttle)
|
||||
dat += "<BR><B>Supply shuttle</B><HR>"
|
||||
dat += "\nLocation: "
|
||||
if (shuttle.has_arrive_time())
|
||||
dat += "In transit ([shuttle.eta_minutes()] Mins.)<BR>"
|
||||
else
|
||||
if (shuttle.at_station())
|
||||
if (shuttle.docking_controller)
|
||||
switch(shuttle.docking_controller.get_docking_status())
|
||||
if ("docked") dat += "Docked at station<BR>"
|
||||
if ("undocked") dat += "Undocked from station<BR>"
|
||||
if ("docking") dat += "Docking with station [shuttle.can_force()? "<span class='warning'><A href='?src=\ref[src];force_send=1'>Force Launch</A></span>" : ""]<BR>"
|
||||
if ("undocking") dat += "Undocking from station [shuttle.can_force()? "<span class='warning'><A href='?src=\ref[src];force_send=1'>Force Launch</A></span>" : ""]<BR>"
|
||||
else
|
||||
dat += "Station<BR>"
|
||||
|
||||
if (shuttle.can_launch())
|
||||
dat += "<A href='?src=\ref[src];send=1'>Send away</A>"
|
||||
else if (shuttle.can_cancel())
|
||||
dat += "<A href='?src=\ref[src];cancel_send=1'>Cancel launch</A>"
|
||||
else
|
||||
dat += "*Shuttle is busy*"
|
||||
dat += "<BR>\n<BR>"
|
||||
else
|
||||
dat += "Away<BR>"
|
||||
if (shuttle.can_launch())
|
||||
dat += "<A href='?src=\ref[src];send=1'>Request supply shuttle</A>"
|
||||
else if (shuttle.can_cancel())
|
||||
dat += "<A href='?src=\ref[src];cancel_send=1'>Cancel request</A>"
|
||||
else
|
||||
dat += "*Shuttle is busy*"
|
||||
dat += "<BR>\n<BR>"
|
||||
|
||||
|
||||
dat += {"<HR>\nSupply points: [supply_controller.points]<BR>\n<BR>
|
||||
\n<A href='?src=\ref[src];order=categories'>Order items</A><BR>\n<BR>
|
||||
\n<A href='?src=\ref[src];viewrequests=1'>View requests</A><BR>\n<BR>
|
||||
\n<A href='?src=\ref[src];vieworders=1'>View orders</A><BR>\n<BR>
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
|
||||
user << browse(dat, "window=computer;size=575x450")
|
||||
onclose(user, "computer")
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/supplycomp/attackby(I as obj, user as mob, params)
|
||||
if(istype(I,/obj/item/weapon/card/emag) && !hacked)
|
||||
user << "\blue Special supplies unlocked."
|
||||
/obj/machinery/computer/supplycomp/emag_act(user as mob)
|
||||
if(!hacked)
|
||||
user << "<span class='notice'>Special supplies unlocked.</span>"
|
||||
hacked = 1
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/supplycomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
// data to send to ui
|
||||
var/data[0]
|
||||
data["last_viewed_group"] = last_viewed_group
|
||||
|
||||
var/category_list[0]
|
||||
for(var/category in all_supply_groups)
|
||||
category_list.Add(list(list("name" = get_supply_group_name(category), "category" = category)))
|
||||
data["categories"] = category_list
|
||||
|
||||
var/cat = text2num(last_viewed_group)
|
||||
var/packs_list[0]
|
||||
for(var/set_name in supply_controller.supply_packs)
|
||||
var/datum/supply_packs/pack = supply_controller.supply_packs[set_name]
|
||||
if((pack.hidden && src.hacked) || (pack.contraband && src.can_order_contraband) || (!pack.contraband && !pack.hidden))
|
||||
if(pack.group == cat)
|
||||
// 0/1 after the pack name (set_name) is a boolean for ordering multiple crates
|
||||
packs_list.Add(list(list("name" = pack.name, "amount" = pack.amount, "cost" = pack.cost, "command1" = list("doorder" = "[set_name]0"), "command2" = list("doorder" = "[set_name]1"), "command3" = list("contents" = set_name))))
|
||||
|
||||
data["supply_packs"] = packs_list
|
||||
if(content_pack)
|
||||
var/pack_name = sanitize(content_pack.name)
|
||||
data["contents_name"] = pack_name
|
||||
data["contents"] = content_pack.manifest
|
||||
data["contents_access"] = get_access_desc(content_pack.access)
|
||||
|
||||
var/requests_list[0]
|
||||
for(var/set_name in supply_controller.requestlist)
|
||||
var/datum/supply_order/SO = set_name
|
||||
if(SO)
|
||||
if(!SO.comment)
|
||||
SO.comment = "No comment."
|
||||
requests_list.Add(list(list("ordernum" = SO.ordernum, "supply_type" = SO.object.name, "orderedby" = SO.orderedby, "comment" = SO.comment, "command1" = list("confirmorder" = SO.ordernum), "command2" = list("rreq" = SO.ordernum))))
|
||||
data["requests"] = requests_list
|
||||
|
||||
var/orders_list[0]
|
||||
for(var/set_name in supply_controller.shoppinglist)
|
||||
var/datum/supply_order/SO = set_name
|
||||
if(SO)
|
||||
orders_list.Add(list(list("ordernum" = SO.ordernum, "supply_type" = SO.object.name, "orderedby" = SO.orderedby, "comment" = SO.comment)))
|
||||
data["orders"] = orders_list
|
||||
|
||||
data["points"] = supply_controller.points
|
||||
data["send"] = list("send" = 1)
|
||||
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
data["moving"] = shuttle.has_arrive_time()
|
||||
data["at_station"] = shuttle.at_station()
|
||||
data["timeleft"] = shuttle.eta_minutes()
|
||||
data["can_launch"] = shuttle.can_launch()
|
||||
data["can_force"] = shuttle.can_force()
|
||||
data["can_cancel"] = shuttle.can_cancel()
|
||||
if(shuttle.docking_controller)
|
||||
data["docked"] = capitalize(shuttle.docking_controller.get_docking_status())
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "supply_console.tmpl", name, COMP_SCREEN_WIDTH, COMP_SCREEN_HEIGHT)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/supplycomp/proc/is_authorized(user)
|
||||
if(allowed(user))
|
||||
return 1
|
||||
|
||||
if(isobserver(user) && check_rights(R_ADMIN, 0))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/supplycomp/Topic(href, href_list)
|
||||
if(!supply_controller)
|
||||
log_to_dd("## ERROR: Eek. The supply_controller controller datum is missing somehow.")
|
||||
return
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
if (!shuttle)
|
||||
log_to_dd("## ERROR: Eek. The supply/shuttle datum is missing somehow.")
|
||||
return
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(isturf(loc) && ( in_range(src, usr) || istype(usr, /mob/living/silicon) ) )
|
||||
usr.set_machine(src)
|
||||
|
||||
//Calling the shuttle
|
||||
return 1
|
||||
|
||||
if(!is_authorized(usr))
|
||||
return 1
|
||||
|
||||
if(!supply_controller)
|
||||
log_to_dd("## ERROR: The supply_controller controller datum is missing somehow.")
|
||||
return 1
|
||||
|
||||
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
|
||||
if(!shuttle)
|
||||
log_to_dd("## ERROR: The supply or shuttle datum is missing somehow.")
|
||||
return 1
|
||||
|
||||
if(href_list["send"])
|
||||
if(shuttle.at_station())
|
||||
if (shuttle.forbidden_atoms_check())
|
||||
temp = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
usr = "<span class='warning'>For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.</span>"
|
||||
else
|
||||
shuttle.launch(src)
|
||||
temp = "Initiating launch sequence. \[<span class='warning'><A href='?src=\ref[src];force_send=1'>Force Launch</A></span>\]<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
else
|
||||
shuttle.launch(src)
|
||||
temp = "The supply shuttle has been called and will arrive in approximately [round(supply_controller.movetime/600,1)] minutes.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
post_signal("supply")
|
||||
|
||||
if (href_list["force_send"])
|
||||
@@ -561,70 +595,34 @@ var/list/mechtoys = list(
|
||||
if (href_list["cancel_send"])
|
||||
shuttle.cancel_launch(src)
|
||||
|
||||
else if (href_list["order"])
|
||||
//if(!shuttle.idle()) return //this shouldn't be necessary it seems
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
last_viewed_group = "categories"
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];mainmenu=1'>Main Menu</A><HR><BR><BR>"
|
||||
temp += "<b>Select a category</b><BR><BR>"
|
||||
for(var/cat in all_supply_groups )
|
||||
temp += "<A href='?src=\ref[src];order=[cat]'>[get_supply_group_name(cat)]</A><BR>"
|
||||
else
|
||||
last_viewed_group = href_list["order"]
|
||||
var/cat = text2num(last_viewed_group)
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=categories'>Back to all categories</A><HR><BR><BR>"
|
||||
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
|
||||
for(var/supply_type in supply_controller.supply_packs )
|
||||
var/datum/supply_packs/N = supply_controller.supply_packs[supply_type]
|
||||
if((N.hidden && !hacked) || (N.contraband && !can_order_contraband) || N.group != cat) continue
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A>" //Have to send the type instead of a reference to the obj because it would get caught by the garbage
|
||||
temp += " (<A href='?src=\ref[src];see_contents=[supply_type]'>contents</A>)"
|
||||
temp += " Cost: [N.cost]<BR>"
|
||||
|
||||
/*temp = "Supply points: [supply_controller.points]<BR><HR><BR>Request what?<BR><BR>"
|
||||
|
||||
for(var/supply_name in supply_controller.supply_packs )
|
||||
var/datum/supply_packs/N = supply_controller.supply_packs[supply_name]
|
||||
if(N.hidden && !hacked) continue
|
||||
if(N.contraband && !can_order_contraband) continue
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_name]'>[supply_name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"*/
|
||||
|
||||
else if (href_list["see_contents"])
|
||||
//Find the correct supply_pack datum
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[href_list["see_contents"]]
|
||||
if(!istype(P)) return
|
||||
|
||||
var/cat = P.group
|
||||
var/tempaccess = get_access_desc(P.access)
|
||||
|
||||
temp = "<b>Supply points: [supply_controller.points]</b><BR>"
|
||||
temp += "<A href='?src=\ref[src];order=[cat]'>Back to [get_supply_group_name(cat)]</A><HR><BR><BR>"
|
||||
temp += "Access restriction: [tempaccess ? tempaccess : "None"]<br><br>"
|
||||
temp += "Contents of <b>[P.name]</b>:<BR>"
|
||||
temp += P.manifest
|
||||
|
||||
else if (href_list["doorder"])
|
||||
if(world.time < reqtime)
|
||||
for(var/mob/V in hearers(src))
|
||||
V.show_message("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
|
||||
visible_message("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
//Find the correct supply_pack datum
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[href_list["doorder"]]
|
||||
if(!istype(P)) return
|
||||
|
||||
var/index = copytext(href_list["doorder"], 1, lentext(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1))
|
||||
var/multi = text2num(copytext(href_list["doorder"], -1))
|
||||
if(!isnum(multi))
|
||||
return
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[index]
|
||||
if(!istype(P))
|
||||
return
|
||||
var/crates = 1
|
||||
if(multi)
|
||||
var/num_input = input(usr, "Amount:", "How many crates?", "") as num
|
||||
crates = Clamp(round(text2num(num_input)), 1, 20)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
if(world.time > timeout || !reason || ..())
|
||||
return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
idname = H.get_authentification_name()
|
||||
@@ -634,13 +632,14 @@ var/list/mechtoys = list(
|
||||
|
||||
supply_controller.ordernum++
|
||||
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(loc)
|
||||
reqform.name = "Requisition Form - [P.name]"
|
||||
reqform.name = "Requisition Form - [crates] '[P.name]' for [idname]"
|
||||
reqform.info += "<h3>[station_name] Supply Requisition Form</h3><hr>"
|
||||
reqform.info += "INDEX: #[supply_controller.ordernum]<br>"
|
||||
reqform.info += "REQUESTED BY: [idname]<br>"
|
||||
reqform.info += "RANK: [idrank]<br>"
|
||||
reqform.info += "REASON: [reason]<br>"
|
||||
reqform.info += "SUPPLY CRATE TYPE: [P.name]<br>"
|
||||
reqform.info += "NUMBER OF CRATES: [crates]<br>"
|
||||
reqform.info += "ACCESS RESTRICTION: [replacetext(get_access_desc(P.access))]<br>"
|
||||
reqform.info += "CONTENTS:<br>"
|
||||
reqform.info += P.manifest
|
||||
@@ -651,21 +650,20 @@ var/list/mechtoys = list(
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
|
||||
//make our supply_order datum
|
||||
var/datum/supply_order/O = new /datum/supply_order()
|
||||
O.ordernum = supply_controller.ordernum
|
||||
O.object = P
|
||||
O.orderedby = idname
|
||||
supply_controller.requestlist += O
|
||||
|
||||
temp = "Order request placed.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];order=[last_viewed_group]'>Back</A> | <A href='?src=\ref[src];mainmenu=1'>Main Menu</A> | <A href='?src=\ref[src];confirmorder=[O.ordernum]'>Authorize Order</A>"
|
||||
|
||||
for(var/i = 1; i <= crates; i++)
|
||||
supply_controller.ordernum++
|
||||
var/datum/supply_order/O = new /datum/supply_order()
|
||||
O.ordernum = supply_controller.ordernum
|
||||
O.object = P
|
||||
O.orderedby = idname
|
||||
O.comment = reason
|
||||
supply_controller.requestlist += O
|
||||
|
||||
else if(href_list["confirmorder"])
|
||||
//Find the correct supply_order datum
|
||||
var/ordernum = text2num(href_list["confirmorder"])
|
||||
var/datum/supply_order/O
|
||||
var/datum/supply_packs/P
|
||||
temp = "Invalid Request"
|
||||
for(var/i=1, i<=supply_controller.requestlist.len, i++)
|
||||
var/datum/supply_order/SO = supply_controller.requestlist[i]
|
||||
if(SO.ordernum == ordernum)
|
||||
@@ -675,64 +673,34 @@ var/list/mechtoys = list(
|
||||
supply_controller.requestlist.Cut(i,i+1)
|
||||
supply_controller.points -= P.cost
|
||||
supply_controller.shoppinglist += O
|
||||
temp = "Thanks for your order.<BR>"
|
||||
else
|
||||
temp = "Not enough supply points.<BR>"
|
||||
usr << "<span class='warning'>There are insufficient supply points for this request.</span>"
|
||||
break
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
|
||||
else if (href_list["vieworders"])
|
||||
temp = "Current approved orders: <BR><BR>"
|
||||
for(var/S in supply_controller.shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]<BR>"// <A href='?src=\ref[src];cancelorder=[S]'>(Cancel)</A><BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
/*
|
||||
else if (href_list["cancelorder"])
|
||||
var/datum/supply_order/remove_supply = href_list["cancelorder"]
|
||||
supply_shuttle_shoppinglist -= remove_supply
|
||||
supply_shuttle_points += remove_supply.object.cost
|
||||
temp += "Canceled: [remove_supply.object.name]<BR><BR><BR>"
|
||||
|
||||
for(var/S in supply_shuttle_shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] <A href='?src=\ref[src];cancelorder=[S]'>(Cancel)</A><BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
*/
|
||||
else if (href_list["viewrequests"])
|
||||
temp = "Current requests: <BR><BR>"
|
||||
for(var/S in supply_controller.requestlist)
|
||||
var/datum/supply_order/SO = S
|
||||
temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] <A href='?src=\ref[src];confirmorder=[SO.ordernum]'>Approve</A> <A href='?src=\ref[src];rreq=[SO.ordernum]'>Remove</A><BR>"
|
||||
|
||||
temp += "<BR><A href='?src=\ref[src];clearreq=1'>Clear list</A>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
|
||||
|
||||
else if (href_list["rreq"])
|
||||
var/ordernum = text2num(href_list["rreq"])
|
||||
temp = "Invalid Request.<BR>"
|
||||
for(var/i=1, i<=supply_controller.requestlist.len, i++)
|
||||
var/datum/supply_order/SO = supply_controller.requestlist[i]
|
||||
if(SO.ordernum == ordernum)
|
||||
supply_controller.requestlist.Cut(i,i+1)
|
||||
temp = "Request removed.<BR>"
|
||||
break
|
||||
temp += "<BR><A href='?src=\ref[src];viewrequests=1'>Back</A> <A href='?src=\ref[src];mainmenu=1'>Main Menu</A>"
|
||||
|
||||
else if (href_list["clearreq"])
|
||||
supply_controller.requestlist.Cut()
|
||||
temp = "List cleared.<BR>"
|
||||
temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
temp = null
|
||||
else if (href_list["last_viewed_group"])
|
||||
content_pack = null
|
||||
last_viewed_group = text2num(href_list["last_viewed_group"])
|
||||
|
||||
else if (href_list["contents"])
|
||||
var/topic = href_list["contents"]
|
||||
if(topic == 1)
|
||||
content_pack = null
|
||||
else
|
||||
var/datum/supply_packs/P = supply_controller.supply_packs[topic]
|
||||
content_pack = P
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/computer/supplycomp/proc/post_signal(var/command)
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
@@ -743,7 +711,3 @@ var/list/mechtoys = list(
|
||||
status_signal.data["command"] = command
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -261,3 +261,11 @@
|
||||
qdel(W)
|
||||
return equipped
|
||||
|
||||
/mob/proc/get_all_slots()
|
||||
return list(wear_mask, back, l_hand, r_hand)
|
||||
|
||||
/mob/proc/get_id_card()
|
||||
for(var/obj/item/I in src.get_all_slots())
|
||||
. = I.GetID()
|
||||
if(.)
|
||||
break
|
||||
@@ -248,11 +248,12 @@
|
||||
syllables = list("02011","01222","10100","10210","21012","02011","21200","1002","2001","0002","0012","0012","000","120","121","201","220","10","11","0")
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
var/new_name
|
||||
if(prob(70))
|
||||
name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
new_name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
else
|
||||
name = pick(ai_names)
|
||||
return name
|
||||
new_name = pick(ai_names)
|
||||
return new_name
|
||||
|
||||
/datum/language/kidan
|
||||
name = "Chittin"
|
||||
|
||||
@@ -683,4 +683,12 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
if(buckled) return initial(pixel_y)
|
||||
return -6
|
||||
else
|
||||
return initial(pixel_y)
|
||||
return initial(pixel_y)
|
||||
|
||||
/mob/living/carbon/get_all_slots()
|
||||
return list(l_hand,
|
||||
r_hand,
|
||||
handcuffed,
|
||||
legcuffed,
|
||||
back,
|
||||
wear_mask)
|
||||
@@ -884,3 +884,33 @@ It can still be worn/put on as normal.
|
||||
if(slot_s_store)
|
||||
return s_store
|
||||
return null
|
||||
|
||||
/mob/living/carbon/human/get_all_slots()
|
||||
. = get_head_slots() | get_body_slots()
|
||||
|
||||
/mob/living/carbon/human/proc/get_body_slots()
|
||||
return list(
|
||||
l_hand,
|
||||
r_hand,
|
||||
back,
|
||||
s_store,
|
||||
handcuffed,
|
||||
legcuffed,
|
||||
wear_suit,
|
||||
gloves,
|
||||
shoes,
|
||||
belt,
|
||||
wear_id,
|
||||
l_store,
|
||||
r_store,
|
||||
w_uniform
|
||||
)
|
||||
|
||||
/mob/living/carbon/human/proc/get_head_slots()
|
||||
return list(
|
||||
head,
|
||||
wear_mask,
|
||||
glasses,
|
||||
r_ear,
|
||||
l_ear,
|
||||
)
|
||||
@@ -5,7 +5,8 @@
|
||||
/mob/living/silicon/robot/get_active_hand()
|
||||
return module_active
|
||||
|
||||
|
||||
/mob/living/silicon/robot/get_all_slots()
|
||||
return list(module_state_1, module_state_2, module_state_3)
|
||||
|
||||
/*-------TODOOOOOOOOOO--------*/
|
||||
/mob/living/silicon/robot/proc/uneq_module(obj/item/O)
|
||||
|
||||
Reference in New Issue
Block a user