41 lines
2.5 KiB
Java
41 lines
2.5 KiB
Java
package com.dunerealms.menus;
|
|
|
|
import org.bukkit.Material;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/** 6 rows. Three labelled bands: Finance, People, Operations. Reads left to right like a ledger. */
|
|
final class CompanyMenu extends Menu {
|
|
CompanyMenu(DuneMenusPlugin plugin, Player p, Menu parent) { super(plugin, p, parent); }
|
|
String id() { return "company"; }
|
|
Skin skin() { return Skin.COMPANY; }
|
|
String title() { return "Company · Ledger Hall"; }
|
|
String subtitle() { return "“Fortunes are built in ledgers before they are built in stone.”"; }
|
|
int rows() { return 6; }
|
|
|
|
private void tool(int slot, Material m, String name, String sub, String action) {
|
|
put(slot, Ui.item(m, name, "<gray>" + sub), t -> act(backend().orgAction(player, "company", action)));
|
|
}
|
|
|
|
void draw() {
|
|
backdrop(Material.BLACK_STAINED_GLASS_PANE);
|
|
for (int r = 1; r <= 3; r++) for (int c = 1; c <= 8; c++) put(r * 9 + c, Ui.pane(Material.CYAN_STAINED_GLASS_PANE));
|
|
back(45);
|
|
put(9, Ui.item(Material.GOLD_INGOT, "<gold><b>Finance"));
|
|
put(18, Ui.item(Material.PLAYER_HEAD, "<aqua><b>People"));
|
|
put(27, Ui.item(Material.LIGHTNING_ROD, "<white><b>Operations"));
|
|
put(4, Ui.item(Material.COPPER_BLOCK, "<aqua><b>Your company", "<gray>Loading…"));
|
|
load(backend().org(player, "company"), o -> {
|
|
put(4, Ui.glow(Ui.item(Material.COPPER_BLOCK, "<aqua><b>" + o.name(), "<gray>Role: <white>" + o.role(), "<gray>Members: <white>" + o.members())));
|
|
put(10, Ui.item(Material.GOLD_INGOT, "<gold>Balance", "<white>" + Ui.dm(o.vaultMinor())));
|
|
});
|
|
tool(11, Material.ENDER_CHEST, "<gold>Vault", "Move funds", "vault");
|
|
tool(12, Material.BOOK, "<gold>Transactions", "Recent activity", "transactions");
|
|
put(19, Ui.item(Material.PLAYER_HEAD, "<aqua>Members", "<gray>Your team"), t -> go(new MembersMenu(plugin, player, this, "company")));
|
|
tool(20, Material.NAME_TAG, "<aqua>Roles", "Who can do what", "roles");
|
|
tool(21, Material.WRITABLE_BOOK, "<aqua>Invite", "Bring someone in", "invite");
|
|
put(28, Ui.item(Material.EMERALD, "<green>Exchange", "<gray>Buy and sell"), t -> go(new ExchangeMenu(plugin, player, this)));
|
|
put(29, Ui.item(Material.BLAZE_POWDER, "<gold>Spice buyers", "<gray>Sell and collect"), t -> go(new SpiceMenu(plugin, player, this)));
|
|
tool(30, Material.MINECART, "<white>War transport", "Move your people", "war-transport");
|
|
tool(31, Material.LODESTONE, "<white>Home block", "Claims and deed", "claims");
|
|
}
|
|
}
|

Staff