From a854a7737141aef51f885f6ccf3e93a84fc7b9fd Mon Sep 17 00:00:00 2001 From: Geeves <22774890+Geevies@users.noreply.github.com> Date: Mon, 25 Aug 2025 01:40:32 +0200 Subject: [PATCH] Admin Portals (#21160) * Added a 'Create Portals' tool under the Admin tab, allowing admins to configure one- or two-way portals easily. image --- code/modules/admin/admin_verbs.dm | 53 +++++++++++++++++++- html/changelogs/geeves-odyssey_portals.yml | 58 ++++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/geeves-odyssey_portals.yml diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index c9838d40bf1..26c827ab4f9 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -105,7 +105,8 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list( /client/proc/reset_openturf, /client/proc/toggle_aooc, /client/proc/force_away_mission, - /client/proc/alooc + /client/proc/alooc, + /client/proc/create_portal )) GLOBAL_LIST_INIT(admin_verbs_ban, list( @@ -429,6 +430,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list( /proc/release, /client/proc/force_away_mission, /client/proc/profiler_start, + /client/proc/create_portal, )) GLOBAL_LIST_INIT(admin_verbs_mod, list( @@ -1406,3 +1408,52 @@ GLOBAL_LIST_INIT(admin_verbs_storyteller, list( prefix = "" if((target.mob in messagemobs) || display_remote) to_chat(target, "" + create_text_tag("ALOOC", target) + " [prefix][display_name][admin_stuff]: [msg]") + +/// Allows the admin to set up portals to and from a destination, can be used for event bugs and such +/client/proc/create_portal() + set name = "Create Portal" + set category = "Admin" + + if(!check_rights(R_ADMIN)) + return + + var/turf/creation_turf + if(tgui_alert(usr, "Please select where you would like to place the portal. When you're in position, press 'Place'.", "Place Portal", list("Place", "Cancel")) != "Place") + return + creation_turf = get_turf(src.mob) + + var/turf/destination_turf + if(tgui_alert(usr, "Please select where you would like to place the portal destination. When you're in position, press 'Place'.", "Place Destination", list("Place", "Cancel")) != "Place") + return + destination_turf = get_turf(src.mob) + + var/custom_color + var/custom_color_choice = tgui_alert(usr, "Would you like the portal to be a specific color? If not, it'll default to the normal blue color.", "Custom Color", list("Yes", "No", "Cancel")) + if(custom_color_choice in list(null, "Cancel")) + return + if(custom_color_choice == "Yes") + // purposefully doesn't return on null here, it'll just default to blue + custom_color = input(usr, "Choose the color you want your portal to be.", "Color Selection") as null|color + + var/two_way_portals + var/two_way_portals_choice = tgui_alert(usr, "Would you like this portal to be standalone, or a two-way portal? If it's a two-way, a portal will also be at the destination turf, allowing anyone to come back.", "Two Way", list("Standalone", "Two-Way", "Cancel")) + if(two_way_portals_choice in list(null, "Cancel")) + return + two_way_portals = two_way_portals_choice == "Two-Way" + + feedback_add_details("admin_verb","CrP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + var/obj/effect/portal/permanent/main_portal = new /obj/effect/portal/permanent(creation_turf, destination_turf) + main_portal.precision = 0 + main_portal.failchance = 0 + if(custom_color) + main_portal.icon_state = "portal_g" + main_portal.color = custom_color + + if(two_way_portals) + var/obj/effect/portal/permanent/destination_portal = new /obj/effect/portal/permanent(destination_turf, creation_turf) + destination_portal.precision = 0 + destination_portal.failchance = 0 + if(custom_color) + destination_portal.icon_state = "portal_g" + destination_portal.color = custom_color diff --git a/html/changelogs/geeves-odyssey_portals.yml b/html/changelogs/geeves-odyssey_portals.yml new file mode 100644 index 00000000000..139241722ba --- /dev/null +++ b/html/changelogs/geeves-odyssey_portals.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Geeves + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - admin: "Added a 'Create Portals' tool under the Admin tab, allowing admins to configure one- or two-way portals easily."