1.0.0-SNAPSHOT-U125

+ Continued to implement the CustomSkillEditor Panels
This commit is contained in:
Charles 2018-12-13 22:22:51 +08:00
parent ada32c1e9d
commit 697cc83f0b
8 changed files with 145 additions and 5 deletions

View File

@ -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",

View File

@ -1752,4 +1752,72 @@ CustomSkillEditorPanel:
type: PAPER
name: '&e&lGo Back'
lore:
- '&7Click here to go back.'
- '&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.'

View File

@ -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<Skill> mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel;
@Getter private IVariablePanelHandler<Skill> mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel;
@Getter private ISubVariablePanelHandler<Skill, PotionEffectHolder> createPotionEffectMenu, potionEffectTypeEditMenu;
@Getter private ISubVariablePanelHandler<Skill, SubCommandSkillElement> 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<Skill>(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);
}
//---------------------------------------------

View File

@ -94,7 +94,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
} 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);
}

View File

@ -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> {
skill.setCustomData(jsonObject);
this.skillsFileManager.save();
Message.Boss_Skills_SetMultiplier.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble((newAmount == null? 0.0 : newAmount)));
};
}
}

View File

@ -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<Skill, CustomSkillElement> {
public CustomSkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder) {
super(bossPanelManager, panelBuilder);
}
@Override
public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) {
Map<String, String> 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) {
}
}

View File

@ -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."),

View File

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