diff --git a/plugin-modules/Core/resources-json/items.json b/plugin-modules/Core/resources-json/items.json index cb2f50f..dfe404d 100644 --- a/plugin-modules/Core/resources-json/items.json +++ b/plugin-modules/Core/resources-json/items.json @@ -11,9 +11,17 @@ "type": "OAK_PRESSURE_PLATE", "name": "&c&lDefault Drop Table Menu Item" }, + "DefaultCustomSkillTypeItem": { + "type": "STICK", + "name": "&c&lDefault Custom Skill Type Item" + }, + "DefaultSelectedCustomSkillTypeItem": { + "type": "BLAZE_ROD", + "name": "&c&lDefault Selected Custom Skill Type Item" + }, "DefaultSelectedDropTableItem": { "type": "LIGHT_WEIGHTED_PRESSURE_PLATE", - "name": "&c&lSelected Defauult Drop Table Menu Item" + "name": "&c&lSelected Default Drop Table Menu Item" }, "DefaultSkillMenuItem": { "type": "BLAZE_POWDER", diff --git a/plugin-modules/Core/resources-yml/editor.yml b/plugin-modules/Core/resources-yml/editor.yml index e167b2c..0eeb74b 100644 --- a/plugin-modules/Core/resources-yml/editor.yml +++ b/plugin-modules/Core/resources-yml/editor.yml @@ -1752,4 +1752,72 @@ CustomSkillEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' \ No newline at end of file + - '&7Click here to go back.' +CustomSkillTypeEditorPanel: + name: '&b&l{name} Skill Editor' + slots: 54 + Settings: + backButton: true + fillTo: 45 + Buttons: + backButton: 54 + Items: + '46': + type: BOOK + name: '&c&lSkill Type Guide' + lore: + - '&7When selecting the custom skill type' + - '&7it is easiest to know what it is if' + - '&7you keep it related to the name of the' + - '&7skill. All you need to change the type' + - '&7is click on a new type from within this' + - '&7menu.' + - '&7' + - '&7To import new custom skill types you' + - '&7can get them custom made and injected' + - '&7in to the plugin or you can suggest them' + - '&7to be added in to the plugin.' + '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: EMERALD_BLOCK + name: '&b&lSelected Custom Skill Type' + lore: + - '&bCurrently: &f{selected}' + - '&7' + - '&7This is the currently assigned' + - '&7custom skill type to the skill.' + - '&7If you would like to change this' + - '&7simply click another one in this' + - '&7menu.' + '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: REDSTONE + name: '&cClick here to go back' + lore: + - '&7Click this button to go back to' + - '&7the main page where you can choose' + - '&7to configure blocks or mobs.' \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java index 4c131ef..752bb4e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java @@ -22,6 +22,7 @@ import com.songoda.epicbosses.panel.handlers.*; import com.songoda.epicbosses.panel.skills.MainSkillEditorPanel; import com.songoda.epicbosses.panel.skills.SkillTypeEditorPanel; import com.songoda.epicbosses.panel.skills.custom.CommandSkillEditorPanel; +import com.songoda.epicbosses.panel.skills.custom.CustomSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.GroupSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.commands.CommandListSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.commands.ModifyCommandEditorPanel; @@ -69,7 +70,7 @@ public class BossPanelManager implements ILoadable, IReloadable { onTauntTextEditMenu; @Getter private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; - @Getter private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel; + @Getter private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; @Getter private ISubVariablePanelHandler createPotionEffectMenu, potionEffectTypeEditMenu; @Getter private ISubVariablePanelHandler modifyCommandEditMenu, commandListSkillEditMenu; @@ -173,6 +174,7 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("CreatePotionEffectEditorPanel")); PanelBuilder panelBuilder4 = new PanelBuilder(editor.getConfigurationSection("CommandSkillEditorPanel")); PanelBuilder panelBuilder5 = new PanelBuilder(editor.getConfigurationSection("ModifyCommandEditorPanel")); + PanelBuilder panelBuilder6 = new PanelBuilder(editor.getConfigurationSection("CustomSkillEditorPanel")); this.mainSkillEditMenu = new MainSkillEditorPanel(this, panelBuilder, this.customBosses); this.customMessageEditMenu = new SingleMessageListEditor(this, getListMenu("Skills.MainEdit"), this.customBosses) { @@ -206,6 +208,7 @@ public class BossPanelManager implements ILoadable, IReloadable { this.modifyCommandEditMenu = new ModifyCommandEditorPanel(this, panelBuilder5, this.customBosses); this.commandListSkillEditMenu = new CommandListSkillEditorPanel(this, getListMenu("Skills.CommandList"), this.customBosses); this.groupSkillEditorPanel = new GroupSkillEditorPanel(this, getListMenu("Skills.Group"), this.customBosses); + this.customSkillEditorPanel = new CustomSkillEditorPanel(this, panelBuilder6, this.customBosses); } private void reloadSkillEditMenus() { @@ -216,6 +219,7 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("CreatePotionEffectEditorPanel")); PanelBuilder panelBuilder4 = new PanelBuilder(editor.getConfigurationSection("CommandSkillEditorPanel")); PanelBuilder panelBuilder5 = new PanelBuilder(editor.getConfigurationSection("ModifyCommandEditorPanel")); + PanelBuilder panelBuilder6 = new PanelBuilder(editor.getConfigurationSection("CustomSkillEditorPanel")); this.mainSkillEditMenu.initializePanel(panelBuilder); this.customMessageEditMenu.initializePanel(getListMenu("Skills.MainEdit")); @@ -227,6 +231,7 @@ public class BossPanelManager implements ILoadable, IReloadable { this.modifyCommandEditMenu.initializePanel(panelBuilder5); this.commandListSkillEditMenu.initializePanel(getListMenu("Skills.CommandList")); this.groupSkillEditorPanel.initializePanel(getListMenu("Skills.Group")); + this.customSkillEditorPanel.initializePanel(panelBuilder6); } //--------------------------------------------- diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java index afae7e4..5f8eb25 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java @@ -94,7 +94,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler { } else if(type.equalsIgnoreCase("GROUP")) { this.bossPanelManager.getGroupSkillEditorPanel().openFor(player, skill); } else if(type.equalsIgnoreCase("CUSTOM")) { - + this.bossPanelManager.getCustomMessageEditMenu().openFor(player, skill); } else if(type.equalsIgnoreCase("COMMAND")) { this.bossPanelManager.getCommandSkillEditorPanel().openFor(player, skill); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java index 9d3fbe5..1c3cce1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java @@ -8,6 +8,8 @@ import com.songoda.epicbosses.managers.BossSkillManager; import com.songoda.epicbosses.managers.files.SkillsFileManager; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.types.CustomSkillElement; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; @@ -114,6 +116,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { skill.setCustomData(jsonObject); this.skillsFileManager.save(); + Message.Boss_Skills_SetMultiplier.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble((newAmount == null? 0.0 : newAmount))); }; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java new file mode 100644 index 0000000..fb56b3c --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java @@ -0,0 +1,55 @@ +package com.songoda.epicbosses.panel.skills.custom.custom; + +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.managers.BossPanelManager; +import com.songoda.epicbosses.skills.Skill; +import com.songoda.epicbosses.skills.types.CustomSkillElement; +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; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 13-Dec-18 + */ +public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler { + + public CustomSkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder) { + super(bossPanelManager, panelBuilder); + } + + @Override + public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) { + Map replaceMap = new HashMap<>(); + PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); + + replaceMap.put("{name}", BossAPI.getSkillName(skill)); + panelBuilder.addReplaceData(replaceMap); + + PanelBuilderCounter counter = panelBuilder.getPanelBuilderCounter(); + Panel panel = panelBuilder.getPanel() + .setParentPanelHandler(this.bossPanelManager.getCustomSkillEditorPanel(), skill); + + + + fillPanel(panel, skill, customSkillElement); + + panel.openFor(player); + } + + @Override + public void fillPanel(Panel panel, Skill skill, CustomSkillElement customSkillElement) { + + } + + @Override + public void initializePanel(PanelBuilder panelBuilder) { + + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java index 258c686..53f249d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java @@ -157,6 +157,7 @@ public enum Message { Boss_Skills_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Skills_SetChance("&b&lEpicBosses &8» &7You have {0} the overall chance for the skill map to &f{1}%&7."), + Boss_Skills_SetMultiplier("&b&lEpicBosses &8» &7You have {0} the multiplier to &f{1}&7."), Boss_Skills_SetRadius("&b&lEpicBosses &8» &7You have {0} the radius for the skill to &f{1}&7."), Boss_Skills_SetMode("&b&lEpicBosses &8» &7You have set the skill mode to &f{0}&7."), Boss_Skills_SetDisplayName("&b&lEpicBosses &8» &7Your next input in to chat will be the display name for the skill. If you enter &f-&7 it will remove/clear the display name of the skill. For color codes use the &f& &7sign."), diff --git a/pom.xml b/pom.xml index ad87bf1..9e93c43 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - 1.0.0-U124 + 1.0.0-U125 EpicBosses com.songoda.epicbosses.CustomBosses AMinecraftDev