Adds the Orion theme and a couple of small changes to the cargo programs (#22655)

The orion theme has arrived! This theme is intentionally not using the
orion colors, as I couldn't get them to look good and I found this theme
to feel better for the warehouse aesthetic.
Other changes include:
- It is now possible to clear the currently selected/viewed order in the
cargo control and cargo delivery programs.
- The cargo delivery program was fixed to not crash if you clicked
overview or pay before selecting an order
- It is now possible to pick a theme for the program selection screen
(see last image) for modular computers. This is currently only used for
the operations delivery tablets.
- The cargo delivery program can print invoices, if the modular computer
has a nanoprinter. One was given to the delivery tablet in the HT
locker.

<img width="800" height="800" alt="image"
src="https://github.com/user-attachments/assets/4f2de8dd-9e94-4898-9907-c97a53084771"
/>
<img width="800" height="800" alt="image"
src="https://github.com/user-attachments/assets/afc841ca-a257-4cd0-9d9d-654ba6abe8f6"
/>
<img width="800" height="800" alt="image"
src="https://github.com/user-attachments/assets/7d2e757e-79fb-4100-a373-9a378d18d6ec"
/>
<img width="1200" height="800" alt="image"
src="https://github.com/user-attachments/assets/bc2da18b-1a5c-463e-a63c-a79b10de20b0"
/>
<img width="1200" height="800" alt="image"
src="https://github.com/user-attachments/assets/441e3479-71b0-4898-a5f0-14f6441ebf97"
/>
<img width="575" height="700" alt="image"
src="https://github.com/user-attachments/assets/25e95e1a-3b1d-4a5b-bc8f-dc01ba07c107"
/>
<img width="620" height="800" alt="image"
src="https://github.com/user-attachments/assets/f68f6954-f077-40c7-b57d-d65e16b897ae"
/>
<img width="575" height="700" alt="image"
src="https://github.com/user-attachments/assets/879d97d3-e5ed-499b-9e15-5459e16ee38e"
/>
<img width="400" height="500" alt="image"
src="https://github.com/user-attachments/assets/ae7b4123-b556-438e-8d55-a826611f00bf"
/>

---------

Co-authored-by: Batrachophreno <batrochophreno@gmail.com>
This commit is contained in:
Casper3667
2026-06-18 22:02:49 +02:00
committed by GitHub
parent 1c6f0d938b
commit 45372d6f97
12 changed files with 433 additions and 81 deletions
@@ -41,7 +41,7 @@
data["PC_showbatteryicon"] = !!battery_module
data["PC_batterypercent"] = battery_module ? "[round(battery_module.battery.percent())] %" : null
data["PC_apclinkicon"] = (tesla_link?.enabled && apc_powered) ? "charging.gif" : ""
data["PC_device_theme"] = active_program ? active_program.tgui_theme : "scc"
data["PC_device_theme"] = active_program ? active_program.tgui_theme : device_theme
data["PC_ntneticon"] = get_ntnet_status_icon()
data["PC_stationtime"] = worldtime2text()
data["PC_stationdate"] = "[time2text(world.realtime, "DDD, Month DD")], [GLOB.game_year]"
@@ -79,6 +79,10 @@
var/screensaver_light_range = 0
var/screensaver_light_color
var/menu_light_color
/// Default theme if the program doesn't set it
var/device_theme = "scc"
/// Adds onto the output_message proc's range
var/message_output_range = 0
/// Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
@@ -83,6 +83,11 @@
// Cargo Delivery
/obj/item/modular_computer/handheld/preset/supply/cargo_delivery
_app_preset_type = /datum/modular_computer_app_presets/cargo_delivery
device_theme = "orion"
/obj/item/modular_computer/handheld/preset/supply/cargo_delivery/install_default_hardware()
. = ..()
nano_printer = new /obj/item/computer_hardware/nano_printer(src)
// Medical
@@ -12,10 +12,14 @@
usage_flags = PROGRAM_LAPTOP | PROGRAM_CONSOLE | PROGRAM_TELESCREEN
tgui_id = "CargoControl"
var/page = "overview_main" //overview_main - Main Menu, overview_submitted - Submitted Order Overview, overview_approved - Approved Order Overview, settings - Settings, details - order details, bounties - centcom bounties
var/status_message //A status message that can be displayed
var/list/order_details = list() //Order Details for the order
var/list/shipment_details = list() //Shipment Details for a selected shipment
//overview_main - Main Menu, overview_submitted - Submitted Order Overview, overview_approved - Approved Order Overview, settings - Settings, details - order details, bounties - centcom bounties
var/page = "overview_main"
//A status message that can be displayed
var/status_message = "Awaiting input"
//Order Details for the order
var/list/order_details = null
//Shipment Details for a selected shipment
var/list/shipment_details = list()
/datum/computer_file/program/civilian/cargocontrol/ui_data(mob/user)
var/list/data = initial_data()
@@ -33,7 +37,7 @@
data["order_submitted_number"] = submitted_orders.len
data["order_submitted_value"] = SScargo.get_orders_value_by_status("submitted",1)
data["order_submitted_suppliers"] = SScargo.get_order_suppliers_by_status("submitted",1)
data["order_submitted_shuttle_time"] = SScargo.get_pending_shipment_time("submitted")
data["order_submitted_shuttle_time"] = SScargo.get_pending_shipment_time("submitted") + SScargo.min_movetime
data["order_submitted_shuttle_price"] = SScargo.get_pending_shipment_cost("submitted")
if(page == "overview_submitted")
data["order_list"] = submitted_orders
@@ -42,7 +46,7 @@
data["order_approved_number"] = approved_orders.len
data["order_approved_value"] = SScargo.get_orders_value_by_status("approved",1)
data["order_approved_suppliers"] = SScargo.get_order_suppliers_by_status("approved",1)
data["order_approved_shuttle_time"] = SScargo.get_pending_shipment_time("approved")
data["order_approved_shuttle_time"] = SScargo.get_pending_shipment_time("approved") + SScargo.min_movetime
data["order_approved_shuttle_price"] = SScargo.get_pending_shipment_cost("approved")
if(page == "overview_approved")
data["order_list"] = approved_orders
@@ -59,8 +63,7 @@
if(page == "overview_delivered")
data["order_list"] = delivered_orders
if(length(order_details))
data["order_details"] = order_details
data["order_details"] = order_details
if(page == "overview_shipments")
data["shipment_list"] = SScargo.get_shipment_list()
@@ -109,24 +112,33 @@
//Page switch between main, submitted, approved and settings
if("page")
switch(params["page"])
//Main overview page with links to the different sub overview pages - submitted, approved, shipped
if("overview_main")
page = "overview_main" //Main overview page with links to the different sub overview pages - submitted, approved, shipped
page = "overview_main"
//Overview page listing the orders that have been submitted with options to view them, approve them and reject them
if("overview_submitted")
page = "overview_submitted" //Overview page listing the orders that have been submitted with options to view them, approve them and reject them
page = "overview_submitted"
//Overview page listing the current elevator price and time as well as orders that have been approved, with options to view the details
if("overview_approved")
page = "overview_approved" //Overview page listing the current shuttle price and time as well as orders that have been approved, with options to view the details
page = "overview_approved"
//Overview page listing the orders that have been moved to the top of the cargo elevator but not delivered
if("overview_shipped")
page = "overview_shipped" //Overview page listing the orders that have been shipped to the station but not delivered
page = "overview_shipped"
//Overview page listing the orders that have been delivered
if("overview_delivered")
page = "overview_delivered" //Overview page listing the orders that have been delivered
if("overview_shipments") //Overview of the shipments to / from the station
page = "overview_delivered"
//Overview of the shipments to / from the ship
if("overview_shipments")
page = "overview_shipments"
//Settings page that allows to tweak various settings such as the cargo handling fee
if("settings")
page = "settings" //Settings page that allows to tweak various settings such as the cargo handling fee
page = "settings"
//Page listing the currently available centcom bounties
if("bounties")
page = "bounties" //Page listing the currently available centcom bounties
page = "bounties"
//fall back to overview_main if a unknown page has been supplied
else
page = "overview_main" //fall back to overview_main if a unknown page has been supplied
page = "overview_main"
return TRUE
//Approve a order
@@ -170,7 +182,13 @@
//Clear Status Message
if("clear_message")
status_message = null
status_message = "Awaiting input"
return TRUE
//Clear selected order
if("clear_order")
order_details = null
status_message = "Selected order cleared."
return TRUE
//Change the handling fee
@@ -252,7 +270,8 @@
else
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
/datum/computer_file/program/civilian/cargocontrol/proc/post_signal(var/command) //Old code right here - Used to send a refresh command to the status screens incargo
//Old code right here - Used to send a refresh command to the status screens incargo
/datum/computer_file/program/civilian/cargocontrol/proc/post_signal(var/command)
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency)
@@ -74,7 +74,6 @@
//Check if its already delivered
if(order_details["status"] == "delivered")
status_message = "Unable to Deliver - Order has already been delivered."
return TRUE
//If a payment is not needed and we are at the status shipped, then confirm the delivery
else if(order_details["status"] == "shipped")
@@ -83,10 +82,9 @@
order_details = co.get_list()
else
status_message = "The order is not yet shipped."
return TRUE
else
status_message = "Unable to process - Network Card or Card Reader Missing"
return TRUE
return TRUE
if(action == "pay")
if(computer && computer.card_slot && computer.network_card)
@@ -144,15 +142,17 @@
playsound(computer, 'sound/machines/chime.ogg', 50, TRUE)
status_message = co.set_paid(GetNameAndAssignmentFromId(id_card), usr.character_id, destinationact)
order_details = co.get_list()
return TRUE
else
status_message = "Unable to process - Network Card or Card Reader Missing"
return TRUE
return FALSE
//But only cargo can switch between the pages
if(!istype(I) || !I.registered_name || !(ACCESS_CARGO in I.access) || issilicon(usr))
to_chat(usr, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return
if(action == "clear_order")
co = null
order_details = list()
status_message = "Selected order cleared."
page = "overview_main"
return TRUE
if(action == "page")
status_message = null //Null the previous status, so its not confusing
@@ -163,15 +163,19 @@
page = "order_overview" //Details page for a specific order - Lists the contents of the orde with the suppliers, prices and required access levels
//Fetch the order details and store it for the order. No need to fetch it again every 2 seconds
co = SScargo.get_order_by_id(text2num(params["order_overview"]))
order_details = co.get_list()
order_details = co?.get_list()
if("order_payment")
page = "order_payment"
co = SScargo.get_order_by_id(text2num(params["order_payment"]))
order_details = co.get_list()
order_details = co?.get_list()
else
page = "overview_main" //fall back to overview_main if a unknown page has been supplied
return TRUE
if(action == "accountselect")
// Only cargo can switch between the paying accounts
if(!access_check(I))
return FALSE
var/list/choices = assoc_to_keys(SSeconomy.department_accounts)
choices += "Personal"
var/dest = tgui_input_list(usr, "What account would you like to select?", "Destination Account", choices)
@@ -179,3 +183,24 @@
return FALSE
destinationact = dest
return TRUE
//Print functions
if(action == "order_print")
if(!access_check(I))
return FALSE
//Get the order
var/datum/cargo_order/co = SScargo.get_order_by_id(text2num(params["order_print"]))
if(co && computer.nano_printer)
if(!computer.nano_printer.print_text(co.get_report_invoice(),"Order Invoice #[co.order_id]"))
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
return TRUE
// Cargo access check
/datum/computer_file/program/civilian/cargodelivery/proc/access_check(var/obj/item/card/id/I)
if(!istype(I) || !I.registered_name || !(ACCESS_CARGO in I.access) || issilicon(usr))
to_chat(usr, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return FALSE
return TRUE