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+1436+0123456789012345678901234567890123456789-101-101-012345678901234567890123456789
Summary
uloop set-game-view-sizeno longer reports success under the Device Simulator when nothing changed; it fails and points touloop game-view-mode.- A new
--resetflag removes theuloopentry 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 720returnedSuccess: trueand "changed from 2360x1640 to 2360x1640" while Unity only logged an error. Theuloopsize entry stayed in Unity's user-wideGameViewSizes.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 runuloop game-view-mode --to GameViewor--device <name>. - Responses now include
View(GameView / Simulator / None / Other) andSelectedSize(the selected dropdown entry, so setting the size already rendered still shows that theuloopentry got selected). A successful change carries aWarningthat the entry persists and how to remove it. uloop set-game-view-size --resetremoves theuloopentries 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).
- A change or reset under the Device Simulator (or another non-Game View Play Mode view) returns
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
uloopwith a fixed resolution, so user entries such asuloop-phoneare 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 (newResetproperty) document where the entry is stored and how--resetworks; shared release input stamps are refreshed for the catalog change.
Verification
uloop run-tests --filter-type class:SetGameViewSizeUseCaseTests21/21,OnionAssemblyDependencyTests83/83,DefaultToolsCatalogDriftTests1/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)",Warningmentions--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.--resetthere: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.assethas 0uloopentries afterwards. - Second
--reset:Removed: 0, "No 'uloop' size entry was found".
- Read on Game View: