This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Quick Web Build | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-10-03 | |
// @description Adds button that will auto-click some buttons for you to build a game. | |
// @author koteelok | |
// @match https://editor.construct.net/ | |
// @icon https://editor.construct.net/r449-2/media/icon-512.png | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function fitRectToWindow(width: number, height: number) { | |
return width / height < window.innerWidth / window.innerHeight | |
? { | |
x: (window.innerWidth - width * (window.innerHeight / height)) / 2, | |
y: 0, | |
width: width * (window.innerHeight / height), | |
height: window.innerHeight, | |
} | |
: { | |
x: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ObjectLike = { [keys: string]: any }; | |
type ObserverCallback<O extends ObjectLike = any> = (obj: O) => void; | |
type StringKeys<O extends ObjectLike> = keyof O & string; | |
class ObjectCallbacks { | |
private callbacks: { [key: string]: Set<ObserverCallback> } = {}; | |
constructor() {} | |
getCallbacks(key: string) { |