diff --git a/triumph-cmds/2.x.x-S/0-welcome/group.conf b/triumph-cmds/2.x.x-S/0-welcome/group.conf new file mode 100644 index 0000000..f61e4a8 --- /dev/null +++ b/triumph-cmds/2.x.x-S/0-welcome/group.conf @@ -0,0 +1,8 @@ +header = "Welcome" +pages = [ + { + header = "Introduction" + link = "introduction" + default = true + } +] diff --git a/triumph-cmds/2.x.x-S/0-welcome/introduction.md b/triumph-cmds/2.x.x-S/0-welcome/introduction.md new file mode 100644 index 0000000..da1b3f3 --- /dev/null +++ b/triumph-cmds/2.x.x-S/0-welcome/introduction.md @@ -0,0 +1,38 @@ +

Introduction

+

Minecraft command framework.

+ +--- + +
header
+ +

Triumph CMDs

+
+

+ license + release + discord +

+
+ +--- + +!!!! +Attention! This version is still a SNAPSHOT and many things can change. +!!! + +# Features + +# Contributing + +Contributions, issues, and feature requests are welcome! +Feel free to check [issues page](https://github.com/TriumphTeam/triumph-cmds/issues). + +# Show your support + +Give a star on [GitHub](https://github.com/TriumphTeam/triumph-cmds) if this project helped you! + +# License + +Copyright © 2024 [TriumphTeam](https://github.com/TriumphTeam). +This project is [MIT](https://github.com/TriumphTeam/triumph-cmds/blob/master/LICENSE) licensed. + diff --git a/triumph-cmds/2.x.x-S/1-started/command-manager.md b/triumph-cmds/2.x.x-S/1-started/command-manager.md new file mode 100644 index 0000000..78c7805 --- /dev/null +++ b/triumph-cmds/2.x.x-S/1-started/command-manager.md @@ -0,0 +1,21 @@ +

Command Manager

+

The basic entry for everything related to your commands.

+ +--- + +# Creating a command manager +Each platform has its own command manager and each manager has its own sender type. +```java +// Bukkit +BukkitCommandManager manager = BukkitCommandManager.create(plugin); + +// JDA Prefixed +PrefixedCommandManager manager = PrefixedCommandManager.create(jda); + +// JDA slash +SlashCommandManager manager = SlashCommandManager.create(jda); +``` +The type parameter for the sender is necessary because you can also specify your own sender type by passing a custom `SenderMapper`. You can read more about it [here](custom-senders). + +# Usage +The command manager is used for doing everything for the commands, registering commands, messages, arguments, etc. diff --git a/triumph-cmds/2.x.x-S/1-started/commands.md b/triumph-cmds/2.x.x-S/1-started/commands.md new file mode 100644 index 0000000..51a097f --- /dev/null +++ b/triumph-cmds/2.x.x-S/1-started/commands.md @@ -0,0 +1,71 @@ +

Commands

+

The basic structure of a command, and its sub commands.

+ +--- + +# Creating a simple command +Every command must extend `BaseCommand`. +You can use the `@Command` annotation to declare the command name and alias. +```java +@Command("foo") +class MyCommand extends BaseCommand {} +``` +A command can also have aliases. +```java +@Command(value = "foo", alias = {"bar", "baz"}) +class MyCommand extends BaseCommand {} +``` +Alternatively you can also declare the command name and alias through the `BaseCommand`'s constructor. +```java +class MyCommand extends BaseCommand { + + public MyCommand() { + super("foo", Arrays.asList("bar", "baz")); + } +} +``` +!!!! +The usage of the keyword `Sender` in the following examples are **not** the correct name, it just represents a sender. +As the real sender name can change based on platform or the provided custom sender. +!!! + +# Sub commands +Each sub commands are declared by methods, currently there is no other way to declare its name and alias other than through annotations. + +## Default +A `@Default` method is a "sub command without a name", implying it is the main executor of a command that has no sub commands. +For example the command `/foo` would be declared in the following way: +```java +@Command("foo") +class MyCommand extends BaseCommand { + + @Default + public void executor(Sender sender) { + // Code to be executed + } +} +``` + +## SubCommand +A `@SubCommand` is a sub command that has a specific name. For example `/foo bar` +```java +@Command("foo") +class MyCommand extends BaseCommand { + + @SubCommand("bar") + public void executor(Sender sender) { + // Code to be executed + } +} +``` + +## Alias +Both annotations also support an alias to be passed: +`@Default(alias = {"bar"})` would be executed as either `/foo` or `/foo bar`. +`@SubCommand(value = "bar", alias = {"baz"})` would be executed as either `/foo bar` or `/foo baz`. + +# Registering +Registering the command is very simple, you simply do: +```java +commandManager.registerCommand(new MyCommand()); +``` diff --git a/triumph-cmds/2.x.x-S/1-started/custom-senders.md b/triumph-cmds/2.x.x-S/1-started/custom-senders.md new file mode 100644 index 0000000..71ca9ec --- /dev/null +++ b/triumph-cmds/2.x.x-S/1-started/custom-senders.md @@ -0,0 +1,54 @@ +

Custom Senders

+

Custom senders creation and registration.

+ +--- + +# Creating a simple sender +```java +public class MySender {} +``` + +# Creating a SenderValidator +Sender Validators are used for pre-command checks. +```java +public class MySenderValidator implements SenderValidator { + + // This method is used when registering, it'll check if the sender declared in the command method is valid or not + @Override + public @NotNull Set> getAllowedSenders() { + return Collections.singleton(MySender.class); + } + + @Override + public boolean validate(final @NotNull MessageRegistry messageRegistry, final @NotNull SubCommand subCommand, final @NotNull MySender sender) { + // Do any checks you want here, for example, on Bukkit this is where it checks if the subcommand is console only, or player only, etc. + // Return true if valid, false, if not, use the message registry to send messages to the player if you want + return false; + } +} +``` +Now you can either make a custom SenderMapper or just use lambda. +If you're not using lambda, then make sure you specify the correct senders. If you're using lambda it will be a little easier. +```java +class MyMapper implements SenderMapper +``` +Now time to create the command manager. We will be using the BukkitCommandManager for this example. +```java +final BukkitCommandManager manager = BukkitCommandManager.create( + plugin, + defaultSender -> new MySender(), // The mapping of the sender, pass a new instance if you don't want lambda + new MySenderValidator() // Validator +); +``` +That is all! You can now register a new command with your custom sender. +```java +@Command("foo") +class MyCommand extends BaseCommand { + + @Default + public void executor(MySender sender) { + // Code to be executed + } +} +``` +You can learn how to create and register commands [here](commands). diff --git a/triumph-cmds/2.x.x-S/1-started/group.conf b/triumph-cmds/2.x.x-S/1-started/group.conf new file mode 100644 index 0000000..103bc32 --- /dev/null +++ b/triumph-cmds/2.x.x-S/1-started/group.conf @@ -0,0 +1,19 @@ +header = "Getting Started" +pages = [ + { + header = "Setup" + link = "setup" + } + { + header = "Command Manager" + link = "command-manager" + } + { + header = "Commands" + link = "commands" + } + { + header = "Custom Senders" + link = "custom-senders" + } +] diff --git a/triumph-cmds/2.x.x-S/1-started/setup.md b/triumph-cmds/2.x.x-S/1-started/setup.md new file mode 100644 index 0000000..a2a1ac2 --- /dev/null +++ b/triumph-cmds/2.x.x-S/1-started/setup.md @@ -0,0 +1,122 @@ +

Setup

+

This is how you add the lib to your project.

+ +--- + +# Version + +Make sure to replace `{version}` with the version you want to use. + +# Platform + +Make sure to replace `{platform}` with one of the following: + +* `bukkit` - For any Bukkit based plugin, Spigot, Paper, etc. +* `jda-prefixed` - For prefixed commands for JDA, for example `!test`. +* `jda-slash` - For JDA slash commands. + +-+- ++Gradle (Kotlin)+ +You need to add the dependency to your `build.gradle.kts`. + +```kotlin +repositories { + maven("https://repo.triumphteam.dev/snapshots/") +} + +dependencies { + implementation("dev.triumphteam:triumph-cmd-{platform}:{version}") // Replace version here +} +``` + +In order to include the lib in your project, you need to add `shadow` plugin `build.gradle.kts`. +Replace `[YOUR PACKAGE]` with your plugin's package, for example `me.myplugin.plugin`. + +```kotlin +// This goes on the top of the build script. +plugins { + id("io.github.goooler.shadow") version "8.1.8" +} + +// This can go anywhere. +shadowJar { + relocate("dev.triumphteam.cmd", "[YOUR PACKAGE].cmd") +} +``` + ++++ ++Gradle (Groovy)+ +You need to add the dependency to your `build.gradle`. + +```groovy +repositories { + maven { url = "https://repo.triumphteam.dev/snapshots/" } +} + +dependencies { + implementation "dev.triumphteam:triumph-cmd-{platform}:{version}" // Replace version here +} +``` + +To include the lib in your project, you need to add `shadow` plugin `build.gradle`. +Replace `[YOUR PACKAGE]` with your plugin's package, for example `me.myplugin.plugin`. + +```groovy +// This goes on the top of the build script. +plugins { + id "io.github.goooler.shadow" version "8.1.8" +} + +// This can go anywhere. +shadowJar { + relocate("dev.triumphteam.cmd", "[YOUR PACKAGE].cmd") +} +``` + ++++ ++Maven+ +You need to add the dependency to your `pom.xml`. + +```xml + + + repo + https://repo.triumphteam.dev/snapshots/ + + + + +dev.triumphteam +triumph-cmd-{platform} +{version} + +``` + +To include the framework in your project, you need the shade plugin. +Replace `[YOUR PACKAGE]` with your plugin's package, for example `me.myplugin.plugin`. + +```xml + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + + dev.triumphteam.cmd + [YOUR PACKAGE].cmd + + + + + + package + + shade + + + + +``` ++++ +-+- diff --git a/triumph-cmds/2.x.x-S/2-arguments/arguments.md b/triumph-cmds/2.x.x-S/2-arguments/arguments.md new file mode 100644 index 0000000..275d54d --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/arguments.md @@ -0,0 +1,39 @@ +

Arguments

+

Command argument declaration and options.

+ +--- + +# Concept +The concept of arguments in the library are based on parameters, each parameter declared in the method will be a command argument. + +# Sender +The first parameter of the command method **must** always be a sender. You can read more about the sender [here](custom-senders). + +# Creating a command with arguments +Let's create the following command `/give item diamond 5`. Where `give` is the command, `item` is the sub command, `diamond` is an argument of type `Material` and `5` is the amount or an `int`. +```java +@Command("give") +class MyClass extends BaseCommand { + + @SubCommand("item") + public void execute(Sender sender, Material material, int amount) { + sender.sendMessage("The selected material was: " + material); // Will send "DIAMOND" + sender.sendMessage("The amount was: " + amount); // Will send "5" + } +} +``` +It is as simple as that to have arguments for your command. + +## Argument Names +By default, argument names will be defined as the name of the parameter. + +The `@ArgName` annotation is used to define the name of the argument should you not want the name of the argument +to be the same as the name of the parameter. If you would like to use the parameter name as the +argument name, you can use the `-parameters` compiler flag when compiling your plugin. +```java +@SubCommand("id") +public void execute(Sender sender, @ArgName("username") Player target) { + sender.sendMessage(target.getName() + " has the id: " + target.getUniqueId()); +} +``` +In this case, the argument will be called `username` instead of the parameter name, `target`. diff --git a/triumph-cmds/2.x.x-S/2-arguments/complex-arguments.md b/triumph-cmds/2.x.x-S/2-arguments/complex-arguments.md new file mode 100644 index 0000000..0369466 --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/complex-arguments.md @@ -0,0 +1,35 @@ +

Arguments

+

Command argument declaration and options.

+ +--- + +# Complex arguments +By default, other more complex arguments are also allowed, for example `Collections`, like `List` or `Set`. + +# Collections +Collections are also type safe, meaning if you do `List` that means any argument that is *not* a number will be `null`, for example: +`/foo bar 1 2 3 hello 4 5` -> `[1, 2, 3, null, 4, 5]`. +Collections by default are **only** allowed as the last argument, for example: +```java +void execute(Sender sender, int number, List args); +``` +With one exception being a split argument. + +## Split argument +A split argument is a collection that is annotated by `@Split`, example: +Given the command `/foo bar diamond,iron_ingot,stone,grass_block 5`, can be declared as: +```java +void execute(Sender sender, @Split(",") List materials, int amount) { + println(materials); // Would print [DIAMOND, IRON_INGOT, STONE, GRASS_BLOCK] +} +``` + +## Join argument +The same way you can split a string into a collection, you can also join a list of arguments into a single string. +This however can only be used as the last argument of the command. +Command example: `/foo bar 5 hello there people`. +```java +void excecute(Sender sender, int number, @Join(", ") String message) { + println(message); // Would print "hello, there, people" +} +``` diff --git a/triumph-cmds/2.x.x-S/2-arguments/custom-arguments.md b/triumph-cmds/2.x.x-S/2-arguments/custom-arguments.md new file mode 100644 index 0000000..c26468d --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/custom-arguments.md @@ -0,0 +1,21 @@ +

Arguments

+

Command argument declaration and options.

+ +--- + +# Registering arguments +If you wish to create your own arguments, you can do so by using `CommandManager#registerArgument`. +This method takes 2 parameters, the first being a `Class`. This class is what will be used when defining the parameters of the command. +The second parameter is a lambda with 2 parameters, the first being the Sender object and the second being a String representing the argument input. + +## Example of registering arguments +```java +commandManager.registerArgument(LocalDate.class, (sender, argument) -> LocalDate.parse(argument)); +``` + +Now we need to use this argument in our command, given the command `/foo bar 2000-01-01`: +```java +void execute(Sender sender, LocalDate date) { + println(date); // outputs 2000-01-01 +} +``` diff --git a/triumph-cmds/2.x.x-S/2-arguments/flags.md b/triumph-cmds/2.x.x-S/2-arguments/flags.md new file mode 100644 index 0000000..c6c824b --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/flags.md @@ -0,0 +1,61 @@ +

Flags

+

Flags, flag arguments, and everything else about flags!

+ +--- + +# Flags +Flags, if you didn't already know, when in commands are typically short identifiers that convey bits of information +or mark what certain arguments are going to be explicitly. It's useful for controlling lots of optional arguments. +In commands, the argument would be the `-n` part of `/flag example -n=1`. + +## Example of Registering Flags + +### Without Flag Argument +```java +@Command("flag") +public class Command { + + @SubCommand("example") + @CommandFlags({@Flag(flag = "f")}) + public void execute(Sender sender, Flags flags) { + if (flags.hasFlag("f")) { + ... + } + } +} +``` + +### With Flag Argument +```java +@Command("flag") +public class Command { + + @SubCommand("example") + @CommandFlags({@Flag(flag = "n", longFlag = "num", argument = int.class, suggestion = "numbers")}) + public void example(Sender sender, Flags flags) { + flags.getValue("n").ifPresent(arg -> { + int num = Integer.parseInt(arg); + ... + }); + } +} +``` + +# Registering Flags +To register flags, annotate the command method with `@CommandFlags(Flag[] value)`. Then, you pass in a list +that has all flag annotations and details to link them to the command. + +Then, to access the flags, add the `Flags` parameter to the function parameters. + +## Flag Definitions +For each individual `@Flag` annotation, you can choose to define these flags with the following fields... +* `flag` - short flag definition (`/command -flag`) +* `longFlag` - long flag definition (`/command --longFlag`) +* `argument` - java class of the type of argument desired +* `suggestion` - string suggestion argument + +Either the `flag` or `longFlag` fields must be present. By default, argument is `void.class` which +corresponds to no argument. The suggestion is what will be suggested as the argument for the flag. + + + diff --git a/triumph-cmds/2.x.x-S/2-arguments/group.conf b/triumph-cmds/2.x.x-S/2-arguments/group.conf new file mode 100644 index 0000000..ca48f77 --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/group.conf @@ -0,0 +1,31 @@ +header = "Arguments" +pages = [ + { + header = "Arguments" + link = "arguments" + } + { + header = "Simple Arguments" + link = "simple-arguments" + } + { + header = "Complex Arguments" + link = "complex-arguments" + } + { + header = "Named Arguments" + link = "named-arguments" + } + { + header = "Custom Arguments" + link = "custom-arguments" + } + { + header = "Flags" + link = "flags" + } + { + header = "Suggestions" + link = "suggestions" + } +] diff --git a/triumph-cmds/2.x.x-S/2-arguments/named-arguments.md b/triumph-cmds/2.x.x-S/2-arguments/named-arguments.md new file mode 100644 index 0000000..634097c --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/named-arguments.md @@ -0,0 +1,26 @@ +

Arguments

+

Command argument declaration and options.

+ +--- + +# Named Arguments +Named arguments allow for arguments to be named. So instead of a command being `/foo bar baz 1`, this will allow for `/foo bar string:baz, number:1`. +This also allows for arguments to be inputted in any order! + +## Example of Named Arguments +Firstly, we must register the named arguments +CommandManager#registerNamedArguments either takes a varag of `Argument`s or a `List`. +```java +commandManager.registerNamedArguments(ArgumentKey.of("example"), // the key of the argument + Argument.forString().name("string").build(), // a description and suggestion can also be set in the argument builder! + Argument.forInt().name("number").build()); +``` + +Now we need to setup our command: +```java +@NamedArguments("example") +void execute(Sender sender, Arguments arguments) { + println("string=" + arguments.get("string", String.class).get() + ", number=" + arguments.get("number", int.class).get()); // outputs string=baz, number=1 + // this is just an example, please dont use Optional#get without checking if the value is present/empty first! +} +``` diff --git a/triumph-cmds/2.x.x-S/2-arguments/simple-arguments.md b/triumph-cmds/2.x.x-S/2-arguments/simple-arguments.md new file mode 100644 index 0000000..3eeed27 --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/simple-arguments.md @@ -0,0 +1,30 @@ +

Arguments

+

Command argument declaration and options.

+ +--- + +By default, the library adds many argument types. + +# Common: +* `short`/`Short` +* `int`/`Integer` +* `long`/`Long` +* `float`/`Float` +* `double`/`Double` +* `boolean`/`Boolean` +* `String` +* `Enums` - Any type of enums, for example `Material`. + +Additionally, each platform also adds a few default types. + +# Bukkit: +* `Material` - Uses `matchMaterial` instead of `valueOf` by overriding default enum behavior. +* `Player` +* `World` + +# JDA: +* `User` +* `Member` +* `TextChannel` +* `VoiceChannel` +* `Role` diff --git a/triumph-cmds/2.x.x-S/2-arguments/suggestions.md b/triumph-cmds/2.x.x-S/2-arguments/suggestions.md new file mode 100644 index 0000000..64ca347 --- /dev/null +++ b/triumph-cmds/2.x.x-S/2-arguments/suggestions.md @@ -0,0 +1,36 @@ +

Suggestions

+

Argument Suggestions

+ +--- + +# Suggestions +Suggestions, as the name suggests, allow for command inputs to be suggested to the user based on the argument required. + +## Registering suggestions +There are two ways to register suggestions: +The first way is to register by `Class` type. This will make all arguments using the class type use the suggestion resolver. +The second way is to register by using a `SuggestionKey`. This will only resolve suggestion when parameters are annotated with `@Suggestion`. +Both of these methods will have a second parameter of a lambda that has 2 parameters of the Sender object, alongside the `SuggestionContext` and will return a `List`. + +## Registering by Class + +```java +commandManager.registerSuggestion(LocalDate.class, (sender, context) -> List.of(LocalDate.now(), LocalDate.EPOCH)); // suggest today's date and epoch date +``` +That's all for registering with class types! Now this will be the default suggestion resolver for LocalDate arguments. + +## Registering with Suggestion Keys + +```java +commandManager.registerSuggestion(SuggestionKey.of("formatted-dates"), (sender, context) -> { + var pattern = DateTimeFormatter.ofPattern("dd/MM/yyyy"); + return Stream.of(LocalDate.now(), LocalDate.EPOCH).map(pattern::format).toList(); // suggest dates in a different format + }) +``` + +Now that the suggestion is registered, we must annotate the argument. +```java +void execute(Sender sender, @Suggestion("formatted-dates") LocalDate date) { + // command logic here +} +``` diff --git a/triumph-cmds/2.x.x-S/3-customization/group.conf b/triumph-cmds/2.x.x-S/3-customization/group.conf new file mode 100644 index 0000000..7286f4d --- /dev/null +++ b/triumph-cmds/2.x.x-S/3-customization/group.conf @@ -0,0 +1,11 @@ +header = "Customization" +pages = [ + { + header = "Messages" + link = "messages" + } + { + header = "Requirements" + link = "requirements" + } +] diff --git a/triumph-cmds/2.x.x-S/3-customization/messages.md b/triumph-cmds/2.x.x-S/3-customization/messages.md new file mode 100644 index 0000000..4439e93 --- /dev/null +++ b/triumph-cmds/2.x.x-S/3-customization/messages.md @@ -0,0 +1,30 @@ +

Messages

+

Customization of error/invalid usage messages.

+ +--- + +# Messages +The library provides many messages that are configurable through a simple structure. Any message that you modify +will be handled using the function and syntax displayed below in the example provided. + +```java +commandManager.registerMessage(MessageKey.INVALID_ARGUMENT, (sender, context) -> { + // handle sending the error message +}); +``` + +Different use-cases provide different applicable keys. You can find a list of all available keys for each module below. + +## Universal Keys +Universal keys are accessed through the `MessageKey` class. +* `INVALID_ARGUMENT` +* `TOO_MANY_ARGUMENTS` +* `NOT_ENOUGH_ARGUMENTS` +* `UNKNOWN_COMMAND` + +## Bukkit Keys +Bukkit keys are accessed through the `BukkitMessageKey` class. +* `NO_PERMISSION` +* `PLAYER_ONLY` +* `CONSOLE_ONLY` + diff --git a/triumph-cmds/2.x.x-S/3-customization/requirements.md b/triumph-cmds/2.x.x-S/3-customization/requirements.md new file mode 100644 index 0000000..5f614bb --- /dev/null +++ b/triumph-cmds/2.x.x-S/3-customization/requirements.md @@ -0,0 +1,28 @@ +

Requirements

+

Command Requirements

+ +--- + +# Requirements +Requirements give fine control to determine whether or not a sender is allowed to run a command. + +## Example of requirements +Firstly, we need to register the requirement. +```java +commandManager.registerRequirement(RequirementKey.of("example"), (sender) -> { + // requirement logic here + return hasPermission(sender); + }) +``` + +Now we need to add the requirement to our command. +```java +@Requirement("example") +void execute(Sender sender) { + // command logic here +} +``` +## Additional Info +* Multiple requirements can be added to a command by wrapping them in a `Requirements` annotation. +* A `MessageKey` can be used in the requirement to send messages to the user upon not meeting the requirement. add the message key string to the parameters! +* Requirements can be inverted by adding a `boolean` to the annotation. diff --git a/triumph-cmds/2.x.x-S/version.conf b/triumph-cmds/2.x.x-S/version.conf new file mode 100644 index 0000000..857baad --- /dev/null +++ b/triumph-cmds/2.x.x-S/version.conf @@ -0,0 +1,3 @@ +reference = "2.x.x-S" +recommended = true +stable = false diff --git a/triumph-cmds/icon.png b/triumph-cmds/icon.png new file mode 100644 index 0000000..efa3b07 Binary files /dev/null and b/triumph-cmds/icon.png differ diff --git a/triumph-cmds/project.conf b/triumph-cmds/project.conf new file mode 100644 index 0000000..d40deb6 --- /dev/null +++ b/triumph-cmds/project.conf @@ -0,0 +1,4 @@ +id = "triumph-cmds" +name = "Triumph CMDs" +color = "#b53c56" +projectHome = "https://github.com/TriumphTeam/trumph-cmds" diff --git a/triumph-gui/3_x_x/0-welcome/introduction.md b/triumph-gui/3_x_x/0-welcome/introduction.md index 6eef3aa..551310c 100644 --- a/triumph-gui/3_x_x/0-welcome/introduction.md +++ b/triumph-gui/3_x_x/0-welcome/introduction.md @@ -1,7 +1,7 @@

Introduction

-
-

This is just an example text for now.

-
+

Library for creating simple GUIs in Bukkit plugins.

+ +---
license
@@ -14,10 +14,6 @@

-!!!! -Attention! This version of the Docs is WIP and incomplete. -!!! - --- # Features diff --git a/triumph-gui/3_x_x/1-started/setup.md b/triumph-gui/3_x_x/1-started/setup.md index 800125b..9d7219a 100644 --- a/triumph-gui/3_x_x/1-started/setup.md +++ b/triumph-gui/3_x_x/1-started/setup.md @@ -1,9 +1,9 @@

Setup

-
-

This is how you add the lib to your project.

-
+

Adding the library to your project.

--+- +--- + +-+- +Gradle (Kotlin)+ You need to add the dependency to your `build.gradle.kts`. diff --git a/triumph-gui/3_x_x/2-types/gui.md b/triumph-gui/3_x_x/2-types/gui.md index 14d4d54..dcdb1de 100644 --- a/triumph-gui/3_x_x/2-types/gui.md +++ b/triumph-gui/3_x_x/2-types/gui.md @@ -1,7 +1,5 @@

GUI

-
-

This is how you create a basic GUI

-
+

This is how you create a basic GUI

# GUI diff --git a/triumph-gui/3_x_x/2-types/pagegui.md b/triumph-gui/3_x_x/2-types/pagegui.md index e0c9bb7..1761dbf 100644 --- a/triumph-gui/3_x_x/2-types/pagegui.md +++ b/triumph-gui/3_x_x/2-types/pagegui.md @@ -1,7 +1,5 @@

PaginatedGUI

-
-

Simple GUI that allows you to have multiple pages and navigate between them.

-
+

Simple GUI that allows you to have multiple pages and navigate between them.

# Paginated GUI diff --git a/triumph-gui/3_x_x/2-types/scrollgui.md b/triumph-gui/3_x_x/2-types/scrollgui.md index d962a7e..fbd2463 100644 --- a/triumph-gui/3_x_x/2-types/scrollgui.md +++ b/triumph-gui/3_x_x/2-types/scrollgui.md @@ -1,8 +1,5 @@

ScrollingGUI

-
-

Simple GUI that allows you to scroll on a Paginated GUI instead of going page - by page.

-
+

Simple GUI that allows you to scroll on a Paginated GUI instead of going page by page.

# Scrolling GUI @@ -23,6 +20,6 @@ ScrollingGui gui = Gui.scrolling() The scrollType if not specified will fall back to `ScrollType.VERTICAL` -Just like the normal [GUI](gui.md) the first parameter is the rows the GUI should have. Like the [Paginated GUI](pagegui.md) the second parameter is to specify the page size, as in how big the page should be, in the example above it's 45 slots dedicated for the page. +Just like the normal [GUI](gui) the first parameter is the rows the GUI should have. Like the [Paginated GUI](pagegui) the second parameter is to specify the page size, as in how big the page should be, in the example above it's 45 slots dedicated for the page. -Everything else about this GUI is exactly like the [Paginated](pagegui.md). +Everything else about this GUI is exactly like the [Paginated](pagegui). diff --git a/triumph-gui/3_x_x/2-types/storagegui.md b/triumph-gui/3_x_x/2-types/storagegui.md index 62d7136..386c8a9 100644 --- a/triumph-gui/3_x_x/2-types/storagegui.md +++ b/triumph-gui/3_x_x/2-types/storagegui.md @@ -1,7 +1,5 @@

StorageGUI

-
-

GUI that does not clear its items on close/open, any external non GuiItem added to it will stay.

-
+

GUI that does not clear its items on close/open, any external non GuiItem added to it will stay.

!!!! Attention! Items stored inside this GUI will not Persist on Server Restart. @@ -22,8 +20,8 @@ StorageGui gui = Gui.storage() .create(); ``` -Just like the normal [GUI](gui.md) the first parameter is the rows the GUI should have. +Just like the normal [GUI](gui) the first parameter is the rows the GUI should have. # Adding the item to the GUI -Differently to the normal [GUI](gui.md), the `addItem` method takes an `ItemStack` instead. Any `GuiItem` added will have actions applied to it, the persistent items are simple ItemStacks that have nothing associated to it. +Differently to the normal [GUI](gui), the `addItem` method takes an `ItemStack` instead. Any `GuiItem` added will have actions applied to it, the persistent items are simple ItemStacks that have nothing associated to it. diff --git a/triumph-gui/3_x_x/3-additional/features.md b/triumph-gui/3_x_x/3-additional/features.md index b016e90..a84a7a2 100644 --- a/triumph-gui/3_x_x/3-additional/features.md +++ b/triumph-gui/3_x_x/3-additional/features.md @@ -1,7 +1,5 @@

GUI Features

-
-

After the basics of a GUI there is a lot more useful features you can use.

-
+

After the basics of a GUI there is a lot more useful features you can use.

# Common features