Skip to content

Commit

Permalink
distress signal admin button (#3186)
Browse files Browse the repository at this point in the history
<!-- 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

A simple button that creates a announcement on whatever ship your
hovering over!

![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/a38409fb-9530-47ba-9c77-cb28e8e75645)

![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/6230d9da-246c-41ee-8e08-7453a275c400)

![image](https://github.com/shiptest-ss13/Shiptest/assets/86381784/4317a4a6-0a6b-4550-89df-47a7248d31ca)

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

Should save admins a lot of time

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: New admin button to launch a distress announcement quicker.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: 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. -->
  • Loading branch information
FalloutFalcon authored Aug 1, 2024
1 parent 0454c26 commit 99d7e49
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/priority_announce(text, title = "", sound = 'sound/ai/attention.ogg', type, sender_override, auth_id, zlevel) //WS Edit - Make cap's announcement use logged-in name
/proc/priority_announce(text, title = "", sound = 'sound/ai/attention.ogg', type, sender_override, auth_id, zlevel)
if(!text)
return

Expand Down Expand Up @@ -73,3 +73,9 @@
to_chat(M, "<span class='minorannounce'><font color = red>[title]</font color><BR>[message]</span><BR>[from ? "<span class='alert'>-[from.name] ([from.job])</span>" : null]")
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
SEND_SOUND(M, S)

/proc/create_distress_beacon(datum/overmap/ship/ship)
if(!ship)
return
var/text = "A distress beacon has been launched by [ship.name], at local sector co-ordinates [ship.x || ship.docked_to.x]/[ship.y || ship.docked_to.y]. No further information available."
priority_announce(text, null, 'sound/effects/alert.ogg', sender_override = "Outpost Distress Beacon System", zlevel = 0)
2 changes: 2 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/cmd_admin_gib_self,
/client/proc/cmd_change_command_name,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/cmd_admin_distress_signal,
/client/proc/drop_bomb,
/client/proc/set_dynex_scale,
/client/proc/drop_dynex_bomb,
Expand Down Expand Up @@ -254,6 +255,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/client/proc/cinematic,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/cmd_admin_distress_signal,
/client/proc/cmd_change_command_name,
/client/proc/object_say,
/client/proc/toggle_random_events,
Expand Down
15 changes: 15 additions & 0 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,21 @@
message_admins("[key_name_admin(src)] has changed Central Command's name to [input]")
log_admin("[key_name(src)] has changed the Central Command name to: [input]")

/client/proc/cmd_admin_distress_signal()
set category = "Event"
set name = "Create Distress Signal"

var/datum/overmap/ship/ship = SSshuttle.get_ship(usr)
if(!ship)
return
var/confirm = alert(src, "Do you want to create a distress signal for [ship.name]", "Distress Signal", "Yes", "Cancel")

switch(confirm)
if("Yes")
create_distress_beacon(ship)
if("Cancel")
return

/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world)
set category = "Debug"
set name = "Delete"
Expand Down

0 comments on commit 99d7e49

Please sign in to comment.