diff --git a/fart.js b/fart.js new file mode 100644 index 0000000..a344e46 --- /dev/null +++ b/fart.js @@ -0,0 +1,248 @@ +System.register("chunks:///_virtual/DebuggerToolbox.ts", ["./rollupPluginModLoBabelHelpers.js", "cc", "./utils.ts"], (function(e) { + var applyDecoratedSCriptor, inheritsLoose, initlizerDefineProperty, assertedThisInitalizd, __cc, ccDecorator, ccPrefabe, ccNode, ccCCOBJECT, ccinput, ccInput, ccKeyCode, ccDirecotr, ccInstanitate, ccButton, ccLabel, ccComponent, isInIFrame, isMobile; + return { + setters: [function(bableHelpers) { + applyDecoratedSCriptor = bableHelpers.applyDecoratedDescriptor, + inheritsLoose = bableHelpers.inheritsLoose, + initlizerDefineProperty = bableHelpers.initializerDefineProperty, + assertedThisInitalizd = bableHelpers.assertThisInitialized + } + , function(e) { + __cc = e.cclegacy, + ccDecorator = e._decorator, + ccPrefabe = e.Prefab, + ccNode = e.Node, + ccCCOBJECT = e.CCObject, + ccinput = e.input, + ccInput = e.Input, + ccKeyCode = e.KeyCode, + ccDirecotr = e.director, + ccInstanitate = e.instantiate, + ccButton = e.Button, + ccLabel = e.Label, + ccComponent = e.Component + } + , function(e) { + isInIFrame = e.inIFrame, + isMobile = e.isMobile + } + ], + execute: function() { + var ToolboxSectionClassDecorated, P, _, C, T, z, S, R, A, N, k, B, D, x, E, K, I, O, U, F, L, G, H, W, j; + __cc._RF.push({}, "6ec179VR5lA8rf8Fv5KJHpJ", "DebuggerToolbox", void 0); + var ccClassDecorator = ccDecorator.ccclass + , ccDecoratorProperty = ccDecorator.property + , Q = (ToolboxSectionClassDecorated = ccClassDecorator("ToolboxSection"), + P = ccDecoratorProperty(ccPrefabe), + ToolboxSectionClassDecorated((T = applyDecoratedSCriptor((C = function(e) { + function t() { + for (var t, i = arguments.length, r = new Array(i), a = 0; a < i; a++) + r[a] = arguments[a]; + return t = e.call.apply(e, [this].concat(r)) || this, + initlizerDefineProperty(t, "Prefab", T, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "Name", z, assertedThisInitalizd(t)), + t + } + return inheritsLoose(t, e), + t + }(ccCCOBJECT)).prototype, "Prefab", [P], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + z = applyDecoratedSCriptor(C.prototype, "Name", [ccDecoratorProperty], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: function() { + return "" + } + }), + _ = C)) || _); + e("DebuggerToolbox", (S = ccClassDecorator("DebuggerToolbox"), + R = ccDecoratorProperty(ccPrefabe), + A = ccDecoratorProperty(ccPrefabe), + N = ccDecoratorProperty([ccNode]), + k = ccDecoratorProperty([Q]), + B = ccDecoratorProperty(ccPrefabe), + D = ccDecoratorProperty(ccPrefabe), + x = ccDecoratorProperty(ccPrefabe), + E = ccDecoratorProperty(ccPrefabe), + S((O = applyDecoratedSCriptor((I = function(e) { + function t() { + for (var t, i = arguments.length, r = new Array(i), a = 0; a < i; a++) + r[a] = arguments[a]; + return t = e.call.apply(e, [this].concat(r)) || this, + initlizerDefineProperty(t, "simpleButtonPrefab", O, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "vertGroupPrefab", U, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "columnRoot", F, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "sections", L, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "powerupPrefab", G, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "networkPrefab", H, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "cameraPrefab", W, assertedThisInitalizd(t)), + initlizerDefineProperty(t, "coursePrefab", j, assertedThisInitalizd(t)), + t._isShowing = !1, + t._sectionNodes = [], + t._paused = !1, + t + } + inheritsLoose(t, e); + var r = t.prototype; + return r.start = function() { + if (!(window._PuttEnv && window._PuttEnv.enabled || !1) && isInIFrame()) + this.node.destroy(); + else if (isMobile()) { + this.node.setScale(1.25, 1.25, 1.25); + var e = this.node.position; + this.node.setPosition(e.x + 50, e.y, e.z), + ccinput.on(ccInput.EventType.TOUCH_START, this.onTouchStart, this) + } else + ccinput.on(ccInput.EventType.KEY_UP, this.onKeyUp, this) + } + , + r.onTouchStart = function(e) { + 3 == e.getAllTouches().length && (this._isShowing = !this._isShowing, + this._isShowing ? this.show() : this.hide()) + } + , + r.onKeyUp = function(e) { + e.keyCode == ccKeyCode.BACK_QUOTE ? (this._isShowing = !this._isShowing, + this._isShowing ? this.show() : this.hide()) : e.keyCode == ccKeyCode.ARROW_DOWN ? ccDirecotr.pause() : e.keyCode == ccKeyCode.ARROW_UP && ccDirecotr.resume() + } + , + r.show = function() { + var e = this + , t = this.columnRoot[0]; + t.destroyAllChildren(), + this.node.active = !0; + var i = ccInstanitate(this.vertGroupPrefab); + t.addChild(i), + this._sectionNodes = []; + for (var o = function(o) { + var n = e.sections[o] + , r = ccInstanitate(n.Prefab); + t.addChild(r), + r.active = !1, + e._sectionNodes.push(r), + e.makeButton(i, n.Name, (function() { + for (var t = o, i = 0; i < e._sectionNodes.length; ++i) + e._sectionNodes[i].active = i == t + } + )) + }, n = 0; n < this.sections.length; ++n) + o(n) + } + , + r.makeButton = function(e, t, i) { + var o = ccInstanitate(this.simpleButtonPrefab) + , n = o.getComponentInChildren(ccButton) + , r = o.getComponentInChildren(ccLabel); + e.addChild(o), + r.string = t, + n.node.on(ccButton.EventType.CLICK, (function(e) { + i() + } + )) + } + , + r.hide = function() { + this.columnRoot[0].destroyAllChildren(), + this.node.active = !1 + } + , + t + }(ccComponent)).prototype, "simpleButtonPrefab", [R], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + U = applyDecoratedSCriptor(I.prototype, "vertGroupPrefab", [A], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + F = applyDecoratedSCriptor(I.prototype, "columnRoot", [N], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: function() { + return [] + } + }), + L = applyDecoratedSCriptor(I.prototype, "sections", [k], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: function() { + return [] + } + }), + G = applyDecoratedSCriptor(I.prototype, "powerupPrefab", [B], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + H = applyDecoratedSCriptor(I.prototype, "networkPrefab", [D], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + W = applyDecoratedSCriptor(I.prototype, "cameraPrefab", [x], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + j = applyDecoratedSCriptor(I.prototype, "coursePrefab", [E], { + configurable: !0, + enumerable: !0, + writable: !0, + initializer: null + }), + K = I)) || K)); + __cc._RF.pop() + } + } +} +)); + +System.register("chunks:///_virtual/DGMath.ts", ["cc"], (function(t) { + var n, e, r; + return { + setters: [function(t) { + n = t.cclegacy, + e = t._decorator, + r = t.Vec3 + } + ], + execute: function() { + var c; + n._RF.push({}, "1500fu+7CVJ2YsBkK8QIrZK", "DGMath", void 0); + var u = e.ccclass; + e.property, + t("DGMath", u("DGMath")(c = function() { + function t() {} + return t.getSign = function(t) { + return t >= 0 ? 1 : -1 + } + , + t.getSignedAngle = function(t, n, e) { + var c = r.angle(t, n) * (180 / Math.PI) + , u = t.y * n.z - t.z * n.y + , a = t.z * n.x - t.x * n.z + , i = t.x * n.y - t.y * n.x; + return c * this.getSign(e.x * u + e.y * a + e.z * i) + } + , + t + }()) || c); + n._RF.pop() + } + } +} +)); \ No newline at end of file diff --git a/out.js/deobfuscated.js b/out.js/deobfuscated.js new file mode 100644 index 0000000..9b09ac2 --- /dev/null +++ b/out.js/deobfuscated.js @@ -0,0 +1,286 @@ +System.register("chunks:///_virtual/DebuggerToolbox.ts", ["./rollupPluginModLoBabelHelpers.js", "cc", "./utils.ts"], function (e) { + var applyDecoratedSCriptor; + var inheritsLoose; + var initlizerDefineProperty; + var assertedThisInitalizd; + var __cc; + var ccDecorator; + var ccPrefab; + var ccNode; + var ccCCOBJECT; + var ccinput; + var ccInput; + var ccKeyCode; + var ccDirecotr; + var ccInstanitate; + var ccButton; + var ccLabel; + var ccComponent; + var isInIFrame; + var isMobile; + return { + setters: [function (bableHelpers) { + applyDecoratedSCriptor = bableHelpers.applyDecoratedDescriptor; + inheritsLoose = bableHelpers.inheritsLoose; + initlizerDefineProperty = bableHelpers.initializerDefineProperty; + assertedThisInitalizd = bableHelpers.assertThisInitialized; + }, function (CC) { + __cc = CC.cclegacy; + ccDecorator = CC._decorator; + ccPrefab = CC.Prefab; + ccNode = CC.Node; + ccCCOBJECT = CC.CCObject; + ccinput = CC.input; + ccInput = CC.Input; + ccKeyCode = CC.KeyCode; + ccDirecotr = CC.director; + ccInstanitate = CC.instantiate; + ccButton = CC.Button; + ccLabel = CC.Label; + ccComponent = CC.Component; + }, function (utils) { + isInIFrame = utils.inIFrame; + isMobile = utils.isMobile; + }], + execute: function () { + var ToolboxSectionClassDecorated; + var PrefabDecoratorProperty; + var _; + var BaseClass; + var ToolboxSection; + var z; + var S; + var R; + var A; + var N; + var k; + var B; + var D; + var x; + var E; + var K; + var I; + var simpleButtonPrefab; + var vertGroupPrefab; + var columnRoot; + var sections; + var powerupPrefab; + var networkPrefab; + var cameraPrefab; + var coursePrefab; + + __cc._RF.push({}, "6ec179VR5lA8rf8Fv5KJHpJ", "DebuggerToolbox", undefined); + var ccClassDecorator = ccDecorator.ccclass; + var ccDecoratorProperty = ccDecorator.property; + ToolboxSectionClassDecorated = ccClassDecorator("ToolboxSection"); + PrefabDecoratorProperty = ccDecoratorProperty(ccPrefab); + function createClass(base) { + function ToolboxSection() { + var instance; + for (var index = arguments.length, args = new Array(index), a = 0; a < index; a++) { + args[a] = arguments[a]; + } + instance = base.call.apply(base, [this].concat(args)) || this; + initlizerDefineProperty(instance, "Prefab", ToolboxSection, assertedThisInitalizd(instance)); + initlizerDefineProperty(instance, "Name", z, assertedThisInitalizd(instance)); + return instance; + } + inheritsLoose(ToolboxSection, base); + return ToolboxSection; + } + const thing = (ToolboxSection = applyDecoratedSCriptor((BaseClass = createClass(ccCCOBJECT)).prototype, "Prefab", [PrefabDecoratorProperty], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), z = applyDecoratedSCriptor(BaseClass.prototype, "Name", [ccDecoratorProperty], { + configurable: true, + enumerable: true, + writable: true, + initializer: function () { + return ""; + } + }), _ = BaseClass); + + var DecoratedToolboxSection = ToolboxSectionClassDecorated(thing) || _; + e("DebuggerToolbox", (S = ccClassDecorator("DebuggerToolbox"), R = ccDecoratorProperty(ccPrefab), A = ccDecoratorProperty(ccPrefab), N = ccDecoratorProperty([ccNode]), k = ccDecoratorProperty([DecoratedToolboxSection]), B = ccDecoratorProperty(ccPrefab), D = ccDecoratorProperty(ccPrefab), x = ccDecoratorProperty(ccPrefab), E = ccDecoratorProperty(ccPrefab), S((simpleButtonPrefab = applyDecoratedSCriptor((I = function (e) { + function createPrefabeInstances() { + var instnaace; + for (var index = arguments.length, args = new Array(index), a = 0; a < index; a++) { + args[a] = arguments[a]; + } + instnaace = e.call.apply(e, [this].concat(args)) || this; + initlizerDefineProperty(instnaace, "simpleButtonPrefab", simpleButtonPrefab, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "vertGroupPrefab", vertGroupPrefab, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "columnRoot", columnRoot, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "sections", sections, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "powerupPrefab", powerupPrefab, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "networkPrefab", networkPrefab, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "cameraPrefab", cameraPrefab, assertedThisInitalizd(instnaace)); + initlizerDefineProperty(instnaace, "coursePrefab", coursePrefab, assertedThisInitalizd(instnaace)); + instnaace._isShowing = false; + instnaace._sectionNodes = []; + instnaace._paused = false; + return instnaace; + } + inheritsLoose(createPrefabeInstances, e); + var createPrefabInstancesPrototype = createPrefabeInstances.prototype; + + createPrefabInstancesPrototype.start = () => { + // If the environment is not enabled and the code is running in an iframe, destroy the node + if ((!window._PuttEnv || !window._PuttEnv.enabled) && isInIFrame()) { + this.node.destroy(); + } + // If the code is running on a mobile device, scale the node and adjust its position + else if (isMobile()) { + this.node.setScale(1.25, 1.25, 1.25); + var currentPosition = this.node.position; + this.node.setPosition(currentPosition.x + 50, currentPosition.y, currentPosition.z); + ccinput.on(ccInput.EventType.TOUCH_START, this.onTouchStart, this); + } + // If the code is running on a non-mobile device, listen for the KEY_UP event + else { + ccinput.on(ccInput.EventType.KEY_UP, this.onKeyUp, this); + } + }; + + // logic for opening ui on mobile + createPrefabInstancesPrototype.onTouchStart = function (e) { + if (e.getAllTouches().length == 3) { + this._isShowing = !this._isShowing; + if (this._isShowing) { + this.show(); + } else { + this.hide(); + } + } + }; + + // logit for opening ui on desktop + createPrefabInstancesPrototype.onKeyUp = function (event) { + if (event.keyCode == ccKeyCode.BACK_QUOTE) { + this._isShowing = !this._isShowing; + if (this._isShowing) { + this.show(); + } else { + this.hide(); + } + } else if (event.keyCode == ccKeyCode.ARROW_DOWN) { + ccDirecotr.pause(); + } else if (event.keyCode == ccKeyCode.ARROW_UP) { + ccDirecotr.resume(); + } + }; + + // + createPrefabInstancesPrototype.show = function () { + var self = this; + var rootColumn = this.columnRoot[0]; + + // Destroy all children of the root column + rootColumn.destroyAllChildren(); + + // Make the node active + this.node.active = true; + + // Instantiate the vertical group prefab and add it as a child to the root column + var vertGroupInstance = ccInstanitate(this.vertGroupPrefab); + rootColumn.addChild(vertGroupInstance); + + // Initialize the section nodes array + this._sectionNodes = []; + + var createSection = function (sectionIndex) { + var section = self.sections[sectionIndex]; + + // Instantiate the section prefab and add it as a child to the root column + var sectionInstance = ccInstanitate(section.Prefab); + rootColumn.addChild(sectionInstance); + + // Initially, make the section instance inactive + sectionInstance.active = false; + + // Add the section instance to the section nodes array + self._sectionNodes.push(sectionInstance); + + // Create a button for the section + self.makeButton(vertGroupInstance, section.Name, function () { + for (var i = 0; i < self._sectionNodes.length; ++i) { + // Only the section corresponding to the clicked button should be active + self._sectionNodes[i].active = i == sectionIndex; + } + }); + }; + + // Create a section for each section in the sections array + for (var i = 0; i < this.sections.length; ++i) { + createSection(i); + } + }; + + createPrefabInstancesPrototype.makeButton = function (e, t, i) { + var o = ccInstanitate(this.simpleButtonPrefab); + var n = o.getComponentInChildren(ccButton); + var r = o.getComponentInChildren(ccLabel); + e.addChild(o); + r.string = t; + n.node.on(ccButton.EventType.CLICK, function (e) { + i(); + }); + }; + + + createPrefabInstancesPrototype.hide = function () { + this.columnRoot[0].destroyAllChildren(); + this.node.active = false; + }; + return createPrefabeInstances; + }(ccComponent)).prototype, "simpleButtonPrefab", [R], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), vertGroupPrefab = applyDecoratedSCriptor(I.prototype, "vertGroupPrefab", [A], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), columnRoot = applyDecoratedSCriptor(I.prototype, "columnRoot", [N], { + configurable: true, + enumerable: true, + writable: true, + initializer: function () { + return []; + } + }), sections = applyDecoratedSCriptor(I.prototype, "sections", [k], { + configurable: true, + enumerable: true, + writable: true, + initializer: function () { + return []; + } + }), powerupPrefab = applyDecoratedSCriptor(I.prototype, "powerupPrefab", [B], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), networkPrefab = applyDecoratedSCriptor(I.prototype, "networkPrefab", [D], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), cameraPrefab = applyDecoratedSCriptor(I.prototype, "cameraPrefab", [x], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), coursePrefab = applyDecoratedSCriptor(I.prototype, "coursePrefab", [E], { + configurable: true, + enumerable: true, + writable: true, + initializer: null + }), K = I)) || K)); + __cc._RF.pop(); + } + }; +}); \ No newline at end of file diff --git a/src/gui/GUIManager.ts b/src/gui/GUIManager.ts index c154d3e..a4f3dad 100644 --- a/src/gui/GUIManager.ts +++ b/src/gui/GUIManager.ts @@ -67,7 +67,8 @@ class GUIManager implements IGUIManager { fontSize: "4vh", left: "85%" } }) - .setText("+"); + .setText("+") + .setStyle("display", module.getSettings().size > 0 ? "block" : "none"); const moduleNameElementContainer = createElement("div", { style: { ...styles.moduleNameContainer, flexDirection: "row", @@ -104,6 +105,7 @@ class GUIManager implements IGUIManager { } }) .onRightClick(() => { + if (module.getSettings().size === 0) return; if (settingsOpen) { moduleSettingOpenIndicator.setText("+"); moduleSettingsContainer.setStyle("display", "none"); diff --git a/src/index.ts b/src/index.ts index e95bf32..e5dc228 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ import { moduleManager } from "./module/ModuleManager"; import "./patcher/index"; import "./gui/index"; -import { FPSUnlocker } from "@modules/index"; +import { FPSUnlocker, RemoveFatasses } from "@modules/index"; moduleManager.registerModule(FPSUnlocker); +moduleManager.registerModule(RemoveFatasses) // @ts-ignore window.mm = moduleManager; \ No newline at end of file diff --git a/src/module/modules/index.ts b/src/module/modules/index.ts index 3726ce1..b7d8360 100644 --- a/src/module/modules/index.ts +++ b/src/module/modules/index.ts @@ -1,5 +1,7 @@ import FPSUnlocker from "./misc/FPSUnlocker" +import RemoveFatasses from "./world/RemoveFatasses" export { - FPSUnlocker + FPSUnlocker, + RemoveFatasses } \ No newline at end of file diff --git a/src/module/modules/misc/FPSUnlocker.ts b/src/module/modules/misc/FPSUnlocker.ts index a83d6fd..0800383 100644 --- a/src/module/modules/misc/FPSUnlocker.ts +++ b/src/module/modules/misc/FPSUnlocker.ts @@ -4,7 +4,6 @@ import { getGameManager } from "@api/Game"; import cocos from "@api/cocos"; import { ModuleSettingBool, ModuleSettingNumber } from "module/ModuleManager.types"; import { after } from "spitroast"; -import { unpatch } from "spitroast/dist/types/unpatch"; enum GameState { Init = 0, diff --git a/src/module/modules/world/RemoveFatasses.ts b/src/module/modules/world/RemoveFatasses.ts new file mode 100644 index 0000000..78fb399 --- /dev/null +++ b/src/module/modules/world/RemoveFatasses.ts @@ -0,0 +1,40 @@ +import { Module } from "../../ModuleManager"; +import { getScene } from "@api/Scene"; + +class EjectModule extends Module { + constructor() { + super("RemoveFatasses", "Removes all the large dancing creatures from the current map (client-sided)", "World") + } + + getDisplayName(): string { + return "RemoveFatasses"; + } + + onEnable(): void { + // for some reason they are located in a different positions in the node tree depending on the map ???? discord stupid + try { + getScene().getChildByName("LevelCharacters")?.setScale(0,0,0) + // most maps seem to do this + getScene().getChildByName("Level")?.getChildByName("Level_Characters")?.setScale(0,0,0); + // Jumpington + getScene().getChildByName("Level")?.getChildByName("Levels_Characters")?.setScale(0,0,0); + } catch (error) { + console.error("Failed to remove fatasses", error) + } + } + + onDisable(): void { + try { + getScene().getChildByName("LevelCharacters")?.setScale(1,1,1) + getScene().getChildByName("Level")?.getChildByName("Level_Characters")?.setScale(1,1,1); + getScene().getChildByName("Level")?.getChildByName("Levels_Characters")?.setScale(1,1,1); + } catch (error) { + console.error("Failed to add fatasses", error) + } + } + + onSettingsUpdate(setting: string): void { + } +} + +export default new EjectModule(); \ No newline at end of file