mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 01:29:05 +00:00
Refactor Ability GUI to support third-party extensibility
This refactoring allows third-party mods to provide their own custom GUI for ability type settings by extending SubGuiAbilityConfig. Changes: - Refactored SubGuiAbilityConfig as base class with GuiMenuTopButton tabs - Added virtual methods: initTypeTab(), handleTypeButton(), handleTypeTextField() - Added createConfigGui() method to Ability base class for GUI instantiation - Created 15 SubGuiAbility* subclasses in new ability package - Updated GuiNPCAbilities and GuiNpcManageAbilities to use ability.createConfigGui() Third-party mods can now: 1. Create a custom Ability subclass 2. Extend SubGuiAbilityConfig with their own GUI 3. Override createConfigGui() to return their custom GUI
This commit is contained in:
34 files changed
+1634
-964
No files matched your search
@@ -241,6 +241,22 @@ public abstract class Ability implements IAbility {
|
||||
*/
|
||||
public int getTypeSettingsRowCount() { return 0; }
|
||||
|
||||
/**
|
||||
* Creates the GUI for configuring this ability.
|
||||
* Override this method to provide a custom GUI subclass for type-specific settings.
|
||||
*
|
||||
* Third-party mods can extend SubGuiAbilityConfig and override initTypeTab(),
|
||||
* handleTypeButton(), and handleTypeTextField() to provide custom type settings.
|
||||
*
|
||||
* @param callback The callback to notify when the ability is saved
|
||||
* @return A SubGuiAbilityConfig instance (or subclass) for configuring this ability
|
||||
*/
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.SubGuiAbilityConfig(this, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a telegraph instance for this ability.
|
||||
* Override for custom telegraph shapes.
|
||||
|
||||
@@ -57,6 +57,13 @@ public class AbilityBeam extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityBeam(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -56,6 +56,13 @@ public class AbilityCharge extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityCharge(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -68,6 +68,13 @@ public class AbilityCutter extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityCutter(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -94,6 +94,13 @@ public class AbilityDash extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityDash(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ public class AbilityGuard extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityGuard(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -86,6 +86,13 @@ public class AbilityHazard extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityHazard(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ public class AbilityHeal extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityHeal(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -39,6 +39,13 @@ public class AbilityHeavyHit extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityHeavyHit(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -63,6 +63,13 @@ public class AbilityOrb extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityOrb(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -46,6 +46,13 @@ public class AbilityProjectile extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityProjectile(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ public class AbilityShockwave extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityShockwave(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -58,6 +58,13 @@ public class AbilitySlam extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilitySlam(this, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Slam can be AOE_SELF (jump in place) or AOE_TARGET (leap to target).
|
||||
*/
|
||||
|
||||
@@ -71,6 +71,13 @@ public class AbilityTeleport extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityTeleport(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -78,6 +78,13 @@ public class AbilityTrap extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityTrap(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -56,6 +56,13 @@ public class AbilityVortex extends Ability {
|
||||
@Override
|
||||
public boolean hasTypeSettings() { return true; }
|
||||
|
||||
@Override
|
||||
@cpw.mods.fml.relauncher.SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
|
||||
public noppes.npcs.client.gui.advanced.SubGuiAbilityConfig createConfigGui(
|
||||
noppes.npcs.client.gui.advanced.IAbilityConfigCallback callback) {
|
||||
return new noppes.npcs.client.gui.advanced.ability.SubGuiAbilityVortex(this, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTargetingModeLocked() { return true; }
|
||||
|
||||
|
||||
@@ -163,7 +163,8 @@ public class GuiNPCAbilities extends GuiNPCInterface2 implements IScrollData, IC
|
||||
// Edit ability
|
||||
if (id == 72) {
|
||||
if (selectedAbilityIndex >= 0 && selectedAbilityIndex < npcAbilities.size()) {
|
||||
setSubGui(new SubGuiAbilityConfig(npcAbilities.get(selectedAbilityIndex), this));
|
||||
Ability ability = npcAbilities.get(selectedAbilityIndex);
|
||||
setSubGui(ability.createConfigGui(this));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -210,7 +211,7 @@ public class GuiNPCAbilities extends GuiNPCInterface2 implements IScrollData, IC
|
||||
Ability abilityToSave = npcAbilities.get(selectedAbilityIndex);
|
||||
if (abilityToSave.getName() == null || abilityToSave.getName().isEmpty()) {
|
||||
// Need a name to save - open edit dialog first
|
||||
setSubGui(new SubGuiAbilityConfig(abilityToSave, this));
|
||||
setSubGui(abilityToSave.createConfigGui(this));
|
||||
} else {
|
||||
setSubGui(new SubGuiAbilitySaveConfirm(abilityToSave));
|
||||
}
|
||||
@@ -429,7 +430,8 @@ public class GuiNPCAbilities extends GuiNPCInterface2 implements IScrollData, IC
|
||||
@Override
|
||||
public void customScrollDoubleClicked(String selection, GuiCustomScroll scroll) {
|
||||
if (scroll == npcAbilitiesScroll && selectedAbilityIndex >= 0 && selectedAbilityIndex < npcAbilities.size()) {
|
||||
setSubGui(new SubGuiAbilityConfig(npcAbilities.get(selectedAbilityIndex), this));
|
||||
Ability ability = npcAbilities.get(selectedAbilityIndex);
|
||||
setSubGui(ability.createConfigGui(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,92 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityBeam;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Beam ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityBeam extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityBeam beam;
|
||||
|
||||
public SubGuiAbilityBeam(AbilityBeam ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.beam = ability;
|
||||
}
|
||||
|
||||
@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 + Damage Interval
|
||||
addLabel(new GuiNpcLabel(100, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, beam.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.dmgInterval", col2LabelX, y + 5));
|
||||
addTextField(createIntField(101, col2FieldX, y, 50, beam.getDamageInterval()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Beam Length + Beam Width
|
||||
addLabel(new GuiNpcLabel(102, "ability.beamLength", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, beam.getBeamLength()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.beamWidth", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, beam.getBeamWidth()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Sweep Angle + Sweep Speed
|
||||
addLabel(new GuiNpcLabel(104, "ability.sweepAngle", labelX, y + 5));
|
||||
addTextField(createFloatField(104, fieldX, y, 50, beam.getSweepAngle()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.sweepSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, beam.getSweepSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Piercing + Lock On Target
|
||||
addLabel(new GuiNpcLabel(106, "ability.piercing", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(106, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isPiercing() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.lockTarget", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(107, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isLockOnTarget() ? 1 : 0));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Sweep Back & Forth
|
||||
addLabel(new GuiNpcLabel(108, "ability.sweepBackForth", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(108, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.isSweepBackAndForth() ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 106: beam.setPiercing(value == 1); break;
|
||||
case 107: beam.setLockOnTarget(value == 1); break;
|
||||
case 108: beam.setSweepBackAndForth(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: beam.setDamage(parseFloat(field, beam.getDamage())); break;
|
||||
case 101: beam.setDamageInterval(field.getInteger()); break;
|
||||
case 102: beam.setBeamLength(parseFloat(field, beam.getBeamLength())); break;
|
||||
case 103: beam.setBeamWidth(parseFloat(field, beam.getBeamWidth())); break;
|
||||
case 104: beam.setSweepAngle(parseFloat(field, beam.getSweepAngle())); break;
|
||||
case 105: beam.setSweepSpeed(parseFloat(field, beam.getSweepSpeed())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityCharge;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Charge ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityCharge extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityCharge charge;
|
||||
|
||||
public SubGuiAbilityCharge(AbilityCharge ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.charge = ability;
|
||||
}
|
||||
|
||||
@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, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, charge.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, charge.getChargeSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Knockback + Knockback Up
|
||||
addLabel(new GuiNpcLabel(102, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, charge.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.knockbackUp", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, charge.getKnockbackUp()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Max Distance + Hit Radius
|
||||
addLabel(new GuiNpcLabel(104, "ability.maxDist", labelX, y + 5));
|
||||
addTextField(createFloatField(104, fieldX, y, 50, charge.getMaxDistance()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.hitRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, charge.getHitRadius()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: charge.setDamage(parseFloat(field, charge.getDamage())); break;
|
||||
case 101: charge.setChargeSpeed(parseFloat(field, charge.getChargeSpeed())); break;
|
||||
case 102: charge.setKnockback(parseFloat(field, charge.getKnockback())); break;
|
||||
case 103: charge.setKnockbackUp(parseFloat(field, charge.getKnockbackUp())); break;
|
||||
case 104: charge.setMaxDistance(parseFloat(field, charge.getMaxDistance())); break;
|
||||
case 105: charge.setHitRadius(parseFloat(field, charge.getHitRadius())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityCutter;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Cutter ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityCutter extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityCutter cutter;
|
||||
|
||||
public SubGuiAbilityCutter(AbilityCutter ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.cutter = ability;
|
||||
}
|
||||
|
||||
@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 + Range
|
||||
addLabel(new GuiNpcLabel(100, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, cutter.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.range", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, cutter.getRange()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Arc Angle + Inner Radius
|
||||
addLabel(new GuiNpcLabel(102, "ability.arcAngle", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, cutter.getArcAngle()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.innerRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, cutter.getInnerRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Knockback + Knockback Up
|
||||
addLabel(new GuiNpcLabel(104, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(104, fieldX, y, 50, cutter.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.knockbackUp", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, cutter.getKnockbackUp()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Sweep Mode + Piercing
|
||||
addLabel(new GuiNpcLabel(106, "ability.sweepMode", labelX, y + 5));
|
||||
String[] sweepModes = {"Instant", "Expanding", "Rotating"};
|
||||
addButton(new GuiNpcButton(106, fieldX, y, 70, 20, sweepModes, cutter.getSweepMode().ordinal()));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.piercing", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(107, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, cutter.isPiercing() ? 1 : 0));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Stun Duration + Bleed Duration
|
||||
addLabel(new GuiNpcLabel(108, "ability.stunDuration", labelX, y + 5));
|
||||
addTextField(createIntField(108, fieldX, y, 50, cutter.getStunDuration()));
|
||||
|
||||
addLabel(new GuiNpcLabel(109, "ability.bleedDuration", col2LabelX, y + 5));
|
||||
addTextField(createIntField(109, col2FieldX, y, 50, cutter.getBleedDuration()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 106: cutter.setSweepMode(AbilityCutter.SweepMode.values()[value]); break;
|
||||
case 107: cutter.setPiercing(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: cutter.setDamage(parseFloat(field, cutter.getDamage())); break;
|
||||
case 101: cutter.setRange(parseFloat(field, cutter.getRange())); break;
|
||||
case 102: cutter.setArcAngle(parseFloat(field, cutter.getArcAngle())); break;
|
||||
case 103: cutter.setInnerRadius(parseFloat(field, cutter.getInnerRadius())); break;
|
||||
case 104: cutter.setKnockback(parseFloat(field, cutter.getKnockback())); break;
|
||||
case 105: cutter.setKnockbackUp(parseFloat(field, cutter.getKnockbackUp())); break;
|
||||
case 108: cutter.setStunDuration(field.getInteger()); break;
|
||||
case 109: cutter.setBleedDuration(field.getInteger()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDash;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Dash ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityDash extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityDash dash;
|
||||
|
||||
public SubGuiAbilityDash(AbilityDash ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.dash = ability;
|
||||
}
|
||||
|
||||
@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: Dash Mode
|
||||
addLabel(new GuiNpcLabel(100, "ability.dashMode", labelX, y + 5));
|
||||
String[] dashModes = {"Aggressive", "Defensive"};
|
||||
addButton(new GuiNpcButton(100, fieldX, y, 80, 20, dashModes, dash.getDashMode().ordinal()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Dash Distance + Dash Speed
|
||||
addLabel(new GuiNpcLabel(101, "ability.dashDist", labelX, y + 5));
|
||||
addTextField(createFloatField(101, fieldX, y, 50, dash.getDashDistance()));
|
||||
|
||||
addLabel(new GuiNpcLabel(102, "ability.dashSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(102, col2FieldX, y, 50, dash.getDashSpeed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
if (id == 100) {
|
||||
dash.setDashMode(AbilityDash.DashMode.values()[button.getValue()]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 101: dash.setDashDistance(parseFloat(field, dash.getDashDistance())); break;
|
||||
case 102: dash.setDashSpeed(parseFloat(field, dash.getDashSpeed())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Guard ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityGuard extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityGuard guard;
|
||||
|
||||
public SubGuiAbilityGuard(AbilityGuard ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.guard = ability;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTypeTab(int startY) {
|
||||
int y = startY;
|
||||
int labelX = guiLeft + 8;
|
||||
int fieldX = guiLeft + 105;
|
||||
int col2LabelX = guiLeft + 165;
|
||||
int col2FieldX = guiLeft + 225;
|
||||
|
||||
// Row 1: Damage Reduction
|
||||
addLabel(new GuiNpcLabel(100, "ability.dmgReduction", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, guard.getDamageReduction()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Can Counter + Counter Damage
|
||||
addLabel(new GuiNpcLabel(101, "ability.canCounter", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(101, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, guard.isCanCounter() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(102, "ability.counterDmg", col2LabelX, y + 5));
|
||||
GuiNpcTextField counterDmgField = createFloatField(102, col2FieldX, y, 40, guard.getCounterDamage());
|
||||
counterDmgField.setEnabled(guard.isCanCounter());
|
||||
addTextField(counterDmgField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Counter Chance
|
||||
addLabel(new GuiNpcLabel(103, "ability.counterChance", labelX, y + 5));
|
||||
GuiNpcTextField counterChanceField = createFloatField(103, fieldX, y, 50, guard.getCounterChance());
|
||||
counterChanceField.setEnabled(guard.isCanCounter());
|
||||
addTextField(counterChanceField);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
if (id == 101) {
|
||||
guard.setCanCounter(button.getValue() == 1);
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: guard.setDamageReduction(parseFloat(field, guard.getDamageReduction())); break;
|
||||
case 102: guard.setCounterDamage(parseFloat(field, guard.getCounterDamage())); break;
|
||||
case 103: guard.setCounterChance(parseFloat(field, guard.getCounterChance())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHazard;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Hazard ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityHazard extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityHazard hazard;
|
||||
|
||||
public SubGuiAbilityHazard(AbilityHazard ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.hazard = ability;
|
||||
}
|
||||
|
||||
@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: Shape + Placement
|
||||
addLabel(new GuiNpcLabel(100, "ability.shape", labelX, y + 5));
|
||||
String[] shapes = {"Circle", "Ring", "Cone"};
|
||||
addButton(new GuiNpcButton(100, fieldX, y, 55, 20, shapes, hazard.getShape().ordinal()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.placement", col2LabelX, y + 5));
|
||||
String[] placements = {"Caster", "Target", "FollowCast", "FollowTgt"};
|
||||
addButton(new GuiNpcButton(101, col2FieldX, y, 60, 20, placements, hazard.getPlacement().ordinal()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Radius + Inner Radius
|
||||
addLabel(new GuiNpcLabel(102, "ability.radius", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, hazard.getRadius()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.innerRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, hazard.getInnerRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Damage Per Tick + Damage Interval
|
||||
addLabel(new GuiNpcLabel(104, "ability.dmgPerTick", labelX, y + 5));
|
||||
addTextField(createFloatField(104, fieldX, y, 50, hazard.getDamagePerTick()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.dmgInterval", col2LabelX, y + 5));
|
||||
addTextField(createIntField(105, col2FieldX, y, 50, hazard.getDamageInterval()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Slowness Level + Debuff Duration
|
||||
addLabel(new GuiNpcLabel(106, "ability.slownessLvl", labelX, y + 5));
|
||||
addTextField(createIntField(106, fieldX, y, 50, hazard.getSlownessLevel()));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.debuffDur", col2LabelX, y + 5));
|
||||
addTextField(createIntField(107, col2FieldX, y, 50, hazard.getDebuffDuration()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Poison Level + Affects Caster
|
||||
addLabel(new GuiNpcLabel(108, "ability.poisonLvl", labelX, y + 5));
|
||||
addTextField(createIntField(108, fieldX, y, 50, hazard.getPoisonLevel()));
|
||||
|
||||
addLabel(new GuiNpcLabel(109, "ability.affectsCaster", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(109, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, hazard.isAffectsCaster() ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 100: hazard.setShape(AbilityHazard.HazardShape.values()[value]); break;
|
||||
case 101: hazard.setPlacement(AbilityHazard.PlacementMode.values()[value]); break;
|
||||
case 109: hazard.setAffectsCaster(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 102: hazard.setRadius(parseFloat(field, hazard.getRadius())); break;
|
||||
case 103: hazard.setInnerRadius(parseFloat(field, hazard.getInnerRadius())); break;
|
||||
case 104: hazard.setDamagePerTick(parseFloat(field, hazard.getDamagePerTick())); break;
|
||||
case 105: hazard.setDamageInterval(field.getInteger()); break;
|
||||
case 106: hazard.setSlownessLevel(field.getInteger()); break;
|
||||
case 107: hazard.setDebuffDuration(field.getInteger()); break;
|
||||
case 108: hazard.setPoisonLevel(field.getInteger()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHeal;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Heal ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityHeal extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityHeal heal;
|
||||
|
||||
public SubGuiAbilityHeal(AbilityHeal ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.heal = ability;
|
||||
}
|
||||
|
||||
@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: Heal Amount + Heal Percent
|
||||
addLabel(new GuiNpcLabel(100, "ability.healAmount", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, heal.getHealAmount()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.healPercent", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, heal.getHealPercent()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Heal Radius + Instant Heal
|
||||
addLabel(new GuiNpcLabel(102, "ability.healRadius", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, heal.getHealRadius()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.instant", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(103, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, heal.isInstantHeal() ? 1 : 0));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Heal Self + Heal Allies
|
||||
addLabel(new GuiNpcLabel(104, "ability.healSelf", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, heal.isHealSelf() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.healAllies", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(105, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, heal.isHealAllies() ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 103: heal.setInstantHeal(value == 1); break;
|
||||
case 104: heal.setHealSelf(value == 1); break;
|
||||
case 105: heal.setHealAllies(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: heal.setHealAmount(parseFloat(field, heal.getHealAmount())); break;
|
||||
case 101: heal.setHealPercent(parseFloat(field, heal.getHealPercent())); break;
|
||||
case 102: heal.setHealRadius(parseFloat(field, heal.getHealRadius())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHeavyHit;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Heavy Hit ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityHeavyHit extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityHeavyHit heavyHit;
|
||||
|
||||
public SubGuiAbilityHeavyHit(AbilityHeavyHit ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.heavyHit = ability;
|
||||
}
|
||||
|
||||
@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 + Stun Ticks
|
||||
addLabel(new GuiNpcLabel(100, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, heavyHit.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.stunTicks", col2LabelX, y + 5));
|
||||
addTextField(createIntField(101, col2FieldX, y, 50, heavyHit.getStunTicks()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Knockback + Knockback Up
|
||||
addLabel(new GuiNpcLabel(102, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, heavyHit.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.knockbackUp", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, heavyHit.getKnockbackUp()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: heavyHit.setDamage(parseFloat(field, heavyHit.getDamage())); break;
|
||||
case 101: heavyHit.setStunTicks(field.getInteger()); break;
|
||||
case 102: heavyHit.setKnockback(parseFloat(field, heavyHit.getKnockback())); break;
|
||||
case 103: heavyHit.setKnockbackUp(parseFloat(field, heavyHit.getKnockbackUp())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityOrb;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Orb ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityOrb extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityOrb orb;
|
||||
|
||||
public SubGuiAbilityOrb(AbilityOrb ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.orb = ability;
|
||||
}
|
||||
|
||||
@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, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, orb.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, orb.getOrbSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Orb Size + Max Distance
|
||||
addLabel(new GuiNpcLabel(102, "ability.orbSize", 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
|
||||
addLabel(new GuiNpcLabel(104, "ability.homing", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isHoming() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.homingStr", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, orb.getHomingStrength()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Explosive + Explosion Radius
|
||||
addLabel(new GuiNpcLabel(106, "ability.explosive", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(106, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isExplosive() ? 1 : 0));
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 104: orb.setHoming(value == 1); break;
|
||||
case 106: orb.setExplosive(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityProjectile;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Projectile ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityProjectile extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityProjectile projectile;
|
||||
|
||||
public SubGuiAbilityProjectile(AbilityProjectile ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.projectile = ability;
|
||||
}
|
||||
|
||||
@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, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, projectile.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.speed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, projectile.getSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Knockback + Projectile Type
|
||||
addLabel(new GuiNpcLabel(102, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, projectile.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.projType", col2LabelX, y + 5));
|
||||
String[] projTypes = {"fireball", "arrow", "magic"};
|
||||
int typeIdx = 0;
|
||||
String currType = projectile.getProjectileType();
|
||||
for (int i = 0; i < projTypes.length; i++) {
|
||||
if (projTypes[i].equals(currType)) {
|
||||
typeIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
addButton(new GuiNpcButton(103, col2FieldX, y, 60, 20, projTypes, typeIdx));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Explosive + Explosion Radius
|
||||
addLabel(new GuiNpcLabel(104, "ability.explosive", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, projectile.isExplosive() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.explosionRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, projectile.getExplosionRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Homing + Homing Strength
|
||||
addLabel(new GuiNpcLabel(106, "ability.homing", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(106, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, projectile.isHoming() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.homingStr", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(107, col2FieldX, y, 50, projectile.getHomingStrength()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 103:
|
||||
String[] projTypes = {"fireball", "arrow", "magic"};
|
||||
projectile.setProjectileType(projTypes[value]);
|
||||
break;
|
||||
case 104: projectile.setExplosive(value == 1); break;
|
||||
case 106: projectile.setHoming(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: projectile.setDamage(parseFloat(field, projectile.getDamage())); break;
|
||||
case 101: projectile.setSpeed(parseFloat(field, projectile.getSpeed())); break;
|
||||
case 102: projectile.setKnockback(parseFloat(field, projectile.getKnockback())); break;
|
||||
case 105: projectile.setExplosionRadius(parseFloat(field, projectile.getExplosionRadius())); break;
|
||||
case 107: projectile.setHomingStrength(parseFloat(field, projectile.getHomingStrength())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityShockwave;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Shockwave ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityShockwave extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityShockwave shockwave;
|
||||
|
||||
public SubGuiAbilityShockwave(AbilityShockwave ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.shockwave = ability;
|
||||
}
|
||||
|
||||
@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 + Push Radius
|
||||
addLabel(new GuiNpcLabel(100, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, shockwave.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.pushRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, shockwave.getPushRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Push Strength + Push Up
|
||||
addLabel(new GuiNpcLabel(102, "ability.pushStrength", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, shockwave.getPushStrength()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.pushUp", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, shockwave.getPushUp()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Stun Duration + Max Targets
|
||||
addLabel(new GuiNpcLabel(104, "ability.stunDuration", labelX, y + 5));
|
||||
addTextField(createIntField(104, fieldX, y, 50, shockwave.getStunDuration()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.maxTargets", col2LabelX, y + 5));
|
||||
addTextField(createIntField(105, col2FieldX, y, 50, shockwave.getMaxTargets()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: shockwave.setDamage(parseFloat(field, shockwave.getDamage())); break;
|
||||
case 101: shockwave.setPushRadius(parseFloat(field, shockwave.getPushRadius())); break;
|
||||
case 102: shockwave.setPushStrength(parseFloat(field, shockwave.getPushStrength())); break;
|
||||
case 103: shockwave.setPushUp(parseFloat(field, shockwave.getPushUp())); break;
|
||||
case 104: shockwave.setStunDuration(field.getInteger()); break;
|
||||
case 105: shockwave.setMaxTargets(field.getInteger()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilitySlam;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Slam ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilitySlam extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilitySlam slam;
|
||||
|
||||
public SubGuiAbilitySlam(AbilitySlam ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.slam = ability;
|
||||
}
|
||||
|
||||
@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 + Radius
|
||||
addLabel(new GuiNpcLabel(100, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, slam.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.radius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, slam.getRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Knockback + Leap Speed
|
||||
addLabel(new GuiNpcLabel(102, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, slam.getKnockbackStrength()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.leapSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, slam.getLeapSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Min/Max Leap Distance
|
||||
addLabel(new GuiNpcLabel(104, "ability.minDist", labelX, y + 5));
|
||||
addTextField(createFloatField(104, fieldX, y, 50, slam.getMinLeapDistance()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.maxDist", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(105, col2FieldX, y, 50, slam.getMaxLeapDistance()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: slam.setDamage(parseFloat(field, slam.getDamage())); break;
|
||||
case 101: slam.setRadius(parseFloat(field, slam.getRadius())); break;
|
||||
case 102: slam.setKnockbackStrength(parseFloat(field, slam.getKnockbackStrength())); break;
|
||||
case 103: slam.setLeapSpeed(parseFloat(field, slam.getLeapSpeed())); break;
|
||||
case 104: slam.setMinLeapDistance(parseFloat(field, slam.getMinLeapDistance())); break;
|
||||
case 105: slam.setMaxLeapDistance(parseFloat(field, slam.getMaxLeapDistance())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityTeleport;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Teleport ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityTeleport extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityTeleport teleport;
|
||||
|
||||
public SubGuiAbilityTeleport(AbilityTeleport ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.teleport = ability;
|
||||
}
|
||||
|
||||
@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: Pattern
|
||||
addLabel(new GuiNpcLabel(100, "ability.pattern", labelX, y + 5));
|
||||
String[] patterns = {"Random", "Toward", "Away", "Behind", "InFront", "Around", "ToTarget"};
|
||||
addButton(new GuiNpcButton(100, fieldX, y, 80, 20, patterns, teleport.getPattern().ordinal()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Blink Radius + Min Blink Radius
|
||||
addLabel(new GuiNpcLabel(101, "ability.blinkRadius", labelX, y + 5));
|
||||
addTextField(createFloatField(101, fieldX, y, 50, teleport.getBlinkRadius()));
|
||||
|
||||
addLabel(new GuiNpcLabel(102, "ability.minBlinkRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(102, col2FieldX, y, 50, teleport.getMinBlinkRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Blink Count + Blink Delay
|
||||
addLabel(new GuiNpcLabel(103, "ability.blinkCount", labelX, y + 5));
|
||||
addTextField(createIntField(103, fieldX, y, 50, teleport.getBlinkCount()));
|
||||
|
||||
addLabel(new GuiNpcLabel(104, "ability.blinkDelay", col2LabelX, y + 5));
|
||||
addTextField(createIntField(104, col2FieldX, y, 50, teleport.getBlinkDelayTicks()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Damage + Damage Radius
|
||||
addLabel(new GuiNpcLabel(105, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(105, fieldX, y, 50, teleport.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(106, "ability.dmgRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(106, col2FieldX, y, 50, teleport.getDamageRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Damage at Start/End + Require LOS
|
||||
addLabel(new GuiNpcLabel(107, "ability.dmgAtStart", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(107, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, teleport.isDamageAtStart() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(108, "ability.dmgAtEnd", col2LabelX, y + 5));
|
||||
addButton(new GuiNpcButton(108, col2FieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, teleport.isDamageAtEnd() ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 100: teleport.setPattern(AbilityTeleport.TeleportPattern.values()[value]); break;
|
||||
case 107: teleport.setDamageAtStart(value == 1); break;
|
||||
case 108: teleport.setDamageAtEnd(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 101: teleport.setBlinkRadius(parseFloat(field, teleport.getBlinkRadius())); break;
|
||||
case 102: teleport.setMinBlinkRadius(parseFloat(field, teleport.getMinBlinkRadius())); break;
|
||||
case 103: teleport.setBlinkCount(field.getInteger()); break;
|
||||
case 104: teleport.setBlinkDelayTicks(field.getInteger()); break;
|
||||
case 105: teleport.setDamage(parseFloat(field, teleport.getDamage())); break;
|
||||
case 106: teleport.setDamageRadius(parseFloat(field, teleport.getDamageRadius())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityTrap;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Trap ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityTrap extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityTrap trap;
|
||||
|
||||
public SubGuiAbilityTrap(AbilityTrap ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.trap = ability;
|
||||
}
|
||||
|
||||
@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: Placement + Trigger Radius
|
||||
addLabel(new GuiNpcLabel(100, "ability.placement", labelX, y + 5));
|
||||
String[] placements = {"Caster", "Target", "Ahead"};
|
||||
addButton(new GuiNpcButton(100, fieldX, y, 55, 20, placements, trap.getPlacement().ordinal()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.triggerRad", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, trap.getTriggerRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Damage + Damage Radius
|
||||
addLabel(new GuiNpcLabel(102, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, trap.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.dmgRadius", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, trap.getDamageRadius()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Arm Time + Max Triggers
|
||||
addLabel(new GuiNpcLabel(104, "ability.armTime", labelX, y + 5));
|
||||
addTextField(createIntField(104, fieldX, y, 50, trap.getArmTime()));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.maxTriggers", col2LabelX, y + 5));
|
||||
addTextField(createIntField(105, col2FieldX, y, 50, trap.getMaxTriggers()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Root Duration + Stun Duration
|
||||
addLabel(new GuiNpcLabel(106, "ability.rootDuration", labelX, y + 5));
|
||||
addTextField(createIntField(106, fieldX, y, 50, trap.getRootDuration()));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.stunDuration", col2LabelX, y + 5));
|
||||
addTextField(createIntField(107, col2FieldX, y, 50, trap.getStunDuration()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Knockback + Knockback Up
|
||||
addLabel(new GuiNpcLabel(108, "ability.knockback", labelX, y + 5));
|
||||
addTextField(createFloatField(108, fieldX, y, 50, trap.getKnockback()));
|
||||
|
||||
addLabel(new GuiNpcLabel(109, "ability.knockbackUp", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(109, col2FieldX, y, 50, trap.getKnockbackUp()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
if (id == 100) {
|
||||
trap.setPlacement(AbilityTrap.TrapPlacement.values()[button.getValue()]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 101: trap.setTriggerRadius(parseFloat(field, trap.getTriggerRadius())); break;
|
||||
case 102: trap.setDamage(parseFloat(field, trap.getDamage())); break;
|
||||
case 103: trap.setDamageRadius(parseFloat(field, trap.getDamageRadius())); break;
|
||||
case 104: trap.setArmTime(field.getInteger()); break;
|
||||
case 105: trap.setMaxTriggers(field.getInteger()); break;
|
||||
case 106: trap.setRootDuration(field.getInteger()); break;
|
||||
case 107: trap.setStunDuration(field.getInteger()); break;
|
||||
case 108: trap.setKnockback(parseFloat(field, trap.getKnockback())); break;
|
||||
case 109: trap.setKnockbackUp(parseFloat(field, trap.getKnockbackUp())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package noppes.npcs.client.gui.advanced.ability;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityVortex;
|
||||
import noppes.npcs.client.gui.advanced.IAbilityConfigCallback;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
|
||||
/**
|
||||
* GUI for configuring Vortex ability type-specific settings.
|
||||
*/
|
||||
public class SubGuiAbilityVortex extends SubGuiAbilityConfig {
|
||||
|
||||
private final AbilityVortex vortex;
|
||||
|
||||
public SubGuiAbilityVortex(AbilityVortex ability, IAbilityConfigCallback callback) {
|
||||
super(ability, callback);
|
||||
this.vortex = ability;
|
||||
}
|
||||
|
||||
@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: Pull Radius + Pull Strength
|
||||
addLabel(new GuiNpcLabel(100, "ability.pullRadius", labelX, y + 5));
|
||||
addTextField(createFloatField(100, fieldX, y, 50, vortex.getPullRadius()));
|
||||
|
||||
addLabel(new GuiNpcLabel(101, "ability.pullStrength", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(101, col2FieldX, y, 50, vortex.getPullStrength()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Damage + Knockback
|
||||
addLabel(new GuiNpcLabel(102, "ability.damage", labelX, y + 5));
|
||||
addTextField(createFloatField(102, fieldX, y, 50, vortex.getDamage()));
|
||||
|
||||
addLabel(new GuiNpcLabel(103, "ability.knockback", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(103, col2FieldX, y, 50, vortex.getKnockback()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: AOE + Max Targets
|
||||
addLabel(new GuiNpcLabel(104, "ability.aoe", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(104, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, vortex.isAoe() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(105, "ability.maxTargets", col2LabelX, y + 5));
|
||||
addTextField(createIntField(105, col2FieldX, y, 50, vortex.getMaxTargets()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Stun Duration + Root Duration
|
||||
addLabel(new GuiNpcLabel(106, "ability.stunDuration", labelX, y + 5));
|
||||
addTextField(createIntField(106, fieldX, y, 50, vortex.getStunDuration()));
|
||||
|
||||
addLabel(new GuiNpcLabel(107, "ability.rootDuration", col2LabelX, y + 5));
|
||||
addTextField(createIntField(107, col2FieldX, y, 50, vortex.getRootDuration()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 5: Damage on Pull + Pull Damage
|
||||
addLabel(new GuiNpcLabel(108, "ability.dmgOnPull", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(108, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, vortex.isDamageOnPull() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(109, "ability.pullDamage", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(109, col2FieldX, y, 50, vortex.getPullDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeButton(int id, GuiNpcButton button) {
|
||||
int value = button.getValue();
|
||||
switch (id) {
|
||||
case 104: vortex.setAoe(value == 1); break;
|
||||
case 108: vortex.setDamageOnPull(value == 1); break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTypeTextField(int id, GuiNpcTextField field) {
|
||||
switch (id) {
|
||||
case 100: vortex.setPullRadius(parseFloat(field, vortex.getPullRadius())); break;
|
||||
case 101: vortex.setPullStrength(parseFloat(field, vortex.getPullStrength())); break;
|
||||
case 102: vortex.setDamage(parseFloat(field, vortex.getDamage())); break;
|
||||
case 103: vortex.setKnockback(parseFloat(field, vortex.getKnockback())); break;
|
||||
case 105: vortex.setMaxTargets(field.getInteger()); break;
|
||||
case 106: vortex.setStunDuration(field.getInteger()); break;
|
||||
case 107: vortex.setRootDuration(field.getInteger()); break;
|
||||
case 109: vortex.setPullDamage(parseFloat(field, vortex.getPullDamage())); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class GuiNpcManageAbilities extends GuiNPCInterface2 implements ICustomSc
|
||||
// Edit
|
||||
Ability ability = AbilityController.Instance.getSavedAbility(selectedName);
|
||||
if (ability != null) {
|
||||
setSubGui(new SubGuiAbilityConfig(ability, this));
|
||||
setSubGui(ability.createConfigGui(this));
|
||||
}
|
||||
} else if (id == 2 && selectedName != null) {
|
||||
// Delete
|
||||
@@ -118,7 +118,7 @@ public class GuiNpcManageAbilities extends GuiNPCInterface2 implements ICustomSc
|
||||
// Double-click to edit
|
||||
Ability ability = AbilityController.Instance.getSavedAbility(selection);
|
||||
if (ability != null) {
|
||||
setSubGui(new SubGuiAbilityConfig(ability, this));
|
||||
setSubGui(ability.createConfigGui(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user