Skip to content

Commit 80bc9f3

Browse files
committed
i can't remember my own syntax lmao
1 parent 7044f91 commit 80bc9f3

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

triumph-gui/4_x_x/1-started/creating-gui.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ setting custom [renderer](/renderer)s.
2020

2121
Let's create a GUI with a `1` row and an item the middle that sends the `player` a message when clicking.
2222

23-
-+-
24-
+Java+
23+
-+-
24+
+Java+
2525

2626
```java
2727
final var gui = Gui.of(1)
@@ -40,7 +40,7 @@ final var gui = Gui.of(1)
4040
gui.open(player);
4141
```
4242
+++
43-
+Kotlin+
43+
+Kotlin+
4444
```kotlin
4545
val gui = buildGui {
4646
// If not set, defaults to chest - 1 row
@@ -64,8 +64,8 @@ val gui = buildGui {
6464
// Now that the GUI is built, we can open it for the player.
6565
gui.open(player)
6666
```
67-
+++
68-
-+-
67+
+++
68+
-+-
6969

7070
Now that the GUI is created, we can dive into something more complex by utilizing [States](/states).
7171
We can continue onto the next example [here](/using-states).

triumph-gui/4_x_x/1-started/updating-title.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ command class.
2424
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
2525
we can use a [StateMutationPolicy](/mutation-policy) for that, so let's create a new one!
2626

27-
-+-
28-
+Java+
27+
-+-
28+
+Java+
2929

3030
```java
3131
public final class HighScoreMutationPolicy implements StateMutationPolicy<Integer> {
@@ -38,8 +38,8 @@ public final class HighScoreMutationPolicy implements StateMutationPolicy<Intege
3838
}
3939
}
4040
```
41-
+++
42-
+Kotlin+
41+
+++
42+
+Kotlin+
4343

4444
```kotlin
4545
class HighScoreMutationPolicy : StateMutationPolicy<Int?> {
@@ -51,33 +51,33 @@ class HighScoreMutationPolicy : StateMutationPolicy<Int?> {
5151
}
5252
}
5353
```
54-
+++
55-
-+-
54+
+++
55+
-+-
5656

5757
_The mutation policy in this example is not really needed; this is just an example of how it can be used._
5858

5959
Now let's create a state with the new policy.
6060

61-
-+-
62-
+Java+
61+
-+-
62+
+Java+
6363

6464
```java
6565
private final MutableState<Integer> highScoreState = MutableState.of(0, new HighScoreMutationPolicy());
6666
```
6767

68-
+++
69-
+Kotlin+
68+
+++
69+
+Kotlin+
7070

7171
```kotlin
7272
private val highScoreState = mutableStateOf(0, HighScoreMutationPolicy())
7373
```
74-
+++
75-
-+-
74+
+++
75+
-+-
7676

7777
Then we can change the GUI to support it.
7878

79-
-+-
80-
+Java+
79+
-+-
80+
+Java+
8181

8282
```java
8383
final var gui = Gui.of(1)
@@ -122,8 +122,8 @@ final var gui = Gui.of(1)
122122

123123
gui.open(player);
124124
```
125-
+++
126-
+Kotlin+
125+
+++
126+
+Kotlin+
127127

128128
```kotlin
129129
val gui = buildGui {
@@ -177,8 +177,8 @@ val gui = buildGui {
177177

178178
gui.open(player)
179179
```
180-
+++
181-
-+-
180+
+++
181+
-+-
182182

183183
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
184184
only update once you reach a new high score.

triumph-gui/4_x_x/1-started/using-states.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ modifier cause the component to re-render.
1919
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
2020
a `player` has clicked on the item.
2121

22-
-+-
23-
+Java+
22+
-+-
23+
+Java+
2424

2525
```java
2626
final var gui = Gui.of(1)
@@ -51,8 +51,8 @@ final var gui = Gui.of(1)
5151
gui.open(player);
5252
```
5353

54-
+++
55-
+Kotlin+
54+
+++
55+
+Kotlin+
5656
```kotlin
5757
val gui = buildGui {
5858
// If not set, defaults to chest - 1 row
@@ -87,7 +87,7 @@ val gui = buildGui {
8787

8888
gui.open(player)
8989
```
90-
+++
91-
-+-
90+
+++
91+
-+-
9292
Congratulations you have built the most simple cookie clicker game!
9393
But we can improve it even more, let's add title updating into the mix, read more in [here](/updating-title).

0 commit comments

Comments
 (0)