Open asset greyed out and real tab cards: Open asset in the scene object menu is only pickable for kinds with an editor of their own, the table of which asset opens which tab moved from Editor.ts into the new module assetTabs.ts with hasAssetEditor so the menu and the editor read the same list, Select asset stays as it was; tabs are drawn as index cards (new module TabButton.ts): the one showing is a light grey card instead of the aggressive blue, rounded above and square below, its name in plain weight and measured bold so it never clips itself, and a mouse down on the tab already showing keeps its colour; the padding left and right grew to 6 px in one place for both kinds of tab, Scene and Game carry an icon too (the scene one from the asset panel, a new game.svg play sign), Plugins and a plugin's own tab have none; new test hook menuEnabled next to menuRows and menuIcons, e2e 01 checks the greyed out entry on a sprite row, 14a-ii the card and the icons of the fixed tabs, 44a the icon at the wider padding (#176)
game-maker / gate (push) Successful in 2m5s
game-maker / suite (push) Successful in 7m0s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-20 11:40:01 +02:00
1 parent 4b5b91eaaa
commit 60ea56a2ce
17 files changed
+287 -47

No files matched your search

+7 -14
View File
@@ -1,6 +1,5 @@
import type { Application } from 'pixi.js';
import type { Asset } from '../core/model/Asset';
import type { AssetType } from '../core/model/AssetTypes';
import { findAsset, findObjectHolder } from '../core/model/Project';
import type { ProjectStore } from '../core/store/ProjectStore';
import type { FontStore } from '../core/store/FontStore';
@@ -26,6 +25,7 @@ import { closeDocument, type DocumentRow, openDocument, replaceDocument } from '
import { ConsolePanel } from './console/ConsolePanel';
import { GameViewport } from './viewport/GameViewport';
import { SceneViewport } from './viewport/SceneViewport';
import { TAB_OF_ASSET } from './assetTabs';
import { attachAutosave } from './autosave';
import { ContainerEditor } from './container/ContainerEditor';
import { EditorRun } from './EditorRun';
@@ -36,7 +36,7 @@ import { resolveList } from './list/slot';
import { AnimationEditor } from './animation/AnimationEditor';
import { TileEditor } from './tile/TileEditor';
import { AssetPanel } from './panels/AssetPanel';
import { ASSET_ICON_SVG, LIST_ICON_SVG } from './panels/assetIcons';
import { ASSET_ICON_SVG, GAME_ICON_SVG, LIST_ICON_SVG } from './panels/assetIcons';
import { HierarchyPanel } from './panels/HierarchyPanel';
import { TilemapPanel } from './panels/TilemapPanel';
import { Toolbar } from './panels/Toolbar';
@@ -113,17 +113,10 @@ const TAB_LABELS: Record<CentreTab, string> = {
plugins: 'Plugins',
};
/** Where an opened asset goes; a placeable one (sprite, camera, text, collider) has no tab of its own. */
const TAB_OF_ASSET: Partial<Record<AssetType, CentreTab>> = {
scene: 'scene',
behavior: 'graph',
statemachine: 'statemachine',
shader: 'shader',
particles: 'particles',
texture: 'texture',
animation: 'animation',
tile: 'tile',
container: 'container',
/** Icons of the fixed tabs (#176); the Plugins tab has none, as plugins have no picture of their own. */
const FIXED_TAB_ICONS: Partial<Record<FixedTab, string>> = {
scene: ASSET_ICON_SVG.scene,
game: GAME_ICON_SVG,
};
function isDocument(tab: StripTab): tab is DocumentId {
@@ -279,7 +272,7 @@ export class Editor implements PlayHost {
this.centre = new VStack();
this.tabs = new TabStrip<StripTab>(
FIXED_TABS.map((tab) => ({ tab, label: TAB_LABELS[tab] })),
FIXED_TABS.map((tab) => ({ tab, label: TAB_LABELS[tab], icon: FIXED_TAB_ICONS[tab] })),
(tab) => this.pickTab(tab),
);
this.tabs.minHeight = Theme.controlHeight + 8;