mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 15:57:22 +01:00
fix bug, where condition buttons are enabled in readonly mode
This commit is contained in:
@@ -4,7 +4,5 @@
|
||||
There are probably a lot of things that could be optimized, which will not be on this list
|
||||
(which will probably also be done, they are just not important enough to track them)
|
||||
|
||||
|
||||
- check, why for example the "Forever" button is active for not altered entities (ex.: NPC->hitEffect) if they have a condition already there
|
||||
- apparently that's always been like that... (or at least on the most recent main branch)
|
||||
-
|
||||
|
||||
|
||||
@@ -321,20 +321,28 @@ public class CommonEditor {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public void updateEffectTimedConditionWidgets(ELEMENT condition) {
|
||||
public void updateEffectTimedConditionWidgets(ELEMENT condition) {
|
||||
boolean writable = editor.target.writable;
|
||||
|
||||
boolean immunity = condition.isImmunity();
|
||||
boolean clear = condition.isClear();
|
||||
boolean forever = condition.isInfinite();
|
||||
|
||||
conditionClear.setSelected(clear);
|
||||
conditionApply.setSelected(!clear && !immunity);
|
||||
conditionMagnitude.setEnabled(!clear && !immunity);
|
||||
conditionImmunity.setSelected(immunity);
|
||||
conditionTimed.setSelected(!forever);
|
||||
conditionTimed.setEnabled(!clear);
|
||||
conditionDuration.setEnabled(!clear && !forever);
|
||||
conditionForever.setSelected(forever);
|
||||
conditionForever.setEnabled(!clear);
|
||||
|
||||
conditionDuration.setEnabled(!clear && !forever && writable);
|
||||
|
||||
conditionClear.setEnabled(writable);
|
||||
conditionApply.setEnabled(writable);
|
||||
conditionMagnitude.setEnabled(!clear && !immunity && writable);
|
||||
|
||||
conditionImmunity.setEnabled(writable);
|
||||
conditionTimed.setEnabled(!clear && writable);
|
||||
conditionForever.setEnabled(!clear && writable);
|
||||
}
|
||||
|
||||
public void updateEffectTimedConditionEditorPane(JPanel pane, ELEMENT condition, final FieldUpdateListener listener) {
|
||||
|
||||
Reference in New Issue
Block a user