diff --git a/build.gradle.kts b/build.gradle.kts index 462b7c2..c106048 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,7 +38,7 @@ dependencies { tasks { named("shadowJar") { - archiveBaseName.set("zircon.skeleton.kotlin") + archiveBaseName.set("potroge") mergeServiceFiles() manifest { attributes(mapOf("Main-Class" to "com.example.MainKt")) diff --git a/gradle.properties b/gradle.properties index 332d954..05fa72b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,5 +9,5 @@ mockito_version=1.10.19 assertj_version=3.6.2 slf4j_version=1.7.25 -group=com.example.zircon.skeleton -version=1.2.0 +group=group.ouroboros.potrogue +version=0.1.0-DEV diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/img/hello.png b/img/hello.png deleted file mode 100644 index d40ee53..0000000 Binary files a/img/hello.png and /dev/null differ diff --git a/img/import.png b/img/import.png deleted file mode 100644 index f27d3c7..0000000 Binary files a/img/import.png and /dev/null differ diff --git a/img/settings.png b/img/settings.png deleted file mode 100644 index bf955e4..0000000 Binary files a/img/settings.png and /dev/null differ diff --git a/settings.gradle.kts b/settings.gradle.kts index 7f167c1..837ec13 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "zircon.skeleton.kotlin" +rootProject.name = "potrogue" diff --git a/src/main/kotlin/com/example/main.kt b/src/main/kotlin/com/example/main.kt deleted file mode 100644 index 03f5897..0000000 --- a/src/main/kotlin/com/example/main.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.example - -import org.hexworks.zircon.api.CP437TilesetResources -import org.hexworks.zircon.api.ColorThemes -import org.hexworks.zircon.api.Components -import org.hexworks.zircon.api.SwingApplications -import org.hexworks.zircon.api.application.AppConfig -import org.hexworks.zircon.api.extensions.toScreen - -fun main(args: Array) { - val tileGrid = SwingApplications.startTileGrid( - AppConfig.newBuilder() - .withSize(60, 30) - .withDefaultTileset(CP437TilesetResources.rexPaint16x16()) - .build() - ) - - val screen = tileGrid.toScreen() - - screen.addComponent( - Components.label() - .withText("Hello, Zircon!") - .withPosition(23, 10) - ) - - screen.display() - screen.theme = ColorThemes.arc() -} diff --git a/src/main/kotlin/group/ouroboros/potrogue/main.kt b/src/main/kotlin/group/ouroboros/potrogue/main.kt new file mode 100644 index 0000000..dc251d0 --- /dev/null +++ b/src/main/kotlin/group/ouroboros/potrogue/main.kt @@ -0,0 +1,49 @@ +package group.ouroboros.potrogue + + +import org.hexworks.zircon.api.ColorThemes +import org.hexworks.zircon.api.Components +import org.hexworks.zircon.api.SwingApplications +import org.hexworks.zircon.api.application.AppConfig +import org.hexworks.zircon.api.component.ComponentAlignment +import org.hexworks.zircon.api.screen.Screen + +//Important Values +public val GAME_ID = "potrogue"; +public val GAME_VER = "0.1.0-DEV"; + +fun main(args: Array) { + + //Start the tilegrid and screen + val grid = SwingApplications.startTileGrid( + AppConfig.newBuilder() + .withTitle("$GAME_ID | $GAME_VER") + .build() + ) + val screen = Screen.create(grid) + + //TODO + //Create Custom Color Theme + /* + val potCol = ColorThemeBuilder.newBuilder() + .withName("potcolor") + .withAccentColor(TileColor.transparent()) + .withPrimaryForegroundColor(TileColor.transparent()) + .withSecondaryForegroundColor(TileColor.transparent()) + .withPrimaryBackgroundColor(TileColor.transparent()) + .withSecondaryBackgroundColor(TileColor.transparent()) + .build()) + */ + + //Add a component to the screen, in this case a header, which is centered. + screen.addComponent( + Components.header() + .withText("Hello, from $GAME_ID v$GAME_VER!") + .withAlignmentWithin(screen, ComponentAlignment.CENTER) + ) + + //Set color theme (will make our own later if we can figure out how + screen.theme = ColorThemes.cyberpunk() + //Show the screen + screen.display() +} \ No newline at end of file diff --git a/src/main/kotlin/group/ouroboros/potrogue/view/StartView.kt b/src/main/kotlin/group/ouroboros/potrogue/view/StartView.kt new file mode 100644 index 0000000..f3ccd63 --- /dev/null +++ b/src/main/kotlin/group/ouroboros/potrogue/view/StartView.kt @@ -0,0 +1,44 @@ +package group.ouroboros.potrogue.view + +import group.ouroboros.potrogue.GAME_ID +import org.hexworks.zircon.api.ColorThemes +import org.hexworks.zircon.api.ComponentDecorations.box +import org.hexworks.zircon.api.ComponentDecorations.shadow +import org.hexworks.zircon.api.Components +import org.hexworks.zircon.api.component.ComponentAlignment +import org.hexworks.zircon.api.grid.TileGrid +import org.hexworks.zircon.api.view.base.BaseView + +class StartView ( + private val grid: TileGrid +) : BaseView(grid, ColorThemes.arc()) { + init { + val msg = "Welcome to $GAME_ID." + + // a text box can hold headers, paragraphs and list items + // `contentWidth = ` here is a so called keyword parameter + // using them you can pass parameters not by their order + // but by their name. + // this might be familiar for Python programmers + val header = Components.textBox(contentWidth = msg.length) + // we add a header + .addHeader(msg) + // and a new line + .addNewLine() + // and align it to center + .withAlignmentWithin(screen, ComponentAlignment.CENTER) + .build() // finally we build the component + + val startButton = Components.button() + // we align the button to the bottom center of our header + .withAlignmentAround(header, ComponentAlignment.BOTTOM_CENTER) + // its text is "Start!" + .withText("Start!") + // we want a box and some shadow around it + .withDecorations(box(), shadow()) + .build() + + // We can add multiple components at once + screen.addComponents(header, startButton) + } +} \ No newline at end of file