From 07fd967bde98cf8e732d6bd8c3bf91371e0d2a33 Mon Sep 17 00:00:00 2001 From: LimePotato Date: Sat, 28 Oct 2023 15:25:49 -0600 Subject: [PATCH] logArea Signed-off-by: LimePotato --- src/main/kotlin/group/ouroboros/potrogue/main.kt | 4 ++-- .../group/ouroboros/potrogue/view/PlayView.kt | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/group/ouroboros/potrogue/main.kt b/src/main/kotlin/group/ouroboros/potrogue/main.kt index bf1b19a..e2a2564 100644 --- a/src/main/kotlin/group/ouroboros/potrogue/main.kt +++ b/src/main/kotlin/group/ouroboros/potrogue/main.kt @@ -5,8 +5,8 @@ import group.ouroboros.potrogue.view.StartView import org.hexworks.zircon.api.SwingApplications //Important Values -public val GAME_ID = "potrogue"; -public val GAME_VER = "0.1.0-DEV"; +const val GAME_ID = "potrogue"; +const val GAME_VER = "0.1.0-DEV"; fun main(args: Array) { val grid = SwingApplications.startTileGrid(GameConfig.buildAppConfig()) diff --git a/src/main/kotlin/group/ouroboros/potrogue/view/PlayView.kt b/src/main/kotlin/group/ouroboros/potrogue/view/PlayView.kt index b7ffa75..a2b55b5 100644 --- a/src/main/kotlin/group/ouroboros/potrogue/view/PlayView.kt +++ b/src/main/kotlin/group/ouroboros/potrogue/view/PlayView.kt @@ -1,20 +1,32 @@ package group.ouroboros.potrogue.view import group.ouroboros.potrogue.GameConfig +import group.ouroboros.potrogue.GameConfig.LOG_AREA_HEIGHT +import group.ouroboros.potrogue.GameConfig.SIDEBAR_WIDTH +import group.ouroboros.potrogue.GameConfig.WINDOW_WIDTH import org.hexworks.zircon.api.ComponentDecorations.box import org.hexworks.zircon.api.Components import org.hexworks.zircon.api.component.ColorTheme +import org.hexworks.zircon.api.component.ComponentAlignment import org.hexworks.zircon.api.grid.TileGrid import org.hexworks.zircon.api.view.base.BaseView class PlayView (private val grid: TileGrid, theme: ColorTheme = GameConfig.THEME) : BaseView(grid, theme) { init { + //Create Sidebar val sidebar = Components.panel() .withSize(GameConfig.SIDEBAR_WIDTH, GameConfig.WINDOW_HEIGHT) .withDecorations(box()) .build() - screen.addComponent(sidebar) + //Create area for logging + val logArea = Components.logArea() + .withDecorations(box(title = "Log")) // 1 + .withSize(WINDOW_WIDTH - SIDEBAR_WIDTH, LOG_AREA_HEIGHT) + .withAlignmentWithin(screen, ComponentAlignment.BOTTOM_RIGHT) // 2 + .build() + + screen.addComponents(sidebar, logArea) } } \ No newline at end of file