1.0.0-SNAPSHOT-U111

+ Improved the handling of Buttons on the Panel
+ Updated all panel handlers to now comply with the new system
+ Updated the editor.yml to have an individual GUI for CustomItems
+ Removed the menuName for Items from config.yml
This commit is contained in:
Charles 2018-12-09 12:24:01 +08:00
parent 824f3e1d52
commit 52a7910674
26 changed files with 124 additions and 114 deletions

View File

@ -106,8 +106,6 @@ Display:
- '&3Type: &7{type}'
- '&7'
- '&7Click to edit the drop table.'
Items:
menuName: '&b&lEpicBosses &3&lCustom Items'
Shop:
menuName: '&b&lEpicBosses &3&lShop'
name: '&b&lBuy {name}''s Egg'
@ -141,6 +139,8 @@ Display:
name: '&b&lCommand Section'
lore:
- '&3Chance &8» &f{chance}%'
- '&'
- '&7'
- '&3Commands &8»'
- '&f{commands}'
- '&f{commands}'
- '&7'
- '&7Click to edit command section.'

View File

@ -129,6 +129,52 @@ ListPanel:
'54':
type: GLASS_PANE
name: '&7'
CustomItemsMenu:
name: '&b&lEpicBosses &3&lCustom Items'
slots: 54
Settings:
fillTo: 45
Items:
'46':
type: GLASS_PANE
name: '&7'
'47':
type: GLASS_PANE
name: '&7'
'48':
type: GLASS_PANE
name: '&7'
'49':
type: ARROW
name: '&e&l&m<-&e&l Previous Page'
lore:
- '&7Click here to go to the previous'
- '&7page of custom drops.'
PreviousPage: true
'50':
type: DIAMOND_BLOCK
name: '&a&lAdd New Item'
lore:
- '&7Click here to add a new'
- '&7item which you have in your'
- '&7inventory.'
Button: AddNew
'51':
type: ARROW
name: '&e&lNext Page &e&l&m->'
lore:
- '&7Click here to go to the next'
- '&7page of custom drops.'
NextPage: true
'52':
type: GLASS_PANE
name: '&7'
'53':
type: GLASS_PANE
name: '&7'
'54':
type: GLASS_PANE
name: '&7'
AddItemsMenu:
name: '&b&lAdd Item Menu'
slots: 27
@ -1647,4 +1693,5 @@ ModifyCommandEditorPanel:
- '&bShift Left-Click &8» &f+0.1'
- '&7'
- '&bRight Click &8» &f-1.0'
- '&bShift Right-Click &8» &f-0.1'
- '&bShift Right-Click &8» &f-0.1'
Button: Chance

View File

@ -667,11 +667,15 @@ public class BossPanelManager implements ILoadable, IReloadable {
//---------------------------------------------
private void loadCustomItemsMenu() {
this.customItems = new CustomItemsPanel(this, getListMenu("Items"), this.customBosses);
PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CustomItemsMenu"));
this.customItems = new CustomItemsPanel(this, panelBuilder, this.customBosses);
}
private void reloadCustomItems() {
this.customItems.initializePanel(getListMenu("Items"));
PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CustomItemsMenu"));
this.customItems.initializePanel(panelBuilder);
}
//---------------------------------------------

View File

@ -10,6 +10,7 @@ import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
import com.songoda.epicbosses.utils.panel.Panel;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
@ -46,6 +47,7 @@ public class CustomItemsPanel extends MainListPanelHandler {
}));
loadPage(panel, 0, currentItemStacks, entryList);
panel.getPanelBuilderCounter().getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAddItemsMenu().openFor((Player) event.getWhoClicked())));
}
private void loadPage(Panel panel, int requestedPage, Map<String, ItemStackHolder> currentItemStacks, List<String> entryList) {

View File

@ -123,8 +123,6 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter.addSlotCounter("CreateEntity");
}
}

View File

@ -53,10 +53,6 @@ public class CommandsMainEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("OnSpawn")
.addSlotCounter("OnDeath");
}
}

View File

@ -48,11 +48,7 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Selected")
.addSlotCounter("CreateDropTable");
}
@Override

View File

@ -73,12 +73,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("NaturalDrops")
.addSlotCounter("DropTable")
.addSlotCounter("NaturalEXP");
}
private ClickAction getNaturalDropsAction(BossEntity bossEntity, Boolean current) {

View File

@ -26,13 +26,7 @@ public class EquipmentEditorPanel extends SubVariablePanelHandler<BossEntity, En
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Helmet")
.addSlotCounter("Chestplate")
.addSlotCounter("Leggings")
.addSlotCounter("Boots");
}
@Override

View File

@ -37,20 +37,7 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Drops")
.addSlotCounter("Equipment")
.addSlotCounter("Targeting")
.addSlotCounter("Weapon")
.addSlotCounter("Skill")
.addSlotCounter("Stats")
.addSlotCounter("Particle")
.addSlotCounter("Spawning")
.addSlotCounter("Text")
.addSlotCounter("Editing")
.addSlotCounter("Command");
}
@Override

View File

@ -66,12 +66,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("OverallChance")
.addSlotCounter("SkillList")
.addSlotCounter("Message");
}
private ClickAction getOverallChanceAction(BossEntity bossEntity) {

View File

@ -64,8 +64,6 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter.addSpecialCounter("TargetingSystem");
}
}

View File

@ -52,11 +52,6 @@ public class TextMainEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("OnSpawn")
.addSlotCounter("OnDeath")
.addSlotCounter("Taunts");
}
}

View File

@ -54,10 +54,6 @@ public class WeaponsEditorPanel extends SubVariablePanelHandler<BossEntity, Enti
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("MainHand")
.addSlotCounter("OffHand");
}
}

View File

@ -78,13 +78,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("MainMessage")
.addSlotCounter("PositionMessage")
.addSlotCounter("OnlyShow")
.addSlotCounter("Radius");
}
private ClickAction getRadiusAction(BossEntity bossEntity) {

View File

@ -68,11 +68,7 @@ public class SpawnTextEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Select")
.addSlotCounter("Radius");
}
private ClickAction getRadiusAction(BossEntity bossEntity) {

View File

@ -77,12 +77,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Radius")
.addSlotCounter("Delay")
.addSlotCounter("Taunts");
}
private ClickAction getRadiusAction(BossEntity bossEntity) {

View File

@ -101,12 +101,6 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Remove")
.addSlotCounter("AddNew");
}

View File

@ -81,15 +81,15 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("CustomMessage")
.addSlotCounter("Radius")
.addSlotCounter("CustomData")
.addSlotCounter("Mode")
.addSlotCounter("DisplayName")
.addSlotCounter("Type");
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
//
// panelBuilderCounter
// .addSlotCounter("CustomMessage")
// .addSlotCounter("Radius")
// .addSlotCounter("CustomData")
// .addSlotCounter("Mode")
// .addSlotCounter("DisplayName")
// .addSlotCounter("Type");
}
private ClickAction getCustomDataAction(Skill skill) {

View File

@ -61,13 +61,13 @@ public class SkillTypeEditorPanel extends VariablePanelHandler<Skill> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Command")
.addSlotCounter("Custom")
.addSlotCounter("Potion")
.addSlotCounter("Group");
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
//
// panelBuilderCounter
// .addSlotCounter("Command")
// .addSlotCounter("Custom")
// .addSlotCounter("Potion")
// .addSlotCounter("Group");
}
private ClickAction getCommandAction(Skill skill) {

View File

@ -87,10 +87,10 @@ public class CommandSkillEditorPanel extends VariablePanelHandler<Skill> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("AddNew");
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
//
// panelBuilderCounter
// .addSlotCounter("AddNew");
}
private ClickAction getAddNewAction(Skill skill) {

View File

@ -92,10 +92,10 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("PotionEffect");
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
//
// panelBuilderCounter
// .addSlotCounter("PotionEffect");
}
private void loadPage(Panel panel, int page, List<PotionEffectHolder> potionEffectHolders, PotionSkillElement potionSkillElement, Skill skill) {

View File

@ -1,9 +1,37 @@
package com.songoda.epicbosses.panel.skills.custom.commands;
import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.elements.SubCommandSkillElement;
import com.songoda.epicbosses.utils.panel.Panel;
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter;
import org.bukkit.entity.Player;
/**
* @author Charles Cullen
* @version 1.0.0
* @since 05-Dec-18
*/
public class ModifyCommandEditorPanel {
public class ModifyCommandEditorPanel extends SubVariablePanelHandler<Skill, SubCommandSkillElement> {
public ModifyCommandEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder) {
super(bossPanelManager, panelBuilder);
}
@Override
public void fillPanel(Panel panel, Skill skill, SubCommandSkillElement subCommandSkillElement) {
}
@Override
public void openFor(Player player, Skill skill, SubCommandSkillElement subCommandSkillElement) {
}
@Override
public void initializePanel(PanelBuilder panelBuilder) {
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
}
}

View File

@ -43,14 +43,14 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill
@Override
public void initializePanel(PanelBuilder panelBuilder) {
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
panelBuilderCounter
.addSlotCounter("Cancel")
.addSlotCounter("Level")
.addSlotCounter("Effect")
.addSlotCounter("Duration")
.addSlotCounter("Confirm");
// PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
//
// panelBuilderCounter
// .addSlotCounter("Cancel")
// .addSlotCounter("Level")
// .addSlotCounter("Effect")
// .addSlotCounter("Duration")
// .addSlotCounter("Confirm");
}
@Override

View File

@ -109,9 +109,9 @@ public class PanelBuilder {
if(innerSection.contains("NextPage") && innerSection.getBoolean("NextPage")) this.panelBuilderCounter.addPageData(slot, 1);
if(innerSection.contains("PreviousPage") && innerSection.getBoolean("PreviousPage")) this.panelBuilderCounter.addPageData(slot, -1);
if(innerSection.contains("Button") && slotsWith.containsKey(innerSection.getString("Button"))) {
if(innerSection.contains("Button")) {
String identifier = innerSection.getString("Button");
Set<Integer> current = slotsWith.get(identifier);
Set<Integer> current = slotsWith.getOrDefault(identifier, new HashSet<>());
current.add(slot);
this.panelBuilderCounter.getSlotsWithCounter().put(identifier, current);

View File

@ -20,7 +20,7 @@
<properties>
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
<plugin.version>1.0.0-U110</plugin.version>
<plugin.version>1.0.0-U111</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>