From 38213b8638121a221c6f5ee1222993472b72331b Mon Sep 17 00:00:00 2001 From: kittiwat424-tech Date: Tue, 10 Nov 2026 21:08:34 +0700 Subject: [PATCH 1/9] Add universal top-speed tuning action to editor scope --- src/controller/editor-scope.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controller/editor-scope.ts b/src/controller/editor-scope.ts index 38aa734..4bd0155 100644 --- a/src/controller/editor-scope.ts +++ b/src/controller/editor-scope.ts @@ -258,6 +258,7 @@ export interface EditorScope extends angular.IScope { resetScalar(param: number): void; selectSetup(setup: DynoEvent): void; optimizeDyno(): void; + ultimateTuneAll(): void; applyDyno(): void; discardDyno(): void; selectCurve(kind: DynoTab): void; From 1a6488590359977709138f3047cdee5ce2acce73 Mon Sep 17 00:00:00 2001 From: kittiwat424-tech Date: Tue, 10 Nov 2026 21:08:53 +0700 Subject: [PATCH 2/9] Add all-car top-speed tuning preset --- src/controller/editor-controller.ts | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/controller/editor-controller.ts b/src/controller/editor-controller.ts index e986d8c..7fb4bb4 100644 --- a/src/controller/editor-controller.ts +++ b/src/controller/editor-controller.ts @@ -17,7 +17,7 @@ import { TRAFFIC_CARS } from '../data/traffic-cars.js'; import { setSlotTrafficCar } from '../model/slots.js'; import { colorPalettes, isVisualColorSlot, parseVisualData, readVisual, VISUAL_SLOTS, VisualCatalog } from '../model/visual.js'; import { - CURVE_POINTS, DynoModel, ECU_OFF, findCar, KW_TO_HP, MPH_TO_KMH, NEUTRAL_BYTE, NM_TO_LBFT, optimizeDynoSetup, parseGameData, + CURVE_POINTS, DynoModel, ECU_OFF, findCar, KW_TO_HP, MPH_TO_KMH, NEUTRAL_BYTE, NM_TO_LBFT, optimizeDynoSetup, optimizeSetup, parseGameData, readSlotDyno, setSetupTuning, SETUP_NAMES, SETUP_SIZE, TURBO_OFF, type CurveKind, type CurvePoint, type DynoEvent, type DynoResult, type GameData, type Gearing, type ScalarRow, type TuningBand, } from '../model/dyno.js'; @@ -843,6 +843,41 @@ export function EditorController($scope: EditorScope): void { }, 30); }; + /** Apply the top-speed objective to every supported filled garage slot and all five setups. */ + $scope.ultimateTuneAll = function (): void { + if (!data || !game || $scope.tuning.dyno.busy) { + setStatus('error', 'Load a career save and GLOBAL\\\\GLOBALB.BUN before tuning all cars.'); + return; + } + if (!confirm('Create a top-speed tuning draft for every supported car and all five setups?\\n\\nOnly existing installed parts and in-game gear ranges are used. Original save remains unchanged until you download the edited save. Back up your save first.')) return; + let next = data.slice(); + let tuned = 0, skipped = 0; + const notes: string[] = []; + for (let slot = 0; slot < slotCount(next); slot++) { + if (!isSlotUsed(next, slot) || isSlotLocked(next, slot)) { skipped++; continue; } + const sd = readSlotDyno(next, slot); + if (TRAFFIC_CARS.some((car) => car.hash === sd.hash)) { skipped++; continue; } + const car = findCar(game, sd.hash); + if (!car) { skipped++; continue; } + const model = new DynoModel(game, car, sd.installed, sd.uniques); + if (!model.ecuTunable && !model.turboTunable && !model.gearingParameters.length) { skipped++; continue; } + let slotTop = 0; + for (let setup = 0; setup < SETUP_NAMES.length; setup++) { + const result = optimizeSetup(model, sd.setups[setup], 'top', true); + next = setSetupTuning(next, slot, setup as DynoEvent, result.setup, true, false); + slotTop = Math.max(slotTop, result.after.topSpeed * MPH_TO_KMH); + } + tuned++; + notes.push(`${car.name}: ${Math.round(slotTop)} km/h simulated max`); + } + if (!tuned) { + setStatus('error', 'No supported filled cars were available. Check the save, installed parts and GLOBALB.BUN.'); + return; + } + applyResult(next); + setStatus('success', `Top-speed tuning prepared for ${tuned} cars across all five setups; ${skipped} slots skipped. Dyno figures are estimates, not a guarantee of 350 km/h. ${notes.join(' | ')} Download to save.`); + }; + $scope.applyDyno = function (): void { const built = dynoModel(); const key = draftKey(), bytes = drafts.get(key)?.bytes; From 20afcdafe4c909509804c1c3e8e87329de586c3b Mon Sep 17 00:00:00 2001 From: kittiwat424-tech Date: Tue, 10 Nov 2026 21:09:00 +0700 Subject: [PATCH 3/9] Add Ultimate Top Speed all-cars control --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index c8c66b6..851769e 100644 --- a/index.html +++ b/index.html @@ -282,6 +282,9 @@

{{ palette.name }}

{{ tuning.dyno.carName }} +

{{ tuning.dyno.blocked }}

+
+ + Optimizes every supported unlocked garage car across all five setups. +
{{ tuning.dyno.carName }} -