mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10: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 Thread foilThread;
|
||||
protected float hue = 0.005f;
|
||||
protected float dh = 0.005f;
|
||||
|
||||
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() {
|
||||
initComponents();
|
||||
|
@ -175,6 +178,7 @@ public class BigCard extends JComponent {
|
|||
return;
|
||||
}
|
||||
final HueFilter filter = FilterFactory.getHueFilter();
|
||||
int sign = 1;
|
||||
while (true) {
|
||||
boolean prevState = foilState;
|
||||
while (!foilState) {
|
||||
|
@ -183,9 +187,16 @@ public class BigCard extends JComponent {
|
|||
if (prevState == foilState) {
|
||||
ThreadUtils.sleep(DEFAULT_DELAY_PERIOD);
|
||||
}
|
||||
hue += 0.005F;
|
||||
if (hue >= 1.0D) {
|
||||
hue += dh * sign;
|
||||
/*if (hue >= 1.0D) {
|
||||
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);
|
||||
BufferedImage f = null;
|
||||
|
|
|
@ -199,13 +199,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
public void setFoil(boolean foil) {
|
||||
this.isFoil = foil;
|
||||
if (foil) {
|
||||
/*BufferedImage source = BufferedImageBuilder.bufferImage(imagePanel.getSrcImage());
|
||||
BufferedImage source = BufferedImageBuilder.bufferImage(imagePanel.getSrcImage());
|
||||
HueFilter filter = FilterFactory.getHueFilter();
|
||||
filter.setHue(0.1sf);
|
||||
filter.setHue(0.1f);
|
||||
BufferedImage dest = filter.filter(source, null);
|
||||
imagePanel.setImage(dest);
|
||||
imagePanel.repaint();*/
|
||||
imagePanel.repaint();
|
||||
|
||||
/*
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -238,7 +239,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
});
|
||||
thread.setDaemon(false);
|
||||
thread.start();
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue