fix: set-game-view-size no longer reports success under the Device Simulator, and --reset removes the size entry it leaves behind

Merged
HA
2d ago
+1436-101

Summary

  • uloop set-game-view-size no longer reports success under the Device Simulator when nothing changed; it fails and points to uloop game-view-mode.
  • A new --reset flag removes the uloop entry the tool leaves in the Game View size list and restores the size that was selected before.

Closes #3410

User Impact

  • Before: with the Device Simulator showing, --width 1280 --height 720 returned Success: true and "changed from 2360x1640 to 2360x1640" while Unity only logged an error. The uloop size entry stayed in Unity's user-wide GameViewSizes.asset (every project, across Editor restarts) with no way to remove it, and reading the size with no Play Mode view open opened a Game View.
  • After:
    • A change or reset under the Device Simulator (or another non-Game View Play Mode view) returns Success: false (exit code 1), changes nothing, and tells the agent to run uloop game-view-mode --to GameView or --device <name>.
    • Responses now include View (GameView / Simulator / None / Other) and SelectedSize (the selected dropdown entry, so setting the size already rendered still shows that the uloop entry got selected). A successful change carries a Warning that the entry persists and how to remove it.
    • uloop set-game-view-size --reset removes the uloop entries from every platform group, saves the list, and re-selects the previous selection (remembered within the Editor session, current platform group only). A selection the user made in the meantime is kept; an unknown or deleted previous selection falls back to the first entry and the message says so.
    • Reading without arguments no longer opens a Game View when none is open (View: None, 0x0).

Changes

  • The tool's logic moved into an internal use case behind a port, mirroring game-view-mode, so every view kind and reset branch is covered by EditMode tests with a fake port (21 tests).
  • A new internal API bridge reads and edits the Game View size list directly through the existing friend-assembly grant (no reflection). Removal matches the exact base text uloop with a fixed resolution, so user entries such as uloop-phone are left alone, and the selection is re-selected by name because removal shifts indices.
  • The skill, Documentation~/tools.md / tools_ja.md, and the embedded tool catalog (new Reset property) document where the entry is stored and how --reset works; shared release input stamps are refreshed for the catalog change.

Verification

  • uloop run-tests --filter-type class: SetGameViewSizeUseCaseTests 21/21, OnionAssemblyDependencyTests 83/83, DefaultToolsCatalogDriftTests 1/1 passed.
  • go run ./cmd/check-asmdef-policy, scripts/sync-tool-docs.sh --check, go run ./cmd/check-skill-size: all exit 0.
  • Live check on Unity 2022.3 (dev project):
    • Read on Game View: View: GameView, SelectedSize: "16:9 Aspect".
    • --width 1280 --height 720: Success: true, SelectedSize: "uloop (1280x720)", Warning mentions --reset.
    • Switched to the Device Simulator, --width 1920 --height 1080: Success: false, exit code 1, View: Simulator, size unchanged (2048x1536); no new "does not support custom resolution" error in the Console. --reset there: Success: false.
    • Back to Game View, --reset: Success: true, Removed: 2 (Standalone and iOS groups), SelectedSize: "16:9 Aspect" restored, size back to 676x380; GameViewSizes.asset has 0 uloop entries afterwards.
    • Second --reset: Removed: 0, "No 'uloop' size entry was found".