mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-12-23 08:27:49 +01:00
1.0.0-SNAPSHOT-U151
+ Started implementing the GiveReward Editor Panels
This commit is contained in:
parent
7f7652cc3b
commit
a51ca13bd2
@ -2467,4 +2467,67 @@ DropRewardMainEditMenu:
|
||||
type: REDSTONE
|
||||
name: '&e&lGo Back'
|
||||
lore:
|
||||
- '&7Click here to go back.'
|
||||
- '&7Click here to go back.'
|
||||
GiveRewardPositionListMenu:
|
||||
name: '&b&l{name} DropTable'
|
||||
slots: 54
|
||||
Settings:
|
||||
backButton: true
|
||||
fillTo: 45
|
||||
Buttons:
|
||||
backButton: 54
|
||||
Items:
|
||||
'46':
|
||||
type: BOOK
|
||||
name: '&c&lGive Position Reward Guide'
|
||||
lore:
|
||||
- '&7In this list it displays the position'
|
||||
- '&7sections for the selected drop table.'
|
||||
- '&7If you want to add a new position section'
|
||||
- '&7then simply click the EmeraldBlock and'
|
||||
- '&7the next available position will be'
|
||||
- '&7created.'
|
||||
- '&7To remove a position simply shift-right'
|
||||
- '&7click the position you want to remove.'
|
||||
'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 damage positions.'
|
||||
PreviousPage: true
|
||||
'50':
|
||||
type: EMERALD_BLOCK
|
||||
name: '&e&lAdd new Position'
|
||||
lore:
|
||||
- '&7Click here to add a new position'
|
||||
- '&7to the drop table. This will find'
|
||||
- '&7the next available position and'
|
||||
- '&7create a new reward section for'
|
||||
- '&7that position.'
|
||||
Button: NewPosition
|
||||
'51':
|
||||
type: ARROW
|
||||
name: '&e&lNext Page &e&l&m->'
|
||||
lore:
|
||||
- '&7Click here to go to the next'
|
||||
- '&7page of damage positions.'
|
||||
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 drop table main edit menu.'
|
@ -28,7 +28,7 @@ import com.songoda.epicbosses.panel.droptables.types.drop.DropDropTableMainEdito
|
||||
import com.songoda.epicbosses.panel.droptables.types.drop.DropNewRewardEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.drop.DropRewardMainEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.drop.DropRewardsListEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.give.GiveDropTableMainEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.give.GiveRewardPositionListPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.spray.SprayDropTableMainEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.spray.SprayNewRewardEditorPanel;
|
||||
import com.songoda.epicbosses.panel.droptables.types.spray.SprayRewardMainEditorPanel;
|
||||
@ -42,7 +42,6 @@ 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;
|
||||
import com.songoda.epicbosses.panel.skills.custom.custom.CustomSkillTypeEditorPanel;
|
||||
import com.songoda.epicbosses.panel.skills.custom.custom.MaterialTypeEditorPanel;
|
||||
import com.songoda.epicbosses.panel.skills.custom.custom.MinionSelectEditorPanel;
|
||||
import com.songoda.epicbosses.panel.skills.custom.custom.SpecialSettingsEditorPanel;
|
||||
import com.songoda.epicbosses.panel.skills.custom.potions.CreatePotionEffectEditorPanel;
|
||||
@ -50,7 +49,6 @@ import com.songoda.epicbosses.panel.skills.custom.potions.PotionEffectTypeEditor
|
||||
import com.songoda.epicbosses.panel.skills.custom.PotionSkillEditorPanel;
|
||||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.elements.SubCommandSkillElement;
|
||||
import com.songoda.epicbosses.skills.elements.SubCustomSkillElement;
|
||||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.panel.base.ISubSubVariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler;
|
||||
@ -100,7 +98,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
||||
@Getter private IVariablePanelHandler<DropTable> mainDropTableEditMenu, dropTableTypeEditMenu;
|
||||
@Getter private ISubVariablePanelHandler<DropTable, SprayTableElement> sprayDropTableMainEditMenu, sprayRewardListEditMenu, sprayNewRewardEditMenu;
|
||||
@Getter private ISubSubVariablePanelHandler<DropTable, SprayTableElement, String> sprayRewardMainEditMenu;
|
||||
@Getter private ISubVariablePanelHandler<DropTable, GiveTableElement> giveDropTableMainEditMenu;
|
||||
@Getter private ISubVariablePanelHandler<DropTable, GiveTableElement> giveRewardPositionListMenu;
|
||||
@Getter private ISubVariablePanelHandler<DropTable, DropTableElement> dropDropTableMainEditMenu, dropRewardListEditMenu, dropNewRewardEditMenu;
|
||||
@Getter private ISubSubVariablePanelHandler<DropTable, DropTableElement, String> dropRewardMainEditMenu;
|
||||
|
||||
@ -227,6 +225,8 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
||||
PanelBuilder panelBuilder8 = new PanelBuilder(editor.getConfigurationSection("DropDropTableMainEditMenu"));
|
||||
PanelBuilder panelBuilder9 = new PanelBuilder(editor.getConfigurationSection("DropNewRewardEditMenu"));
|
||||
|
||||
PanelBuilder panelBuilder10 = new PanelBuilder(editor.getConfigurationSection("GiveRewardPositionListMenu"));
|
||||
|
||||
this.mainDropTableEditMenu = new MainDropTableEditorPanel(this, panelBuilder);
|
||||
this.dropTableTypeEditMenu = new DropTableTypeEditorPanel(this, panelBuilder1, this.customBosses);
|
||||
|
||||
@ -239,6 +239,8 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
||||
this.dropRewardListEditMenu = new DropRewardsListEditorPanel(this, panelBuilder7, this.customBosses);
|
||||
this.dropRewardMainEditMenu = new DropRewardMainEditorPanel(this, panelBuilder8, this.customBosses);
|
||||
this.dropNewRewardEditMenu = new DropNewRewardEditorPanel(this, panelBuilder9, this.customBosses);
|
||||
|
||||
this.giveRewardPositionListMenu = new GiveRewardPositionListPanel(this, panelBuilder10, this.customBosses);
|
||||
}
|
||||
|
||||
private void reloadDropTableEditMenus() {
|
||||
@ -255,6 +257,8 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
||||
PanelBuilder panelBuilder8 = new PanelBuilder(editor.getConfigurationSection("DropDropTableMainEditMenu"));
|
||||
PanelBuilder panelBuilder9 = new PanelBuilder(editor.getConfigurationSection("DropNewRewardEditMenu"));
|
||||
|
||||
PanelBuilder panelBuilder10 = new PanelBuilder(editor.getConfigurationSection("GiveRewardPositionListMenu"));
|
||||
|
||||
this.mainDropTableEditMenu.initializePanel(panelBuilder);
|
||||
this.dropTableTypeEditMenu.initializePanel(panelBuilder1);
|
||||
|
||||
@ -267,6 +271,8 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
||||
this.dropRewardListEditMenu.initializePanel(panelBuilder7);
|
||||
this.dropRewardMainEditMenu.initializePanel(panelBuilder8);
|
||||
this.dropNewRewardEditMenu.initializePanel(panelBuilder9);
|
||||
|
||||
this.giveRewardPositionListMenu.initializePanel(panelBuilder10);
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
@ -4,31 +4,33 @@ import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.droptable.DropTable;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableSubElement;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
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;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 24-Dec-18
|
||||
*/
|
||||
public class GiveDropTableMainEditorPanel extends SubVariablePanelHandler<DropTable, GiveTableElement> {
|
||||
public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTable, GiveTableElement> {
|
||||
|
||||
public GiveDropTableMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
|
||||
public GiveRewardPositionListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
|
||||
super(bossPanelManager, panelBuilder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillPanel(Panel panel, DropTable dropTable, GiveTableElement giveTableElement) {
|
||||
Map<String, Map<String, GiveTableSubElement>> rewardSections = giveTableElement.getGiveRewards();
|
||||
List<String> keys = new ArrayList<>(rewardSections.keySet());
|
||||
int maxPage = panel.getMaxPage(keys);
|
||||
|
||||
}
|
||||
|
||||
@ -44,8 +46,8 @@ public class GiveDropTableMainEditorPanel extends SubVariablePanelHandler<DropTa
|
||||
Panel panel = panelBuilder.getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getDropTables());
|
||||
|
||||
//handle buttons
|
||||
|
||||
panelBuilderCounter.getSlotsWith("NewPosition").forEach(slot -> panel.setOnClick(slot, getNewPositionAction(dropTable, giveTableElement)));
|
||||
fillPanel(panel, dropTable, giveTableElement);
|
||||
panel.openFor(player);
|
||||
}
|
||||
|
||||
@ -53,4 +55,14 @@ public class GiveDropTableMainEditorPanel extends SubVariablePanelHandler<DropTa
|
||||
public void initializePanel(PanelBuilder panelBuilder) {
|
||||
|
||||
}
|
||||
|
||||
private int getNextAvailablePosition(List<String> keys) {
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private ClickAction getNewPositionAction(DropTable dropTable, GiveTableElement giveTableElement) {
|
||||
return event -> {};
|
||||
}
|
||||
}
|
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-U150</plugin.version>
|
||||
<plugin.version>1.0.0-U151</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