MORE VERBS! [MODULAR] (#872)

* VERBS!

* no more who

* aaaaaaa

* Delete who.dm

* Update tgstation.dme

* Update readme.md

* Update readme.md

* Update readme.md

* fixes

* Update chat-dark.scss

* sss

* Update preferences.dm

* idiot!

* Update modular_skyrat/modules/verbs/code/modules/client/preferences_toggles.dm

Co-authored-by: Azarak <azarak10@gmail.com>

* Update modular_skyrat/modules/verbs/code/modules/client/preferences_toggles.dm

Co-authored-by: Azarak <azarak10@gmail.com>

Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
Gandalf
2020-09-23 15:33:38 +02:00
committed by GitHub
co-authored by Azarak
parent ec28f27bf8
commit 9ea5ffbc6e
11 changed files with 301 additions and 1 deletions
@@ -0,0 +1 @@
#define LOG_SUBTLER (1 << 20)
@@ -0,0 +1,5 @@
//Skyrat toggles
#define CHAT_LOOC (1<<0)
#define CHAT_LOOC_ADMIN (1<<1)
#define TOGGLES_DEFAULT_SKYRAT (CHAT_LOOC|CHAT_LOOC_ADMIN)
@@ -0,0 +1,2 @@
//LOOC Module
GLOBAL_VAR_INIT(looc_allowed, TRUE)
+4
View File
@@ -14,3 +14,7 @@ MASTER CODE FILES
- /master_files/code/modules/power/lighting.dm
- /master_files/code/modules/clothing/non_anthro_clothes.dm > PLEASE USE THIS TO LOG ANY CLOTHES THAT DO NOT NEED ANTHRO VARIANTS.
- /master_files/code/modules/clothing/anthro_clothes.dm > PLEASE USE THIS TO LOG ANY CLOTHES THAT DO NEED ANTHRO VARIANTS.
MASTER GLOBAL VARS
- modular_skyrat/master_files/code/_globalvars/configuration.dm > GLOBAL_VAR_INIT(looc_allowed, TRUE)
@@ -45,6 +45,7 @@
var/toggles = TOGGLES_DEFAULT
var/db_flags
var/chat_toggles = TOGGLES_DEFAULT_CHAT
var/skyrat_toggles = TOGGLES_DEFAULT_SKYRAT
var/ghost_form = "ghost"
var/ghost_orbit = GHOST_ORBIT_CIRCLE
var/ghost_accs = GHOST_ACCS_DEFAULT_OPTION
@@ -754,7 +755,6 @@
loadout_button_class = "class='linkOff'"
else //We can buy it
loadout_button_class = "href='?_src_=prefs;task=change_loadout;item=[path]'"
dat += "<tr style='vertical-align:top; background-color: [background_cl];'>"
dat += "<td><font size=2><a [loadout_button_class]>[LI.name]</a></font></td>"
dat += "<td><font size=2>[customization_button]</font></td>"
@@ -0,0 +1,9 @@
/client/verb/listen_looc()
set name = "Show/Hide LOOC"
set category = "Preferences"
set desc = "Toggles seeing LocalOutOfCharacter chat"
usr.client.prefs.skyrat_toggles ^= CHAT_LOOC
usr.client.prefs.save_preferences()
to_chat(usr, "You will [(usr.client.prefs.skyrat_toggles & CHAT_LOOC) ? "now" : "no longer"] see messages on the LOOC channel.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing LOOC", "[usr.client.prefs.skyrat_toggles & CHAT_LOOC ? "Enabled" : "Disabled"]"))
@@ -0,0 +1,67 @@
/client/verb/looc(msg as text)
set name = "LOOC"
set desc = "Local OOC, seen only by those in view."
set category = "OOC"
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'> Speech is currently admin-disabled.</span>")
return
if(!mob)
return
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
if(!msg)
return
if(!(prefs.skyrat_toggles & CHAT_LOOC))
to_chat(src, "<span class='danger'> You have LOOC muted.</span>")
return
if(is_banned_from(mob, "OOC"))
to_chat(src, "<span class='danger'>You have been banned from OOC.</span>")
return
if(!holder)
if(!GLOB.looc_allowed)
to_chat(src, "<span class='danger'> LOOC is globally muted</span>")
return
if(prefs.muted & MUTE_OOC)
to_chat(src, "<span class='danger'> You cannot use OOC (muted).</span>")
return
if(handle_spam_prevention(msg,MUTE_OOC))
return
if(findtext(msg, "byond://"))
to_chat(src, "<B>Advertising other servers is not allowed.</B>")
log_admin("[key_name(src)] has attempted to advertise in LOOC: [msg]")
return
if(mob.stat)
to_chat(src, "<span class='danger'>You cannot use LOOC while unconscious or dead.</span>") //Skyrat change
return
if(istype(mob, /mob/dead))
to_chat(src, "<span class='danger'>You cannot use LOOC while ghosting.</span>")
return
msg = emoji_parse(msg)
mob.log_talk(msg,LOG_OOC, tag="(LOOC)")
var/list/heard = get_hearers_in_view(7, get_top_level_mob(src.mob))
for(var/mob/M in heard)
if(!M.client)
continue
var/client/C = M.client
if (C in GLOB.admins)
continue //they are handled after that
if (isobserver(M))
continue //Also handled later.
if(C.prefs.skyrat_toggles & CHAT_LOOC)
to_chat(C, "<span class='looc'><span class='prefix'>LOOC:</span> <EM>[src.mob.name]:</EM> <span class='message'>[msg]</span></span>")
for(var/client/C in GLOB.admins)
if(C.prefs.skyrat_toggles & CHAT_LOOC)
if (C.mob in heard)
to_chat(C, "<span class='looc'>[ADMIN_FLW(usr)] <span class='prefix'>LOOC:</span> <EM>[src.key]/[src.mob.name]:</EM> <span class='message'>[msg]</span></span>")
else if (!(C.prefs.skyrat_toggles & CHAT_LOOC_ADMIN))
to_chat(C, "<span class='looc'>[ADMIN_FLW(usr)] <span class='prefix'>(R)LOOC:</span> <EM>[src.key]/[src.mob.name]:</EM> <span class='message'>[msg]</span></span>")
@@ -0,0 +1,23 @@
/mob/proc/get_top_level_mob()
if(istype(src.loc,/mob)&&src.loc!=src)
var/mob/M=src.loc
return M.get_top_level_mob()
return src
/proc/get_top_level_mob(var/mob/S)
if(istype(S.loc,/mob)&&S.loc!=S)
var/mob/M=S.loc
return M.get_top_level_mob()
return S
#define ENCODE_HTML_EPHASIS(input, char, html, varname) \
var/static/regex/##varname = regex("[char]{2}(.+?)[char]{2}", "g");\
input = varname.Replace_char(input, "<[html]>$1</[html]>")
/atom/movable/proc/say_emphasis(input)
ENCODE_HTML_EPHASIS(input, "\\|", "i", italics)
ENCODE_HTML_EPHASIS(input, "\\+", "b", bold)
ENCODE_HTML_EPHASIS(input, "_", "u", underline)
return input
#undef ENCODE_HTML_EPHASIS
@@ -0,0 +1,152 @@
/datum/emote/living/subtle
key = "subtle"
key_third_person = "subtle"
message = null
mob_type_blacklist_typecache = list(/mob/living/brain)
/datum/emote/living/subtle/proc/check_invalid(mob/user, input)
/* TO DO
if(stop_bad_mime.Find(input, 1, 1))
to_chat(user, "<span class='danger'>Invalid emote.</span>")
return TRUE
*/
return FALSE
/datum/emote/living/subtle/run_emote(mob/user, params, type_override = null)
if(is_banned_from(user, "emote"))
to_chat(user, "You cannot send subtle emotes (banned).")
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
var/subtle_emote = stripped_multiline_input(user, "Choose an emote to display.", "Subtle", null, MAX_MESSAGE_LEN)
if(subtle_emote && !check_invalid(user, subtle_emote))
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
switch(type)
if("Visible")
emote_type = EMOTE_VISIBLE
if("Hearable")
emote_type = EMOTE_AUDIBLE
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = subtle_emote
else
return FALSE
else
message = params
if(type_override)
emote_type = type_override
. = TRUE
if(!can_run_emote(user))
return FALSE
user.log_message(message, LOG_EMOTE)
message = "<b>[user]</b> " + "<i>[user.say_emphasis(message)]</i>"
for(var/mob/M in GLOB.dead_mob_list)
if(!M.client || isnewplayer(M))
continue
var/T = get_turf(src)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
M.show_message(message)
if(emote_type == EMOTE_AUDIBLE)
user.audible_message(message=message,hearing_distance=1)
else
user.visible_message(message=message,self_message=message,vision_distance=1)
///////////////// SUBTLE 2: NO GHOST BOOGALOO
/datum/emote/living/subtler
key = "subtler"
key_third_person = "subtler"
message = null
mob_type_blacklist_typecache = list(/mob/living/brain)
/datum/emote/living/subtler/proc/check_invalid(mob/user, input)
/* TO DO
if(stop_bad_mime.Find(input, 1, 1))
to_chat(user, "<span class='danger'>Invalid emote.</span>")
return TRUE
*/
return FALSE
/datum/emote/living/subtler/run_emote(mob/user, params, type_override = null)
if(is_banned_from(user, "emote"))
to_chat(user, "You cannot send subtle emotes (banned).")
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
var/subtle_emote = stripped_multiline_input(user, "Choose an emote to display.", "Subtler" , null, MAX_MESSAGE_LEN)
if(subtle_emote && !check_invalid(user, subtle_emote))
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
switch(type)
if("Visible")
emote_type = EMOTE_VISIBLE
if("Hearable")
emote_type = EMOTE_AUDIBLE
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = subtle_emote
else
return FALSE
else
message = params
if(type_override)
emote_type = type_override
. = TRUE
if(!can_run_emote(user))
return FALSE
user.log_message(message, LOG_SUBTLER)
message = "<b>[user]</b> " + "<i>[user.say_emphasis(message)]</i>"
if(emote_type == EMOTE_AUDIBLE)
user.audible_message_subtler(message=message,hearing_distance=1, ignored_mobs = GLOB.dead_mob_list)
else
user.visible_message(message=message,self_message=message,vision_distance=1, ignored_mobs = GLOB.dead_mob_list)
///////////////// VERB CODE
/mob/living/proc/subtle_keybind()
var/message = input(src, "", "subtle") as text|null
if(!length(message))
return
return subtle(message)
/mob/living/verb/subtle()
set name = "Subtle"
set category = "IC"
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
usr.emote("subtle")
///////////////// VERB CODE 2
/mob/living/verb/subtler()
set name = "Subtler Anti-Ghost"
set category = "IC"
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
usr.emote("subtler")
//This is bad code.
/atom/proc/audible_message_subtler(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs, self_message, audible_message_flags = NONE)
var/list/hearers = get_hearers_in_view(hearing_distance, src)
if(self_message)
hearers -= src
hearers -= ignored_mobs
var/raw_msg = message
if(audible_message_flags & EMOTE_MESSAGE)
message = "<b>[src]</b> [message]"
for(var/mob/M in hearers)
if(audible_message_flags & EMOTE_MESSAGE && runechat_prefs_check(M, audible_message_flags) && M.can_hear())
M.create_chat_message(src, raw_message = raw_msg, runechat_flags = audible_message_flags)
M.show_message(message, MSG_AUDIBLE, deaf_message, MSG_VISUAL)
+30
View File
@@ -0,0 +1,30 @@
https://github.com/Skyrat-SS13/Skyrat-tg/pull/872
## Title: More verbs and subtler.
MODULE ID: VERBS
### Description:
Adds a few emotes and verbs for players to use, such as LOOC, subtle.
### TG Proc Changes:
- N/A
### Defines:
- #define CHAT_LOOC (1<<12)
- #define CHAT_LOOC_ADMIN (1<<13)
- #define LOG_SUBTLER (1 << 20)
### Master file additions
- D:\Documents\Github\SS13\Skyrat-tg\modular_skyrat\master_files\code\_globalvars\configuration.dm
### Included files that are not contained in this module:
- N/A
### Credits:
Gandalf2k15 - porting and refactoring
+7
View File
@@ -131,7 +131,9 @@
#include "code\__DEFINES\research\anomalies.dm"
#include "code\__DEFINES\~skyrat_defines\blueshield.dm"
#include "code\__DEFINES\~skyrat_defines\DNA.dm"
#include "code\__DEFINES\~skyrat_defines\logging.dm"
#include "code\__DEFINES\~skyrat_defines\obj_flags.dm"
#include "code\__DEFINES\~skyrat_defines\preferences.dm"
#include "code\__DEFINES\~skyrat_defines\robot_defines.dm"
#include "code\__DEFINES\~skyrat_defines\say.dm"
#include "code\__DEFINES\~skyrat_defines\signals.dm"
@@ -3234,6 +3236,7 @@
#include "interface\menu.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"
#include "modular_skyrat\master_files\code\_globalvars\configuration.dm"
#include "modular_skyrat\master_files\code\modules\clothing\anthro_clothes.dm"
#include "modular_skyrat\master_files\code\modules\clothing\non_anthro_clothes.dm"
#include "modular_skyrat\master_files\code\modules\power\lighting.dm"
@@ -3385,4 +3388,8 @@
#include "modular_skyrat\modules\modular_weapons\code\modules\projectiles\projectile\bullets\modular_projectiles.dm"
#include "modular_skyrat\modules\modular_weapons\code\modules\research\designs\autolathe_designs.dm"
#include "modular_skyrat\modules\typing_indicator\code\mob.dm"
#include "modular_skyrat\modules\verbs\code\modules\client\preferences_toggles.dm"
#include "modular_skyrat\modules\verbs\code\modules\client\verbs\looc.dm"
#include "modular_skyrat\modules\verbs\code\modules\mob\say.dm"
#include "modular_skyrat\modules\verbs\code\modules\mob\subtle.dm"
// END_INCLUDE