some fixes (#18030)

* some fixes

* .

* observer state

* .

* .

* .

* .

* fix

* update

* bun up
This commit is contained in:
Kashargul
2025-07-21 22:42:32 +02:00
committed by GitHub
parent b2fed07496
commit 87b45d138f
13 changed files with 371 additions and 160 deletions
+1
View File
@@ -8,6 +8,7 @@ juke
**/dist
**/node_modules
html/templates
html/create_object.html
# File names / types
*.min.*
+3 -2
View File
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"assist": {
"actions": {
"source": {
@@ -50,7 +50,8 @@
"noDangerouslySetInnerHtml": "off"
},
"style": {
"noNonNullAssertion": "off"
"noNonNullAssertion": "off",
"useSelfClosingElements": "error"
},
"suspicious": {
"noArrayIndexKey": "off",
+1 -1
View File
@@ -11,7 +11,7 @@ GLOBAL_VAR_INIT(allowed_ghost_spawns, 2)
var/active_tab = GHOST_POD_TAB
/datum/tgui_module/ghost_spawn_menu/tgui_state(mob/user)
return GLOB.tgui_self_state
return GLOB.tgui_observer_state
/datum/tgui_module/ghost_spawn_menu/tgui_close(mob/user)
. = ..()
+1 -1
View File
@@ -17,7 +17,7 @@ export RUST_G_VERSION=3.11.0
export NODE_VERSION_LTS=22.14.0
# Bun version
export BUN_VERSION=1.2.18
export BUN_VERSION=1.2.19
# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.10
+108 -128
View File
@@ -1,149 +1,129 @@
<html>
<head>
<title>Create Object</title>
<style type="text/css">
body {
font-size: 9pt;
font-family: Verdana, sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #00f;
font-family: Georgia, Arial, sans-serif;
}
img {
border: 0px;
}
p.lic {
font-size: 6pt;
}
</style>
</head>
<head>
<title>Create Object</title>
<style type="text/css">
body
{
font-size: 9pt;
font-family: Verdana, sans-serif;
}
<body>
<form name="spawner" action="byond://?src=/* ref src */" method="get">
<input type="hidden" name="src" value="/* ref src */" />
/* hreftokenfield */
<input type="hidden" name="action" value="object_list" />
h1, h2, h3, h4, h5, h6
{
color: #00f;
font-family: Georgia, Arial, sans-serif;
}
img {
border: 0px;
}
p.lic {
font-size: 6pt;
}
</style>
</head>
Type
<input
type="text"
name="filter"
value=""
onkeypress="submitFirst(event)"
style="width: 280px; height: 25"
/>
<input type="button" value="Search" onclick="updateSearch()" /><br />
Offset:
<input type="text" name="offset" value="x,y,z" style="width: 250px" />
<body>
<form name="spawner" action="byond://?src=/* ref src */" method="get">
<input type="hidden" name="src" value="/* ref src */">
/* hreftokenfield */
<input type="hidden" name="action" value="object_list">
A <input type="radio" name="offset_type" value="absolute" /> R
<input
type="radio"
name="offset_type"
value="relative"
checked="checked"
/><br />
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:280px;height:25"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br>
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px">
Number:
<input type="text" name="object_count" value="1" style="width: 30px" />
Dir:
<input type="text" name="object_dir" value="2" style="width: 30px" />
Name:
<input
type="text"
name="object_name"
value=""
style="width: 180px"
/><br />
Where:
<select name="object_where" style="width: 320px">
<option value="onfloor">On floor below own mob</option>
<!-- <option value='inhand'>In own mob's hand</option> -->
<option value="inmarked">In marked object</option>
</select>
<br /><br />
Number of matches:
<input id="number" value="0" style="width: 180px" /><br />
<br /><br />
A <input type="radio" name="offset_type" value="absolute">
R <input type="radio" name="offset_type" value="relative" checked="checked"><br>
<div id="selector_hs">
<select name="object_list" id="object_list" multiple size="20"></select>
</div>
Number: <input type="text" name="object_count" value="1" style="width:30px">
Dir: <input type="text" name="object_dir" value="2" style="width:30px">
Name: <input type="text" name="object_name" value="" style="width:180px"><br>
Where:
<select name='object_where' style="width:320px">
<option value='onfloor'>On floor below own mob</option>
<!-- <option value='inhand'>In own mob's hand</option> -->
<option value='inmarked'>In marked object</option>
</select>
<br><br>
Number of matches: <input id="number" value="0" style="width:180px"><br>
<br><br>
<br />
<input type="submit" value="spawn" />
</form>
<div id="selector_hs">
<select name="object_list" id="object_list" multiple size="20">
</select>
</div>
<script language="JavaScript">
var old_search = "";
var object_list = document.spawner.object_list;
var object_list_container = document.getElementById("selector_hs");
var object_paths = null; /* object types */
var objects =
object_paths == null ? new Array() : object_paths.split(";");
<br>
<input type="submit" value="spawn">
</form>
document.spawner.filter.focus();
populateList(objects);
<script language="JavaScript">
var old_search = "";
var object_list = document.spawner.object_list;
var object_list_container = document.getElementById('selector_hs');
var object_paths = null /* object types */;
var objects = object_paths == null ? new Array() : object_paths.split(";");
function populateList(from_list) {
var newOpts = "";
var i;
for (i in from_list) {
newOpts +=
'<option value="' +
from_list[i] +
'">' +
from_list[i] +
"</option>";
}
object_list_container.innerHTML =
'<select name="object_list" id="object_list" multiple size="20">' +
newOpts +
"</select>";
document.getElementById("number").value = from_list.length;
}
document.spawner.filter.focus();
populateList(objects);
function updateSearch() {
if (old_search == document.spawner.filter.value) {
return false;
}
function populateList(from_list)
{
var newOpts = '';
var i;
for (i in from_list)
{
newOpts += '<option value="' + from_list[i] + '">'
+ from_list[i] + '</option>';
}
object_list_container.innerHTML = '<select name="object_list" id="object_list" multiple size="20">' +
newOpts + '</select>';
document.getElementById("number").value = from_list.length;
}
old_search = document.spawner.filter.value;
function updateSearch()
{
if (old_search == document.spawner.filter.value)
{
return false;
}
var filtered = new Array();
var i;
for (i in objects) {
if (objects[i].search(old_search) < 0) {
continue;
}
old_search = document.spawner.filter.value;
filtered.push(objects[i]);
}
populateList(filtered);
var filtered = new Array();
var i;
for (i in objects)
{
if(objects[i].search(old_search) < 0)
{
continue;
}
if (object_list.options.length)
object_list.options[0].selected = "true";
filtered.push(objects[i]);
}
return true;
}
populateList(filtered);
function submitFirst(event) {
if (!object_list.options.length) {
return false;
}
if (object_list.options.length)
object_list.options[0].selected = 'true';
return true;
}
function submitFirst(event)
{
if (!object_list.options.length)
{
return false;
}
if (event.keyCode == 13 || event.which == 13)
{
object_list.options[0].selected = 'true';
}
}
</script>
</body>
if (event.keyCode == 13 || event.which == 13) {
object_list.options[0].selected = "true";
}
}
</script>
</body>
</html>
+3 -3
View File
@@ -7,7 +7,7 @@
"@happy-dom/global-registrator": "^17.6.3",
"@rspack/cli": "^1.4.8",
"@rspack/core": "^1.4.8",
"@types/bun": "^1.2.18",
"@types/bun": "^1.2.19",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/webpack-env": "^1.18.8",
@@ -234,7 +234,7 @@
"@types/bonjour": ["@types/bonjour@3.5.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ=="],
"@types/bun": ["@types/bun@1.2.18", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="],
"@types/bun": ["@types/bun@1.2.19", "", { "dependencies": { "bun-types": "1.2.19" } }, "sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg=="],
"@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="],
@@ -396,7 +396,7 @@
"bufferstreams": ["bufferstreams@4.0.0", "", { "dependencies": { "readable-stream": "^3.4.0", "yerror": "^8.0.0" } }, "sha512-azX778/2VQ9K2uiYprSUKLgK2K6lR1KtJycJDsMg7u0+Cc994A9HyGaUKb01e/T+M8jse057429iKXurCaT35g=="],
"bun-types": ["bun-types@1.2.18", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="],
"bun-types": ["bun-types@1.2.19", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ=="],
"bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
+2 -2
View File
@@ -2,7 +2,7 @@
"private": true,
"name": "tgui-workspace",
"version": "6.0.0",
"packageManager": "bun@1.2.18",
"packageManager": "bun@1.2.19",
"workspaces": [
"packages/*"
],
@@ -17,7 +17,7 @@
"@happy-dom/global-registrator": "^17.6.3",
"@rspack/cli": "^1.4.8",
"@rspack/core": "^1.4.8",
"@types/bun": "^1.2.18",
"@types/bun": "^1.2.19",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/webpack-env": "^1.18.8",
@@ -1,4 +1,3 @@
import type React from 'react';
import { Component, type CSSProperties, type PropsWithChildren } from 'react';
import { resolveAsset } from 'tgui/assets';
import { useBackend } from 'tgui/backend';
@@ -0,0 +1,230 @@
import { Box, Icon, Section, Table } from 'tgui-core/components';
export const WikiBloodTypes = (props) => {
return (
<Section fill title="Blood Type Compatibility">
<Table>
<Table.Row>
<Table.Cell colSpan={10}>
<Box align="center" bold>
You can receive
</Box>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell />
<Table.Cell />
<Table.Cell>
<Box bold>O+</Box>
</Table.Cell>
<Table.Cell>
<Box bold>O-</Box>
</Table.Cell>
<Table.Cell>
<Box bold>A+</Box>
</Table.Cell>
<Table.Cell>
<Box bold>A-</Box>
</Table.Cell>
<Table.Cell>
<Box bold>B+</Box>
</Table.Cell>
<Table.Cell>
<Box bold>B-</Box>
</Table.Cell>
<Table.Cell>
<Box bold>AB+</Box>
</Table.Cell>
<Table.Cell>
<Box bold>AB-</Box>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>y</Box>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>o</Box>
</Table.Cell>
<Table.Cell>
<Box bold>O+</Box>
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>u</Box>
</Table.Cell>
<Table.Cell>
<Box bold>O-</Box>
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>r</Box>
</Table.Cell>
<Table.Cell>
<Box bold>A+</Box>
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell />
<Table.Cell>
<Box bold>A-</Box>
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>t</Box>
</Table.Cell>
<Table.Cell>
<Box bold>B+</Box>
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>y</Box>
</Table.Cell>
<Table.Cell>
<Box bold>B-</Box>
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell />
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>p</Box>
</Table.Cell>
<Table.Cell>
<Box bold>AB+</Box>
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
<Box bold>e</Box>
</Table.Cell>
<Table.Cell>
<Box bold>AB-</Box>
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
<Table.Cell />
<Table.Cell>
<Icon name="droplet" color="red" />
</Table.Cell>
</Table.Row>
</Table>
</Section>
);
};
+1 -1
View File
@@ -2,6 +2,6 @@
"private": true,
"type": "module",
"devDependencies": {
"@types/bun": "^1.2.18"
"@types/bun": "^1.2.19"
}
}
+3 -3
View File
@@ -6,7 +6,7 @@ let files = {};
let count = 0;
while (queue.length) {
let entries = await Promise.all(
const entries = await Promise.all(
queue.slice(0, 100).map((path) => readdir(path, { withFileTypes: true })),
);
for (let i = 0; i < entries.length; ++i) {
@@ -24,8 +24,8 @@ while (queue.length) {
files = Object.keys(files);
while (files.length) {
let queue = files.slice(0, 100);
let buffers = await Promise.all(queue.map((path) => readFile(path)));
const queue = files.slice(0, 100);
const buffers = await Promise.all(queue.map((path) => readFile(path)));
for (let i = 0; i < queue.length; ++i) {
if (!isValidUTF8(buffers[i])) {
console.log(queue[i]);
+5 -5
View File
@@ -38,13 +38,13 @@ const extFolderMapping = {
var genIndexHtml = dot.template(fs.readFileSync("index.html", "utf8"));
// the main thing
var server = http.createServer(function (request, response) {
var server = http.createServer((request, response) => {
// extract the pathname from the request URL
var pathname = url.parse(request.url).pathname;
// Exception for front page
if (pathname === "/") {
let initialData = JSON.parse(fs.readFileSync("initialData.json", "utf8"));
const initialData = JSON.parse(fs.readFileSync("initialData.json", "utf8"));
response.writeHead(200, { "Content-Type": "text/html" });
response.write(
genIndexHtml({
@@ -70,7 +70,7 @@ var server = http.createServer(function (request, response) {
// console.log("Trying to serve ", pathname, " from ", filename);
// Does this path exist?
fs.exists(filename, function (gotPath) {
fs.exists(filename, (gotPath) => {
// no, bail out
if (!gotPath) {
console.warn("Path: %s File: %s NOT FOUND", pathname, filename);
@@ -93,10 +93,10 @@ var server = http.createServer(function (request, response) {
mode: 0x3146, // 0666
bufferSize: 4 * 1024,
})
.addListener("data", function (chunk) {
.addListener("data", (chunk) => {
response.write(chunk, "binary");
})
.addListener("close", function () {
.addListener("close", () => {
response.end();
});
});
+13 -13
View File
@@ -1,10 +1,10 @@
var fs = require("fs");
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function (dir, filelist) {
var walkSync = (dir, filelist) => {
var files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function (file) {
files.forEach((file) => {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + "/", filelist);
} else {
@@ -16,8 +16,8 @@ var walkSync = function (dir, filelist) {
var findNearestAbsolute = (data, line) => {
for (let i = line; i > 0; i--) {
let str = data[i];
if (str && str.match(/^\//)) {
const str = data[i];
if (str?.match(/^\//)) {
return str.trim().replace(/,/g, "|");
}
}
@@ -25,9 +25,9 @@ var findNearestAbsolute = (data, line) => {
};
var main = () => {
let files = walkSync("code/");
let matches = {};
for (let file of files) {
const files = walkSync("code/");
const matches = {};
for (const file of files) {
const data = fs.readFileSync(file, "utf8");
if (!data.match(/playsound.*/)) {
@@ -38,9 +38,9 @@ var main = () => {
const dataArray = data.split("\n");
let i = 1;
for (let line of dataArray) {
for (const line of dataArray) {
i++;
let m = line.match(/playsound.*/);
const m = line.match(/playsound.*/);
if (m) {
matches[file].push({
line: i,
@@ -52,10 +52,10 @@ var main = () => {
}
Object.keys(matches).map((file) => {
let allResults = matches[file];
const allResults = matches[file];
allResults.map((obj) => {
obj.params = obj.match.split(",");
for (var i = 0; i < obj.params.length; i++) {
for (let i = 0; i < obj.params.length; i++) {
obj.params[i] = obj.params[i]
.trim()
.replace(/playsound\(/g, "")
@@ -67,8 +67,8 @@ var main = () => {
// Final loop, spit out a csv
Object.keys(matches).map((file) => {
let thisFileCsvEntry = "";
let allResults = matches[file];
for (let matchObj of allResults) {
const allResults = matches[file];
for (const matchObj of allResults) {
thisFileCsvEntry += `${file},${matchObj.line},${matchObj.src},${matchObj.params.join(",")}\n`;
}
fs.appendFileSync("results.csv", thisFileCsvEntry);