Skip to content

Commit

Permalink
Merge pull request #5007 from Superlagg/oh-so-this-is-why-AIM-died
Browse files Browse the repository at this point in the history
Fixes DMs AGAIN
  • Loading branch information
Superlagg authored Apr 21, 2024
2 parents fa86d72 + 33a90f2 commit 0700578
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 35 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#define span_holoparasite(str) ("<span class='holoparasite'>" + str + "</span>")
#define span_hypnophrase(str) ("<span class='hypnophrase'>" + str + "</span>")
#define span_private(str) ("<span class='private'>" + str + "</span>")
#define span_private_sent(str) ("<span class='privateSent'>" + str + "</span>")
#define span_urgent(str) ("<span class='urgent'>" + str + "</span>")
#define span_softlove(str) ("<span class='softlove'>" + str + "</span>")
#define span_glitch(str) ("<span class='glitch'>" + str + "</span>")
Expand Down
41 changes: 25 additions & 16 deletions code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ SUBSYSTEM_DEF(chat)
to_chat(sender, span_warning("Module failed to load."))
return
var/theirname = name_or_shark(reciever) || "some jerk" // stop. naming. your. ckeys. after. your characcteres!!!!!!!!!!!!!!!!!!
if(check_rights(R_ADMIN, FALSE))
theirname = "[theirname] - [extract_ckey(reciever)]" // we're an admin, we can see their name
var/mesage = input(
sender,
"Enter your message to [theirname]. This will send a direct message to them, which they can reply to! Be sure to respect their OOC preferences, don't be a creep (unless they like it), and <i>have fun!</i>",
Expand All @@ -303,17 +305,22 @@ SUBSYSTEM_DEF(chat)
) as message|null
if(!mesage)
return
var/myname = name_or_shark(sender) || "some jerk"
var/myname = name_or_shark(sender) || "Anonymouse"
if(check_rights(R_ADMIN, FALSE))
myname = "[myname] - [extract_ckey(sender)]" // we're an admin, we can see their name

var/payload2them = "<u><b>From [dm_linkify(reciever, sender, myname)]</u></b>: [mesage]<br>"
payload2them = span_private(payload2them)
to_chat(reciever, span_private("<br><U>You have a new message from [name_or_shark(sender) || "Some jerk"]!</U>"))
to_chat(reciever, payload2them)
reciever.playsound_local(reciever, 'sound/effects/direct_message_recieved.ogg', 75, FALSE)

var/payload2me = "<u><b>To [dm_linkify(sender, reciever, theirname)]</u></b>: [mesage]<br>"
payload2me = span_private(payload2me)
to_chat(sender, span_private("<br><U>Your message to [theirname] has been sent!</U>"))
payload2me = span_private_sent(payload2me)
to_chat(sender, span_private_sent("<br><U>Your message to [theirname] has been sent!</U>"))
to_chat(sender, payload2me)
sender.playsound_local(sender, 'sound/effects/direct_message_setn.ogg', 75, FALSE)
reciever.playsound_local(reciever, 'sound/effects/direct_message_recieved.ogg', 75, FALSE)

log_ooc("[sender.real_name] ([sender.ckey]) -> [reciever.real_name] ([reciever.ckey]): [mesage]")
message_admins("[ADMIN_TPMONTY(sender)] -DM-> [ADMIN_TPMONTY(reciever)]: [mesage]", ADMIN_CHAT_FILTER_DMS)

Expand All @@ -327,7 +334,7 @@ SUBSYSTEM_DEF(chat)
reciever = extract_mob(reciever)
if(!reciever || !reciever.client)
return
var/theirname = optional_name || name_or_shark(reciever) || "some jerk" // stop. naming. your. ckeys. after. your characcteres!!!!!!!!!!!!!!!!!!
var/theirname = optional_name || name_or_shark(reciever) || "Anonymouse" // stop. naming. your. ckeys. after. your characcteres!!!!!!!!!!!!!!!!!!
return "<a href='?src=[REF(src)];DM=1;sender_quid=[extract_quid(sender)];reciever_quid=[extract_quid(reciever)]'>[theirname]</a>"

/datum/controller/subsystem/chat/Topic(href, list/href_list)
Expand All @@ -342,19 +349,21 @@ SUBSYSTEM_DEF(chat)
if(!istype(they))
return "Nobody"
if(check_rights(R_ADMIN, FALSE))
return they.real_name // we're an admin, we can see their name
if(isnewplayer(they))
return they.client.prefs.my_shark
return they.name || they.real_name
if(ckey(they.real_name) == ckey(they.ckey) || ckey(they.name) == ckey(they.ckey))
if(strings("data/super_special_ultra_instinct.json", "[ckey(they.name)]", TRUE, TRUE))
return they.name
if(strings("data/super_special_ultra_instinct.json", "[ckey(they.real_name)]", TRUE, TRUE))
return they.real_name
if(they.client)
return they.client.prefs.my_shark
else
return "Some jerk"
return they.name
var/test_name = they.client.prefs.real_name
if(ckey(test_name) == ckey(they.ckey))
if(strings("data/super_special_ultra_instinct.json", "[ckey(test_name)]", TRUE, TRUE))
return test_name
if(strings("data/super_special_ultra_instinct.json", "[ckey(they.name)]", TRUE, TRUE))
return test_name
if(strings("data/super_special_ultra_instinct.json", "[ckey(they.real_name)]", TRUE, TRUE))
return test_name
return they.client.prefs.my_shark
return test_name
return safepick(GLOB.cow_names + GLOB.megacarp_first_names + GLOB.megacarp_last_names)
return they.real_name

/datum/controller/subsystem/chat/proc/inspect_character(mob/viewer, list/payload)
if(!viewer)
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/monster_wave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ SUBSYSTEM_DEF(monster_wave)

/mob/living/simple_animal/nest_spawn_hole_guy/ComponentInitialize()
. = ..()
RegisterSignal(src, COMSIG_HOSTILE_CHECK_FACTION,PROC_REF(no_attack_pls))
RegisterSignal(src, COMSIG_MOB_APPLY_DAMAGE,PROC_REF(im_hit))
RegisterSignal(src, COMSIG_HOSTILE_CHECK_FACTION,PROC_REF(no_attack_pls), TRUE)
RegisterSignal(src, COMSIG_MOB_APPLY_DAMAGE,PROC_REF(im_hit), TRUE)

/mob/living/simple_animal/nest_spawn_hole_guy/update_overlays()
. = ..()
Expand Down
18 changes: 7 additions & 11 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,21 @@
output += "<center><p><a href='byond://?src=[REF(src)];quirks=1'>Configure Quirks!</a></p>"

if(SSticker.current_state <= GAME_STATE_PREGAME)
/*
switch(ready)
if(PLAYER_NOT_READY)
output += "<p>\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | <b>Not Ready</b> | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]</p>"
if(PLAYER_READY_TO_PLAY)
output += "<p>\[ <b>Ready</b> | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]</p>"
if(PLAYER_READY_TO_OBSERVE)
output += "<p>\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | <b> Observe </b> \]</p>"
*/
output += "<p>Please be patient, the game is starting soon!</p>"
output += "<p><a href='byond://?src=[REF(src)];refresh=1'>(Refresh)</a></p>"
output += "<p><a href='byond://?src=[REF(src)];refresh_chat=1)'>(Fix Chat Window)</a></p>"
output += "<p><a href='byond://?src=[REF(src)];fit_viewport_lobby=1)'>(Fit Viewport)</a></p>"
else
output += "<p><a href='byond://?src=[REF(src)];manifest=1'>View the Crew Manifest</a></p>"
output += "<p><a href='byond://?src=[REF(src)];directory=1'>View Character Directory</a></p>"
output += "<p><a href='byond://?src=[REF(src)];late_join=1'>Join Game!</a></p>"
output += "<p>[LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)]</p>"
output += "<p><a href='byond://?src=[REF(src)];join_as_creature=1'>Join as Simple Creature!</a></p>"
output += "<p><a href='byond://?src=[REF(src)];refresh_chat=1)'>(Fix Chat Window)</a></p>"
output += "<p><a href='byond://?src=[REF(src)];fit_viewport_lobby=1)'>(Fit Viewport)</a></p>"

if(!IsGuestKey(src.key))
output += playerpolls()
// if(!IsGuestKey(src.key))
// output += playerpolls()

output += "</center>"

Expand Down Expand Up @@ -185,6 +177,10 @@
client.prefs.ShowChoices(src)
return 1

if(href_list["directory"])
client.show_character_directory()
return 1

if(href_list["quirkconversion"])
SSquirks.ConvertOldQuirklistToNewQuirklist(client.prefs)
new_player_panel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GLOBAL_LIST_INIT(char_directory_erptags, list("Top", "Bottom", "Switch", "No ERP
var/mob/M = C?.mob
if(!M)
continue
var/name = C.prefs.real_name || M.real_name || M.name
var/name = SSchat.name_or_shark(M) //C.prefs.real_name || M.real_name || M.name
var/thegender = capitalize(C.prefs.gender || M.gender || "Other")
var/whokisser = "Unsure"
var/species
Expand All @@ -98,9 +98,13 @@ GLOBAL_LIST_INIT(char_directory_erptags, list("Top", "Bottom", "Switch", "No ERP
whokisser = "Likes Anyone"
if(KISS_NONE)
whokisser = "Not Interested"

if((isdead(M) && (lowertext(M.real_name) == M.ckey || lowertext(M.name) == M.ckey)))
name = C.prefs.my_shark

if(isdead(M) && lowertext(name) == ckey(M.ckey))
var/testname = C.prefs.real_name
if(lowertext(testname) == M.ckey)
name = C.prefs.my_shark
else
name = testname
// It's okay if we fail to find OOC notes and flavor text
// But if we can't find the name, they must be using a non-compatible mob type currently.
if(!name)
Expand Down
17 changes: 17 additions & 0 deletions tgui/packages/tgui-panel/styles/goon/chat-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,23 @@ em {
}
}


.privateSent {
color: #007f5f;
// font-weight: bold;
animation: privateSent 3000ms;
animation-direction: linear;
}

@keyframes privateSent {
0% {
color: #00FF00;
}
100% {
color: #007f5f;
}
}

.phobia {
color: #dd0000;
font-weight: bold;
Expand Down
20 changes: 18 additions & 2 deletions tgui/packages/tgui-panel/styles/goon/chat-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ h1.alert, h2.alert {
}

.private {
color: #00BB80;
color: #00563b;
// font-weight: bold;
animation: private 3000ms;
animation-direction: linear;
Expand All @@ -1123,7 +1123,23 @@ h1.alert, h2.alert {
color: #00FF00;
}
100% {
color: #00BB80;
color: #00563b;
}
}

.privateSent {
color: #002c21;
// font-weight: bold;
animation: privateSent 3000ms;
animation-direction: linear;
}

@keyframes privateSent {
0% {
color: #00FF00;
}
100% {
color: #002c21;
}
}

Expand Down

0 comments on commit 0700578

Please sign in to comment.