Name box in the New world panel (t10)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 01:19:25 -04:00
co-authored by Claude Opus 5.5
parent 40d9647b73
commit edd9cdf940
9 changed files with 52 additions and 12 deletions
+2 -2
View File
@@ -15,13 +15,13 @@ function enterGame() {
GAME.drag = null; GAME.lmb = GAME.rmb = false; lastBagKey = '';
hudDirty = true; renderHotbar();
}
function startNewWorld(seed, w, h) {
function startNewWorld(seed, w, h, name = '') {
auInit();
showLoading(true, 0);
setTimeout(async () => {
try {
const worlds = await listWorlds();
GAME.worldId = newWorldId(); GAME.worldName = `World ${worlds.length + 1}`;
GAME.worldId = newWorldId(); GAME.worldName = cleanWorldName(name, `World ${worlds.length + 1}`);
await putWorldEntry({ id: GAME.worldId, name: GAME.worldName, seed, w, h, createdAt: Date.now(), savedAt: 0, playTime: 0 });
generateWorld(seed, w, h, null);
GAME.playTime = 0; GAME.clip = null; GAME.paste = false; GAME.selDrag = null; GAME.tool = 0; GAME.dropMat = 0; GAME.matChosen = false; GAME.wallMat = RSTONE; GAME.filterCfg = { m: [], inv: 0 }; GAME.pieceIdx = 0;