mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
[mage.client] because of slowness, turned off all foil animation for cards except bigCard. Changed range (left and right color offset) of the effect.
This commit is contained in:
parent
5683a8c719
commit
b76fa3db0d
3 changed files with 18 additions and 6 deletions
Binary file not shown.
|
|
@ -67,8 +67,11 @@ public class BigCard extends JComponent {
|
||||||
protected boolean foilState;
|
protected boolean foilState;
|
||||||
protected Thread foilThread;
|
protected Thread foilThread;
|
||||||
protected float hue = 0.005f;
|
protected float hue = 0.005f;
|
||||||
|
protected float dh = 0.005f;
|
||||||
|
|
||||||
static private final int DEFAULT_DELAY_PERIOD = 25;
|
static private final int DEFAULT_DELAY_PERIOD = 25;
|
||||||
|
static private final float LEFT_BOUNDARY = -0.3f;
|
||||||
|
static private final float RIGHT_BOUNDARY = 0.1f;
|
||||||
|
|
||||||
public BigCard() {
|
public BigCard() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
@ -175,6 +178,7 @@ public class BigCard extends JComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final HueFilter filter = FilterFactory.getHueFilter();
|
final HueFilter filter = FilterFactory.getHueFilter();
|
||||||
|
int sign = 1;
|
||||||
while (true) {
|
while (true) {
|
||||||
boolean prevState = foilState;
|
boolean prevState = foilState;
|
||||||
while (!foilState) {
|
while (!foilState) {
|
||||||
|
|
@ -183,9 +187,16 @@ public class BigCard extends JComponent {
|
||||||
if (prevState == foilState) {
|
if (prevState == foilState) {
|
||||||
ThreadUtils.sleep(DEFAULT_DELAY_PERIOD);
|
ThreadUtils.sleep(DEFAULT_DELAY_PERIOD);
|
||||||
}
|
}
|
||||||
hue += 0.005F;
|
hue += dh * sign;
|
||||||
if (hue >= 1.0D) {
|
/*if (hue >= 1.0D) {
|
||||||
hue = 0.000F;
|
hue = 0.000F;
|
||||||
|
}*/
|
||||||
|
if (hue < LEFT_BOUNDARY) {
|
||||||
|
sign *= -1;
|
||||||
|
hue = LEFT_BOUNDARY;
|
||||||
|
} else if (hue > RIGHT_BOUNDARY) {
|
||||||
|
sign *= -1;
|
||||||
|
hue = RIGHT_BOUNDARY;
|
||||||
}
|
}
|
||||||
filter.setHue(hue);
|
filter.setHue(hue);
|
||||||
BufferedImage f = null;
|
BufferedImage f = null;
|
||||||
|
|
|
||||||
|
|
@ -199,13 +199,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
public void setFoil(boolean foil) {
|
public void setFoil(boolean foil) {
|
||||||
this.isFoil = foil;
|
this.isFoil = foil;
|
||||||
if (foil) {
|
if (foil) {
|
||||||
/*BufferedImage source = BufferedImageBuilder.bufferImage(imagePanel.getSrcImage());
|
BufferedImage source = BufferedImageBuilder.bufferImage(imagePanel.getSrcImage());
|
||||||
HueFilter filter = FilterFactory.getHueFilter();
|
HueFilter filter = FilterFactory.getHueFilter();
|
||||||
filter.setHue(0.1sf);
|
filter.setHue(0.1f);
|
||||||
BufferedImage dest = filter.filter(source, null);
|
BufferedImage dest = filter.filter(source, null);
|
||||||
imagePanel.setImage(dest);
|
imagePanel.setImage(dest);
|
||||||
imagePanel.repaint();*/
|
imagePanel.repaint();
|
||||||
|
|
||||||
|
/*
|
||||||
Thread thread = new Thread(new Runnable() {
|
Thread thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
@ -238,7 +239,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
});
|
});
|
||||||
thread.setDaemon(false);
|
thread.setDaemon(false);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue