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