mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 15:57:22 +01:00
improve *EffectPane initialisation
This commit is contained in:
@@ -68,9 +68,9 @@ public class ItemEditor extends JSONElementEditor {
|
||||
private JRadioButton equipConditionImmunity;
|
||||
private JSpinner equipConditionMagnitude;
|
||||
|
||||
private CommonEditor.HitEffectPane hitEffectPane;
|
||||
private CommonEditor.DeathEffectPane killEffectPane;
|
||||
private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane;
|
||||
private CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
private CommonEditor.DeathEffectPane killEffectPane = new CommonEditor.DeathEffectPane(killLabel, Common.TimedActorConditionEffect::new, this, null);
|
||||
private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
|
||||
public ItemEditor(Item item) {
|
||||
super(item, item.getDesc(), item.getIcon());
|
||||
@@ -159,8 +159,6 @@ public class ItemEditor extends JSONElementEditor {
|
||||
} else {
|
||||
hitEffect = item.hit_effect;
|
||||
}
|
||||
if (hitEffectPane == null)
|
||||
hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
hitEffectPane.createHitEffectPaneContent(listener, item.writable, hitEffect, new CommonEditor.SourceTimedConditionsListModel(hitEffect), new CommonEditor.TargetTimedConditionsListModel(hitEffect));
|
||||
pane.add(hitEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
@@ -170,8 +168,6 @@ public class ItemEditor extends JSONElementEditor {
|
||||
} else {
|
||||
killEffect = item.kill_effect;
|
||||
}
|
||||
if (killEffectPane == null)
|
||||
killEffectPane = new CommonEditor.DeathEffectPane(killLabel, Common.TimedActorConditionEffect::new, this, null);
|
||||
killEffectPane.createDeathEffectPaneContent(listener, item.writable, killEffect, new CommonEditor.SourceTimedConditionsListModel(killEffect));
|
||||
pane.add(killEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
@@ -181,8 +177,6 @@ public class ItemEditor extends JSONElementEditor {
|
||||
} else {
|
||||
hitReceivedEffect = item.hit_received_effect;
|
||||
}
|
||||
if (hitReceivedEffectPane == null)
|
||||
hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, hitReceivedEffect, new CommonEditor.SourceTimedConditionsListModel(hitReceivedEffect), new CommonEditor.TargetTimedConditionsListModel(hitReceivedEffect));
|
||||
pane.add(killEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ public class NPCEditor extends JSONElementEditor {
|
||||
private JSpinner blockChance;
|
||||
private JSpinner dmgRes;
|
||||
|
||||
private CommonEditor.HitEffectPane hitEffectPane;
|
||||
private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane;
|
||||
private CommonEditor.DeathEffectPane deathEffectPane;
|
||||
private CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", Common.TimedActorConditionEffect::new, this, "NPC", "Attacker");
|
||||
private CommonEditor.DeathEffectPane deathEffectPane = new CommonEditor.DeathEffectPane("Effect when killed: ", Common.TimedActorConditionEffect::new, this, "Killer");
|
||||
|
||||
private JPanel dialogueGraphPane;
|
||||
private DialogueGraphView dialogueGraphView;
|
||||
@@ -149,8 +149,6 @@ public class NPCEditor extends JSONElementEditor {
|
||||
} else {
|
||||
hitEffect = npc.hit_effect;
|
||||
}
|
||||
if (hitEffectPane == null)
|
||||
hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, null, null);
|
||||
hitEffectPane.createHitEffectPaneContent(listener, npc.writable, hitEffect, new CommonEditor.SourceTimedConditionsListModel(hitEffect), new CommonEditor.TargetTimedConditionsListModel(hitEffect));
|
||||
combatTraitPane.add(hitEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
@@ -160,8 +158,6 @@ public class NPCEditor extends JSONElementEditor {
|
||||
} else {
|
||||
hitReceivedEffect = npc.hit_received_effect;
|
||||
}
|
||||
if (hitReceivedEffectPane == null)
|
||||
hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", Common.TimedActorConditionEffect::new, this, "NPC", "Attacker");
|
||||
hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, npc.writable, hitReceivedEffect, new CommonEditor.SourceTimedConditionsListModel(hitReceivedEffect), new CommonEditor.TargetTimedConditionsListModel(hitReceivedEffect));
|
||||
combatTraitPane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
@@ -171,10 +167,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
} else {
|
||||
deathEffect = npc.death_effect;
|
||||
}
|
||||
if (deathEffectPane == null)
|
||||
deathEffectPane = new CommonEditor.DeathEffectPane("Effect when killed: ", Common.TimedActorConditionEffect::new, this, "Killer");
|
||||
deathEffectPane.createDeathEffectPaneContent(listener, npc.writable, deathEffect, new CommonEditor.SourceTimedConditionsListModel(deathEffect)
|
||||
);
|
||||
deathEffectPane.createDeathEffectPaneContent(listener, npc.writable, deathEffect, new CommonEditor.SourceTimedConditionsListModel(deathEffect));
|
||||
combatTraitPane.add(deathEffectPane.effectPane, JideBoxLayout.FIX);
|
||||
|
||||
pane.add(combatTraitPane, JideBoxLayout.FIX);
|
||||
@@ -274,11 +267,11 @@ public class NPCEditor extends JSONElementEditor {
|
||||
npc.block_chance = (Integer) value;
|
||||
} else if (source == dmgRes) {
|
||||
npc.damage_resistance = (Integer) value;
|
||||
} else if(hitEffectPane != null &&hitEffectPane.valueChanged(source, value, npc)) {
|
||||
} else if(hitEffectPane.valueChanged(source, value, npc)) {
|
||||
updateHit = true;
|
||||
} else if (hitReceivedEffectPane != null && hitReceivedEffectPane.valueChanged(source, value, npc)) {
|
||||
} else if (hitReceivedEffectPane.valueChanged(source, value, npc)) {
|
||||
updateHitReceived = true;
|
||||
} else if (deathEffectPane != null && deathEffectPane.valueChanged(source, value, npc)) {
|
||||
} else if (deathEffectPane.valueChanged(source, value, npc)) {
|
||||
updateDeath = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user