mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-02-23 15:38:23 +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
|
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)
|
(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)
|
|
||||||
|
|
||||||
|
|||||||
@@ -322,19 +322,27 @@ public class CommonEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateEffectTimedConditionWidgets(ELEMENT condition) {
|
public void updateEffectTimedConditionWidgets(ELEMENT condition) {
|
||||||
|
boolean writable = editor.target.writable;
|
||||||
|
|
||||||
boolean immunity = condition.isImmunity();
|
boolean immunity = condition.isImmunity();
|
||||||
boolean clear = condition.isClear();
|
boolean clear = condition.isClear();
|
||||||
boolean forever = condition.isInfinite();
|
boolean forever = condition.isInfinite();
|
||||||
|
|
||||||
conditionClear.setSelected(clear);
|
conditionClear.setSelected(clear);
|
||||||
conditionApply.setSelected(!clear && !immunity);
|
conditionApply.setSelected(!clear && !immunity);
|
||||||
conditionMagnitude.setEnabled(!clear && !immunity);
|
|
||||||
conditionImmunity.setSelected(immunity);
|
conditionImmunity.setSelected(immunity);
|
||||||
conditionTimed.setSelected(!forever);
|
conditionTimed.setSelected(!forever);
|
||||||
conditionTimed.setEnabled(!clear);
|
|
||||||
conditionDuration.setEnabled(!clear && !forever);
|
|
||||||
conditionForever.setSelected(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) {
|
public void updateEffectTimedConditionEditorPane(JPanel pane, ELEMENT condition, final FieldUpdateListener listener) {
|
||||||
|
|||||||
Reference in New Issue
Block a user