Menus
The Menu Files
Every screen is a YAML file in plugins/XShop/guis/, in XCore's menu format. The files decide the layout; the texts are in lang/<code>.yml. A file a new version adds is saved beside yours, and yours are never overwritten.
| File | Screen |
|---|---|
menu.yml | The list of shops: /shop |
shop.yml | One shop's page |
search.yml | The results of a search |
quantity.yml | How many to buy or sell |
sell.yml | The chest /sell opens |
confirm.yml | "Are you sure?", from buying.confirm-above |
What Each File Decides
menu.yml: itsslotsare where the shops without a place of their own go, 28 of them by default. A shop that names aslotin its file sits there on the first page, as long as no item of this file is there. The balance, the sell button and the search button are items of the file.shop.yml: itsslotsare the product slots of every shop, 0 to 44 by default, the numbersslot:refers to in a shop file. Changing them moves every product placed by number, so set them once. The items namedBalanceandInfoshow the balances, the countdown of a rotating shop and the sales running.search.yml: itsslotshold the results, and the item namedSearchAgainopens the search anvil again.quantity.yml: the buttons namedadd-<n>andremove-<n>change the quantity by n lots: add one namedadd-128and it adds 128. The items nameddisplay,confirm,max,modeandbackare drawn by the plugin; their place and look are yours.sell.yml: every row but the last takes items, so it needs two rows at least. Itsinfo,confirmandcancelitems are drawn by the plugin.confirm.yml:confirm,display(the product) andcancel.
On the paged screens, the list, a shop and the search, slots 48 and 50 turn the pages and 49 goes back. The list has nothing to go back to: there, 49 closes the menu only when an item named close sits in it.
Item Properties
items:
Sell:
slot: 45 # one slot, or a list: [45, 46]
material: HOPPER # PLAYER_HEAD:<base64 texture> for a textured head
target-title: "gui-sell-button-title" # a key of lang/<code>.yml
target-lore: "gui-sell-button-lore"
permission: "xshop.sell.gui" # needed to use it
sound: "minecraft:ui.button.click"
custom_model_data_value: 1001 # for a resource pack
item_model_key: "mypack:sell_icon" # an item model, 1.20.5+
An item can also run actions of its own on a click, msg, cmd (as the player or the console) and close, after what the plugin does. The format is XCore's, the same in every plugin of the family: XAuctionHouse's GUI Customization describes every property.
Texts
Every text of the menus and the messages is a key of lang/<code>.yml, in MiniMessage, with English and French shipped; the dashboard's are in lang/web_<code>.yml. The plugin follows XCore's language setting unless its own config.yml sets one. A message a new version adds is appended to your file, and your wording is never overwritten.
How a product reads is one template, product-lore: each placeholder (%description%, %buy%, %sell%, %stock%, %limits%, %locked%, %hints%) is replaced by its lines, a line with nothing to say goes away, and so does a blank line left with nothing on one side. Item names are written <lang:...>: each player reads them in the language of their own game.