fix: better handling of whiteship signaller input (#25531)

This commit is contained in:
warriorstar-orion
2024-06-06 15:29:59 -04:00
committed by GitHub
parent ef557d7743
commit c6d0eced94
+11 -5
View File
@@ -37,6 +37,7 @@
var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST)
var/dir_choice = tgui_input_list(user, "Select the new docking area orientation.", "Dock Orientation", dir_choices)
if(!dir_choice)
to_chat(user, "<span class='notice'>Docking placement cancelled.</span>")
return
var/dest_dir = dir_choices[dir_choice]
@@ -76,17 +77,22 @@
qdel(port, force = TRUE)
return
placed_docks += port
var/dock_count = length(placed_docks)
var/basename = "Custom Dock #[dock_count]"
var/basename = "Docking Port #[length(placed_docks) + 1]"
var/name = tgui_input_text(user,
message = "Select the new docking area name.",
title = "New Dock Name",
default = basename,
max_length = 20
)
port.name = name ? name : basename
if(!name)
to_chat(user, "<span class='notice'>Docking placement cancelled.</span>")
qdel(port, force = TRUE)
return
placed_docks += port
var/dock_count = length(placed_docks)
port.name = name
port.id = "whiteship_custom_[dock_count]"
port.register()