Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id("io.gitlab.arturbosch.detekt").version("1.23.3")
id("org.jlleitschuh.gradle.ktlint").version("12.1.2")
id("secrets-plugin")
id("com.github.gmazzo.buildconfig") version "6.0.10"
}

group = "com.github.ppartisan.roky"
Expand All @@ -16,6 +17,11 @@ application {
mainClass.set("MainKt")
}

buildConfig {
buildConfigField("String", "VERSION", "\"${version}\"")
packageName("com.github.ppartisan.roky")
}

ktlint {
android = false
reporters {
Expand All @@ -25,6 +31,9 @@ ktlint {
}
filter {
exclude("**/style-violations.kt")
exclude {
it.file.path.contains("generated")
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ kotlin.code.style=official
# Determines whether this project should use hardcoded mocks or Supabase-CLI.
# See https://github.com/PPartisan/Roky/wiki/Project-Setup
USE_LOCAL_MOCKS=true
version=0.1.3
version=0.1.4
38 changes: 38 additions & 0 deletions src/main/kotlin/about/AboutWindow.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package about

import com.github.ppartisan.roky.BuildConfig
import com.googlecode.lanterna.SGR.*
import com.googlecode.lanterna.gui2.*
import com.googlecode.lanterna.gui2.Direction.VERTICAL
import com.googlecode.lanterna.gui2.Window.Hint.CENTERED
import help.FormattedTextRow.*
import navigation.NavigateToMainMenu
import view.*
import java.awt.GridLayout

class AboutWindow(
menu: NavigateToMainMenu,
) : AppWindow("About", menu) {
init {
setHints(listOf(CENTERED))
val label =
Panel(
GridLayout(1).apply {
topMarginSize = 1
bottomMarginSize = 1
leftMarginSize = 2
rightMarginSize = 2
},
).apply {

addComponent(Label("ROKY v${BuildConfig.VERSION}"))
}
val root =
Panel(LinearLayout(VERTICAL))
.apply {
addComponent(label)
}

component = root
}
}
3 changes: 2 additions & 1 deletion src/main/kotlin/navigation/NavigationController.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package navigation

import about.AboutWindow
import chatroom.ChatroomWindow
import com.googlecode.lanterna.gui2.MultiWindowTextGUI
import com.googlecode.lanterna.gui2.Window
Expand Down Expand Up @@ -28,7 +29,7 @@ class NavigationController(
}

override fun toAbout() {
println("About")
setActiveWindow(AboutWindow(this))
}

override fun toMainMenu() {
Expand Down
Loading