Skip to content

Commit

Permalink
Do not show static when no robots exist in creative mode (#1248)
Browse files Browse the repository at this point in the history
"Stub" maps generated by the World Editor (#873) do not define any robots.

It is convenient to view these via:

    scripts/play.sh --scenario stub.yaml --cheat

However, the static needs to be suppressed in creative mode when robots do not exist.
  • Loading branch information
kostmo authored May 7, 2023
1 parent f4776e2 commit 271b485
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Swarm/TUI/View/CellDisplay.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ getStatic g coords
isStatic = case focusedRange g of
-- If we're not viewing a robot, display static. This
-- can happen if e.g. the robot we were viewing drowned.
Nothing -> True
-- This is overridden by creative mode, e.g. when no robots
-- have been defined for the scenario.
Nothing -> not $ g ^. creativeMode
-- Don't display static if the robot is close, or when we're in
-- creative mode or the player is allowed to scroll the world.
Just Close -> False
Expand Down

0 comments on commit 271b485

Please sign in to comment.