Render one selection card per House
This commit is contained in:
parent
fc4fb60914
commit
f86476bd9d
4 changed files with 21 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
plugins { java }
|
||||
group = "com.dunerealms"
|
||||
version = "1.1.40-navigator1"
|
||||
version = "1.1.41-house1"
|
||||
repositories { mavenCentral(); maven("https://repo.papermc.io/repository/maven-public/"); maven("https://repo.opencollab.dev/main/") }
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
|
||||
|
|
|
|||
|
|
@ -259,14 +259,29 @@ public final class DuneGUI extends JavaPlugin implements Listener,CommandExecuto
|
|||
Screen screen=screen(p,"Choose your House",0xE300+(chosen==null?0:Arrays.asList(IDS).indexOf(chosen)+1));
|
||||
for(int i=0;i<IDS.length;i++){String id=IDS[i];int centre=CENTRES[i];boolean selected=id.equals(chosen);
|
||||
var item=icon(p,houseName(data,id),selected?"Selected · confirm below":"Click to select this House","drgui_transparent",Material.PAPER);menuArt(item,"house_"+id);
|
||||
for(int row=i<3?-1:0;row<=1;row++)for(int col=-1;col<=1;col++){int slot=centre+row*9+col;screen.inventory.setItem(slot,item.clone());screen.actions.put(slot,()->select(p,data,id));}
|
||||
screen.inventory.setItem(centre,item);
|
||||
screen.actions.put(centre,()->select(p,data,id));
|
||||
}
|
||||
button(screen,p,45,"Close","Return to the lobby",Material.ARROW,p::closeInventory);
|
||||
button(screen,p,49,sidebar.enabled(p)?"Hide scoreboard":"Show scoreboard","Toggle your personal briefing",Material.LEVER,()->{toggleSidebar(p);select(p,data,chosen);});
|
||||
for(int slot:new int[]{48,50})screen.actions.put(slot,screen.actions.get(49));
|
||||
if(chosen!=null)button(screen,p,53,"Confirm "+houseName(data,chosen),"Write your confirmed House key",Material.LIME_DYE,()->confirm(p,data,chosen));
|
||||
screen.actions.put(46,screen.actions.get(45));if(chosen!=null)screen.actions.put(52,screen.actions.get(53));
|
||||
if(MCGUIMenus.show(p,"Choose your House","",screen.inventory,screen.actions,screen.gate))return;
|
||||
// The inventory fallback uses a multi-slot hit area for each background tile.
|
||||
// Card-based menus must only receive the five center slots.
|
||||
for(int i=0;i<CENTRES.length;i++){
|
||||
int centre=CENTRES[i];
|
||||
ItemStack item=screen.inventory.getItem(centre);
|
||||
Runnable action=screen.actions.get(centre);
|
||||
for(int row=i<3?-1:0;row<=1;row++)for(int col=-1;col<=1;col++){
|
||||
int slot=centre+row*9+col;
|
||||
if(slot==centre)continue;
|
||||
screen.inventory.setItem(slot,item.clone());
|
||||
screen.actions.put(slot,action);
|
||||
}
|
||||
}
|
||||
for(int slot:new int[]{48,50})screen.actions.put(slot,screen.actions.get(49));
|
||||
screen.actions.put(46,screen.actions.get(45));
|
||||
if(chosen!=null)screen.actions.put(52,screen.actions.get(53));
|
||||
p.openInventory(screen.inventory);expire(screen);
|
||||
}
|
||||
private void confirmForm(Player p,JsonObject data,String id){BedrockForms.show(this,p,"Confirm House · "+houseName(data,id),"Confirm your allegiance to "+houseName(data,id)+". This initial selection does not grant an elected office.",List.of(new BedrockForms.Choice("Confirm House","Save through J.A.R.V.I.S.",()->confirm(p,data,id)),new BedrockForms.Choice("Back","Review all five Houses",()->select(p,data,id))));}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: DunerealmsGUI
|
||||
main: com.dunerealms.gui.DuneGUI
|
||||
version: 1.1.40-navigator1
|
||||
version: 1.1.41-house1
|
||||
api-version: '1.21.8'
|
||||
depend: [JarvisTranslator]
|
||||
softdepend: [Citizens, MCGUI, DecentHolograms, DuneLobby, DuneCore, DuneEss, DuneNPC, Vault, floodgate, ViaVersion]
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
}
|
||||
},
|
||||
"DunerealmsGUI": {
|
||||
"version": "1.1.40-navigator1",
|
||||
"version": "1.1.41-house1",
|
||||
"changedClasses": [
|
||||
"com/dunerealms/gui/DuneGUI$1.class",
|
||||
"com/dunerealms/gui/DuneGUI.class",
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff