Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch refactor to main #13

Merged
merged 89 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
bc64bfe
Fix unregistered commands prefix
Matt-MX Jun 26, 2023
e290102
Fix unregistered commands prefix
Matt-MX Jul 31, 2023
eb656d4
Started the refactor
Matt-MX Oct 25, 2023
f5c8ec5
moving code
Matt-MX Oct 25, 2023
eb332c4
GuiPattern docs
Matt-MX Oct 26, 2023
8d3e4ce
Adding per-plugin configuration
Matt-MX Oct 26, 2023
2902f59
Update BuildablePrompt.kt
Matt-MX Oct 26, 2023
8e8d30d
Changing var names of conversation inline fun, some comments for code…
Matt-MX Oct 26, 2023
f3a6701
Docs, removing deprecated functions, making methods properly privated
Matt-MX Oct 26, 2023
69350ca
Removed old ItemBuilder
Matt-MX Oct 26, 2023
2032e59
docs, changing click handling a little
Matt-MX Oct 26, 2023
f53f985
removing in favour of future Signals
Matt-MX Oct 26, 2023
d9c0d2b
Refactoring var/method names
Matt-MX Oct 26, 2023
f408ac0
docs + newer methods? Removed YamlGuiParser
Matt-MX Oct 26, 2023
6328b87
added cool utils
Matt-MX Oct 26, 2023
9f9a630
dep and func
Matt-MX Oct 26, 2023
58484db
fixing examples up a bit
Matt-MX Oct 26, 2023
5189a70
impl new command dsl
Matt-MX Nov 2, 2023
a8eb00b
Update KtCommand.kt
Matt-MX Nov 3, 2023
c37e9c6
config stuff and decisions on scoreboard
Matt-MX Nov 3, 2023
71de1f5
Create config.kt
Matt-MX Nov 3, 2023
492f241
Deprecating old components and replacing
Matt-MX Nov 15, 2023
15bdfb1
Improving stability
Matt-MX Nov 16, 2023
5a9e997
Deprecate old components
Matt-MX Nov 16, 2023
e442c98
approaching release
Matt-MX Nov 16, 2023
54e02e2
refactoring examples
Matt-MX Nov 16, 2023
6154a1c
typo
Matt-MX Nov 16, 2023
9e5d886
Fix some paper shenanigans
Matt-MX Nov 16, 2023
8c77d59
Trying to fix scoreboards
Matt-MX Nov 16, 2023
8b80ba8
Examples!
Matt-MX Nov 16, 2023
1195b5d
Safety features
Matt-MX Nov 16, 2023
39df63f
Fixing some components
Matt-MX Nov 16, 2023
027087b
Update GuiButton.kt
Matt-MX Nov 16, 2023
cdbd29e
Rough impl of Signals
Matt-MX Nov 18, 2023
d8d07f8
Signal Example
Matt-MX Nov 18, 2023
31618ce
Adding new command dsl
Matt-MX Nov 18, 2023
8515810
docs
Matt-MX Nov 18, 2023
163b7ca
impl legacy callbacks
Matt-MX Nov 18, 2023
bc0e035
Update LegacyBossBarBuilder.kt
Matt-MX Nov 18, 2023
188951c
Adding command descriptions
Matt-MX Nov 18, 2023
c046c0f
Update tests.kt
Matt-MX Nov 18, 2023
370c9d4
custom command usage generator
Matt-MX Nov 18, 2023
3ba66de
dynamic title!
Matt-MX Nov 18, 2023
e4be6c4
adding list example and fixing issue with SignalButton
Matt-MX Nov 18, 2023
e170050
docs
Matt-MX Nov 19, 2023
6c09049
update name
Matt-MX Nov 19, 2023
6e984de
publishing stuff
Matt-MX Nov 19, 2023
b04e9aa
fixed animated scoreboards (one single typo broke it)
Matt-MX Nov 20, 2023
338e47a
Update AnimatedScoreboardExample.kt
Matt-MX Nov 20, 2023
d1231ca
Added a gui hook example
Matt-MX Nov 20, 2023
6319361
Fixing some signal stuff
Matt-MX Nov 20, 2023
80edfdd
Update CustomGUI.kt
Matt-MX Nov 20, 2023
d23759d
Project presentation
Matt-MX Nov 20, 2023
415297e
presentation
Matt-MX Nov 20, 2023
56e01e1
Update README.md
Matt-MX Nov 20, 2023
3260e4b
Update README.md
Matt-MX Nov 20, 2023
9fdb0aa
Update README.md
Matt-MX Nov 20, 2023
1a0fac6
enchantments
Matt-MX Nov 20, 2023
03b8ac1
Update config.kt
Matt-MX Nov 20, 2023
54e57cc
Update settings.gradle.kts
Matt-MX Nov 20, 2023
7864207
Added workflow
Matt-MX Nov 20, 2023
36e139c
Update build.yml
Matt-MX Nov 20, 2023
a484490
Update build.yml
Matt-MX Nov 20, 2023
a93c0be
Update README.md
Matt-MX Nov 20, 2023
f8fa977
Update build.yml
Matt-MX Nov 20, 2023
8517a76
Update build.yml
Matt-MX Nov 20, 2023
08154ed
Update build.yml
Matt-MX Nov 20, 2023
6766616
Update build.yml
Matt-MX Nov 20, 2023
bc27490
Automatic versioning
Matt-MX Nov 20, 2023
a561155
Merge branch 'refactor' of https://github.com/Matt-MX/KtBukkitGui int…
Matt-MX Nov 20, 2023
1d66a0d
Include commit hash in build version
Matt-MX Nov 20, 2023
148dff3
Update build.yml
Matt-MX Nov 20, 2023
708271b
Fix "unspecified" version
Matt-MX Nov 20, 2023
968d160
Merge branch 'refactor' of https://github.com/Matt-MX/KtBukkitGui int…
Matt-MX Nov 20, 2023
bb630b9
Typo fix and changing builder
Matt-MX Nov 21, 2023
7474db6
Fix build issues
Matt-MX Nov 21, 2023
bca108b
Fixing build issues
Matt-MX Nov 22, 2023
38f0f1d
Update build.gradle.kts
Matt-MX Nov 22, 2023
68b80c5
Update build.yml
Matt-MX Nov 22, 2023
6235709
Update README.md
Matt-MX Nov 22, 2023
50532bc
Update README.md
Matt-MX Nov 22, 2023
8b05cb1
Update README.md
Matt-MX Nov 22, 2023
e33c142
Update README.md
Matt-MX Nov 22, 2023
7adb25e
Update README.md
Matt-MX Nov 22, 2023
c2cff0b
fixing click callback clone
Matt-MX Dec 2, 2023
659e537
Merge branch 'refactor' of https://github.com/Matt-MX/KtBukkitGui int…
Matt-MX Dec 2, 2023
679b4eb
Update GuiCycleButton.kt
Matt-MX Dec 2, 2023
c1e747d
No longer using SignalButton #11
Matt-MX Dec 14, 2023
eb51352
Change version
Matt-MX Dec 14, 2023
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
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build Gradle project

on:
push:

jobs:
build-gradle-project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Checkout project sources
uses: actions/checkout@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run build with Gradle Wrapper
run: ./gradlew build
- uses: actions/upload-artifact@v3
with:
name: build-outputs
path: plugin/build/libs/ktgui-plugin-*.jar
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/.idea/
/build/
/build/classes/kotlin/main/
/build/classes/kotlin/test/
/build/classes/kotlin/test/
/api/build
/plugin/build
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules/ktgui.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ProjectBanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ProjectLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
132 changes: 106 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,127 @@

<p align="center">
<img src="./ProjectBanner.png" width="512px">
<img src="./ProjectBanner.png" width="512px" title="Logo* Not final">
</p>
<h2 align="center">Declarative guis for Bukkit!</h2>
<h2 align="center">Declarative guis for Paper!</h2>

<div align="center">
<p>
The KtGUI library provides a plethora of utilities to help speed up the development of your PaperMC plugins.
</p>
</div>

<div align="center">

<h3>

|&emsp;&emsp;
[Wiki](https://github.com/Matt-MX/KtBukkitGui/wiki)
&emsp;&emsp;|&emsp;&emsp;
[Downloads](https://github.com/Matt-MX/KtBukkitGui/actions)
&emsp;&emsp;|&emsp;&emsp;
[Help](https://github.com/Matt-MX/KtBukkitGui/wiki)
&emsp;&emsp;|

</h3>

</div>

---

<br>
<div align="left">
<h1>GUI DSL</h1>
<p>

| <h2>About</h2><br/><p align="left">A lightweight GUI library with almost unlimited customization. Featuring a declarative style to make it easier for everyone to create beautiful GUIs with minimal code.<br>We also bake our registered GUIs then format them to certain players.</p> | <img src="./ProjectLogo.png" width=50%a> |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| | |
| <p align="center"><img src="https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8OHx8Y29kZXxlbnwwfHwwfHw%3D&w=1000&q=80" width=100%></p> | <h2 align="center">Usage</h2><br><p align="right"> To make it even easier for people to take advantage of, we have provided some simple and stunning example guis. Click to view them.<br>We also provide documentation in our code. Combined with the usages, what can't you do?</p> |
| <h2 align="center">Examples</h2><br><p align="left">We have provided plenty of examples of usages.<br>This includes creating GUIs on the fly as well as making them ready for usage.<br>Since this is written in kotlin, the library works perfect with Java and is just as easy to use and lightweight as in Kotlin!</p> | <p align="center"><img src="./img/examples_cmd.png"></p> |
With Kotlin's amazing DSL, you can create guis in a declarative style. Simply stating exactly what you want, where you want it.
With KtGUI, you can speed up development of guis tenfold.

<h2 id="example_buttons" align="right">Dynamic buttons</h2>
</p>

| <p align="center"><img src="./img/example_buttons.gif"></p> | <p align="right">The Component based system allows for you to create your own widgets and button types.<br/>Different types of buttons may behave differently and control parts of your server/plugin.<br/>We even offer a few pre-made custom buttons for you to play around with.<br/><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/ConfigScreenExample.kt">Check out the code »</a></p> |
|-------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
<h3>

[View Examples »](https://github.com/Matt-MX/KtBukkitGui/blob/refactor/plugin/src/main/kotlin/com/mattmx/ktgui/examples/TitleCounterExample.kt)

<h2 id="example_static">Pre-defined GUIs</h2>
</h3>

| <p align="left">This example shows off a lightweight GUI example. Look at what you can achieve with only a few lines of code!<br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/CustomGUI.kt">Check out the code »</a></p> | <p align="center"><img src="./img/static_gui.gif" width=100%></p> |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
</div>

<h2 id="realtime" align="right">Realtime built GUIs</h2>
<div align="right">
<h1>Signals</h1>
<p>

| <p align="center"><img src="./img/dynamic_gui.gif" width=100%></p> | <p align="right">Want to create GUIs dynamically? We support that! Simple create a new `GuiScreen` object and treat it as you would normally. This can allow you to make guis do whatever you want, whenever you want!<br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/DynamicExample.kt#L20">Check out the code »</a></p> |
|--------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Recently we introduced Signals into the library. They allow you to dynamically update components with absolute ease.
Simply change your variables, and the components that mention it will update for your users.
Making dynamic GUIs has never been easier.

</p>

<h3>

[« View Examples](https://github.com/Matt-MX/KtBukkitGui/blob/refactor/plugin/src/main/kotlin/com/mattmx/ktgui/examples/SignalsExample.kt)

</h3>
</div>

<div align="left">
<h1>Command DSL</h1>
<p>

KtGUI provides two types of command DSL: Declarative and Simple.
Simple gives you complete control and responsibility over how the command executes, and arguments are processed.
Meanwhile Declarative commands use Delegated properties to allow for easy argument handling - simply state
your arguments and their datatype, and KtGUI will do the rest under the hood.

</p>
<h3>

<h2 id="example_furnace">Other Types of GUIs</h2>
[View Examples »](https://github.com/Matt-MX/KtBukkitGui/blob/refactor/plugin/src/main/kotlin/com/mattmx/ktgui/KotlinGui.kt#L42)

| <p align="left">We also offer the same easy-to-use support for every type of GUI in the game, here's a quick example of a custom furnace GUI.<br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/DynamicExample.kt#L77">Check out the code »</a></p> | <p align="center"><img src="./img/example_furnace.png" width=100%></p> |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
</h3>
</div>

<h2 id="example_conversation" align="right">Conversation API</h2>
<div align="right">
<h1>Events DSL</h1>
<p>

| <p align="center"><img src="./img/example_conversation.gif" width=100%></p> | <p align = "right">Comes with a build-in conersation API to make it easy for you to get string player input.<br>Quickly build lightweight conversations and execute them per-player to get different types of input from them: Player names, strings, numbers (with range), fixed inputs.<br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/ConversationGuiExample.kt">Check out the code »</a></p> |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
We also provide a way to easily create handlers for **Bukkit Events**, so you don't always need to make a whole
new class just for your EventListeners.

</p>
<h3>

[« View Examples](https://google.com/)

</h3>
</div>

<div align="left">
<h1>GUI Hooks</h1>
<p>

We also provide some events to allow you to change any GUI just before it is opened, essentially hooking into
a gui and adding or modifying whatever you want.

This can prove very useful for making extensions to other plugins.

</p>
<h3>

[View Examples »](https://github.com/Matt-MX/KtBukkitGui/blob/refactor/plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt)

</h3>
</div>

<div align="right">
<h1>Scoreboards</h1>
<p>

Making scoreboards has never been easier with our lightweight scoreboard DSL.
With the ability to define and animate your personalized scoreboards however you like.

</p>
<h3>

<h2 id="example_furnace">Animated and normal scoreboards</h2>
[« View Examples](https://github.com/Matt-MX/KtBukkitGui/blob/refactor/plugin/src/main/kotlin/com/mattmx/ktgui/examples/AnimatedScoreboardExample.kt)

| <p align="left">We like to make ourself proud of our extremely lightweight scoreboard API.<br>We give you the option, built-in, to create animated or static scoreboards to pretty-up your server.<br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/ScoreboardExample.kt">Static Example »</a><br><a href="https://github.com/Matt-MX/KtBukkitGui/blob/master/src/main/kotlin/com/mattmx/ktgui/examples/AnimatedScoreboardExample.kt">Animated Example »</a></p> | <p align="center"><img src="./img/example_scoreboard.gif" width=100%></p> |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
</h3>
</div>
59 changes: 59 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.0.0"
}

dependencies {
compileOnly(kotlin("reflect"))
}

tasks.test {
useJUnitPlatform()
}

version = rootProject.version

sourceSets["main"].resources.srcDir("src/resources/")

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}

tasks {
build {
dependsOn(shadowJar)
}
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("ktgui")
mergeServiceFiles()
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
repositories {
maven {
name = "pvphub-releases"
url = uri("https://maven.pvphub.me/releases")
credentials {
username = System.getenv("PVPHUB_MAVEN_USERNAME")
password = System.getenv("PVPHUB_MAVEN_SECRET")
}
}
}
publications {
create<MavenPublication>("ktgui") {
from(components["java"])
groupId = "com.mattmx"
artifactId = "ktgui"
version = rootProject.version.toString()
}
}
}
Loading