add applyToTargetHint to HitEffectPanel

This commit is contained in:
OMGeeky
2025-06-23 21:17:44 +02:00
parent ebafae7503
commit 270c613f66
2 changed files with 7 additions and 6 deletions

View File

@@ -84,6 +84,9 @@ public class CommonEditor {
public static class HitEffectPane extends DeathEffectPane {
/// this should just be a convenience field, to access it, without casting. DO NOT SET WITHOUT ALSO SETTING THE FIELD IN THE SUPER-CLASS!
Common.HitEffect effect;
String applyToTargetHint;
NPCEditor.TargetTimedConditionsListModel hitTargetConditionsListModel;
JList hitTargetConditionsList;
Common.TimedActorConditionEffect selectedHitEffectTargetCondition;
@@ -101,9 +104,10 @@ public class CommonEditor {
/*
* create a new HitEffectPane with the selections (probably passed in from last time)
*/
public HitEffectPane(String title, Supplier<?> sourceNewSupplier, Editor editor, String applyToHint) {
public HitEffectPane(String title, Supplier<?> sourceNewSupplier, Editor editor, String applyToHint, String applyToTargetHint) {
super(title, sourceNewSupplier, editor, applyToHint);
this.selectedHitEffectTargetCondition = selectedHitEffectTargetCondition;
this.applyToTargetHint = applyToTargetHint;
}
void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, Common.HitEffect e, NPCEditor.SourceTimedConditionsListModel sourceConditionsModelInput) {

View File

@@ -194,11 +194,8 @@ public class NPCEditor extends JSONElementEditor {
hitEffect = npc.hit_effect;
}
if (hitEffectPane == null)
hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, "test");
hitEffectPane.createHitEffectPaneContent(listener,
npc.writable,
hitEffect,
new SourceTimedConditionsListModel(hitEffect));
hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", Common.TimedActorConditionEffect::new, this, null, null);
hitEffectPane.createHitEffectPaneContent(listener, npc.writable, hitEffect, new SourceTimedConditionsListModel(hitEffect));
combatTraitPane.add(hitEffectPane.effectPane, JideBoxLayout.FIX);
hitReceivedEffectPane = new CollapsiblePanel("Effect on every hit received: ");