From 2b0d8b0b5629e4d939a196f149b42b93c6b2c5e7 Mon Sep 17 00:00:00 2001 From: MHeMoTexHuK Date: Thu, 6 Jan 2022 00:31:00 +0300 Subject: [PATCH] use splitters --- README.md | 9 +- .../github/mnemotechnician/mkui/Elements.kt | 15 +++ .../mkui/windows/WindowManager.kt | 113 +++++++++++------- 3 files changed, 88 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 772f1d3..f036050 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # Mindustry Kotlin Ui Lib -An ui library for mindustry mods. +An ui library for mindustry kotlin mods. Provides some useful stuff, such as inline ui construction functions, utility functions, new ui classes, etc. May not be compatible with other (non-mindustry) arc projects. -***Note: this library will only work with mods written in kotlin!*** - Messy documentation: [mnemotechnician.github.io/mkui](https://mnemotechnician.github.io/mkui/) +# Note +Most of features provided by this library are supposed to be used in kotlin mods, as they have little to no usage in java (it lacks many features providen by kotlin) + +If you (somewhy) want to use this library in a java mod, you will have to include the whole kotlin stdlib as an implementation dependency. + # Adding this dependency In your `build.gradle` file: * add `maven { url("https://jitpack.io") }` to the `repositories {}` block diff --git a/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Elements.kt b/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Elements.kt index dde0b09..20ec734 100644 --- a/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Elements.kt +++ b/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Elements.kt @@ -6,6 +6,7 @@ import arc.scene.style.* import arc.graphics.* import arc.graphics.g2d.* import mindustry.ui.* +import mindustry.gen.* /** Adds a constant label to the table and returns the created cell */ inline fun Table.addLabel(text: String, style: Label.LabelStyle = Styles.defaultLabel, wrap: Boolean = false, ellipsis: String? = null): Cell