Skip to content

Commit

Permalink
refactor(app): remove stuff that does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Hoefer committed Dec 17, 2020
1 parent f89b7d4 commit 4200fbc
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions src/main/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,27 @@ fun main() = invokeLater {
CharacterTemplate.DEFAULT_CHARACTER
)

window = initializeAppWindow(window, characterState)
window = AppWindow(
title = "CK3 Mod Workbench v0.0.1-a",
menuBar = MenuBar(
Menu(
"File",
MenuItem("Exit", onClick = { AppManager.exit() })
),
Menu(
"Characters",
MenuItem(
"Import Characters",
onClick = {
val file = openScriptFile(window)
val characterScriptImporter = CharacterScriptImporter()
characterScriptImporter.importCharactersScript(file)
}
),
MenuItem("Dynasties", onClick = {})
),
)
)

window.show {
window.events.onResize = {
Expand Down Expand Up @@ -88,31 +108,6 @@ fun main() = invokeLater {
}
}

private fun initializeAppWindow(
window: AppWindow,
characterState: SnapshotStateList<Character>
) = AppWindow(
title = "CK3 Mod Workbench v0.0.1-a",
menuBar = MenuBar(
Menu(
"File",
MenuItem("Exit", onClick = { AppManager.exit() })
),
Menu(
"Characters",
MenuItem(
"Import Characters",
onClick = {
val file = openScriptFile(window)
val characterScriptImporter = CharacterScriptImporter()
characterScriptImporter.importCharactersScript(file, characterState)
}
),
MenuItem("Dynasties", onClick = {})
),
)
)

private fun percWindowWidth(width: Int, percentage: Int): Int {
return width.div(100).times(percentage)
}
Expand Down

0 comments on commit 4200fbc

Please sign in to comment.