Skip to content

Commit

Permalink
cache scenario preview widget
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Sep 10, 2024
1 parent 65c5ef9 commit c9efee3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/swarm-tui/Swarm/TUI/Model/Name.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ data Name
InventoryList
| -- | The inventory item position in the InventoryList.
InventoryListItem Int
| -- | Cacheable scenario preview
ScenarioPreview FilePath
| -- | The list of main menu choices.
MenuList
| -- | The list of achievements.
Expand Down
7 changes: 3 additions & 4 deletions src/swarm-tui/Swarm/TUI/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ module Swarm.TUI.View (
drawModalMenu,
drawKeyCmd,

-- * World
drawWorldPane,

-- * Robot panel
drawRobotPanel,
drawItem,
Expand Down Expand Up @@ -255,7 +252,9 @@ drawNewGameMenuUI (l :| ls) launchOptions = case displayedFor of
drawDescription (SISingle (s, si)) =
vBox
[ drawMarkdown (nonBlank (s ^. scenarioOperation . scenarioDescription))
, hCenter . padTop (Pad 1) . vLimit 6 $ hLimitPercent 60 worldPeek
, cached (ScenarioPreview $ si ^. scenarioPath) $
hCenter . padTop (Pad 1) . vLimit 6 $
hLimitPercent 60 worldPeek
, padTop (Pad 1) table
]
where
Expand Down

0 comments on commit c9efee3

Please sign in to comment.