Typescript refactor - #614
Conversation
Reads raw touch events via getevent to detect where the user taps, then finds the connected same-color component at that position and draws the chain. Disables auto-play when active so the user picks the cluster. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ws only. Broke up scripts into multiple files A few other updates
The tiara-minnie-plus merge restored the pre-refactor monolithic index.ts alongside the split files. Since tsconfig concatenates index.ts last, its 54 duplicate Tsum.prototype assignments overwrote the split versions at load time, making the tiara/minnie+ skill, dialog handling and taskWatchdog dead code. Restore the entry-point index.ts and move the master-side Click Assist work into clickAssist.ts + pathfinding.ts (findChainAtTouch). pollSkillActivation is dropped: link()'s blind-tap path supersedes it. Each skill now lives in its own file under src/skills/ and registers a handler with skillCore.ts. useSkill keeps the parts common to every skill -- gauge check, fever hold-off, activation tap(s) -- and delegates the choreography. Pair Tsum's second button and the burst family's blind-tap eligibility become registry flags instead of skillType string comparisons scattered across useSkill, link and maybeAutoTapSkill. Drops the isSkillActive helper, which duplicated checkSkillReadiness's color table and was equivalent to its 'active' result. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Orientation doc for the source: what each non-skill .ts file holds, how the concatenated single-global-scope bundle works and why tsconfig file order matters, the settings-UI-to-script boundary, the dependency layering, and a lookup table for common tasks. Links it from README.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replaces the monolithic index.js/index.html with TsumThi's split TypeScript source (src/*.ts + src/skills/, outFile-bundled to dist/index.js), including all 15 skill handlers, and the build/deploy tooling that goes with it. Excluded: the file-backed pause (gPause + tools/pause-hotkey.ahk), which is a PC-side dev aid rather than a script feature. doc/screenshots is not duplicated -- the Tiara reference frames stay in com.r2studio.TsumThi. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@mcs @jasoncwho Here's the TS refactor. Made the DEVELOPMENT.MD to explain the structure and where things live as a starting point for other developers. |
* v84 - fix auto unlock , add max chain * v85
33386a0 to
07c1b44
Compare
|
Hey hey, I'll try compiling it tomorrow, diff the result with the current script files and try understanding the structure. Typescript is of course a way better choice for source code than ES4, but even mid 2026 I am still sceptical regarding AI generated stuff. I'll leave a review here soon 😊 |
|
@thireven you are changing the behavior of depth first search in this refactor, could u take it out and keep the same logic as it so that we can do an apple to apple comparison? Thanks |
Closes the last feature gaps against TsumBeta v85: - "Maximum chain length" setting (default 0 = no limit). Caps the chain the board scan returns, trading a few long chains for many short ones, which suits Roxas/Maleficent-type Tsums and high-FPS setups. Applied as a stopping condition inside the longest-path DFS rather than a trim, so a short cap also halves the per-scan search cost. Click Assist is exempt -- pointing at a chain should still draw all of it. - Re-measured the eight lock-badge samples used by "Unlock Level every hours" (239,247,255 on the current client). - Board scans log the chain lengths they found when debug logs are on. Verified offline at caps 0/3/5/8/12: chains never exceed the cap, stay contiguous, repeat no tsum, and a cap above what the board offers gives exactly the uncapped result. Deliberately not ported: TsumBeta's greedy nearest-neighbour path search (the graph longest-path here supersedes it), and the "Handle Long Skill Animations" toggle -- Tsum already confirms game over positively rather than assuming it, unconditionally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tsum is a TypeScript refactor of TsumBeta, so a run of one has to be comparable with a run of the other. Settings surface is now identical on every shared key -- same titles, defaults, min/max/step: - "Maximum Chain Number" takes Beta's spec (3-15, default 3) instead of the 0-means-no-limit variant added here. - "Handle Long Skill Animations" added; the positive game-over confirmation is now behind it, as in Beta, rather than always on. - "Auto Tap Skill" back to Beta's title and its default of on. - "Tsum app restart frequency" back to 6-hour steps. Behavioural alignment: - linkTsums drag timings back to Beta's 10/10/10ms. These had been raised to 30/20/20 after the game was seen missing presses; if that returns it returns in Beta too, and they have to move together. - taskTsumAppRestart inlines Beta's restart (10s wait, relaunch only if the app is down) instead of calling forceRestartApp(), which is the stall-recovery path and differs. Also fixes calculateNearTsumPaths in TsumBeta, which the merge at 0e31690 left calling into the deleted findTsumComponents -- it pushed to an undefined `components` and never appended to the path, throwing on first use. Restored from upstream/master. DEVELOPMENT.md gains a parity ledger: the comparison method, the differences that are form-only (leak guards, hoisting, lifted constants, skill dispatch table), and the ten that are real. Remaining divergences are structural and still open: path search, native dialog handling, navigation stall guards, the sender-portrait cap, and the three Tsum-only settings (all defaulting to Beta's behaviour). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The rest of the Page and Button tables compare value-identical; the RootDetection entries differ because the navigation loops branch on the unified name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
996627e to
06a5fa7
Compare
@jasoncwho This branch should now have feature parity with TsumBeta |
|
|
||
| // double check | ||
| const page = this.findPage(1, 2500); | ||
| let page = this.findPage(1, 2500); |
There was a problem hiding this comment.
It'll get compiled down to var.
|
I'm still working on some major refactors for this so that it can better utilize Typescript (like finding and clicking-through references). Some of the goals I hope to achieve with this refactor:
If there's anything you guys want to implement in the meantime, please do so and don't let this PR hold anything up. I can port whatever gets released into this PR until it's fully ready. |
|
the idea is good. |
|
one more difference: var blindTap = skillBareTapActivates(this.skillType); |
|
this.gameBubbles = this.skillType === 'block_tiara_minnie_plus_s' |
|
i have completed the review, good job, thank you for your contribution. |
I made a few minor changes based on some of the differences (removed the blindTap addition), but the intent was always feature-parity rather than exact code output match. They should result in the same game behavior. Thank you for the time put in reviewing this PR so far! |
This is an infrastructure update and should have no bearing on the game itself. I've kept it at v85 since it doesn't add anything new in the end product.
I think we should be ok to take over the old/abandoned Tsum folder here. This update should have the same updates as Beta and should ultimately be what most people use after the update.