mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-13 10:11:50 +00:00
Merge branch 'modloader' of github.com:tobspr/shapez.io into modloader
This commit is contained in:
commit
b11ac4977f
@ -94,11 +94,12 @@ export class HUDEntityDebugger extends BaseHUDPart {
|
|||||||
<div>`;
|
<div>`;
|
||||||
|
|
||||||
for (const property in val) {
|
for (const property in val) {
|
||||||
const isRoot = val[property] == this.root;
|
let hiddenValue = null;
|
||||||
const isRecursive = recursion.includes(val[property]);
|
if (val[property] == this.root) {
|
||||||
|
hiddenValue = "<root>";
|
||||||
let hiddenValue = isRoot ? "<root>" : null;
|
} else if (val[property] instanceof Node) {
|
||||||
if (isRecursive) {
|
hiddenValue = `<${val[property].constructor.name}>`;
|
||||||
|
} else if (recursion.includes(val[property])) {
|
||||||
// Avoid recursion by not "expanding" object more than once
|
// Avoid recursion by not "expanding" object more than once
|
||||||
hiddenValue = "<recursion>";
|
hiddenValue = "<recursion>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,12 @@ import { BaseHUDPart } from "../game/hud/base_hud_part";
|
|||||||
* @typedef {{new(...args: any[]): any, prototype: any}} constructable
|
* @typedef {{new(...args: any[]): any, prototype: any}} constructable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template {(...args: any) => any} F The function
|
||||||
|
* @template {object} T The value of this
|
||||||
|
* @typedef {(this: T, ...args: Parameters<F>) => ReturnType<F>} bindThis
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template {(...args: any[]) => any} F
|
* @template {(...args: any[]) => any} F
|
||||||
* @template P
|
* @template P
|
||||||
@ -400,7 +406,7 @@ export class ModInterface {
|
|||||||
* @template {extendsPrams<P[M]>} O the method that will override the old one
|
* @template {extendsPrams<P[M]>} O the method that will override the old one
|
||||||
* @param {C} classHandle
|
* @param {C} classHandle
|
||||||
* @param {M} methodName
|
* @param {M} methodName
|
||||||
* @param {beforePrams<O, P[M]>} override
|
* @param {bindThis<beforePrams<O, P[M]>, InstanceType<C>>} override
|
||||||
*/
|
*/
|
||||||
replaceMethod(classHandle, methodName, override) {
|
replaceMethod(classHandle, methodName, override) {
|
||||||
const oldMethod = classHandle.prototype[methodName];
|
const oldMethod = classHandle.prototype[methodName];
|
||||||
@ -418,7 +424,7 @@ export class ModInterface {
|
|||||||
* @template {extendsPrams<P[M]>} O the method that will run before the old one
|
* @template {extendsPrams<P[M]>} O the method that will run before the old one
|
||||||
* @param {C} classHandle
|
* @param {C} classHandle
|
||||||
* @param {M} methodName
|
* @param {M} methodName
|
||||||
* @param {O} executeBefore
|
* @param {bindThis<O, InstanceType<C>>} executeBefore
|
||||||
*/
|
*/
|
||||||
runBeforeMethod(classHandle, methodName, executeBefore) {
|
runBeforeMethod(classHandle, methodName, executeBefore) {
|
||||||
const oldHandle = classHandle.prototype[methodName];
|
const oldHandle = classHandle.prototype[methodName];
|
||||||
@ -437,7 +443,7 @@ export class ModInterface {
|
|||||||
* @template {extendsPrams<P[M]>} O the method that will run before the old one
|
* @template {extendsPrams<P[M]>} O the method that will run before the old one
|
||||||
* @param {C} classHandle
|
* @param {C} classHandle
|
||||||
* @param {M} methodName
|
* @param {M} methodName
|
||||||
* @param {O} executeAfter
|
* @param {bindThis<O, InstanceType<C>>} executeAfter
|
||||||
*/
|
*/
|
||||||
runAfterMethod(classHandle, methodName, executeAfter) {
|
runAfterMethod(classHandle, methodName, executeAfter) {
|
||||||
const oldHandle = classHandle.prototype[methodName];
|
const oldHandle = classHandle.prototype[methodName];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user