mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 08:49:41 +00:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
77be537de4
22 files changed
+2813
-37
No files matched your search
@@ -0,0 +1,328 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDualBeam;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubGuiAbilityDualBeam extends SubGuiAbilityConfig {
|
||||
private final AbilityDualBeam beam;
|
||||
private int editingVisualColorId = 0;
|
||||
private int editingBeam = 0;
|
||||
|
||||
public SubGuiAbilityDualBeam(AbilityDualBeam ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.beam = ability;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasVisualSettings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTypeTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 145;
|
||||
int col2FieldX = guiLeft + 205;
|
||||
|
||||
// Row 1: Damage + Speed
|
||||
addLabel(new GuiNpcLabel(100, "enchantment.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, beam.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "stats.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, beam.getSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Beam Width + Head Size
|
||||
addLabel(new GuiNpcLabel(102, "ability.beamWidth", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, beam.getBeamWidth()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.headSize", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, beam.getHeadSize()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Homing + Homing Strength (only show strength if homing)
|
||||
addLabel(new GuiNpcLabel(104, "ability.homing", labelX, y + 5));
|
||||
GuiNpcButton homingBtn = new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isHoming() ? 1 : 0);
|
||||
homingBtn.setHoverText("ability.hover.homing");
|
||||
addButton(homingBtn);
|
||||
|
||||
if (beam.isHoming()) {
|
||||
addLabel(new GuiNpcLabel(105, "ability.homingStr", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, beam.getHomingStrength()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Max Distance (+ Homing Range only if homing)
|
||||
if (beam.isHoming()) {
|
||||
addLabel(new GuiNpcLabel(106, "ability.homingRange", labelX, y + 5));
|
||||
addTextField(createFloatField(106, fieldX, y, 50, beam.getHomingRange()));
|
||||
}
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.maxDist", beam.isHoming() ? col2LabelX : labelX, y + 5));
|
||||
addTextField(createFloatField(107, beam.isHoming() ? col2FieldX : fieldX, y, 50, beam.getMaxDistance()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Explosive + Explosion Radius (only show radius if explosive)
|
||||
addLabel(new GuiNpcLabel(108, "ability.explosive", labelX, y + 5));
|
||||
GuiNpcButton explosiveBtn = new GuiNpcButton(108, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isExplosive() ? 1 : 0);
|
||||
explosiveBtn.setHoverText("ability.hover.explosive");
|
||||
addButton(explosiveBtn);
|
||||
|
||||
if (beam.isExplosive()) {
|
||||
addLabel(new GuiNpcLabel(109, "ability.explosionRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(109, col2FieldX, y, 50, beam.getExplosionRadius()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 6: Knockback + Max Lifetime
|
||||
addLabel(new GuiNpcLabel(110, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(110, fieldX, y, 50, beam.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(111, "ability.lifetime", col2LabelX, y + 5));
|
||||
addTextField(createIntField(111, col2FieldX, y, 50, beam.getMaxLifetime()));
|
||||
|
||||
y += 24;
|
||||
|
||||
addLabel(new GuiNpcLabel(112, "ability.dualFire", labelX, y + 5));
|
||||
addButton(new GuiNpcButtonYesNo(112, fieldX, y, beam.isDualFire()));
|
||||
|
||||
if (beam.isDualFire()) {
|
||||
addLabel(new GuiNpcLabel(113, "ability.dualFireDelay", col2LabelX, y + 5));
|
||||
addTextField(createIntField(113, col2FieldX, y, 50, beam.getDualFireDelay()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
addButton(new GuiNpcButton(150, labelX, y, 80, 20, "ability.effects"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVisualTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 180;
|
||||
int col2FieldX = guiLeft + 260;
|
||||
|
||||
// Row 1: Anchor Point
|
||||
addLabel(new GuiNpcLabel(210, "ability.anchorPoint", labelX, y + 5));
|
||||
GuiNpcButton anchorBtn = new GuiNpcButton(210, fieldX, y, 80, 20, AnchorPoint.getDisplayNames(), beam.getAnchorPointEnum(editingBeam).ordinal());
|
||||
anchorBtn.setHoverText("ability.hover.anchorPoint");
|
||||
addButton(anchorBtn);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Inner Color + Outer Color
|
||||
addLabel(new GuiNpcLabel(200, "ability.innerColor", labelX, y + 5));
|
||||
String innerHex = String.format("%06X", beam.getInnerColor(editingBeam) & 0xFFFFFF);
|
||||
GuiNpcButton innerColorBtn = new GuiNpcButton(200, fieldX, y, 55, 20, innerHex);
|
||||
innerColorBtn.setTextColor(beam.getInnerColor(editingBeam) & 0xFFFFFF);
|
||||
addButton(innerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(201, "ability.outerColor", col2LabelX, y + 5));
|
||||
String outerHex = String.format("%06X", beam.getOuterColor(editingBeam) & 0xFFFFFF);
|
||||
GuiNpcButton outerColorBtn = new GuiNpcButton(201, col2FieldX, y, 55, 20, outerHex);
|
||||
outerColorBtn.setTextColor(beam.getOuterColor(editingBeam) & 0xFFFFFF);
|
||||
outerColorBtn.setEnabled(beam.isOuterColorEnabled(editingBeam));
|
||||
addButton(outerColorBtn);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Outer Color Enabled + Outer Color Width
|
||||
addLabel(new GuiNpcLabel(202, "ability.outerEnabled", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(202, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isOuterColorEnabled(editingBeam) ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(203, "ability.outerWidth", col2LabelX, y + 5));
|
||||
GuiNpcTextField widthField = createFloatField(203, col2FieldX, y, 55, beam.getOuterColorWidth(editingBeam));
|
||||
widthField.setEnabled(beam.isOuterColorEnabled(editingBeam));
|
||||
addTextField(widthField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Rotation Speed
|
||||
addLabel(new GuiNpcLabel(204, "ability.outerAlpha", labelX, y + 5));
|
||||
GuiNpcTextField alphaField = createFloatField(204, fieldX, y, 55, beam.getOuterColorAlpha(editingBeam));
|
||||
alphaField.setEnabled(beam.isOuterColorEnabled(editingBeam));
|
||||
alphaField.setMinMaxDefaultFloat(0, 1, 0.5f);
|
||||
addTextField(alphaField);
|
||||
|
||||
addLabel(new GuiNpcLabel(205, "ability.rotationSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(205, col2FieldX, y, 50, beam.getRotationSpeed(editingBeam)));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Lightning Effect Enabled (only affects head)
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightning", labelX, y + 5));
|
||||
GuiNpcButton lightningBtn = new GuiNpcButton(206, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.hasLightningEffect(editingBeam) ? 1 : 0);
|
||||
lightningBtn.setHoverText("ability.hover.lightning");
|
||||
addButton(lightningBtn);
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (beam.hasLightningEffect(editingBeam)) {
|
||||
y += 24;
|
||||
|
||||
// Row 5: Density + Radius
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(207, this, fontRendererObj, fieldX, y, 55, 18, "" + beam.getLightningDensity(editingBeam));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(208, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(208, this, fontRendererObj, col2FieldX, y, 55, 18, "" + beam.getLightningRadius(editingBeam));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
addButton(new GuiNpcButton(400, col2FieldX, y, 55, 20, new String[]{"Beam 1", "Beam 2"}, editingBeam));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 104:
|
||||
beam.setHoming(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 108:
|
||||
beam.setExplosive(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 112:
|
||||
beam.setDualFire(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 150:
|
||||
setSubGui(new SubGuiAbilityEffects(beam.getEffects()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 200:
|
||||
editingVisualColorId = 200;
|
||||
setSubGui(new SubGuiColorSelector(beam.getInnerColor(editingBeam)));
|
||||
break;
|
||||
case 201:
|
||||
editingVisualColorId = 201;
|
||||
setSubGui(new SubGuiColorSelector(beam.getOuterColor(editingBeam)));
|
||||
break;
|
||||
case 202:
|
||||
beam.setOuterColorEnabled(editingBeam, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 206:
|
||||
beam.setLightningEffect(editingBeam, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 210:
|
||||
beam.setAnchorPointEnum(editingBeam, AnchorPoint.fromOrdinal(value));
|
||||
break;
|
||||
case 400:
|
||||
editingBeam = (editingBeam + 1) % 2;
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subGuiClosed(SubGuiInterface subgui) {
|
||||
if (subgui instanceof SubGuiColorSelector && editingVisualColorId != 0) {
|
||||
SubGuiColorSelector colorSelector = (SubGuiColorSelector) subgui;
|
||||
int rgb = colorSelector.color & 0x00FFFFFF;
|
||||
if (editingVisualColorId == 200) {
|
||||
beam.setInnerColor(editingBeam, rgb);
|
||||
} else if (editingVisualColorId == 201) {
|
||||
beam.setOuterColor(editingBeam, rgb);
|
||||
}
|
||||
editingVisualColorId = 0;
|
||||
initGui();
|
||||
} else if (subgui instanceof SubGuiAbilityEffects) {
|
||||
SubGuiAbilityEffects effectsGui = (SubGuiAbilityEffects) subgui;
|
||||
List<AbilityEffect> result = effectsGui.getResult();
|
||||
if (result != null) {
|
||||
beam.setEffects(result);
|
||||
}
|
||||
} else {
|
||||
super.subGuiClosed(subgui);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100:
|
||||
beam.setDamage(parseFloat(field, beam.getDamage()));
|
||||
break;
|
||||
case 101:
|
||||
beam.setSpeed(parseFloat(field, beam.getSpeed()));
|
||||
break;
|
||||
case 102:
|
||||
beam.setBeamWidth(parseFloat(field, beam.getBeamWidth()));
|
||||
break;
|
||||
case 103:
|
||||
beam.setHeadSize(parseFloat(field, beam.getHeadSize()));
|
||||
break;
|
||||
case 105:
|
||||
beam.setHomingStrength(parseFloat(field, beam.getHomingStrength()));
|
||||
break;
|
||||
case 106:
|
||||
beam.setHomingRange(parseFloat(field, beam.getHomingRange()));
|
||||
break;
|
||||
case 107:
|
||||
beam.setMaxDistance(parseFloat(field, beam.getMaxDistance()));
|
||||
break;
|
||||
case 109:
|
||||
beam.setExplosionRadius(parseFloat(field, beam.getExplosionRadius()));
|
||||
break;
|
||||
case 110:
|
||||
beam.setKnockback(parseFloat(field, beam.getKnockback()));
|
||||
break;
|
||||
case 111:
|
||||
beam.setMaxLifetime(field.getInteger());
|
||||
break;
|
||||
case 113:
|
||||
beam.setDualFireDelay(field.getInteger());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 203:
|
||||
beam.setOuterColorWidth(editingBeam, parseFloat(field, beam.getOuterColorWidth(editingBeam)));
|
||||
break;
|
||||
case 204:
|
||||
beam.setOuterColorAlpha(editingBeam, parseFloat(field, beam.getOuterColorAlpha(editingBeam)));
|
||||
break;
|
||||
case 205:
|
||||
beam.setRotationSpeed(editingBeam, parseFloat(field, beam.getRotationSpeed(editingBeam)));
|
||||
break;
|
||||
case 207:
|
||||
beam.setLightningDensity(editingBeam, parseFloat(field, beam.getLightningDensity(editingBeam)));
|
||||
break;
|
||||
case 208:
|
||||
beam.setLightningRadius(editingBeam, parseFloat(field, beam.getLightningRadius(editingBeam)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDisc;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDualDisc;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubGuiAbilityDualDisc extends SubGuiAbilityConfig {
|
||||
private final AbilityDualDisc disc;
|
||||
private int editingVisualColorId = 0;
|
||||
private int editingDisc = 0;
|
||||
|
||||
public SubGuiAbilityDualDisc(AbilityDualDisc ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.disc = ability;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasVisualSettings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTypeTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 145;
|
||||
int col2FieldX = guiLeft + 205;
|
||||
|
||||
// Row 1: Damage + Speed
|
||||
addLabel(new GuiNpcLabel(100, "enchantment.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, disc.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "stats.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, disc.getSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Disc Radius + Disc Thickness
|
||||
addLabel(new GuiNpcLabel(102, "ability.discRadius", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, disc.getDiscRadius()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.discThickness", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, disc.getDiscThickness()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Homing + Homing Strength (only show strength if homing)
|
||||
addLabel(new GuiNpcLabel(104, "ability.homing", labelX, y + 5));
|
||||
GuiNpcButton homingBtn = new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.isHoming() ? 1 : 0);
|
||||
homingBtn.setHoverText("ability.hover.homing");
|
||||
addButton(homingBtn);
|
||||
|
||||
if (disc.isHoming()) {
|
||||
addLabel(new GuiNpcLabel(105, "ability.homingStr", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, disc.getHomingStrength()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Boomerang + Boomerang Delay (only show delay if boomerang)
|
||||
addLabel(new GuiNpcLabel(106, "ability.boomerang", labelX, y + 5));
|
||||
GuiNpcButton boomerangBtn = new GuiNpcButton(106, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.isBoomerang() ? 1 : 0);
|
||||
boomerangBtn.setHoverText("ability.hover.boomerang");
|
||||
addButton(boomerangBtn);
|
||||
|
||||
if (disc.isBoomerang()) {
|
||||
addLabel(new GuiNpcLabel(107, "ability.boomerangDelay", col2LabelX, y + 5));
|
||||
addTextField(createIntField(107, col2FieldX, y, 50, disc.getBoomerangDelay()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Explosive + Explosion Radius (only show radius if explosive)
|
||||
addLabel(new GuiNpcLabel(108, "ability.explosive", labelX, y + 5));
|
||||
GuiNpcButton explosiveBtn = new GuiNpcButton(108, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.isExplosive() ? 1 : 0);
|
||||
explosiveBtn.setHoverText("ability.hover.explosive");
|
||||
addButton(explosiveBtn);
|
||||
|
||||
if (disc.isExplosive()) {
|
||||
addLabel(new GuiNpcLabel(109, "ability.explosionRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(109, col2FieldX, y, 50, disc.getExplosionRadius()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 6: Knockback + Max Distance
|
||||
addLabel(new GuiNpcLabel(110, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(110, fieldX, y, 50, disc.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(111, "ability.maxDist", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(111, col2FieldX, y, 50, disc.getMaxDistance()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 7: Max Lifetime + Effects button
|
||||
addLabel(new GuiNpcLabel(112, "ability.lifetime", labelX, y + 5));
|
||||
addTextField(createIntField(112, fieldX, y, 50, disc.getMaxLifetime()));
|
||||
|
||||
y += 24;
|
||||
|
||||
addLabel(new GuiNpcLabel(113, "ability.dualFire", labelX, y + 5));
|
||||
addButton(new GuiNpcButtonYesNo(113, fieldX, y, disc.isDualFire()));
|
||||
|
||||
if (disc.isDualFire()) {
|
||||
addLabel(new GuiNpcLabel(114, "ability.dualFireDelay", col2LabelX, y + 5));
|
||||
addTextField(createIntField(114, col2FieldX, y, 50, disc.getDualFireDelay()));
|
||||
}
|
||||
|
||||
addButton(new GuiNpcButton(150, col2LabelX + 120, y, 80, 20, "ability.effects"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVisualTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 180;
|
||||
int col2FieldX = guiLeft + 260;
|
||||
|
||||
// Row 1: Anchor Point
|
||||
addLabel(new GuiNpcLabel(210, "ability.anchorPoint", labelX, y + 5));
|
||||
GuiNpcButton anchorBtn = new GuiNpcButton(210, fieldX, y, 80, 20, AnchorPoint.getDisplayNames(), disc.getAnchorPointEnum(editingDisc).ordinal());
|
||||
anchorBtn.setHoverText("ability.hover.anchorPoint");
|
||||
addButton(anchorBtn);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Inner Color + Outer Color
|
||||
addLabel(new GuiNpcLabel(200, "ability.innerColor", labelX, y + 5));
|
||||
String innerHex = String.format("%06X", disc.getInnerColor(editingDisc) & 0xFFFFFF);
|
||||
GuiNpcButton innerColorBtn = new GuiNpcButton(200, fieldX, y, 55, 20, innerHex);
|
||||
innerColorBtn.setTextColor(disc.getInnerColor(editingDisc) & 0xFFFFFF);
|
||||
addButton(innerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(201, "ability.outerColor", col2LabelX, y + 5));
|
||||
String outerHex = String.format("%06X", disc.getOuterColor(editingDisc) & 0xFFFFFF);
|
||||
GuiNpcButton outerColorBtn = new GuiNpcButton(201, col2FieldX, y, 55, 20, outerHex);
|
||||
outerColorBtn.setTextColor(disc.getOuterColor(editingDisc) & 0xFFFFFF);
|
||||
outerColorBtn.setEnabled(disc.isOuterColorEnabled(editingDisc));
|
||||
addButton(outerColorBtn);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Outer Color Enabled + Outer Color Width
|
||||
addLabel(new GuiNpcLabel(202, "ability.outerEnabled", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(202, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.isOuterColorEnabled(editingDisc) ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(203, "ability.outerWidth", col2LabelX, y + 5));
|
||||
GuiNpcTextField widthField = createFloatField(203, col2FieldX, y, 55, disc.getOuterColorWidth(editingDisc));
|
||||
widthField.setEnabled(disc.isOuterColorEnabled(editingDisc));
|
||||
addTextField(widthField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Outer Color Alpha
|
||||
addLabel(new GuiNpcLabel(204, "ability.outerAlpha", labelX, y + 5));
|
||||
GuiNpcTextField alphaField = createFloatField(204, fieldX, y, 55, disc.getOuterColorAlpha(editingDisc));
|
||||
alphaField.setEnabled(disc.isOuterColorEnabled(editingDisc));
|
||||
alphaField.setMinMaxDefaultFloat(0, 1, 0.5f);
|
||||
addTextField(alphaField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Rotation Speed
|
||||
addLabel(new GuiNpcLabel(205, "ability.rotationSpeed", labelX, y + 5));
|
||||
addTextField(createFloatField(205, fieldX, y, 50, disc.getRotationSpeed(editingDisc)));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Lightning Effect Enabled
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightning", labelX, y + 5));
|
||||
GuiNpcButton lightningBtn = new GuiNpcButton(206, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.hasLightningEffect(editingDisc) ? 1 : 0);
|
||||
lightningBtn.setHoverText("ability.hover.lightning");
|
||||
addButton(lightningBtn);
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (disc.hasLightningEffect(editingDisc)) {
|
||||
y += 24;
|
||||
|
||||
// Row 6: Density + Radius
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(207, this, fontRendererObj, fieldX, y, 55, 18, "" + disc.getLightningDensity(editingDisc));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(208, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(208, this, fontRendererObj, col2FieldX, y, 55, 18, "" + disc.getLightningRadius(editingDisc));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
addButton(new GuiNpcButton(400, col2FieldX, y, 55, 20, new String[]{"Disc 1", "Disc 2"}, editingDisc));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 104:
|
||||
disc.setHoming(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 106:
|
||||
disc.setBoomerang(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 108:
|
||||
disc.setExplosive(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 113:
|
||||
disc.setDualFire(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 150:
|
||||
setSubGui(new SubGuiAbilityEffects(disc.getEffects()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 200:
|
||||
editingVisualColorId = 200;
|
||||
setSubGui(new SubGuiColorSelector(disc.getInnerColor(editingDisc)));
|
||||
break;
|
||||
case 201:
|
||||
editingVisualColorId = 201;
|
||||
setSubGui(new SubGuiColorSelector(disc.getOuterColor(editingDisc)));
|
||||
break;
|
||||
case 202:
|
||||
disc.setOuterColorEnabled(editingDisc, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 206:
|
||||
disc.setLightningEffect(editingDisc, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 210:
|
||||
disc.setAnchorPointEnum(editingDisc, AnchorPoint.fromOrdinal(value));
|
||||
break;
|
||||
case 400:
|
||||
editingDisc = (editingDisc + 1) % 2;
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subGuiClosed(SubGuiInterface subgui) {
|
||||
if (subgui instanceof SubGuiColorSelector && editingVisualColorId != 0) {
|
||||
SubGuiColorSelector colorSelector = (SubGuiColorSelector) subgui;
|
||||
int rgb = colorSelector.color & 0x00FFFFFF;
|
||||
if (editingVisualColorId == 200) {
|
||||
disc.setInnerColor(editingDisc, rgb);
|
||||
} else if (editingVisualColorId == 201) {
|
||||
disc.setOuterColor(editingDisc, rgb);
|
||||
}
|
||||
editingVisualColorId = 0;
|
||||
initGui();
|
||||
} else if (subgui instanceof SubGuiAbilityEffects) {
|
||||
SubGuiAbilityEffects effectsGui = (SubGuiAbilityEffects) subgui;
|
||||
List<AbilityEffect> result = effectsGui.getResult();
|
||||
if (result != null) {
|
||||
disc.setEffects(result);
|
||||
}
|
||||
} else {
|
||||
super.subGuiClosed(subgui);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100:
|
||||
disc.setDamage(parseFloat(field, disc.getDamage()));
|
||||
break;
|
||||
case 101:
|
||||
disc.setSpeed(parseFloat(field, disc.getSpeed()));
|
||||
break;
|
||||
case 102:
|
||||
disc.setDiscRadius(parseFloat(field, disc.getDiscRadius()));
|
||||
break;
|
||||
case 103:
|
||||
disc.setDiscThickness(parseFloat(field, disc.getDiscThickness()));
|
||||
break;
|
||||
case 105:
|
||||
disc.setHomingStrength(parseFloat(field, disc.getHomingStrength()));
|
||||
break;
|
||||
case 107:
|
||||
disc.setBoomerangDelay(field.getInteger());
|
||||
break;
|
||||
case 109:
|
||||
disc.setExplosionRadius(parseFloat(field, disc.getExplosionRadius()));
|
||||
break;
|
||||
case 110:
|
||||
disc.setKnockback(parseFloat(field, disc.getKnockback()));
|
||||
break;
|
||||
case 111:
|
||||
disc.setMaxDistance(parseFloat(field, disc.getMaxDistance()));
|
||||
break;
|
||||
case 112:
|
||||
disc.setMaxLifetime(field.getInteger());
|
||||
break;
|
||||
case 114:
|
||||
disc.setDualFireDelay(field.getInteger());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 203:
|
||||
disc.setOuterColorWidth(editingDisc, parseFloat(field, disc.getOuterColorWidth(editingDisc)));
|
||||
break;
|
||||
case 204:
|
||||
disc.setOuterColorAlpha(editingDisc, parseFloat(field, disc.getOuterColorAlpha(editingDisc)));
|
||||
break;
|
||||
case 205:
|
||||
disc.setRotationSpeed(editingDisc, parseFloat(field, disc.getRotationSpeed(editingDisc)));
|
||||
break;
|
||||
case 207:
|
||||
disc.setLightningDensity(editingDisc, parseFloat(field, disc.getLightningDensity(editingDisc)));
|
||||
break;
|
||||
case 208:
|
||||
disc.setLightningRadius(editingDisc, parseFloat(field, disc.getLightningRadius(editingDisc)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDualOrb;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubGuiAbilityDualOrb extends SubGuiAbilityConfig {
|
||||
private final AbilityDualOrb orb;
|
||||
private int editingVisualColorId = 0;
|
||||
private int editingOrb = 0;
|
||||
|
||||
public SubGuiAbilityDualOrb(AbilityDualOrb ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.orb = ability;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasVisualSettings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTypeTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 145;
|
||||
int col2FieldX = guiLeft + 205;
|
||||
|
||||
// Row 1: Damage + Speed
|
||||
addLabel(new GuiNpcLabel(100, "enchantment.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, orb.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "stats.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, orb.getOrbSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Orb Size + Max Distance
|
||||
addLabel(new GuiNpcLabel(102, "stats.size", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, orb.getOrbSize()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.maxDist", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, orb.getMaxDistance()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Homing + Homing Strength (only show strength if homing)
|
||||
addLabel(new GuiNpcLabel(104, "ability.homing", labelX, y + 5));
|
||||
GuiNpcButton homingBtn = new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isHoming() ? 1 : 0);
|
||||
homingBtn.setHoverText("ability.hover.homing");
|
||||
addButton(homingBtn);
|
||||
|
||||
if (orb.isHoming()) {
|
||||
addLabel(new GuiNpcLabel(105, "ability.homingStr", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, orb.getHomingStrength()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Explosive + Explosion Radius (only show radius if explosive)
|
||||
addLabel(new GuiNpcLabel(106, "ability.explosive", labelX, y + 5));
|
||||
GuiNpcButton explosiveBtn = new GuiNpcButton(106, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isExplosive() ? 1 : 0);
|
||||
explosiveBtn.setHoverText("ability.hover.explosive");
|
||||
addButton(explosiveBtn);
|
||||
|
||||
if (orb.isExplosive()) {
|
||||
addLabel(new GuiNpcLabel(107, "ability.explosionRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(107, col2FieldX, y, 50, orb.getExplosionRadius()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Knockback + Max Lifetime
|
||||
addLabel(new GuiNpcLabel(108, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(108, fieldX, y, 50, orb.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(109, "ability.lifetime", col2LabelX, y + 5));
|
||||
addTextField(createIntField(109, col2FieldX, y, 50, orb.getMaxLifetime()));
|
||||
|
||||
y += 24;
|
||||
|
||||
addLabel(new GuiNpcLabel(110, "ability.dualFire", labelX, y + 5));
|
||||
addButton(new GuiNpcButtonYesNo(110, fieldX, y, orb.isDualFire()));
|
||||
|
||||
if (orb.isDualFire()) {
|
||||
addLabel(new GuiNpcLabel(111, "ability.dualFireDelay", col2LabelX, y + 5));
|
||||
addTextField(createIntField(111, col2FieldX, y, 50, orb.getDualFireDelay()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 7: Effects button
|
||||
addButton(new GuiNpcButton(150, labelX, y, 80, 20, "ability.effects"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVisualTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 85;
|
||||
int col2LabelX = guiLeft + 180;
|
||||
int col2FieldX = guiLeft + 260;
|
||||
|
||||
// Row 1: Anchor Point
|
||||
addLabel(new GuiNpcLabel(210, "ability.anchorPoint", labelX, y + 5));
|
||||
GuiNpcButton anchorBtn = new GuiNpcButton(210, fieldX, y, 80, 20, AnchorPoint.getDisplayNames(), orb.getAnchorPointEnum(editingOrb).ordinal());
|
||||
anchorBtn.setHoverText("ability.hover.anchorPoint");
|
||||
addButton(anchorBtn);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Inner Color + Rotation Speed
|
||||
addLabel(new GuiNpcLabel(200, "ability.innerColor", labelX, y + 5));
|
||||
String innerHex = String.format("%06X", orb.getInnerColor(editingOrb) & 0xFFFFFF);
|
||||
GuiNpcButton innerColorBtn = new GuiNpcButton(200, fieldX, y, 55, 20, innerHex);
|
||||
innerColorBtn.setTextColor(orb.getInnerColor(editingOrb) & 0xFFFFFF);
|
||||
addButton(innerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(205, "ability.rotationSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(205, col2FieldX, y, 55, orb.getRotationSpeed(editingOrb)));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Outer Glow Enabled
|
||||
addLabel(new GuiNpcLabel(202, "ability.outerEnabled", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(202, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isOuterColorEnabled(editingOrb) ? 1 : 0));
|
||||
|
||||
// Only show Outer Color and Width if Outer Glow is enabled
|
||||
if (orb.isOuterColorEnabled()) {
|
||||
addLabel(new GuiNpcLabel(204, "ability.outerAlpha", col2LabelX, y + 5));
|
||||
GuiNpcTextField alphaField = createFloatField(204, col2FieldX, y, 55, orb.getOuterColorAlpha(editingOrb));
|
||||
alphaField.setEnabled(orb.isOuterColorEnabled(editingOrb));
|
||||
alphaField.setMinMaxDefaultFloat(0, 1, 0.5f);
|
||||
addTextField(alphaField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Outer Color + Outer Width
|
||||
addLabel(new GuiNpcLabel(201, "ability.outerColor", labelX, y + 5));
|
||||
String outerHex = String.format("%06X", orb.getOuterColor(editingOrb) & 0xFFFFFF);
|
||||
GuiNpcButton outerColorBtn = new GuiNpcButton(201, fieldX, y, 55, 20, outerHex);
|
||||
outerColorBtn.setTextColor(orb.getOuterColor(editingOrb) & 0xFFFFFF);
|
||||
addButton(outerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(203, "ability.outerWidth", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(203, col2FieldX, y, 55, orb.getOuterColorWidth(editingOrb)));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Lightning Effect Enabled
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightning", labelX, y + 5));
|
||||
GuiNpcButton lightningBtn = new GuiNpcButton(206, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.hasLightningEffect(editingOrb) ? 1 : 0);
|
||||
lightningBtn.setHoverText("ability.hover.lightning");
|
||||
addButton(lightningBtn);
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (orb.hasLightningEffect(editingOrb)) {
|
||||
y += 24;
|
||||
|
||||
// Row 61: Density + Radius
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(207, this, fontRendererObj, fieldX, y, 55, 18, "" + orb.getLightningDensity(editingOrb));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(208, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(208, this, fontRendererObj, col2FieldX, y, 55, 18, "" + orb.getLightningRadius(editingOrb));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
addButton(new GuiNpcButton(400, col2FieldX, y, 55, 20, new String[]{"Orb 1", "Orb 2"}, editingOrb));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 104:
|
||||
orb.setHoming(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 106:
|
||||
orb.setExplosive(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 110:
|
||||
orb.setDualFire(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 150:
|
||||
setSubGui(new SubGuiAbilityEffects(orb.getEffects()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 200:
|
||||
editingVisualColorId = 200;
|
||||
setSubGui(new SubGuiColorSelector(orb.getInnerColor(editingOrb)));
|
||||
break;
|
||||
case 201:
|
||||
editingVisualColorId = 201;
|
||||
setSubGui(new SubGuiColorSelector(orb.getOuterColor(editingOrb)));
|
||||
break;
|
||||
case 202:
|
||||
orb.setOuterColorEnabled(editingOrb, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 206:
|
||||
orb.setLightningEffect(editingOrb, value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 210:
|
||||
orb.setAnchorPointEnum(editingOrb, AnchorPoint.fromOrdinal(value));
|
||||
break;
|
||||
case 400:
|
||||
editingOrb = (editingOrb + 1) % 2;
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subGuiClosed(SubGuiInterface subgui) {
|
||||
if (subgui instanceof SubGuiColorSelector && editingVisualColorId != 0) {
|
||||
SubGuiColorSelector colorSelector = (SubGuiColorSelector) subgui;
|
||||
int rgb = colorSelector.color & 0x00FFFFFF;
|
||||
if (editingVisualColorId == 200) {
|
||||
orb.setInnerColor(editingOrb, rgb);
|
||||
} else if (editingVisualColorId == 201) {
|
||||
orb.setOuterColor(editingOrb, rgb);
|
||||
}
|
||||
editingVisualColorId = 0;
|
||||
initGui();
|
||||
} else if (subgui instanceof SubGuiAbilityEffects) {
|
||||
SubGuiAbilityEffects effectsGui = (SubGuiAbilityEffects) subgui;
|
||||
List<AbilityEffect> result = effectsGui.getResult();
|
||||
if (result != null) {
|
||||
orb.setEffects(result);
|
||||
}
|
||||
} else {
|
||||
super.subGuiClosed(subgui);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100:
|
||||
orb.setDamage(parseFloat(field, orb.getDamage()));
|
||||
break;
|
||||
case 101:
|
||||
orb.setOrbSpeed(parseFloat(field, orb.getOrbSpeed()));
|
||||
break;
|
||||
case 102:
|
||||
orb.setOrbSize(parseFloat(field, orb.getOrbSize()));
|
||||
break;
|
||||
case 103:
|
||||
orb.setMaxDistance(parseFloat(field, orb.getMaxDistance()));
|
||||
break;
|
||||
case 105:
|
||||
orb.setHomingStrength(parseFloat(field, orb.getHomingStrength()));
|
||||
break;
|
||||
case 107:
|
||||
orb.setExplosionRadius(parseFloat(field, orb.getExplosionRadius()));
|
||||
break;
|
||||
case 108:
|
||||
orb.setKnockback(parseFloat(field, orb.getKnockback()));
|
||||
break;
|
||||
case 109:
|
||||
orb.setMaxLifetime(field.getInteger());
|
||||
break;
|
||||
case 111:
|
||||
orb.setDualFireDelay(field.getInteger());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleVisualTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 203:
|
||||
orb.setOuterColorWidth(editingOrb, parseFloat(field, orb.getOuterColorWidth(editingOrb)));
|
||||
break;
|
||||
case 204:
|
||||
orb.setOuterColorAlpha(editingOrb, parseFloat(field, orb.getOuterColorAlpha(editingOrb)));
|
||||
break;
|
||||
case 205:
|
||||
orb.setRotationSpeed(editingOrb, parseFloat(field, orb.getRotationSpeed(editingOrb)));
|
||||
break;
|
||||
case 207:
|
||||
orb.setLightningDensity(editingOrb, parseFloat(field, orb.getLightningDensity(editingOrb)));
|
||||
break;
|
||||
case 208:
|
||||
orb.setLightningRadius(editingOrb, parseFloat(field, orb.getLightningRadius(editingOrb)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.ITimers;
|
||||
import noppes.npcs.api.ability.IDataAbilities;
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
@@ -51,6 +52,7 @@ import noppes.npcs.scripted.roles.ScriptRoleInterface;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleMailman;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleTrader;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleTransporter;
|
||||
import noppes.npcs.scripted.wrapper.ScriptDataAbilities;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1458,7 +1460,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
return npc.stats.magicData;
|
||||
}
|
||||
|
||||
public noppes.npcs.api.ability.IDataAbilities getAbilityData() {
|
||||
return new noppes.npcs.scripted.wrapper.ScriptDataAbilities(npc);
|
||||
public IDataAbilities getAbilityData() {
|
||||
return new ScriptDataAbilities(npc);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,15 @@ package noppes.npcs.scripted.wrapper;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilitySlot;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.DataAbilities;
|
||||
import noppes.npcs.api.ability.IAbility;
|
||||
import noppes.npcs.api.ability.IDataAbilities;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Script wrapper for DataAbilities providing API access to NPC abilities.
|
||||
*/
|
||||
@@ -65,7 +68,7 @@ public class ScriptDataAbilities implements IDataAbilities {
|
||||
|
||||
@Override
|
||||
public boolean isAbilityReference(String abilityId) {
|
||||
List<kamkeel.npcs.controllers.data.ability.AbilitySlot> slots = data.getAbilitySlots();
|
||||
List<AbilitySlot> slots = data.getAbilitySlots();
|
||||
for (int i = 0; i < slots.size(); i++) {
|
||||
kamkeel.npcs.controllers.data.ability.AbilitySlot slot = slots.get(i);
|
||||
if (slot.isReference()) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ScriptPlayerAbilityData implements IPlayerAbilityData {
|
||||
|
||||
@Override
|
||||
public String[] getUnlockedAbilities() {
|
||||
return data.getUnlockedAbilities().toArray(new String[0]);
|
||||
return data.getUnlockedAbilities();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,6 +79,11 @@ public class ScriptPlayerAbilityData implements IPlayerAbilityData {
|
||||
data.interruptCurrentAbility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnCooldown() {
|
||||
return data.isOnCooldown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnCooldown(String key) {
|
||||
EntityPlayer player = playerData.player;
|
||||
@@ -86,6 +91,11 @@ public class ScriptPlayerAbilityData implements IPlayerAbilityData {
|
||||
return data.isOnCooldown(key, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCooldown() {
|
||||
data.resetCooldown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCooldown(String key) {
|
||||
data.resetCooldown(key);
|
||||
|
||||
Reference in new issue
Block a user