From ce7a3478c4805262bb783944e84bef59423265a2 Mon Sep 17 00:00:00 2001 From: MHeMoTexHuK Date: Sun, 2 Jan 2022 22:39:49 +0300 Subject: [PATCH] restructured --- .../workflows/{deploy.yml => snapshot.yml} | 0 .../github/mnemotechnician/mkui/Buttons.kt | 79 +++++++++ .../github/mnemotechnician/mkui/Elements.kt | 44 +++++ .../com/github/mnemotechnician/mkui/Groups.kt | 63 +++++++ .../com/github/mnemotechnician/mkui/Layout.kt | 155 ------------------ .../mnemotechnician/mkui/windows/Window.kt | 4 +- .../mkui/windows/WindowManager.kt | 2 +- 7 files changed, 189 insertions(+), 158 deletions(-) rename .github/workflows/{deploy.yml => snapshot.yml} (100%) create mode 100644 lib/src/main/kotlin/com/github/mnemotechnician/mkui/Buttons.kt create mode 100644 lib/src/main/kotlin/com/github/mnemotechnician/mkui/Elements.kt create mode 100644 lib/src/main/kotlin/com/github/mnemotechnician/mkui/Groups.kt delete mode 100644 lib/src/main/kotlin/com/github/mnemotechnician/mkui/Layout.kt diff --git a/.github/workflows/deploy.yml b/.github/workflows/snapshot.yml similarity index 100% rename from .github/workflows/deploy.yml rename to .github/workflows/snapshot.yml diff --git a/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Buttons.kt b/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Buttons.kt new file mode 100644 index 0000000..4638e32 --- /dev/null +++ b/lib/src/main/kotlin/com/github/mnemotechnician/mkui/Buttons.kt @@ -0,0 +1,79 @@ +package com.github.mnemotechnician.mkui + +import arc.scene.* +import arc.scene.ui.* +import arc.scene.ui.layout.* +import arc.scene.style.* +import arc.struct.* +import arc.graphics.* +import arc.graphics.g2d.* +import mindustry.ui.* + +/** Adds a custom button constructed by a lambda and returns the created cell */ +inline fun Table.customButton(constructor: Button.() -> Unit, style: Button.ButtonStyle = Styles.defaultb, crossinline onclick: Button.() -> Unit): Cell