mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Fixes tram info plate (#90311)
## About The Pull Request Fixes tram info plate from being underneath the tram wall, converting it from a plaque to a sign. ## Why It's Good For The Game Fix layering issue ## Changelog 🆑 LT3 fix: Tram information plate and other signs mount correctly on tram walls /🆑
This commit is contained in:
@@ -25,83 +25,6 @@
|
||||
/obj/structure/plaque/static_plaque/golden/captain
|
||||
name = "The Most Robust Captain Award for Robustness"
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram
|
||||
/// The tram we have info about
|
||||
var/specific_transport_id = TRAMSTATION_LINE_1
|
||||
/// Weakref to the tram we have info about
|
||||
var/datum/weakref/transport_ref
|
||||
/// Serial number of the tram
|
||||
var/tram_serial
|
||||
name = "\improper tram information plate"
|
||||
icon_state = "commission_tram"
|
||||
custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT)
|
||||
layer = SIGN_LAYER
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/Initialize(mapload)
|
||||
. = ..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/LateInitialize()
|
||||
link_tram()
|
||||
set_tram_serial()
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
||||
. = ..()
|
||||
if(isnull(held_item))
|
||||
context[SCREENTIP_CONTEXT_LMB] = "View details"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/proc/link_tram()
|
||||
for(var/datum/transport_controller/linear/tram/tram as anything in SStransport.transports_by_type[TRANSPORT_TYPE_TRAM])
|
||||
if(tram.specific_transport_id == specific_transport_id)
|
||||
transport_ref = WEAKREF(tram)
|
||||
break
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/proc/set_tram_serial()
|
||||
var/datum/transport_controller/linear/tram/tram = transport_ref?.resolve()
|
||||
if(isnull(tram) || isnull(tram.tram_registration))
|
||||
return
|
||||
|
||||
tram_serial = tram.tram_registration.serial_number
|
||||
desc = "A plate showing details from the manufacturer about this Nakamura Engineering SkyyTram Mk VI, serial number [tram_serial].<br><br>We are not responsible for any injuries or fatalities caused by usage of the tram. \
|
||||
Using the tram carries inherent risks, and we cannot guarantee the safety of all passengers. By using the tram, you assume, acknowledge, and accept all the risks and responsibilities. <br><br>\
|
||||
Please be aware that riding the tram can cause a variety of injuries, including but not limited to: slips, trips, and falls; collisions with other passengers or objects; strains, sprains, and other musculoskeletal injuries; \
|
||||
cuts, bruises, and lacerations; and more severe injuries such as head trauma, spinal cord injuries, and even death. These injuries can be caused by a variety of factors, including the movements of the tram, the behaviour \
|
||||
of other passengers, and unforeseen circumstances such as foul play or mechanical issues.<br><br>\
|
||||
By entering the tram, guideway, or crossings you agree Nanotrasen is not liable for any injuries, damages, or losses that may occur. If you do not agree to these terms, please do not use the tram.<br>"
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "TramPlaque")
|
||||
ui.autoupdate = FALSE
|
||||
ui.open()
|
||||
|
||||
/obj/structure/plaque/static_plaque/tram/ui_static_data(mob/user)
|
||||
var/datum/transport_controller/linear/tram/tram = transport_ref?.resolve()
|
||||
var/list/data = list()
|
||||
var/list/current_tram = list()
|
||||
var/list/previous_trams = list()
|
||||
|
||||
current_tram += list(list(
|
||||
"serialNumber" = tram.tram_registration.serial_number,
|
||||
"mfgDate" = tram.tram_registration.mfg_date,
|
||||
"distanceTravelled" = tram.tram_registration.distance_travelled,
|
||||
"tramCollisions" = tram.tram_registration.collisions,
|
||||
))
|
||||
|
||||
for(var/datum/tram_mfg_info/previous_tram as anything in tram.tram_history)
|
||||
previous_trams += list(list(
|
||||
"serialNumber" = previous_tram.serial_number,
|
||||
"mfgDate" = previous_tram.mfg_date,
|
||||
"distanceTravelled" = previous_tram.distance_travelled,
|
||||
"tramCollisions" = previous_tram.collisions,
|
||||
))
|
||||
|
||||
data["currentTram"] = current_tram
|
||||
data["previousTrams"] = previous_trams
|
||||
return data
|
||||
|
||||
// Commission plaques, to give a little backstory to the stations. Commission dates are date of merge (or best approximation, in the case of Meta) + 540 years to convert to SS13 dates.
|
||||
// Where PRs are available, I've linked them. Where they are unavailable, a git hash is provided instead for the direct commit that added/removed the map.
|
||||
// Please enjoy this trip through SS13's history.
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/sign/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
||||
if(!iswallturf(interacting_with))
|
||||
if(!iswallturf(interacting_with) && !istype(interacting_with, /obj/structure/tram))
|
||||
return NONE
|
||||
var/turf/target_turf = interacting_with
|
||||
var/turf/user_turf = get_turf(user)
|
||||
|
||||
@@ -27,3 +27,85 @@
|
||||
desc = "85cr for a iced lactose-free caramel frappe?! Who buys that?!"
|
||||
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/xenobio_guide, 32)
|
||||
|
||||
// Tram-mounted statistics plate
|
||||
/obj/structure/sign/tram_plate
|
||||
/// The tram we have info about
|
||||
var/specific_transport_id = TRAMSTATION_LINE_1
|
||||
/// Weakref to the tram we have info about
|
||||
var/datum/weakref/transport_ref
|
||||
/// Serial number of the tram
|
||||
var/tram_serial
|
||||
name = "tram information plate"
|
||||
sign_change_name = "Information - Tram Statistics"
|
||||
icon_state = "commission_tram"
|
||||
max_integrity = 150
|
||||
armor_type = /datum/armor/tram_structure
|
||||
is_editable = FALSE
|
||||
|
||||
/obj/structure/sign/tram_plate/Initialize(mapload)
|
||||
. = ..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/sign/tram_plate/LateInitialize()
|
||||
link_tram()
|
||||
set_tram_serial()
|
||||
|
||||
/obj/structure/sign/tram_plate/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
||||
. = ..()
|
||||
if(isnull(held_item))
|
||||
context[SCREENTIP_CONTEXT_LMB] = "View details"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
/obj/structure/sign/tram_plate/proc/link_tram()
|
||||
for(var/datum/transport_controller/linear/tram/tram as anything in SStransport.transports_by_type[TRANSPORT_TYPE_TRAM])
|
||||
if(tram.specific_transport_id == specific_transport_id)
|
||||
transport_ref = WEAKREF(tram)
|
||||
break
|
||||
|
||||
/obj/structure/sign/tram_plate/proc/set_tram_serial()
|
||||
var/datum/transport_controller/linear/tram/tram = transport_ref?.resolve()
|
||||
if(isnull(tram) || isnull(tram.tram_registration))
|
||||
return
|
||||
|
||||
tram_serial = tram.tram_registration.serial_number
|
||||
desc = "A plate showing details from the manufacturer about this Nakamura Engineering SkyyTram Mk VI, serial number [tram_serial].<br><br>We are not responsible for any injuries or fatalities caused by usage of the tram. \
|
||||
Using the tram carries inherent risks, and we cannot guarantee the safety of all passengers. By using the tram, you assume, acknowledge, and accept all the risks and responsibilities. <br><br>\
|
||||
Please be aware that riding the tram can cause a variety of injuries, including but not limited to: slips, trips, and falls; collisions with other passengers or objects; strains, sprains, and other musculoskeletal injuries; \
|
||||
cuts, bruises, and lacerations; and more severe injuries such as head trauma, spinal cord injuries, and even death. These injuries can be caused by a variety of factors, including the movements of the tram, the behaviour \
|
||||
of other passengers, and unforeseen circumstances such as foul play or mechanical issues.<br><br>\
|
||||
By entering the tram, guideway, or crossings you agree Nanotrasen is not liable for any injuries, damages, or losses that may occur. If you do not agree to these terms, please do not use the tram.<br>"
|
||||
|
||||
/obj/structure/sign/tram_plate/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "TramPlaque")
|
||||
ui.autoupdate = FALSE
|
||||
ui.open()
|
||||
|
||||
/obj/structure/sign/tram_plate/ui_static_data(mob/user)
|
||||
var/datum/transport_controller/linear/tram/tram = transport_ref?.resolve()
|
||||
var/list/data = list()
|
||||
var/list/current_tram = list()
|
||||
var/list/previous_trams = list()
|
||||
|
||||
current_tram += list(list(
|
||||
"serialNumber" = tram.tram_registration.serial_number,
|
||||
"mfgDate" = tram.tram_registration.mfg_date,
|
||||
"distanceTravelled" = tram.tram_registration.distance_travelled,
|
||||
"tramCollisions" = tram.tram_registration.collisions,
|
||||
))
|
||||
|
||||
for(var/datum/tram_mfg_info/previous_tram as anything in tram.tram_history)
|
||||
previous_trams += list(list(
|
||||
"serialNumber" = previous_tram.serial_number,
|
||||
"mfgDate" = previous_tram.mfg_date,
|
||||
"distanceTravelled" = previous_tram.distance_travelled,
|
||||
"tramCollisions" = previous_tram.collisions,
|
||||
))
|
||||
|
||||
data["currentTram"] = current_tram
|
||||
data["previousTrams"] = previous_trams
|
||||
return data
|
||||
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/tram_plate, 32)
|
||||
|
||||
Reference in New Issue
Block a user