Skip to content

Commit

Permalink
Merge pull request #4994 from Superlagg/aim-msn-icq-irc-xfire-steam-e…
Browse files Browse the repository at this point in the history
…mail-telegraph

Social Media Update
  • Loading branch information
Superlagg authored Apr 21, 2024
2 parents 9aa7c44 + a8366b9 commit 601b968
Show file tree
Hide file tree
Showing 23 changed files with 1,077 additions and 185 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/voreconstants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,5 @@ GLOBAL_LIST_INIT(prey_release_sounds, list(

#define RADIOPREF_HEAR_RADIO_BLURBLES "hear_staticky_chittering"
#define RADIOPREF_HEAR_RADIO_STATIC "hear_staticky_clicks"

#define ADMIN_CHAT_FILTER_DMS "ADMIN_CHAT_FILTER_DMS"
29 changes: 27 additions & 2 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)

/mob/dview/Destroy(force = FALSE)
if(!ready_to_die)
stack_trace("ALRIGHT WHICH FUCKER TRIED TO DELETE *MY* DVIEW?")
stack_trace("ALRIGHT WHICH frickER TRIED TO DELETE *MY* DVIEW?")

if (!force)
return QDEL_HINT_LETMELIVE
Expand Down Expand Up @@ -1707,6 +1707,31 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
if(clint)
return clint

/// Takes in a client, mob, ckey, quid, or even prefs, and returns a mob
/proc/extract_mob(something)
if(isclient(something))
var/client/clint = something
return clint.mob
if(ismob(something))
return something
if(istext(something))
var/client/C = LAZYACCESS(GLOB.directory, something)
if(C)
return C.mob
var/mob/critter = SSeconomy.quid2mob(something)
if(critter)
return critter
if(istype(something, /datum/preferences))
var/datum/preferences/P = something
return P.parent.mob

/// takes in something that may have preferences, and returns their quid, wot wot
/proc/extract_quid(something)
var/datum/preferences/P = extract_prefs(something)
if(!P)
return
return P.quester_uid

/// Takes in a client, mob, or ckey, and returns the ckey
/proc/get_ckey(clientthing)
var/client/clint
Expand Down Expand Up @@ -1799,7 +1824,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
var/index = GaussianReacharound(mean, stddev, min, max)
return index

/// takes in fuckin anything and outputs if its a player
/// takes in frickin anything and outputs if its a player
/proc/isplayer(imput)
if(istext(imput))
return !!LAZYACCESS(GLOB.directory, imput)
Expand Down
5 changes: 3 additions & 2 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
#define ui_acti "EAST-3:24,SOUTH:5"
#define ui_zonesel "EAST-1:28,SOUTH:5"
#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_crafting "EAST-1:27,SOUTH+3:5"
#define ui_crafting "EAST-4:24,SOUTH+1:6"
#define ui_building "EAST-1:27,SOUTH+2:7"
#define ui_language_menu "EAST-1:27,SOUTH+2:22"
#define ui_wield "EAST-1:10,SOUTH+1:23"
Expand Down Expand Up @@ -169,6 +169,7 @@
#define ui_ghost_teleport "SOUTH:6,CENTER-0.25:24"
#define ui_ghost_spawners "SOUTH:6,CENTER+0.75:24"
#define ui_ghost_second_wind "SOUTH:38,CENTER-1.25:24"
#define ui_ghost_char_dir "SOUTH:38,CENTER-2.25:24"
#define ui_ghost_move_up "SOUTH:6,CENTER+1.75:24"
#define ui_ghost_move_down "SOUTH:6,CENTER+1.75:24"

Expand All @@ -181,6 +182,6 @@
#define ui_resistdelay "EAST-3:24,SOUTH+1:4"
#define ui_combat_toggle "EAST-4:22,SOUTH:5"

#define ui_boxcraft "EAST-4:22,SOUTH+1:6"
#define ui_boxcraft "EAST-4:24,SOUTH+1:6"
#define ui_boxarea "EAST-4:6,SOUTH+1:6"
#define ui_boxlang "EAST-5:22,SOUTH+1:6"
15 changes: 15 additions & 0 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
var/mob/dead/observer/G = usr
SSsecondwind.show_menu_to(G)

/atom/movable/screen/ghost/character_directory
name = "Character Directory"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "chardir"

/atom/movable/screen/ghost/character_directory/Click()
var/mob/dead/observer/G = usr
var/client/C = G.client
C.show_character_directory()

/atom/movable/screen/ghost/move_ghost_up
name = "Move up"
icon_state = "move_ghost_up"
Expand Down Expand Up @@ -102,6 +112,11 @@
using.hud = src
static_inventory += using

using = new /atom/movable/screen/ghost/character_directory()
using.screen_loc = ui_ghost_char_dir // THIS IS A DEFINE!!!
using.hud = src
static_inventory += using

using = new /atom/movable/screen/language_menu
using.icon = ui_style // THIS IS A DEFINE!!!
using.hud = src
Expand Down
212 changes: 209 additions & 3 deletions code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ SUBSYSTEM_DEF(chat)
var/flirt_debug = TRUE
var/debug_block_radio_blurbles = FALSE

/// Format: list("quid" = /datum/character_inspection)
var/list/inspectors = list()

/// list of flirt ckey things so that we can store their target or something
/// format: list("flirterckey" = "targetckey")
var/list/active_flirters = list()
Expand Down Expand Up @@ -88,11 +91,15 @@ SUBSYSTEM_DEF(chat)
/datum/controller/subsystem/chat/fire()
for(var/key in payload_by_client)
var/client/client = key
var/payload = payload_by_client[key]
var/list/payload = payload_by_client[key]
payload_by_client -= key
if(client)
if(payload["prefCheck"] && CHECK_PREFS(client, payload["prefCheck"]))
continue // we dont want to see it
// for(var/pl_badwater in 1 to LAZYLEN(payload))
// // Check if we should block this message
// var/list/control_point = LAZYACCESS(payload, pl_badwater)
// if(control_point["prefCheck"] && !CHECK_PREFS(client, control_point["prefCheck"]))
// payload.Cut(pl_badwater, pl_badwater-1) // Failmate
// continue // we dont want to see it
// Send to tgchat
client.tgui_panel?.window.send_message("chat/message", payload)
// Send to old chat
Expand All @@ -106,10 +113,14 @@ SUBSYSTEM_DEF(chat)
for(var/_target in target)
var/client/client = CLIENT_FROM_VAR(_target)
if(client)
if(message["prefCheck"] && !CHECK_PREFS(client, message["prefCheck"]))
continue
LAZYADD(payload_by_client[client], list(message))
return
var/client/client = CLIENT_FROM_VAR(target)
if(client)
if(message["prefCheck"] && !CHECK_PREFS(client, message["prefCheck"]))
return
LAZYADD(payload_by_client[client], list(message))

/datum/controller/subsystem/chat/proc/build_flirt_datums()
Expand Down Expand Up @@ -270,6 +281,92 @@ SUBSYSTEM_DEF(chat)
/datum/controller/subsystem/chat/ui_state(mob/user)
return GLOB.always_state

/datum/controller/subsystem/chat/proc/start_page(mob/sender, mob/reciever)
if(!sender || !reciever)
return
sender = extract_mob(sender)
if(!sender || !sender.client)
return
reciever = extract_mob(reciever)
if(!reciever || !reciever.client)
to_chat(sender, span_alert("Unable to contact user, please try again later!"))
return
if(is_blocked(sender, reciever))
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!!!!!!!!!!!!!!!!!!
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>",
"Direct OOC Message",
""
) as message|null
if(!mesage)
return
var/myname = name_or_shark(sender) || "some jerk"
var/payload2them = {"<u><b>From <a href='
?src=[REF(src)];
DM=1;
sender_quid=[extract_quid(sender)];
reciever_quid=[extract_quid(reciever)];
'>[myname]</a></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)
var/payload2me = {"<u><b>To <a href='
?src=[REF(src)];
DM=1;
sender_quid=[extract_quid(sender)];
reciever_quid=[extract_quid(reciever)];
'>[theirname]</a></u></b>: [mesage]<br>"}
payload2me = span_private(payload2me)
to_chat(sender, span_private("<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)

/datum/controller/subsystem/chat/Topic(href, list/href_list)
. = ..()
if(href_list["DM"])
start_page(href_list["sender_quid"], href_list["reciever_quid"])

/datum/controller/subsystem/chat/proc/is_blocked(mob/sender, mob/reciever)
return FALSE // todo: this

/datum/controller/subsystem/chat/proc/name_or_shark(mob/they)
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
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

/datum/controller/subsystem/chat/proc/inspect_character(mob/viewer, list/payload)
if(!viewer)
return
viewer = extract_mob(viewer)
if(!viewer || !viewer.client)
return
var/datum/character_inspection/chai = LAZYACCESS(inspectors, viewer.client.prefs.quester_uid)
if(!chai)
chai = new()
inspectors[viewer.client.prefs.quester_uid] = chai
chai.update(viewer, payload)
chai.show_to(viewer)
return TRUE

/datum/controller/subsystem/chat/proc/flirt_debug_toggle()
TOGGLE_VAR(flirt_debug)
build_flirt_datums()
Expand Down Expand Up @@ -569,4 +666,113 @@ SUBSYSTEM_DEF(chat)
message = replacetext(message, "THEIR", emoter.p_their())
return message

////////////// so those datums were awful, maybe this one will be better
/datum/character_inspection // DROP YOUR PANTS, ITS CHARACTER INSPECTION DAY
var/gender
var/species
var/vorepref
var/erppref
var/kisspref
var/flink
var/ad
var/notes
var/flavor
var/their_quid
var/looking_for_friends
var/dms_r_open
var/name
var/profile_pic

/// update the character inspection with new data
/datum/character_inspection/proc/update(mob/viewer, list/payload)
if(!payload)
return
gender = payload["gender"]
species = payload["species"]
vorepref = payload["tag"]
erppref = payload["erptag"]
kisspref = payload["whokisser"]
flink = payload["flist"]
ad = payload["character_ad"]
notes = payload["ooc_notes"]
flavor = payload["flavor_text"]
their_quid = payload["quid"]
looking_for_friends = payload["looking_for_friends"]
dms_r_open = payload["dms_r_open"]
name = payload["name"]
profile_pic = payload["profile_pic"]
if(viewer && viewer.client)
show_to(viewer)

/// show the character inspection to the viewer
/datum/character_inspection/proc/show_to(mob/viewer)
ui_interact(viewer)

/datum/character_inspection/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CharacterInspection")
ui.open()
ui.set_autoupdate(FALSE)

/datum/character_inspection/ui_static_data(mob/user)
var/list/static_data = list()
static_data["gender"] = gender
static_data["species"] = species
static_data["vorepref"] = vorepref
static_data["erppref"] = erppref
static_data["kisspref"] = kisspref
static_data["flink"] = flink
static_data["ad"] = html_decode(ad)
static_data["notes"] = html_decode(notes)
static_data["flavor"] = html_decode(flavor)
static_data["their_quid"] = their_quid
static_data["name"] = name
static_data["looking_for_friends"] = looking_for_friends
static_data["dms_r_open"] = dms_r_open
static_data["profile_pic"] = profile_pic
if(user && user.client) // dont know why they wouldnt, but whatever
static_data["viewer_quid"] = user.client.prefs.quester_uid
return static_data

/datum/character_inspection/ui_act(action, list/params)
. = ..()
if(!params["viewer_quid"])
return
var/mob/viower = extract_mob(params["viewer_quid"])
if(!viower) // warning: sum of dis chapta is extremely scray
return // viower excretion advisd
var/mob/viowed = extract_mob(params["their_quid"])
if(!viowed)
return
if(action == "pager")
SSchat.start_page(viower, viowed)
return TRUE
if(action == "show_pic")
var/dat = {"<img src='[profile_pic]'>"}
var/datum/browser/popup = new(viower, "enlargeImage", "Full Sized Picture!",1024,768)
popup.set_content(dat)
popup.open()
return TRUE
if(action == "view_flist")
if(viowed)
to_chat(viower, span_notice("Opening F-list..."))
SEND_SIGNAL(viowed, COMSIG_FLIST, viower)
return TRUE
else
to_chat(viower, span_alert("Couldn't find that character's F-list!"))
return TRUE
return TRUE

/datum/character_inspection/ui_state(mob/user)
return GLOB.always_state

/mob/verb/direct_message(mob/A as mob in view(10, src))
set name = "Direct Message"
set category = "OOC"
set desc = "Send a direct message to this character."
set popup_menu = TRUE

SSchat.start_page(src, A)


8 changes: 8 additions & 0 deletions code/controllers/subsystem/prefbreak.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ SUBSYSTEM_DEF(prefbreak) // ALL ABOARD THE S.S. PREFBREAK OFF TO **** YOUR *****
PREFBROKEN
return CHECK_BITFIELD(consumer.chat_toggles, CHAT_HEAR_RADIOSTATIC) // kinda vital here

/// im an admin and i dont want to hear about how you want to destroy someone's bussy
/datum/prefcheck/admin_wire_tap
index = ADMIN_CHAT_FILTER_DMS

/datum/prefcheck/admin_wire_tap/allowed(datum/preferences/consumer)
PREFBROKEN
return consumer.admin_wire_tap // kinda vital here




Expand Down
3 changes: 2 additions & 1 deletion code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
var/list/ui_item_blocks

var/current_maxscreensize
var/max_depth = STORAGE_VIEW_DEPTH

var/allow_big_nesting = FALSE //allow storage objects of the same or greater size.

Expand Down Expand Up @@ -336,7 +337,7 @@

/datum/component/storage/proc/check_views()
for(var/mob/M in can_see_contents())
if(!isobserver(M) && !M.can_reach(parent, STORAGE_VIEW_DEPTH))
if(!isobserver(M) && !M.can_reach(parent, max_depth))
close(M)

/datum/component/storage/proc/emp_act(datum/source, severity)
Expand Down
Loading

0 comments on commit 601b968

Please sign in to comment.