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