Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(editor): name a section for what it holds, split a switch that held two things

esenginedaac490c6d8f
diff --git a/desktop/src/commands/editorCommands.ts b/desktop/src/commands/editorCommands.ts
index 8873ccc2b..0f8eed2ae 100644
--- a/desktop/src/commands/editorCommands.ts
+++ b/desktop/src/commands/editorCommands.ts
@@ -518,6 +518,13 @@ commands.register({
isChecked: () => editor().showCoords,
run: () => editor().toggleCoords(),
});
+commands.register({
+ id: 'view.toggleHints',
+ label: t('cmd.view.toggleHints'),
+ category: t('cat.view'),
+ isChecked: () => editor().showHints,
+ run: () => editor().toggleHints(),
+});
// — Editor —
commands.register({
diff --git a/desktop/src/i18n/messages/commands.ts b/desktop/src/i18n/messages/commands.ts
index 002eee5ba..f1327aa97 100644
--- a/desktop/src/i18n/messages/commands.ts
+++ b/desktop/src/i18n/messages/commands.ts
@@ -61,6 +61,7 @@ export const commandMessages = defineMessages({
'cmd.view.toggleMinimap': { en: 'Minimap', zh: '小地图' },
'cmd.view.toggleStats': { en: 'Stats HUD', zh: '统计信息' },
'cmd.view.toggleCoords': { en: 'Coordinates HUD', zh: '坐标信息' },
+ 'cmd.view.toggleHints': { en: 'Tool Hints', zh: '工具提示' },
'cmd.view.zoomIn': { en: 'Zoom In', zh: '放大界面' },
'cmd.view.zoomOut': { en: 'Zoom Out', zh: '缩小界面' },
'cmd.view.zoomReset': { en: 'Reset Zoom', zh: '重置界面缩放' },
diff --git a/desktop/src/i18n/messages/settings.ts b/desktop/src/i18n/messages/settings.ts
index 014d67a28..c12d784a9 100644
--- a/desktop/src/i18n/messages/settings.ts
+++ b/desktop/src/i18n/messages/settings.ts
@@ -36,7 +36,9 @@ export const settingsMessages = defineMessages({
'set.section.performance': { en: 'Performance', zh: '性能' },
'set.section.shortcuts': { en: 'Keyboard Shortcuts', zh: '键盘快捷键' },
'set.section.console': { en: 'Console', zh: '控制台' },
- 'set.section.renderer': { en: 'Renderer', zh: '渲染器' },
+ // Names the GPU device it picks, not the subsystem: "Renderer" sat one word
+ // from the project's "Rendering" in the same rail, and holds nothing of it.
+ 'set.section.renderer': { en: 'Graphics Backend', zh: '图形后端' },
'set.section.externalTools': { en: 'External Tools', zh: '外部工具' },
'set.section.agents': { en: 'AI Agents', zh: 'AI 代理' },
'toast.programMissing': {
diff --git a/desktop/src/layout/menus.ts b/desktop/src/layout/menus.ts
index e4cfbb46a..cc39db8bd 100644
--- a/desktop/src/layout/menus.ts
+++ b/desktop/src/layout/menus.ts
@@ -108,6 +108,7 @@ const BUILTIN_ITEMS: MenuContribution[] = [
cmd('view', 'overlays', 'view.toggleMinimap'),
cmd('view', 'overlays', 'view.toggleStats'),
cmd('view', 'overlays', 'view.toggleCoords'),
+ cmd('view', 'overlays', 'view.toggleHints'),
cmd('view', 'overlays', 'view.togglePerf'),
cmd('view', 'gizmo', 'view.toggleCoordSpace'),
cmd('view', 'gizmo', 'view.togglePivotMode'),
diff --git a/desktop/src/panels/Viewport.tsx b/desktop/src/panels/Viewport.tsx
index e3a02c8da..0745cf469 100644
--- a/desktop/src/panels/Viewport.tsx
+++ b/desktop/src/panels/Viewport.tsx
@@ -545,12 +545,13 @@ function HudCursor() {
// The corner HUD (perf + coordinates). Owns the StatsStore subscription so the
// slow stats updates re-render ONLY this leaf — not the whole, gizmo-heavy
// Viewport.
-function ViewportHud({ ready, showStats, showCoords, selCount, zoomPct, tool, paintHint }: {
+function ViewportHud({ ready, showStats, showCoords, showHints, selCount, zoomPct, tool, paintHint }: {
ready: boolean;
/** Corner FPS/frame/entity HUD — opt-in (off by default). */
showStats: boolean;
/** Bottom-left cursor/selection/hint readout — opt-in (off by default). */
showCoords: boolean;
+ showHints: boolean;
selCount: number;
zoomPct: number;
tool: ToolMode;
@@ -577,13 +578,15 @@ function ViewportHud({ ready, showStats, showCoords, selCount, zoomPct, tool, pa
</div>
</div>
)}
- {showCoords && (
+ {(showCoords || showHints) && (
<div className="vp-coord">
- <div className="ro">
- <HudCursor />
- {t('vp.hud.sel')} <strong>{selCount}</strong> · {zoomPct}%
- </div>
- <div className="hint">{paintHint ?? TOOL_HINT[tool]}</div>
+ {showCoords && (
+ <div className="ro">
+ <HudCursor />
+ {t('vp.hud.sel')} <strong>{selCount}</strong> · {zoomPct}%
+ </div>
+ )}
+ {showHints && <div className="hint">{paintHint ?? TOOL_HINT[tool]}</div>}
</div>
)}
</>
@@ -708,6 +711,7 @@ export function Viewport() {
const previewFx = useEditorStore((s) => s.previewFx);
const showStats = useEditorStore((s) => s.showStats);
const showCoords = useEditorStore((s) => s.showCoords);
+ const showHints = useEditorStore((s) => s.showHints);
const showMinimap = useEditorStore((s) => s.showMinimap);
const activeGizmoAxis = useEditorStore((s) => s.activeGizmoAxis);
const coordSpace = useEditorStore((s) => s.coordSpace);
@@ -2581,6 +2585,7 @@ export function Viewport() {
ready={engine.status === 'ready'}
showStats={showStats}
showCoords={showCoords}
+ showHints={showHints}
selCount={selCount}
zoomPct={zoomPct}
tool={tool}
diff --git a/desktop/src/store/editorStore.ts b/desktop/src/store/editorStore.ts
index 17561155a..bd4cbc373 100644
--- a/desktop/src/store/editorStore.ts
+++ b/desktop/src/store/editorStore.ts
@@ -55,8 +55,11 @@ interface EditorState {
previewFx: boolean;
/** Corner performance HUD (FPS / frame time / entity count). Off by default — opt-in. */
showStats: boolean;
- /** Bottom-left cursor / selection / zoom / tool-hint readout. Off by default. */
+ /** Bottom-left cursor / selection / zoom readout. */
showCoords: boolean;
+ /** The instructional line under it. Its own switch because it is not a readout:
+ * once you know the gizmo, it is a sentence that never stops being shown. */
+ showHints: boolean;
/** Bottom-right scene minimap overview. On by default; toggle to reclaim the corner. */
showMinimap: boolean;
snapping: boolean;
@@ -89,6 +92,7 @@ interface EditorState {
togglePreviewFx: () => void;
toggleStats: () => void;
toggleCoords: () => void;
+ toggleHints: () => void;
toggleMinimap: () => void;
toggleSnapping: () => void;
setSnapStep: (step: number) => void;
@@ -196,6 +200,7 @@ export const useEditorStore = create<EditorState>((set) => ({
// brush flip/rotate, eyedropper…) + the cursor world coord / tile-cell readout —
// the editor's cheapest self-teaching surface. FPS/entity stats stay opt-in.
showCoords: true,
+ showHints: true,
showMinimap: true,
snapping: false,
snapStep: 32,
@@ -216,6 +221,7 @@ export const useEditorStore = create<EditorState>((set) => ({
togglePreviewFx: () => set((s) => ({ previewFx: !s.previewFx })),
toggleStats: () => set((s) => ({ showStats: !s.showStats })),
toggleCoords: () => set((s) => ({ showCoords: !s.showCoords })),
+ toggleHints: () => set((s) => ({ showHints: !s.showHints })),
toggleMinimap: () => set((s) => ({ showMinimap: !s.showMinimap })),
toggleSnapping: () => set((s) => ({ snapping: !s.snapping })),
setSnapStep: (snapStep) => set({ snapStep, snapping: true }),
diff --git a/desktop/tests/menu-registry.test.ts b/desktop/tests/menu-registry.test.ts
index 2a8f71d18..b76ac4641 100644
--- a/desktop/tests/menu-registry.test.ts
+++ b/desktop/tests/menu-registry.test.ts
@@ -43,7 +43,7 @@ describe('menu registry', () => {
]);
expect(layout('view')).toEqual([
'view.toggleGrid', 'view.toggleGizmos', 'view.toggleColliders', 'view.toggleTileCollision', 'view.togglePreviewFx', null,
- 'view.toggleMinimap', 'view.toggleStats', 'view.toggleCoords', 'view.togglePerf', null,
+ 'view.toggleMinimap', 'view.toggleStats', 'view.toggleCoords', 'view.toggleHints', 'view.togglePerf', null,
'view.toggleCoordSpace', 'view.togglePivotMode', 'view.toggleSnapping', null,
'view.zoomIn', 'view.zoomOut', 'view.zoomReset',
]);