forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/AlbertNanotracen/Monkest…
…ation2.0 into develop
- Loading branch information
Showing
154 changed files
with
2,330 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// Called before an item is compressed by a bluespace compression kit: (mob/user, obj/item/compression_kit/kit) | ||
#define COMSIG_ITEM_PRE_COMPRESS "item_pre_compress" | ||
#define COMPONENT_STOP_COMPRESSION (1 << 0) | ||
#define COMPONENT_HANDLED_MESSAGE (1 << 1) | ||
/// Called after an item is compressed by a bluespace compression kit: (mob/user, obj/item/compression_kit/kit) | ||
#define COMSIG_ITEM_COMPRESSED "item_compressed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Sends a div formatted chat box announcement | ||
* | ||
* Formatted like: | ||
* | ||
* " Server Announcement " (or sender_override) | ||
* | ||
* " Title " | ||
* | ||
* " Text " | ||
* | ||
* Arguments | ||
* * text - required, the text to announce | ||
* * title - optional, the title of the announcement. | ||
* * players - optional, a list of all players to send the message to. defaults to the entire world | ||
* * play_sound - if TRUE, play a sound with the announcement (based on player option) | ||
* * sound_override - optional, override the default announcement sound | ||
* * sender_override - optional, modifies the sender of the announcement | ||
* * encode_title - if TRUE, the title will be HTML encoded | ||
* * encode_text - if TRUE, the text will be HTML encoded | ||
* * color_override - optional, set a color for the announcement box | ||
*/ | ||
|
||
/proc/send_formatted_announcement( | ||
text, | ||
title = "", | ||
players, | ||
play_sound = TRUE, | ||
sound_override = 'sound/ai/default/attention.ogg', | ||
sender_override = "Server Admin Announcement", | ||
encode_title = TRUE, | ||
encode_text = TRUE, | ||
color_override = "grey", | ||
) | ||
if(isnull(text)) | ||
return | ||
|
||
var/list/announcement_strings = list() | ||
|
||
if(encode_title && title && length(title) > 0) | ||
title = html_encode(title) | ||
if(encode_text) | ||
text = html_encode(text) | ||
if(!length(text)) | ||
return | ||
|
||
announcement_strings += span_announcement_header(generate_unique_announcement_header(title, sender_override)) | ||
announcement_strings += span_major_announcement_text(text) | ||
var/finalized_announcement = create_announcement_div(jointext(announcement_strings, ""), color_override) | ||
|
||
if(islist(players)) | ||
for(var/mob/target in players) | ||
to_chat(target, finalized_announcement) | ||
if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) | ||
SEND_SOUND(target, sound(sound_override)) | ||
else | ||
to_chat(world, finalized_announcement) | ||
|
||
if(!play_sound) | ||
return | ||
|
||
for(var/mob/player in GLOB.player_list) | ||
if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) | ||
SEND_SOUND(player, sound(sound_override)) | ||
|
||
/** | ||
* Inserts a span styled message into an alert box div | ||
* | ||
* | ||
* Arguments | ||
* * message - required, the message contents | ||
* * color - optional, set a div color other than default | ||
*/ | ||
/proc/create_announcement_div(message, color = "default") | ||
var/processed_message = "<div class='chat_alert_[color]'>[message]</div>" | ||
return processed_message |
Oops, something went wrong.