mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Fixes shidd not working
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
SUBSYSTEM_DEF(chat)
|
||||
name = "Chat"
|
||||
flags = SS_TICKER
|
||||
@@ -16,24 +21,18 @@ SUBSYSTEM_DEF(chat)
|
||||
// Send to tgchat
|
||||
client.tgui_panel?.window.send_message("chat/message", payload)
|
||||
// Send to old chat
|
||||
for(var/msg in payload)
|
||||
SEND_TEXT(client, msg["text"])
|
||||
for(var/message in payload)
|
||||
SEND_TEXT(client, message_to_html(message))
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/chat/proc/queue(target, text, flags)
|
||||
/datum/controller/subsystem/chat/proc/queue(target, message)
|
||||
if(islist(target))
|
||||
for(var/_target in target)
|
||||
var/client/client = CLIENT_FROM_VAR(_target)
|
||||
if(client)
|
||||
LAZYADD(payload_by_client[client], list(list(
|
||||
"text" = text,
|
||||
"flags" = flags,
|
||||
)))
|
||||
LAZYADD(payload_by_client[client], list(message))
|
||||
return
|
||||
var/client/client = CLIENT_FROM_VAR(target)
|
||||
if(client)
|
||||
LAZYADD(payload_by_client[client], list(list(
|
||||
"text" = text,
|
||||
"flags" = flags,
|
||||
)))
|
||||
LAZYADD(payload_by_client[client], list(message))
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
body {
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
font-size: 12px !important;
|
||||
margin: 5px !important;
|
||||
padding: 2px !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
body.dark {
|
||||
background-color: #131313;
|
||||
@@ -19,11 +19,18 @@ body.dark {
|
||||
|
||||
#menu {
|
||||
background-color: white;
|
||||
position: fixed;
|
||||
padding: 7px;
|
||||
width: 100%;
|
||||
}
|
||||
.dark #menu {
|
||||
background-color: #131313;
|
||||
}
|
||||
|
||||
#statcontent {
|
||||
padding: 0 7px 7px 7px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: black;
|
||||
text-decoration: none
|
||||
@@ -142,6 +149,7 @@ li a:hover:not(.active) {
|
||||
</head>
|
||||
<body>
|
||||
<ul id="menu" class="button-container"></ul>
|
||||
<div id="under_menu"></div>
|
||||
<div id="statcontent"></div>
|
||||
<script>
|
||||
// Polyfills and compatibility ------------------------------------------------
|
||||
@@ -173,10 +181,14 @@ if (window.location) {
|
||||
if(e.which) {
|
||||
if(!anti_spam[e.which]) {
|
||||
anti_spam[e.which] = true;
|
||||
var href = "?__keydown=" + e.which;
|
||||
if(e.ctrlKey === false) href += "&ctrlKey=0"
|
||||
else if(e.ctrlKey === true) href += "&ctrlKey=1"
|
||||
window.location.href = href;
|
||||
var key = String.fromCharCode(e.which);
|
||||
if(key == "t")
|
||||
window.location.href = "byond://winset?command=Say"
|
||||
else if(key == "o")
|
||||
window.location.href = "byond://winset?command=OOC"
|
||||
else if(key == "m")
|
||||
window.location.href = "byond://winset?command=Me"
|
||||
window.location.href = "byond://winset?command=keyDown " + key;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -187,10 +199,8 @@ if (window.location) {
|
||||
return;
|
||||
if(e.which) {
|
||||
anti_spam[e.which] = false;
|
||||
var href = "?__keyup=" + e.which;
|
||||
if(e.ctrlKey === false) href += "&ctrlKey=0"
|
||||
else if(e.ctrlKey === true) href += "&ctrlKey=1"
|
||||
window.location.href = href;
|
||||
var key = String.fromCharCode(e.which);
|
||||
window.location.href = "byond://winset?command=keyUp " + key;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -220,6 +230,7 @@ var permanent_tabs = []; // tabs that won't be cleared by wipes
|
||||
var turfcontents = [];
|
||||
var turfname = "";
|
||||
var menu = document.querySelector('#menu');
|
||||
var under_menu = document.querySelector('#under_menu');
|
||||
|
||||
function createStatusTab(name) {
|
||||
if(document.getElementById(name) || name.trim() == "")
|
||||
@@ -227,7 +238,10 @@ function createStatusTab(name) {
|
||||
if(!verb_tabs.includes(name) && !permanent_tabs.includes(name))
|
||||
return;
|
||||
var B = document.createElement("BUTTON");
|
||||
B.onclick = function() {tab_change(name)};
|
||||
B.onclick = function() {
|
||||
tab_change(name);
|
||||
this.blur();
|
||||
};
|
||||
B.id = name;
|
||||
B[textContentKey] = name;
|
||||
B.className = "button";
|
||||
@@ -241,6 +255,7 @@ function createStatusTab(name) {
|
||||
}
|
||||
//END ORDERING
|
||||
menu.appendChild(B);
|
||||
under_menu.style.height = menu.clientHeight + 'px';
|
||||
}
|
||||
|
||||
function removeStatusTab(name) {
|
||||
@@ -252,10 +267,15 @@ function removeStatusTab(name) {
|
||||
}
|
||||
}
|
||||
menu.removeChild(document.getElementById(name));
|
||||
under_menu.style.height = menu.clientHeight + 'px';
|
||||
if(document.getElementById(name)) // repeat for duplicates
|
||||
removeStatusTab(name);
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
under_menu.style.height = menu.clientHeight + 'px';
|
||||
}
|
||||
|
||||
function addPermanentTab(name) {
|
||||
if(!permanent_tabs.includes(name))
|
||||
permanent_tabs.push(name);
|
||||
@@ -276,21 +296,6 @@ function checkStatusTab() {
|
||||
if(!verb_tabs.includes(menu.children[i].id) && !permanent_tabs.includes(menu.children[i].id))
|
||||
removeStatusTab(menu.children[i].id);
|
||||
}
|
||||
function add_verb(v) {
|
||||
var to_add = JSON.parse(v);
|
||||
var cat = "";
|
||||
cat = to_add[0];
|
||||
if(verb_tabs.includes(cat)){ // we have the category already
|
||||
verbs.push(to_add); // add it to verb list and we done
|
||||
} else if(cat.trim() != "") { // we don't have the category
|
||||
verb_tabs.push(cat);
|
||||
verbs.push(to_add); // add verb
|
||||
createStatusTab(cat); // create the category
|
||||
}
|
||||
if(current_tab == cat) {
|
||||
draw_verbs(cat); // redraw if we added a verb to the tab we're currently in
|
||||
}
|
||||
}
|
||||
function remove_verb(v) {
|
||||
var verb_to_remove = v; // to_remove = [verb:category, verb:name]
|
||||
for(var i = verbs.length - 1; i >= 0; i--){
|
||||
@@ -345,6 +350,9 @@ function add_verb_list(v) {
|
||||
for(var i = 0; i < to_add.length; i++) {
|
||||
var part = to_add[i];
|
||||
if(verb_tabs.includes(part[0])){
|
||||
if(verbs.includes(part)){
|
||||
continue;
|
||||
}
|
||||
verbs.push(part);
|
||||
if(current_tab == part[0]) {
|
||||
draw_verbs(part[0]); // redraw if we added a verb to the tab we're currently in
|
||||
|
||||
Reference in New Issue
Block a user