forked from unimatrix/web
28 lines
1.3 KiB
Java
28 lines
1.3 KiB
Java
package com.dunerealms.menus;
|
|
|
|
import org.bukkit.Material;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/** 3 rows. Left to right: your item, what it needs, the result. Click the result to refit at once. */
|
|
final class EquipmentMenu extends Menu {
|
|
EquipmentMenu(DuneMenusPlugin plugin, Player p, Menu parent) { super(plugin, p, parent); }
|
|
String id() { return "equipment"; }
|
|
Skin skin() { return Skin.FORGE; }
|
|
String title() { return "Quartermaster · Refit"; }
|
|
String subtitle() { return "“Good gear can be made whole again.”"; }
|
|
int rows() { return 3; }
|
|
|
|
void draw() {
|
|
backdrop(Material.BLACK_STAINED_GLASS_PANE);
|
|
for (int s : new int[]{11, 12, 14, 15}) put(s, Ui.pane(Material.LIGHT_BLUE_STAINED_GLASS_PANE));
|
|
back(18);
|
|
load(backend().refitQuote(player), q -> {
|
|
put(10, Ui.item(q.icon(), "<white><b>" + q.itemName(), "<gray>Your original item"));
|
|
put(13, Ui.item(Material.IRON_INGOT, "<aqua><b>Needs", q.costs().stream().map(c -> "<gray>" + c).toArray(String[]::new)));
|
|
if (q.possible())
|
|
put(16, Ui.glow(Ui.item(Material.SMITHING_TABLE, "<green><b>Refit now", "<gray>" + q.note())), t -> act(backend().refit(player)));
|
|
else
|
|
put(16, Ui.item(Material.BARRIER, "<red>Can't refit yet", "<gray>" + q.note()));
|
|
});
|
|
}
|
|
}
|

Staff