Skip to content

Commit

Permalink
In draw-screen, always show the status bar.
Browse files Browse the repository at this point in the history
Previously, the status bar was hidden during targeting. This was a little more efficient of screen real estate, but caused the view to shift as it recentered.
  • Loading branch information
Kodiologist committed Feb 28, 2024
1 parent aed460a commit ff3eec1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions simalq/commands.hy
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
0
(menu (len stack) :draw (fn []
(print-main-screen :target target
:status-bar F :tile-list 'pickable)))))))
:tile-list 'pickable)))))))
(info-screen (get stack tile-ix)))))

ShiftHistory (do
Expand Down Expand Up @@ -336,7 +336,7 @@
(hy.I.simalq/main.io-mode
:draw (fn []
(hy.I.simalq/main.print-main-screen
:target focus :status-bar F :tile-list 'nonpickable))
:target focus :tile-list 'nonpickable))
:on-input (fn [key]
(nonlocal focus)
(setv dir-v (hy.I.simalq/keyboard.read-dir-key key))
Expand Down
8 changes: 3 additions & 5 deletions simalq/display.hy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ interface elements as lists of `ColorChar`s."
[target None]
; An optional `Pos` to focus the map. Otherwise, we use the
; player's current position.
[status-bar T]
[tile-list None]
; `None`, or the symbols `pickable` or `nonpickable`
[inventory F]
Expand All @@ -108,10 +107,9 @@ interface elements as lists of `ColorChar`s."
(setv out [])

; The status bar is drawn first.
(when status-bar
(+= out (lfor
line (draw-status-bar)
(colorstr-to-width line width))))
(+= out (lfor
line (draw-status-bar)
(colorstr-to-width line width)))
(setv status-bar-lines (len out))
; Then the map, including overmarks.
(setv focus (or target G.player.pos))
Expand Down
1 change: 0 additions & 1 deletion simalq/util.hy
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
(return))

(print-main-screen
:status-bar T
:messages message-queue
:overmarks (dfor p ps p (lfor i (range 2)
(ColorChar
Expand Down

0 comments on commit ff3eec1

Please sign in to comment.