Compact menu cards and clarify Exchange and blocked claim controls

This commit is contained in:
unimatrixgit 2026-11-29 12:01:42 +01:00
commit 23dce90e82

View file

@ -91,8 +91,8 @@ final class OrganisationMenus implements Listener {
int width=1,height=1;if(row.has("claimedChunks")&&row.getAsJsonArray("claimedChunks").size()>0){int minX=Integer.MAX_VALUE,maxX=Integer.MIN_VALUE,minZ=Integer.MAX_VALUE,maxZ=Integer.MIN_VALUE;for(var v:row.getAsJsonArray("claimedChunks")){var c=v.getAsJsonObject();int x=c.get("x").getAsInt(),z=c.get("z").getAsInt();minX=Math.min(minX,x);maxX=Math.max(maxX,x);minZ=Math.min(minZ,z);maxZ=Math.max(maxZ,z);}width=maxX-minX+1;height=maxZ-minZ+1;}
String[] directions={"north","east","south","west","all"};int[] slots={13,23,31,21,22};int[] additions={width,height,width,height,2*width+2*height+4};
boolean manage=row.get("canManage").getAsBoolean(),home=row.has("homeBlock")&&!row.get("homeBlock").isJsonNull();
for(int i=0;i<directions.length;i++){String direction=directions[i];int addition=additions[i],next=used+addition;boolean allowed=manage&&home&&capacity>0&&next<=capacity;
put(screen,slots[i],"Expand "+direction,allowed?"Add "+addition+" adjacent chunks\nResult: "+next+" / "+capacity+"\nReview before applying":!manage?"Current organisation management required":!home?"Set your Home Block first":capacity==0?"Claim entitlement unavailable":"Needs "+next+" chunks; unlocked limit "+capacity,allowed?Material.LIME_DYE:Material.GRAY_DYE,()->{if(!allowed)return;var confirm=panel(p,"Confirm claim expansion",!kind.equals("clans"));put(confirm,13,"Expand "+direction,"Add "+addition+" chunks around the current estate\nResult: "+next+" / "+capacity+" chunks\nExisting Home Block stays in place\nForeign claims and active wars are checked",Material.MAP,()->claims(p,data,kind,row));put(confirm,30,"Confirm expansion","Use unlocked capacity; no new tier purchase",Material.LIME_DYE,()->perform(p,kind,row,"expand-claim",direction));put(confirm,32,"Cancel","Leave the estate unchanged",Material.ARROW,()->claims(p,data,kind,row));show(p,confirm);});
for(int i=0;i<directions.length;i++){String direction=directions[i];int addition=additions[i],next=used+addition;boolean allowed=manage&&home&&capacity>0&&next<=capacity;String blocked=!manage?"Current organisation management required":!home?"Set your Home Block first":capacity==0?"Claim entitlement unavailable":"Needs "+next+" chunks; unlocked limit "+capacity;
put(screen,slots[i],"Expand "+direction,allowed?"Add "+addition+" adjacent chunks\nResult: "+next+" / "+capacity+"\nReview before applying":blocked,allowed?Material.LIME_DYE:Material.GRAY_DYE,()->{if(!allowed){p.sendMessage(blocked);claims(p,data,kind,row);return;}var confirm=panel(p,"Confirm claim expansion",!kind.equals("clans"));put(confirm,13,"Expand "+direction,"Add "+addition+" chunks around the current estate\nResult: "+next+" / "+capacity+" chunks\nExisting Home Block stays in place\nForeign claims and active wars are checked",Material.MAP,()->claims(p,data,kind,row));put(confirm,30,"Confirm expansion","Use unlocked capacity; no new tier purchase",Material.LIME_DYE,()->perform(p,kind,row,"expand-claim",direction));put(confirm,32,"Cancel","Leave the estate unchanged",Material.ARROW,()->claims(p,data,kind,row));show(p,confirm);});
}
put(screen,45,"Back","Organisation",Material.ARROW,()->organisation(p,data,kind,row));show(p,screen);
}