Updates AsciiTile to only allow non-CharacterShader shaders.
package com.valkryst.VTerminal;
import com.valkryst.VTerminal.misc.ImageCache;
+import com.valkryst.VTerminal.shader.CharacterShader;
+import com.valkryst.VTerminal.shader.Shader;
import lombok.NonNull;
import lombok.ToString;
@@ -36,6 +38,10 @@ public class AsciiTile extends AsciiCharacter {
public AsciiTile(final @NonNull AsciiCharacter character) {
super(character.getCharacter());
+ for (final Shader shader : character.getShaders()) {
+ addShaders(shader);
+ }
+
super.setHidden(character.isHidden());
super.setBackgroundColor(character.getBackgroundColor());
@@ -97,4 +103,16 @@ public class AsciiTile extends AsciiCharacter {
gc.drawImage(image, columnIndex, rowIndex, null);
}
}
+
+
+ @Override
+ public void addShaders(final @NonNull Shader... shaders) {
+ for (final Shader shader : shaders) {
+ if (shader instanceof CharacterShader == false) {
+ super.addShaders(shader);
+ }
+ }
+
+ updateCacheHash = true;
+ }
}
\ No newline at end of file
