forked from unimatrix/web
Replace the old menu layout with direct actions from the supplied design
This commit is contained in:
parent
62638f4957
commit
121b4c7d46
1 changed files with 276 additions and 107 deletions
|
|
@ -145,7 +145,7 @@ final class ExchangeMenus implements Listener,AutoCloseable {
|
|||
private void editPrice(Player p,Draft draft){
|
||||
var s=panel(p,"Exchange · Price");s.description=money(draft.price)+" per item · "+draft.amount+" items\nTotal: "+money(draft.price*draft.amount);s.inventory.setItem(13,icon(Material.GOLD_INGOT,"Price: "+money(draft.price),"Per item · total "+money(draft.price*draft.amount)));
|
||||
long[] steps={1,100,1000,10000};for(int i=0;i<steps.length;i++){long step=steps[i];button(s,27+i,Material.RED_DYE,"− "+money(step),"Decrease the price per item",()->editPrice(p,draft.price(Math.max(1,draft.price-step))));button(s,32+i,Material.LIME_DYE,"+ "+money(step),"Increase the price per item",()->editPrice(p,draft.price(Math.min(100000000,draft.price+step))));}
|
||||
button(s,45,Material.ARROW,"Back to listing","Review the current price before publishing",()->sell(p,draft));button(s,49,Material.EMERALD,"Use price: "+money(draft.price),"Review the listing before publishing",()->sell(p,draft));button(s,53,Material.NAME_TAG,"Type exact price","Optional private text entry",()->typePrice(p,draft));show(p,s);
|
||||
button(s,45,Material.ARROW,"Back to listing","Review the current price before publishing",()->sell(p,draft));button(s,53,Material.NAME_TAG,"Type exact price","Optional private text entry",()->typePrice(p,draft));show(p,s);
|
||||
}
|
||||
private void quantityPresets(Panel s,int available,IntConsumer choose){for(int i=0;i<3;i++){int amount=new int[]{16,32,64}[i];button(s,21+i,Material.CHEST,String.valueOf(amount),"Set quantity · maximum "+available,()->choose.accept(Math.min(amount,available)));}}
|
||||
private void typePrice(Player p,Draft draft){
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff