mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 16:07:36 +01:00
Codeside Cargo Refactor (#20030)
**NOTE TO SYSADMINS: See "SQL Details" section below for information on SQL modifications.** Moves the data containing cargo items (i.e. the ones you order from ops and get in the cargo shuttle) from the online database to the codebase. Everything from suppliers to categories to individual items is now code-side and editable by developers/contributors. Refactors cargo items to use `singletons` instead of `datums` for `cargo_supplier`, `cargo_category`, and `cargo_item`. Multiple-instnace things like cargo_orders, etc. still use `datums`. Fixed a bunch of strange discrepancies in categories, suppliers, and pricing for various cargo items. I did a little bit, but it's exhausting to go through all of it right now. Clicking the 'Details' button on the Cargo Order app now actually gives you details instead of bluescreening. Also added some UI elements to the Cargo Order app - Cargo Control and Delivery remain untouched. Overhauled the Cargo Order console TGUI window. It now has tabs on the left, displays restricted access, supplier information, and boasts search functionality. ### SQL Details <details> <summary>SQL Details [Click to Expand]</summary> The following SQL tables should be deleted or deprecated from the server database, as they are no longer in use: - `ss13_cargo_items` - `ss13_cargo_categories` - `ss13_cargo_suppliers` The included migration file, `V011__codeside_cargo`, creates a new table `ss13_cargo_item_orderlog` to the DB. This **replaces** `ss13_cargo_orderlog_items`. Because of this, `ss13_cargo_orderlog_items` is deprecated and should either be deleted or locked & preserved for logging purposes. </details> ## Screenshots      --------- Signed-off-by: naut <55491249+nauticall@users.noreply.github.com> Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
ui_auto_update = FALSE
|
||||
|
||||
var/page = "main" //main - Main Menu, order - Order Page, item_details - Item Details Page, tracking - Tracking Page
|
||||
var/selected_category = "" // Category that is currently selected
|
||||
var/selected_category = null // Category that is currently selected
|
||||
var/selected_item = "" // Path of the currently selected item
|
||||
var/datum/cargo_order/co
|
||||
var/status_message //Status Message to be displayed to the user
|
||||
@@ -34,6 +34,9 @@
|
||||
data["order_value"] = co.get_value(0)
|
||||
data["order_item_count"] = co.get_item_count()
|
||||
|
||||
if(!selected_category)
|
||||
selected_category = SScargo.get_default_category()
|
||||
|
||||
//Pass Data for Main page
|
||||
if(page == "main")
|
||||
//Pass all available categories and the selected category
|
||||
@@ -98,14 +101,14 @@
|
||||
|
||||
co.set_submitted(GetNameAndAssignmentFromId(I), usr.character_id, reason)
|
||||
status_message = "Order submitted successfully. Order ID: [co.order_id] Tracking code: [co.get_tracking_code()]"
|
||||
//TODO: Print a list with the order data
|
||||
|
||||
co = null
|
||||
return TRUE
|
||||
|
||||
//Add item to the order list
|
||||
if("add_item")
|
||||
var/datum/cargo_order_item/coi = new
|
||||
var/datum/cargo_item/ci = SScargo.cargo_items[params["add_item"]]
|
||||
var/singleton/cargo_item/ci = SScargo.cargo_items[params["add_item"]]
|
||||
if(ci)
|
||||
coi.ci = ci
|
||||
coi.calculate_price()
|
||||
|
||||
Reference in New Issue
Block a user