mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Make reveal speed easier to tweak
This commit is contained in:
@@ -29,10 +29,12 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
private final FButton btnForge = new FButton("Forge");
|
private final FButton btnForge = new FButton("Forge");
|
||||||
private final FDigitalClock clock = new FDigitalClock();
|
private final FDigitalClock clock = new FDigitalClock();
|
||||||
private final JPanel pnlReveal = new JPanel();
|
private final JPanel pnlReveal = new JPanel();
|
||||||
private Timer incrementRevealTimer, checkForRevealChangeTimer;
|
private final int revealSpeed = 300;
|
||||||
private boolean hidden;
|
private final int revealDelay = 150;
|
||||||
private int revealDir = 0;
|
private int revealDir = 0;
|
||||||
private long timeMenuHidden = 0;
|
private long timeMenuHidden = 0;
|
||||||
|
private Timer incrementRevealTimer, checkForRevealChangeTimer;
|
||||||
|
private boolean hidden;
|
||||||
|
|
||||||
public FNavigationBar(FFrame f) {
|
public FNavigationBar(FFrame f) {
|
||||||
super(f);
|
super(f);
|
||||||
@@ -109,12 +111,12 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
incrementRevealTimer = new Timer(300 / visibleHeight, new ActionListener() {
|
incrementRevealTimer = new Timer(revealSpeed / visibleHeight, new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
incrementReveal();
|
incrementReveal();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkForRevealChangeTimer = new Timer(150, new ActionListener() {
|
checkForRevealChangeTimer = new Timer(revealDelay, new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
checkForRevealChange();
|
checkForRevealChange();
|
||||||
}
|
}
|
||||||
@@ -124,7 +126,7 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
private void startReveal() {
|
private void startReveal() {
|
||||||
if (this.getHeight() == visibleHeight) { return; }
|
if (this.getHeight() == visibleHeight) { return; }
|
||||||
if (revealDir == 0) {
|
if (revealDir == 0) {
|
||||||
incrementRevealTimer.setInitialDelay(150);
|
incrementRevealTimer.setInitialDelay(revealDelay);
|
||||||
incrementRevealTimer.start();
|
incrementRevealTimer.start();
|
||||||
checkForRevealChangeTimer.stop();
|
checkForRevealChangeTimer.stop();
|
||||||
}
|
}
|
||||||
@@ -134,7 +136,7 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
private void stopReveal() {
|
private void stopReveal() {
|
||||||
if (this.getHeight() == 0) { return; }
|
if (this.getHeight() == 0) { return; }
|
||||||
if (revealDir == 0) {
|
if (revealDir == 0) {
|
||||||
incrementRevealTimer.setInitialDelay(150);
|
incrementRevealTimer.setInitialDelay(revealDelay);
|
||||||
incrementRevealTimer.start();
|
incrementRevealTimer.start();
|
||||||
checkForRevealChangeTimer.stop();
|
checkForRevealChangeTimer.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user