mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 14:16:58 +01:00
[MIRROR] Implementing tgchat to replace old VChat (#7371)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Selis <selis@xynolabs.com>
This commit is contained in:
co-authored by
Heroman3003
Selis
parent
a5c370fb85
commit
c2bc0f78c8
@@ -41,8 +41,10 @@
|
||||
var/datum/admins/deadmin_holder = null
|
||||
var/buildmode = 0
|
||||
|
||||
var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming.
|
||||
var/last_message_count = 0 //contins a number of how many times a message identical to last_message was sent.
|
||||
///Contains the last message sent by this client - used to protect against copy-paste spamming.
|
||||
var/last_message = ""
|
||||
///contins a number of how many times a message identical to last_message was sent.
|
||||
var/last_message_count = 0
|
||||
var/ircreplyamount = 0
|
||||
var/entity_narrate_holder //Holds /datum/entity_narrate when using the relevant admin verbs.
|
||||
|
||||
@@ -56,9 +58,7 @@
|
||||
var/area = null
|
||||
var/time_died_as_mouse = null //when the client last died as a mouse
|
||||
var/datum/tooltip/tooltips = null
|
||||
var/datum/chatOutput/chatOutput
|
||||
var/datum/volume_panel/volume_panel = null // Initialized by /client/verb/volume_panel()
|
||||
var/chatOutputLoadedAt
|
||||
var/seen_news = 0
|
||||
|
||||
var/adminhelped = 0
|
||||
|
||||
@@ -135,7 +135,6 @@
|
||||
if("usr") hsrc = mob
|
||||
if("prefs") return prefs.process_link(usr,href_list)
|
||||
if("vars") return view_var_Topic(href,href_list,hsrc)
|
||||
if("chat") return chatOutput.Topic(href, href_list)
|
||||
|
||||
switch(href_list["action"])
|
||||
if("openLink")
|
||||
@@ -174,11 +173,6 @@
|
||||
del(src)
|
||||
return
|
||||
|
||||
chatOutput = new /datum/chatOutput(src) //veechat
|
||||
chatOutput.send_resources()
|
||||
spawn()
|
||||
chatOutput.start()
|
||||
|
||||
//Only show this if they are put into a new_player mob. Otherwise, "what title screen?"
|
||||
if(isnewplayer(src.mob))
|
||||
to_chat(src, "<font color='red'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</font>")
|
||||
@@ -186,6 +180,9 @@
|
||||
GLOB.clients += src
|
||||
GLOB.directory[ckey] = src
|
||||
|
||||
// Instantiate tgui panel
|
||||
tgui_panel = new(src, "browseroutput")
|
||||
|
||||
GLOB.tickets.ClientLogin(src) // CHOMPedit - Tickets System
|
||||
|
||||
//Admin Authorisation
|
||||
@@ -214,6 +211,9 @@
|
||||
if(prefs)
|
||||
prefs.selecting_slots = FALSE
|
||||
|
||||
// Initialize tgui panel
|
||||
tgui_panel.initialize()
|
||||
|
||||
connection_time = world.time
|
||||
connection_realtime = world.realtime
|
||||
connection_timeofday = world.timeofday
|
||||
@@ -492,29 +492,6 @@
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/client/verb/reload_vchat()
|
||||
set name = "Reload VChat"
|
||||
set category = "OOC"
|
||||
|
||||
//Timing
|
||||
if(src.chatOutputLoadedAt > (world.time - 10 SECONDS))
|
||||
tgui_alert_async(src, "You can only try to reload VChat every 10 seconds at most.")
|
||||
return
|
||||
|
||||
// YW EDIT: disabled until we can fix the lag: verbs -= /client/proc/vchat_export_log
|
||||
|
||||
//Log, disable
|
||||
log_debug("[key_name(src)] reloaded VChat.")
|
||||
winset(src, null, "outputwindow.htmloutput.is-visible=false;outputwindow.oldoutput.is-visible=false;outputwindow.chatloadlabel.is-visible=true")
|
||||
|
||||
//The hard way
|
||||
qdel_null(src.chatOutput)
|
||||
chatOutput = new /datum/chatOutput(src) //veechat
|
||||
chatOutput.send_resources()
|
||||
spawn()
|
||||
chatOutput.start()
|
||||
|
||||
|
||||
//This is for getipintel.net.
|
||||
//You're welcome to replace this proc with your own that does your own cool stuff.
|
||||
//Just set the client's ip_reputation var and make sure it makes sense with your config settings (higher numbers are worse results)
|
||||
|
||||
@@ -296,7 +296,7 @@ var/list/_client_preferences_by_type
|
||||
key = "SOUND_INSTRUMENT"
|
||||
|
||||
/datum/client_preference/vchat_enable
|
||||
description = "Enable/Disable VChat"
|
||||
description = "Enable/Disable TGChat"
|
||||
key = "VCHAT_ENABLE"
|
||||
enabled_description = "Enabled"
|
||||
disabled_description = "Disabled"
|
||||
|
||||
@@ -367,17 +367,17 @@
|
||||
feedback_add_details("admin_verb","THInstm") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/verb/toggle_vchat()
|
||||
set name = "Toggle VChat"
|
||||
set name = "Toggle TGChat"
|
||||
set category = "Preferences"
|
||||
set desc = "Toggles VChat. Reloading VChat and/or reconnecting required to affect changes."
|
||||
set desc = "Toggles TGChat. Reloading TGChat and/or reconnecting required to affect changes."
|
||||
|
||||
var/pref_path = /datum/client_preference/vchat_enable
|
||||
toggle_preference(pref_path)
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
to_chat(src, "You have toggled VChat [is_preference_enabled(pref_path) ? "on" : "off"]. \
|
||||
You will have to reload VChat and/or reconnect to the server for these changes to take place. \
|
||||
VChat message persistence is not guaranteed if you change this again before the start of the next round.")
|
||||
to_chat(src, "You have toggled TGChat [is_preference_enabled(pref_path) ? "on" : "off"]. \
|
||||
You will have to reload TGChat and/or reconnect to the server for these changes to take place. \
|
||||
TGChat message persistence is not guaranteed if you change this again before the start of the next round.")
|
||||
|
||||
/client/verb/toggle_chat_timestamps()
|
||||
set name = "Toggle Chat Timestamps"
|
||||
|
||||
Reference in New Issue
Block a user