mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-20 09:27:01 +01:00
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request this doesnt work yet lol bring over the ticket printer from CHOMPers. now you too can slap a ticket on your friends for extreme bottom activity ## Why It's Good For The Game soul ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> 🆑 add: add ticket printing /🆑 <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> --------- Co-authored-by: silicons <2003111+silicons@users.noreply.github.com> Co-authored-by: Zandario <zandarioh@gmail.com>
57 lines
2.3 KiB
Plaintext
57 lines
2.3 KiB
Plaintext
/obj/item/ticket_printer
|
|
name = "ticket printer"
|
|
desc = "It prints security citations!"
|
|
icon = 'icons/obj/device_vr.dmi'
|
|
icon_state = "sec_ticket_printer"
|
|
slot_flags = SLOT_BELT | SLOT_HOLSTER
|
|
var/print_cooldown = 1 MINUTE
|
|
var/last_print
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
|
|
/obj/item/ticket_printer/attack_self(mob/user)
|
|
. = ..()
|
|
if(last_print + print_cooldown <= world.time)
|
|
print_a_ticket(user)
|
|
else
|
|
to_chat(user, SPAN_WARNING("\The [src] is not ready to print another ticket yet."))
|
|
|
|
/obj/item/ticket_printer/proc/print_a_ticket(mob/user)
|
|
|
|
var/ticket_name = sanitize(tgui_input_text(user, "The Name of the person you are issuing the ticket to.", "Name", max_length = 100))
|
|
if(length(ticket_name) > 100)
|
|
tgui_alert_async(user, "Entered name too long. 100 character limit.","Error")
|
|
return
|
|
if(!ticket_name)
|
|
return
|
|
var/details = sanitize(tgui_input_text(user, "What is the ticket for? Avoid entering personally identifiable information in this section. This information should not be used to harrass or otherwise make the person feel uncomfortable. (Max length: 200)", "Ticket Details", max_length = 200))
|
|
if(length(details) > 200)
|
|
tgui_alert_async(user, "Entered details too long. 200 character limit.","Error")
|
|
return
|
|
if(!details)
|
|
return
|
|
|
|
var/turf/our_turf = get_turf(user)
|
|
|
|
var/final = "<head><style>body {font-family: Verdana; background-color: #A37F97;}</style></head><center><h3>Nanotrasen Security Citation</h3><hr>This security citation has been issued to <br><big>[capitalize(ticket_name)]</big></center><b>Reason</b>:<br><i>[details]</i><hr><center><small>See your local representative at Central Command after the shift is over to resolve this issue.</small><br></center>"
|
|
|
|
var/obj/item/paper/sec_ticket/p = new /obj/item/paper/sec_ticket(our_turf)
|
|
|
|
p.info = final
|
|
p.name = "Security Citation: [ticket_name]"
|
|
playsound(user, 'sound/items/ticket_printer.ogg', 75, 1)
|
|
|
|
/obj/item/paper/sec_ticket
|
|
name = "Security Citation"
|
|
desc = "A citation issued by security for some kind of infraction!"
|
|
icon = 'icons/obj/bureaucracy.dmi'
|
|
icon_state = "sec_ticket"
|
|
|
|
/obj/item/paper/sec_ticket/Initialize(mapload, text, title)
|
|
. = ..()
|
|
icon = 'icons/obj/bureaucracy.dmi'
|
|
icon_state = "sec_ticket"
|
|
|
|
/obj/item/paper/sec_ticket/update_icon()
|
|
icon = icon
|
|
icon_state = icon_state
|