mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-23 07:11:28 +01:00
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:
parent
824f3e1d52
commit
52a7910674
@ -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.'
|
@ -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
|
@ -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);
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
@ -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) {
|
||||
|
@ -123,8 +123,6 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit
|
||||
|
||||
@Override
|
||||
public void initializePanel(PanelBuilder panelBuilder) {
|
||||
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
|
||||
|
||||
panelBuilderCounter.addSlotCounter("CreateEntity");
|
||||
}
|
||||
}
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -64,8 +64,6 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> {
|
||||
|
||||
@Override
|
||||
public void initializePanel(PanelBuilder panelBuilder) {
|
||||
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
|
||||
|
||||
panelBuilderCounter.addSpecialCounter("TargetingSystem");
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user