diff --git a/triumph-gui/4_x_x/1-started/creating-gui.md b/triumph-gui/4_x_x/1-started/creating-gui.md index 15e872e..9d725ee 100644 --- a/triumph-gui/4_x_x/1-started/creating-gui.md +++ b/triumph-gui/4_x_x/1-started/creating-gui.md @@ -20,8 +20,8 @@ setting custom [renderer](/renderer)s. Let's create a GUI with a `1` row and an item the middle that sends the `player` a message when clicking. --+- -+Java+ +-+- ++Java+ ```java final var gui = Gui.of(1) @@ -40,7 +40,7 @@ final var gui = Gui.of(1) gui.open(player); ``` +++ -+Kotlin+ ++Kotlin+ ```kotlin val gui = buildGui { // If not set, defaults to chest - 1 row @@ -64,8 +64,8 @@ val gui = buildGui { // Now that the GUI is built, we can open it for the player. gui.open(player) ``` -+++ --+- ++++ +-+- Now that the GUI is created, we can dive into something more complex by utilizing [States](/states). We can continue onto the next example [here](/using-states). diff --git a/triumph-gui/4_x_x/1-started/updating-title.md b/triumph-gui/4_x_x/1-started/updating-title.md index a26b167..eaacf97 100644 --- a/triumph-gui/4_x_x/1-started/updating-title.md +++ b/triumph-gui/4_x_x/1-started/updating-title.md @@ -24,8 +24,8 @@ command class. For this state it's nice to make it so it can only be updated if the clicks are higher than the stored value. Thankfully we can use a [StateMutationPolicy](/mutation-policy) for that, so let's create a new one! --+- -+Java+ +-+- ++Java+ ```java public final class HighScoreMutationPolicy implements StateMutationPolicy { @@ -38,8 +38,8 @@ public final class HighScoreMutationPolicy implements StateMutationPolicy { @@ -51,33 +51,33 @@ class HighScoreMutationPolicy : StateMutationPolicy { } } ``` -+++ --+- ++++ +-+- _The mutation policy in this example is not really needed; this is just an example of how it can be used._ Now let's create a state with the new policy. --+- -+Java+ +-+- ++Java+ ```java private final MutableState highScoreState = MutableState.of(0, new HighScoreMutationPolicy()); ``` -+++ -+Kotlin+ ++++ ++Kotlin+ ```kotlin private val highScoreState = mutableStateOf(0, HighScoreMutationPolicy()) ``` -+++ --+- ++++ +-+- Then we can change the GUI to support it. --+- -+Java+ +-+- ++Java+ ```java final var gui = Gui.of(1) @@ -122,8 +122,8 @@ final var gui = Gui.of(1) gui.open(player); ``` -+++ -+Kotlin+ ++++ ++Kotlin+ ```kotlin val gui = buildGui { @@ -177,8 +177,8 @@ val gui = buildGui { gui.open(player) ``` -+++ --+- ++++ +-+- When the GUI is opened for the first time the title will update with the clicks, once you close and re-open it, it'll only update once you reach a new high score. diff --git a/triumph-gui/4_x_x/1-started/using-states.md b/triumph-gui/4_x_x/1-started/using-states.md index bca5dcd..fe37f3d 100644 --- a/triumph-gui/4_x_x/1-started/using-states.md +++ b/triumph-gui/4_x_x/1-started/using-states.md @@ -19,8 +19,8 @@ modifier cause the component to re-render. Let's take the previous example and add some a state to it. We can create a state that'll keep track of how many times a `player` has clicked on the item. --+- -+Java+ +-+- ++Java+ ```java final var gui = Gui.of(1) @@ -51,8 +51,8 @@ final var gui = Gui.of(1) gui.open(player); ``` -+++ -+Kotlin+ ++++ ++Kotlin+ ```kotlin val gui = buildGui { // If not set, defaults to chest - 1 row @@ -87,7 +87,7 @@ val gui = buildGui { gui.open(player) ``` -+++ --+- ++++ +-+- Congratulations you have built the most simple cookie clicker game! But we can improve it even more, let's add title updating into the mix, read more in [here](/updating-title).