Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions modular_doppler/ships_r_us/code/order_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name = "Personal Shuttle Order Console"
desc = "A console giving you access to only the sleaziest of shuttle sales services."
id = "personal_shuttle_console"
build_path = /obj/item/circuitboard/computer/personal_shuttle_order
build_path = /obj/item/circuitboard/computer/personal_shuttle_order/station
category = list(
RND_CATEGORY_COMPUTER + RND_SUBCATEGORY_COMPUTER_CARGO
)
Expand Down Expand Up @@ -62,7 +62,7 @@
. = ..()
if(our_docking_port)
return
. += span_danger("This shuttle wasn't constructed close enough to a suitable shuttle dock, and will not work.")
. += span_danger("This console wasn't constructed close enough to a suitable shuttle dock, and will not work.")

/// Asks SSshuttle if our set docking port id is around and in range
/obj/machinery/computer/personal_shuttle_order/proc/try_and_find_a_dock()
Expand Down Expand Up @@ -111,32 +111,32 @@
#define PERSONAL_SHUTTLE_CONSOLE_PURCHASE_SHUTTLE "Purchase"
#define PERSONAL_SHUTTLE_CONSOLE_CLEAR_SELECTION "Clear Selection"

/obj/machinery/computer/personal_shuttle_order/ui_interact(mob/user, datum/tgui/ui)
/obj/machinery/computer/personal_shuttle_order/interact(mob/user)
. = ..()
if(!our_docking_port)
balloon_alert(user, "no linked docking port")
return
return FALSE
if(!length(shopping_list))
balloon_alert(user, "no ships available")
return
return FALSE

var/menu_option = tgui_alert(user, , "Personal Shuttle Order Console", list(PERSONAL_SHUTTLE_CONSOLE_SHOPPING_LIST, PERSONAL_SHUTTLE_CONSOLE_SELECTION_DETAILS))
if(!menu_option)
balloon_alert(user, "no selection made")
return
return FALSE

switch(menu_option)
if(PERSONAL_SHUTTLE_CONSOLE_SHOPPING_LIST)
var/new_template = tgui_input_list(user, "Choose Shuttle Template", "Personal Shuttle Order Console", shopping_list)
if(!new_template)
balloon_alert(user, "no selection made")
return
return FALSE
selected_template = shopping_list[new_template]
balloon_alert_to_viewers("new shuttle selection made")
if(PERSONAL_SHUTTLE_CONSOLE_SELECTION_DETAILS)
if(!selected_template)
balloon_alert(user, "no selected shuttle")
return
return FALSE
/// Temporarily holds what the selected template was at the time of the menu opening, to prevent accidental baits and switches
var/datum/map_template/shuttle/personal_buyable/cached_selected_template = selected_template
var/shuttle_details_option = tgui_alert( \
Expand All @@ -147,15 +147,14 @@
)
if(!shuttle_details_option)
balloon_alert(user, "no selection made")
return
return FALSE

switch(shuttle_details_option)
if(PERSONAL_SHUTTLE_CONSOLE_PURCHASE_SHUTTLE)
// Just to be safe, again
if(!cached_selected_template)
balloon_alert(user, "no selected shuttle")
return

return FALSE
try_and_buy_that_shuttle(user, cached_selected_template)
if(PERSONAL_SHUTTLE_CONSOLE_CLEAR_SELECTION)
balloon_alert(user, "selection cleared")
Expand Down
Loading