diff --git a/.gitignore b/.gitignore index a219f2a..71f5281 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ cacerts # Workspace save /save + +*~ diff --git a/sprites/Border.png b/sprites/BorderB.png similarity index 100% rename from sprites/Border.png rename to sprites/BorderB.png diff --git a/sprites/BorderT.png b/sprites/BorderT.png new file mode 100644 index 0000000..409be1f Binary files /dev/null and b/sprites/BorderT.png differ diff --git a/sprites/CornerTL.png b/sprites/CornerTL.png index 9806acf..3e96c2c 100644 Binary files a/sprites/CornerTL.png and b/sprites/CornerTL.png differ diff --git a/sprites/CornerTR.png b/sprites/CornerTR.png index f4aff5a..3939c86 100644 Binary files a/sprites/CornerTR.png and b/sprites/CornerTR.png differ diff --git a/src/main/resources/ocelot/desktop/spritesheet.png b/src/main/resources/ocelot/desktop/spritesheet.png index 290b6ee..b6e5fd3 100644 Binary files a/src/main/resources/ocelot/desktop/spritesheet.png and b/src/main/resources/ocelot/desktop/spritesheet.png differ diff --git a/src/main/resources/ocelot/desktop/spritesheet.txt b/src/main/resources/ocelot/desktop/spritesheet.txt index f276891..f094af7 100644 --- a/src/main/resources/ocelot/desktop/spritesheet.txt +++ b/src/main/resources/ocelot/desktop/spritesheet.txt @@ -1,10 +1,11 @@ -Border 96 8 2 8 +BorderB 3 25 2 8 +BorderT 0 25 2 10 Circle 0 0 24 24 -Computer 24 0 24 24 -CornerBL 96 0 8 8 -CornerBR 104 0 8 8 -CornerTL 112 0 8 8 -CornerTR 120 0 8 8 -DefaultNode 48 0 24 24 -Empty 98 8 1 1 -Screen 72 0 24 24 +Computer 25 0 24 24 +CornerBL 118 0 8 8 +CornerBR 100 11 8 8 +CornerTL 100 0 8 10 +CornerTR 109 0 8 10 +DefaultNode 50 0 24 24 +Empty 6 25 1 1 +Screen 75 0 24 24 diff --git a/src/main/scala/ocelot/desktop/ui/widget/ScreenWidget.scala b/src/main/scala/ocelot/desktop/ui/widget/ScreenWidget.scala index 44a7c3e..b827b71 100644 --- a/src/main/scala/ocelot/desktop/ui/widget/ScreenWidget.scala +++ b/src/main/scala/ocelot/desktop/ui/widget/ScreenWidget.scala @@ -21,7 +21,7 @@ class ScreenWidget(screen: Screen) extends Widget with Logging { private var data: Array[Cell] = Array.fill(width * height)(Cell(' ', background, foreground)) - minimumSize = Size2D(width * fontWidth + 32, height * fontHeight + 32) + minimumSize = Size2D(width * fontWidth + 32, height * fontHeight + 40) maximumSize = minimumSize private var lastMousePos = Vector2D(0, 0) @@ -91,7 +91,7 @@ class ScreenWidget(screen: Screen) extends Widget with Logging { val sx = position.x val sy = position.y val w = fontWidth * width + 32 - val h = fontHeight * height + 32 + val h = fontHeight * height + 40 g.foreground = RGBAColor(30, 30, 30) g.sprite = "Empty" @@ -103,19 +103,25 @@ class ScreenWidget(screen: Screen) extends Widget with Logging { val Cell(char, bg, fg) = data(y * width + x) g.background = IntColor(bg) g.foreground = IntColor(fg) - g.char(sx + x * fontWidth + 16, sy + y * fontHeight + 16, char) + g.char(sx + x * fontWidth + 16, sy + y * fontHeight + 20, char) } } } - g.sprite("CornerTL", sx, sy, 16, 16) - g.sprite("CornerTR", sx + w - 16, sy, 16, 16) + g.sprite("CornerTL", sx, sy, 16, 20) + g.sprite("CornerTR", sx + w - 16, sy, 16, 20) g.sprite("CornerBL", sx, sy + h - 16, 16, 16) g.sprite("CornerBR", sx + w - 16, sy + h - 16, 16, 16) - g.sprite("Border", sx + 16, sy + 0, w - 32, 16) - g.sprite("Border", sx + 16, sy + h - 16, w - 32, 16) - g.sprite("Border", sx + 0, sy + 16, 16, h - 32, 270) - g.sprite("Border", sx + w - 16, sy + 16, 16, h - 32, 270) + g.sprite("BorderT", sx + 16, sy + 0, w - 32, 20) + g.sprite("BorderB", sx + 16, sy + h - 16, w - 32, 16) + g.sprite("BorderB", sx + 0, sy + 20, 16, h - 36, 270) + g.sprite("BorderB", sx + w - 16, sy + 20, 16, h - 36, 270) + + g.setSmallFont() + g.background = RGBAColor(0, 0, 0, 0) + g.foreground = RGBAColor(110, 110, 110) + g.text(sx + 12, sy + 6, screen.node.address) + g.setNormalFont() } def set(x: Int, y: Int, text: String, vertical: Boolean): Unit = {