Skip to content

macos: File > Open... and a welcome item in the Help menu - #105

Open
dsrw wants to merge 1 commit into
mainfrom
feature/macos-file-open
Open

dsrw wants to merge 1 commit into
mainfrom
feature/macos-file-open

Conversation

@dsrw

@dsrw dsrw commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Two macOS menu-bar changes.

Help > Enu Welcome — was "Launch Tutorial" opening tutorial-1; it opens the welcome level now, which is where a new player should start.

File > Open... — a new File menu, before Help, running the same native directory picker as Settings > Level > Open... and following the same rules for what a picked directory means (a dir with a level.json is a level: open its parent world at that level; anything else is a world, opened at its initial level). That resolution moved out of Settings.show_open_world into open_picked_dir so both entry points share one implementation.

⌘O works as you'd expect from a File menu. Godot 3.5's global menu API builds every item with keyEquivalent:@"" and has no way to attach one, so the shortcut is a normal input action instead: open_world ships with no events and only open_world.macosx binds ⌘O, so is_action_pressed stays valid on every platform but can only fire here. Being modal on the main thread, the picker releases the pointer first — otherwise the mouse stays captured by a game the player can't see behind the dialog.

Both are gated on connect_address_override == "", the same test the welcome item already used: a client joined to someone else's world can't open one of its own.

Testing

nim test passes. Driven against a running Enu on macOS:

  • Menu bar reads Apple, Enu, File, Help; File contains Open..., Help contains Documentation, Web Site, ---, Enu Welcome.
  • ⌘O (via the action) and clicking File > Open... each open the native dialog.
  • Escape cancels with no level change; picking …/tutorial/welcome loads that level.

🤖 Generated with Claude Code

The Help menu's "Launch Tutorial" opens the welcome level now, which is
where a new player should start.

File > Open... (⌘O) runs the same native directory picker as Settings >
Level > Open..., with the same rules for what a pick means — the
resolution moves to open_picked_dir so both entry points share it.
Godot's global menu API can't attach a key equivalent, so the shortcut
is a normal input action; the base action ships with no events and only
the .macosx override binds ⌘O. Both the menu and the shortcut are
macOS-only, and neither appears for a client joined to someone else's
world, which can't open one of its own.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant