mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-28 23:59:40 +01:00
[MIRROR] cleanup (#12464)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
638e21a05a
commit
460ddecf33
@@ -9,7 +9,7 @@
|
||||
#if defined(ENABLE_BYOND_TRACY)
|
||||
var/tracy_init = LIBCALL(world.system_type == MS_WINDOWS ? "prof.dll" : "./libprof.so", "init")() // Setup Tracy integration
|
||||
if(length(tracy_init) != 0 && tracy_init[1] == ".") // it returned the output file
|
||||
to_world_log("TRACY Enabled, streaming to [tracy_init].")
|
||||
log_world("TRACY Enabled, streaming to [tracy_init].")
|
||||
else if(tracy_init != "0")
|
||||
CRASH("Tracy init error: [tracy_init]")
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { BackendState } from './events/types';
|
||||
* ```
|
||||
*/
|
||||
export function useBackend<
|
||||
TData extends Record<string, any>,
|
||||
TData extends Record<string, unknown>,
|
||||
>(): BackendState<TData> {
|
||||
const state = store.get(backendStateAtom);
|
||||
|
||||
|
||||
@@ -3,11 +3,16 @@ import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
/*
|
||||
*/
|
||||
export function mapTwoByTwo(a: any[][], c: any) {
|
||||
const result: any[] = [];
|
||||
export function mapTwoByTwo<T, R>(
|
||||
a: T[][],
|
||||
c: (row1: T[], row2: T[] | undefined, index: number) => R,
|
||||
): R[] {
|
||||
const result: R[] = [];
|
||||
|
||||
for (let i = 0; i < a.length; i += 2) {
|
||||
result.push(c(a[i], a[i + 1], i));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import { classes } from 'tgui-core/react';
|
||||
import { InputButtons } from './common/InputButtons';
|
||||
import { Loader } from './common/Loader';
|
||||
|
||||
interface ColorPickerData {
|
||||
type ColorPickerData = {
|
||||
autofocus: boolean;
|
||||
buttons: string[];
|
||||
message: string;
|
||||
@@ -52,7 +52,7 @@ interface ColorPickerData {
|
||||
title: string;
|
||||
default_color: string;
|
||||
presets?: string;
|
||||
}
|
||||
};
|
||||
|
||||
type ColorPickerModalProps = Record<never, never>;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { FilterEntry } from './FilterEntry';
|
||||
import type { Data } from './types';
|
||||
|
||||
export const Filteriffic = (props: any) => {
|
||||
export const Filteriffic = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
const name = data.target_name || 'Unknown Object';
|
||||
const filters = data.target_filter_data || {};
|
||||
|
||||
@@ -47,7 +47,7 @@ type Data = {
|
||||
logs: Log[];
|
||||
};
|
||||
|
||||
export const OreSilo = (props: any) => {
|
||||
export const OreSilo = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
const { SHEET_MATERIAL_AMOUNT, machines, logs } = data;
|
||||
|
||||
|
||||
@@ -110,20 +110,19 @@ export const GamePreferencesPage = (props) => {
|
||||
const [searchVisible, setSearchVisible] = useState(false);
|
||||
|
||||
// For some reason, typescript thinks that this call to filter() can change the shape of the array
|
||||
const gamePreferenceEntries: any = sortByName(Object.entries(gamePreferences))
|
||||
.map(([category, preferences]) => {
|
||||
return [
|
||||
category,
|
||||
preferences
|
||||
.filter(
|
||||
(entry) =>
|
||||
!search ||
|
||||
entry.name.toLowerCase().includes(search.toLowerCase()),
|
||||
)
|
||||
.map((entry) => entry.children),
|
||||
];
|
||||
})
|
||||
.filter(([category, prefs]) => prefs.length !== 0);
|
||||
const gamePreferenceEntries: [string, ReactNode[]][] = sortByName(
|
||||
Object.entries(gamePreferences),
|
||||
)
|
||||
.map(([category, preferences]): [string, ReactNode[]] => [
|
||||
category,
|
||||
preferences
|
||||
.filter(
|
||||
(entry) =>
|
||||
!search || entry.name.toLowerCase().includes(search.toLowerCase()),
|
||||
)
|
||||
.map((entry) => entry.children),
|
||||
])
|
||||
.filter((item): item is [string, ReactNode[]] => item[1].length !== 0);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
|
||||
function ensureRecord<T>(
|
||||
trait: string[] | Record<string, T>,
|
||||
): Record<string, any> {
|
||||
): Record<string, unknown> {
|
||||
if (Array.isArray(trait)) {
|
||||
const new_obj: Record<string, null> = {};
|
||||
for (let i = 0; i < trait.length; i++) {
|
||||
@@ -161,7 +161,7 @@ export const SubtabTraits = (props: {
|
||||
export const TraitComponent = (props: {
|
||||
traitPath: string;
|
||||
trait: Trait;
|
||||
data: any;
|
||||
data: unknown;
|
||||
}) => {
|
||||
const { act } = useBackend();
|
||||
const { traitPath, trait, data } = props;
|
||||
@@ -208,7 +208,7 @@ export const TraitSubprefSelector = (props: {
|
||||
trait: string;
|
||||
prefKey: string;
|
||||
prefData: TraitSubpref;
|
||||
data: any;
|
||||
data: unknown;
|
||||
}) => {
|
||||
const { act } = useBackend();
|
||||
const { trait, prefKey, prefData, data } = props;
|
||||
|
||||
@@ -285,9 +285,9 @@ export type MiscData = {
|
||||
|
||||
custom_species: string;
|
||||
ignore_shoes: BooleanLike;
|
||||
pos_traits: string[] | Record<string, Record<string, any> | null>;
|
||||
neu_traits: string[] | Record<string, Record<string, any> | null>;
|
||||
neg_traits: string[] | Record<string, Record<string, any> | null>;
|
||||
pos_traits: string[] | Record<string, Record<string, unknown> | null>;
|
||||
neu_traits: string[] | Record<string, Record<string, unknown> | null>;
|
||||
neg_traits: string[] | Record<string, Record<string, unknown> | null>;
|
||||
traits_cheating: BooleanLike;
|
||||
max_traits: number;
|
||||
trait_points: number;
|
||||
|
||||
Reference in New Issue
Block a user