diff --git a/PlayWall/assets/de/tobias/playpad/assets/view/option/layout/modernLayoutCart.fxml b/PlayWall/assets/de/tobias/playpad/assets/view/option/layout/modernLayoutCart.fxml index 47f1ad840bd6cebeedff224dff9332c4c32d01a4..0307ce2b59a3e730796a184cb34c75fe027f6320 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/view/option/layout/modernLayoutCart.fxml +++ b/PlayWall/assets/de/tobias/playpad/assets/view/option/layout/modernLayoutCart.fxml @@ -30,12 +30,6 @@ <Button fx:id="playColorButton" focusTraversable="false" mnemonicParsing="false" onAction="#playColorButtonHandler" prefWidth="150.0" /> </children> </VBox> - <VBox maxWidth="1.7976931348623157E308" prefWidth="150.0" spacing="14.0" HBox.hgrow="ALWAYS"> - <children> - <Label alignment="BOTTOM_LEFT" layoutX="243.0" layoutY="8.0" prefHeight="60.0" prefWidth="150.0" text="%layout.label.animation" wrapText="true" VBox.vgrow="ALWAYS" /> - <CheckBox fx:id="warnAnimationCheckBox" mnemonicParsing="false" text="%layout.label.warnAnimation" /> - </children> - </VBox> </children> </HBox> <Button fx:id="resetButton" mnemonicParsing="false" onAction="#resetButtonHandler" text="%layout.button.reset"> diff --git a/PlayWall/src/de/tobias/playpad/layout/classic/ClassicCartLayout.java b/PlayWall/src/de/tobias/playpad/layout/classic/ClassicCartLayout.java index 7bd47b406ccf8aba5a185f690b9e0bcac2c31464..013765c7953f7a69791ae7c5d1a80c166ca1b088 100644 --- a/PlayWall/src/de/tobias/playpad/layout/classic/ClassicCartLayout.java +++ b/PlayWall/src/de/tobias/playpad/layout/classic/ClassicCartLayout.java @@ -210,7 +210,7 @@ public class ClassicCartLayout extends Layout implements CartLayout { } @Override - public void handleWarning(IPadViewController controller, Warning warning) { + public void handleWarning(IPadViewController controller, Warning warning, GlobalLayout layout) { final IPadView view = controller.getParent(); try { diff --git a/PlayWall/src/de/tobias/playpad/layout/modern/ModernLayoutCart.java b/PlayWall/src/de/tobias/playpad/layout/modern/ModernLayoutCart.java index cbc99d65840c46d882d609515f60dff71f9e85b0..fef4f679a0c476f4aafc354a38a6af2a0663e18b 100644 --- a/PlayWall/src/de/tobias/playpad/layout/modern/ModernLayoutCart.java +++ b/PlayWall/src/de/tobias/playpad/layout/modern/ModernLayoutCart.java @@ -25,8 +25,6 @@ public class ModernLayoutCart extends Layout implements CartLayout, LayoutColorA private ModernColor backgroundColor = ModernColor.GRAY1; private ModernColor playColor = ModernColor.RED3; - private boolean isWarnAnimation = true; - public ModernColor getBackgroundColor() { return backgroundColor; } @@ -43,19 +41,9 @@ public class ModernLayoutCart extends Layout implements CartLayout, LayoutColorA this.playColor = playColor; } - public boolean isWarnAnimation() { - return isWarnAnimation; - } - - public void setWarnAnimation(boolean isWarnAnimation) { - this.isWarnAnimation = isWarnAnimation; - } - public void reset() { backgroundColor = ModernColor.GRAY1; playColor = ModernColor.RED1; - - isWarnAnimation = true; } @Override @@ -77,28 +65,18 @@ public class ModernLayoutCart extends Layout implements CartLayout, LayoutColorA e.printStackTrace(); } } - - Element animationElement = rootElement.element("Animation"); - if (animationElement != null) { - Element warnAnimationElement = animationElement.element("Warn"); - if (warnAnimationElement != null) { - isWarnAnimation = Boolean.valueOf(warnAnimationElement.getStringValue()); - } - } } @Override public void save(Element rootElement) { rootElement.addElement("BackgroundColor").addText(backgroundColor.name()); rootElement.addElement("PlayColor").addText(playColor.name()); - Element animationElement = rootElement.addElement("Animation"); - animationElement.addElement("Warn").addText(String.valueOf(isWarnAnimation)); } // Warn Handler -> Animation oder Blinken @Override - public void handleWarning(IPadViewController controller, Warning warning) { - if (isWarnAnimation) { + public void handleWarning(IPadViewController controller, Warning warning, GlobalLayout layout) { + if (layout instanceof ModernLayoutGlobal && ((ModernLayoutGlobal) layout).isWarnAnimation()) { warnAnimation(controller, warning); } else { ModernLayoutAnimator.warnFlash(controller); @@ -204,7 +182,6 @@ public class ModernLayoutCart extends Layout implements CartLayout, LayoutColorA ModernLayoutGlobal modernLayoutGlobal = (ModernLayoutGlobal) globalLayout; backgroundColor = modernLayoutGlobal.getBackgroundColor(); playColor = modernLayoutGlobal.getPlayColor(); - isWarnAnimation = modernLayoutGlobal.isWarnAnimation(); } } } diff --git a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java index 9f582ea5782a13581240ccea9460638627ac5bcb..b9f60d711e6b4f4aad86b3e1d108bc09bc87628d 100644 --- a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java +++ b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java @@ -88,7 +88,7 @@ public class PadPositionListener implements ChangeListener<Duration>, Runnable { Warning warning = pad.getWarning(); if (pad.isCustomLayout()) { - pad.getLayout().handleWarning(controller, warning); + pad.getLayout().handleWarning(controller, warning, Profile.currentProfile().currentLayout()); } else { Profile.currentProfile().currentLayout().handleWarning(controller, warning); } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/layout/ModernLayoutCartViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/layout/ModernLayoutCartViewController.java index dd3e7bd2cfe6f21f8ab1fbe39d609185c2cb9930..f5c5214f553b3393422300a8142b29022fb74c6c 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/layout/ModernLayoutCartViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/layout/ModernLayoutCartViewController.java @@ -42,16 +42,10 @@ public class ModernLayoutCartViewController extends CartLayoutViewController { private void setLayout() { backgroundColorButton.setStyle(getLinearGradientCss(cartLayout.getBackgroundColor())); playColorButton.setStyle(getLinearGradientCss(cartLayout.getPlayColor())); - - warnAnimationCheckBox.setSelected(cartLayout.isWarnAnimation()); } @Override public void init() { - warnAnimationCheckBox.selectedProperty().addListener((a, b, c) -> - { - cartLayout.setWarnAnimation(c); - }); } @FXML diff --git a/PlayWallCore/src/de/tobias/playpad/layout/CartLayout.java b/PlayWallCore/src/de/tobias/playpad/layout/CartLayout.java index 851d42c6e2ec04a1d056b6b28d3bdd9607e6dab1..46dec367e902df0ec0e13d6b175312cd5f650039 100644 --- a/PlayWallCore/src/de/tobias/playpad/layout/CartLayout.java +++ b/PlayWallCore/src/de/tobias/playpad/layout/CartLayout.java @@ -25,11 +25,11 @@ public interface CartLayout { * @param controller * @param warning */ - public abstract void handleWarning(IPadViewController controller, Warning warning); + public abstract void handleWarning(IPadViewController controller, Warning warning, GlobalLayout animate); public default void stopWarning(IPadViewController controller) {} public void reset(); - + public void copyGlobalLayout(GlobalLayout globalLayout); }