Skip to content

Commit

Permalink
add new masks
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Jan 20, 2024
1 parent e38d944 commit bff7282
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 1 deletion.
2 changes: 2 additions & 0 deletions content/premium/masked-gui/mask/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ You can use this to make a simple menu
* [Template Mask]({{% ref "template" %}})
* [Player List Mask]({{% ref "player-list" %}})
* [Value List Mask]({{% ref "value-list" %}})
* [Key-Value List Mask]({{% ref "key-value-list" %}})
* [Filtered Button Paginated Mask]({{% ref "filtered-button-paginated" %}})
188 changes: 188 additions & 0 deletions content/premium/masked-gui/mask/filtered-button-paginated/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
+++
title = "Filtered Button Paginated Mask"
weight = 18
+++

This mask is similar to [Button Paginated Mask]({{% ref "../button-paginated" %}}), but you can filter out the buttons with specific requirements.

## Format

```yaml
mask-name:
mask: filtered-button-paginated
slot: <slot>
cycle: <true/false>
signal: <signal>
update: 20
child:
button-1:
<button-settings>
filter-requirement:
<requirement-set>
<requirement-set>
<requirement-set>
...

button-2:
<button-settings>
filter-requirement:
<requirement-set>
<requirement-set>
<requirement-set>
...

button-3:
<button-settings>
filter-requirement:
<requirement-set>
<requirement-set>
<requirement-set>
...
...
```

## Note

* `cycle`: Whether the buttons should cycle when you reach the end of the page. If this is set to `true`, then when you reach the end of the page, it will go back to the first page. If this is set to `false`, then when you reach the end of the page, it will stop at the last page.
* `signal`: The signal name used by actions to change the page.
* `update`: The ticks to wait before the mask is refreshed.
* You can use `filter-requirement` on the button to remove it from the list if the player doesn't meet the requirements.
* It's similar to `view-requirement`, but the difference is that, while buttons with `view-requirement` will leave an empty button on the list, those with `filter-requirement` will be removed from the list if the player doesn't meet the requirements.

## Action

* `next-page: <signal>`: Changes the page to the next page.
* `previous-page: <signal>`: Changes the page to the previous page.
* `set-mask(<signal>): <page>`: Changes the page to `<page>`.

## Example

```yaml
# The paginated mask
demo-slot:
mask: filtered-button-paginated
slot: 1-7
cycle: false
signal: demo-page-signal # This is the signal name used by actions to change the page.
child:
button1:
id: red_stained_glass_pane
name: "&c&lButton 1"
filter-requirement:
test-level:
level:
value: 1
take: false
button2:
id: green_stained_glass_pane
name: "&a&lButton 2"
filter-requirement:
test-level:
level:
value: 2
take: false
button3:
id: blue_stained_glass_pane
name: "&9&lButton 3"
filter-requirement:
test-level:
level:
value: 4
take: false
button4:
id: yellow_stained_glass_pane
name: "&e&lButton 4"
filter-requirement:
test-level:
level:
value: 5
take: false
button5:
id: purple_stained_glass_pane
name: "&5&lButton 5"
filter-requirement:
test-level:
level:
value: 6
take: false
button6:
id: orange_stained_glass_pane
name: "&6&lButton 6"
filter-requirement:
test-level:
level:
value: 10
take: false
button7:
id: pink_stained_glass_pane
name: "&d&lButton 7"
filter-requirement:
test-level:
level:
value: 11
take: false
button8:
id: black_stained_glass_pane
name: "&0&lButton 8"
filter-requirement:
test-level:
level:
value: 11
take: false
button9:
id: white_stained_glass_pane
name: "&f&lButton 9"
filter-requirement:
test-level:
level:
value: 11
take: false
button10:
id: gray_stained_glass_pane
name: "&7&lButton 10"
filter-requirement:
test-level:
level:
value: 12
take: false
button11:
id: light_gray_stained_glass_pane
name: "&8&lButton 11"
filter-requirement:
test-level:
level:
value: 12
take: false

# The button to go to the previous page
previous-button:
slot: 0
id: arrow
name: "&c&lPrevious"
command: "previous-page: demo-page-signal" # The action to change the page

# The button to go to the next page
next-button:
slot: 8
id: arrow
name: "&a&lNext"
command: "next-page: demo-page-signal" # The action to change the page

# Button to give XP
give-xp:
slot: 9-17
id:
- EXPERIENCE_BOTTLE
- EXP_BOTTLE
name: "&eGive &f10 XP"
lore:
- ""
- "&fLevel: {level}"
click-requirement:
old-version:
version: 13 # Check if the server is at 1.13.X
success-action: "console: xp add {player} 10 points"
fail-action: "console: xp 10 {player}"
```
![Filtered Button Paginated 1](filtered-button-paginated-1.gif)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions content/premium/masked-gui/mask/key-value-list/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
+++
title = "Key-Value List Mask"
weight = 17
+++

This mask is similar to [Button Paginated Mask]({{% ref "../button-paginated" %}}), but you can specify a list of map-like values and display each of them as a [Button]({{% ref "button/overview" %}}).

## Format

```yaml
mask-name:
mask: key-value-list
slot: <slot>
cycle: <true/false>
signal: <signal>
value-update: 20
viewer-update: 0
viewer-condition:
- condition1
- condition2
- condition3
value:
- key1: value1
key2: value2
key3: value3
- key1: value11
key2: value12
key3: value13
- key1: value21
key2: value22
key3: value23
button:
<button-settings>
```
## Note
* `cycle`: Whether the buttons should cycle when you reach the end of the page. If this is set to `true`, then when you reach the end of the page, it will go back to the first page. If this is set to `false`, then when you reach the end of the page, it will stop at the last page.
* `signal`: The signal name used by actions to change the page.
* `viewer-condition`: The list of [Condition Requirement]({{% ref "requirement/condition" %}}) that the viewer must meet to see the button.
* `value`: The list of map-like values
* `button`: The [Button]({{% ref "button/overview" %}}) to be displayed for each values.
* `value-update`: The ticks to wait before the value list is refreshed.
* `viewer-update`: The ticks to wait before the "passed" value list from the viewer view is refreshed.

## Action

* `next-page: <signal>`: Changes the page to the next page.
* `previous-page: <signal>`: Changes the page to the previous page.
* `set-mask(<signal>): <page>`: Changes the page to `<page>`.

## Variable

* On `button`, you can use a key to get the value from the `value` list by using the variable `{key_<name>}`
* For examples: With this `value` list
```yaml
value:
- material: red_stained_glass_pane
name: "Button 1"
- material: green_stained_glass_pane
name: "Button 2"
```
* You can use `{key_material}` to get the `material` part of the value
* You can use `{key_name}` to get the `name` part of the value

## Example

```yaml
# The paginated mask
demo-slot:
mask: key-value-list
slot: 1-7
cycle: false
signal: demo-page-signal # This is the signal name used by actions to change the page.
value:
- material: red_stained_glass_pane
name: Button 1
- material: green_stained_glass_pane
name: Button 2
- material: blue_stained_glass_pane
name: Button 3
- material: yellow_stained_glass_pane
name: Button 4
- material: purple_stained_glass_pane
name: Button 5
- material: orange_stained_glass_pane
name: Button 6
- material: pink_stained_glass_pane
name: Button 7
- material: black_stained_glass_pane
name: Button 8
- material: white_stained_glass_pane
name: Button 9
- material: gray_stained_glass_pane
name: Button 10
- material: light_gray_stained_glass_pane
name: Button 11
button:
id: "{key_material}"
name: "&c&l{key_name}"
# The button to go to the previous page
previous-button:
slot: 0
id: arrow
name: "&c&lPrevious"
command: "previous-page: demo-page-signal" # The action to change the page
# The button to go to the next page
next-button:
slot: 8
id: arrow
name: "&a&lNext"
command: "next-page: demo-page-signal" # The action to change the page
```

![Key Value List 1](key-value-list-1.gif)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/premium/masked-gui/mask/value-list/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This mask is similar to [Button Paginated Mask]({{% ref "../button-paginated" %}

```yaml
mask-name:
mask: player-list
mask: value-list
slot: <slot>
cycle: <true/false>
signal: <signal>
Expand Down
Binary file modified content/premium/masked-gui/mask/value-list/value-list-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bff7282

Please sign in to comment.