diff --git a/PlayWall/src/main/java/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java b/PlayWall/src/main/java/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java index e1489f3445343db9ef7b1b3a46be0e6030a8f690..09038fa1959a241e22247f06c6ae34ea83daf2c6 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java +++ b/PlayWall/src/main/java/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java @@ -8,6 +8,7 @@ import de.thecodelabs.utils.ui.scene.BusyView; import de.thecodelabs.utils.util.ColorUtils; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.design.FeedbackDesignColorSuggester; +import de.tobias.playpad.design.modern.model.ModernCartDesign; import de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadStatus; @@ -354,19 +355,20 @@ public class DesktopPadView implements IPadView { @Override public void showNotFoundIcon(Pad pad, boolean show) { if (show) { - FeedbackDesignColorSuggester associator; - if (pad.getPadSettings().isCustomDesign()) { - associator = pad.getPadSettings().getDesign(); - } else { - associator = Profile.currentProfile().getProfileSettings().getDesign(); - } + FeedbackDesignColorSuggester globalDesign = Profile.currentProfile().getProfileSettings().getDesign(); + Color layoutStdColor = globalDesign.getDesignDefaultColor(); - if (associator != null) { - Color color = associator.getDesignDefaultColor(); - notFoundLabel.setColor(ColorUtils.getAppropriateTextColor(color)); - } else { - notFoundLabel.setColor(Color.RED); + if(pad != null) + { + final ModernCartDesign padDesign = pad.getPadSettings().getDesign(); + + if(padDesign.isEnableCustomBackgroundColor()) + { + layoutStdColor = padDesign.getDesignDefaultColor(); + } } + + notFoundLabel.setColor(ColorUtils.getAppropriateTextColor(layoutStdColor)); } notFoundLabel.setVisible(show); root.setOpacity(show ? 0.5 : 1.0); diff --git a/PlayWall/src/main/java/de/tobias/playpad/layout/touch/pad/TouchPadView.java b/PlayWall/src/main/java/de/tobias/playpad/layout/touch/pad/TouchPadView.java index c9f233e15d351c154a65fd41e47ad3f2f9196eb2..f0f20d4a74d40b4548e5276711cc3da60860a852 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/layout/touch/pad/TouchPadView.java +++ b/PlayWall/src/main/java/de/tobias/playpad/layout/touch/pad/TouchPadView.java @@ -10,6 +10,7 @@ import de.thecodelabs.utils.util.OS; import de.thecodelabs.utils.util.win.User32X; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.design.FeedbackDesignColorSuggester; +import de.tobias.playpad.design.modern.model.ModernCartDesign; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.content.PadContent; import de.tobias.playpad.pad.content.PadContentFactory; @@ -283,20 +284,21 @@ public class TouchPadView implements IPadView { @Override public void showNotFoundIcon(Pad pad, boolean show) { - if (show) { - FeedbackDesignColorSuggester associator = null; - if (pad.getPadSettings().isCustomDesign()) { - associator = pad.getPadSettings().getDesign(); - } else { - associator = Profile.currentProfile().getProfileSettings().getDesign(); - } + if(show) { + FeedbackDesignColorSuggester globalDesign = Profile.currentProfile().getProfileSettings().getDesign(); + Color layoutStdColor = globalDesign.getDesignDefaultColor(); + + if(pad != null) + { + final ModernCartDesign padDesign = pad.getPadSettings().getDesign(); - if (associator != null) { - Color color = associator.getDesignDefaultColor(); - notFoundLabel.setColor(ColorUtils.getAppropriateTextColor(color)); - } else { - notFoundLabel.setColor(Color.RED); + if(padDesign.isEnableCustomBackgroundColor()) + { + layoutStdColor = padDesign.getDesignDefaultColor(); + } } + + notFoundLabel.setColor(ColorUtils.getAppropriateTextColor(layoutStdColor)); } notFoundLabel.setVisible(show); root.setOpacity(show ? 0.5 : 1.0); diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/action/feedback/ColorAdjuster.java b/PlayWallCore/src/main/java/de/tobias/playpad/action/feedback/ColorAdjuster.java index 43b68616b2f60bfe777cb52cef208acb88f6ea2a..90d9df8f322498968c13d61d962f3898b197fb1b 100644 --- a/PlayWallCore/src/main/java/de/tobias/playpad/action/feedback/ColorAdjuster.java +++ b/PlayWallCore/src/main/java/de/tobias/playpad/action/feedback/ColorAdjuster.java @@ -12,6 +12,7 @@ import de.thecodelabs.midi.mapping.MidiKey; import de.thecodelabs.midi.midi.Midi; import de.thecodelabs.midi.midi.feedback.MidiFeedbackTranscript; import de.tobias.playpad.design.FeedbackDesignColorSuggester; +import de.tobias.playpad.design.modern.model.ModernCartDesign; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.profile.Profile; import javafx.scene.paint.Color; @@ -69,19 +70,23 @@ public class ColorAdjuster { Pad pad = suggester.getPad(action); - Color layoutStdColor = null; - Color layoutEvColor = null; + FeedbackDesignColorSuggester globalDesign = Profile.currentProfile().getProfileSettings().getDesign(); + Color layoutStdColor = globalDesign.getDesignDefaultColor(); + Color layoutEvColor = globalDesign.getDesignEventColor(); - FeedbackDesignColorSuggester design; - if (pad != null && pad.getPadSettings().isCustomDesign()) { - design = pad.getPadSettings().getDesign(); - } else { - design = Profile.currentProfile().getProfileSettings().getDesign(); - } + if(pad != null) + { + final ModernCartDesign padDesign = pad.getPadSettings().getDesign(); + + if(padDesign.isEnableCustomBackgroundColor()) + { + layoutStdColor = padDesign.getDesignDefaultColor(); + } - if (design != null) { - layoutStdColor = design.getDesignDefaultColor(); - layoutEvColor = design.getDesignEventColor(); + if(padDesign.isEnableCustomPlayColor()) + { + layoutEvColor = padDesign.getDesignEventColor(); + } } if (layoutStdColor != null) { @@ -96,9 +101,7 @@ public class ColorAdjuster { final byte channel = suggester.suggestFeedbackChannel(FeedbackType.EVENT); key.setEventFeedback(new Feedback(channel, matchedColor.getValue())); }); - } - if (layoutEvColor != null) { searchColor(transcript, layoutEvColor).ifPresent(matchedColor -> { final byte channel = suggester.suggestFeedbackChannel(FeedbackType.WARNING); key.setWarningFeedback(new Feedback(channel, matchedColor.getValue())); diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/pad/PadSettings.java b/PlayWallCore/src/main/java/de/tobias/playpad/pad/PadSettings.java index eadd8e2d96655a671f7439851e9c0a2de9326258..db4b411ea3e3b64dff1f9f9da6674d2999e29d19 100644 --- a/PlayWallCore/src/main/java/de/tobias/playpad/pad/PadSettings.java +++ b/PlayWallCore/src/main/java/de/tobias/playpad/pad/PadSettings.java @@ -271,10 +271,7 @@ public class PadSettings { else clone.warningProperty = new SimpleObjectProperty<>(); - clone.customDesignProperty = new SimpleBooleanProperty(isCustomDesign()); - if (design != null) { - clone.design = design.copy(pad); - } + clone.design = design.copy(pad); clone.triggers = new EnumMap<>(TriggerPoint.class); triggers.forEach((key, value) -> clone.triggers.put(key, value.copy())); @@ -307,10 +304,11 @@ public class PadSettings { //// Computed public ModernColor getBackgroundColor() { - if (isCustomDesign()) { + if(design.isEnableCustomBackgroundColor()) + { return design.getBackgroundColor(); - } else { - return Profile.currentProfile().getProfileSettings().getDesign().getBackgroundColor(); } + + return Profile.currentProfile().getProfileSettings().getDesign().getBackgroundColor(); } }