πPatterns
Inventory
Patterns allow you to create reusable button configurations that can be applied across multiple inventories. This approach helps manage the decoration of your inventories efficiently, avoiding the need to replicate the same configurations multiple times.
How to Use Patterns
Create Patterns: Place your pattern files in the
patterns
folder. You can create as many patterns as you need to manage different decorative elements or layouts.Define Patterns: Each pattern file will define a set of buttons and their configurations. Use these patterns to standardize and streamline the design of your inventories.
Apply Patterns: In your inventory configuration files, you can reference these patterns to apply them. This allows you to maintain consistency and easily update or modify the design elements across multiple inventories.
Example
For instance, if you have a pattern for a pagination button or a decorative border, you can define it in a pattern file and then include that pattern in various inventory configurations. This way, any changes to the pattern will automatically reflect in all inventories that use it.
Benefits
Efficiency: Avoid duplicating button configurations.
Consistency: Maintain a uniform look across different inventories.
Ease of Management: Update design elements in one place and see the changes applied everywhere.
By leveraging patterns, you can effectively manage and customize the appearance of your inventories without redundant configuration efforts.
A pattern must contain a name
, its name will be used in inventories to identify the pattern.
You then have a size
, which is that of the inventory, you have to put patterns of the same size with the inventories, a pattern of size 18 cannot go with an inventory of cut 27 for example.
You then have a list of items, itβs the same as for inventories.
Button
You can create a pattern for your buttons to avoid having to repeat the same thing hundreds of times. You will save hours of configuration with this system.
How to create a pattern ?
You must create a yml file in the pattern folder, the file name is important. It will be used in your inventory file. In the file you must specify the name, type and button. A default file will look like this:
You can then configure your button as you do for inventories. Except that here you will be able to define variables from the inventory file that will be used here. You can define an infinite number of variables, it all depends on your need.
Here is an example of a pattern with the name and slot that will change.
A variable can have prefixes to change their uses.
Prefix | Definition |
---|---|
%upper_<key>% | Displays the text in uppercase |
%lower_<key>% | Displays the text in lowercase |
%capitalize_<key>% | Display the text in capital |
%add_one_<key>% | Allows to add one to the value, attention the value must be a number. |
%remove_one_<key>% | Allows to remove one has the value, attention the value must be mandatory a number. |
How to use a pattern
Using a pattern is very simple. Simply display the pattern configuration in your button, set the file name and put your placeholders. For the example if above we will have:
The pattern can be used endlessly in inventory. This allows to create very optimized configs without having to repeat the same thing several times. Only the important items will be in your inventory file.
Example
This example provient de la resource Vote Menu.
Inventory Shop
Pattern
Last updated