Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
2.0.0-b2 - Bugfix and animation \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
skyecodes committed Jul 29, 2017
1 parent cf09f8b commit fdecb6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 15 additions & 3 deletions src/main/java/com/github/franckyi/cmpdl/InterfaceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.github.franckyi.cmpdl.task.CleanTask;
import com.github.franckyi.cmpdl.task.DownloadModpackTask;
import com.github.franckyi.cmpdl.task.VerifyProjectTask;
import javafx.animation.Animation;
import javafx.animation.TranslateTransition;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
Expand All @@ -14,6 +16,7 @@
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.stage.DirectoryChooser;
import javafx.util.Duration;

import java.io.File;
import java.io.IOException;
Expand All @@ -35,8 +38,17 @@ public void initialize(URL location, ResourceBundle resources) {
log(CMPDL.title());
log("Java version " + System.getProperty("java.version"));
destinationPath.setText(System.getProperty("user.home") + File.separator + "modpack");
TranslateTransition transition = new TranslateTransition(Duration.seconds(1), title);
transition.setFromY(-10);
transition.setToY(10);
transition.setCycleCount(Animation.INDEFINITE);
transition.setAutoReverse(true);
transition.play();
}

@FXML
private Label title;

@FXML
private TextField modpackURL;

Expand Down Expand Up @@ -190,9 +202,9 @@ private void setDisableButtons(boolean value) {
downloadButton.setDisable(value);
verifyButton.setDisable(value);
destinationButton.setDisable(value);
modpackURL.setEditable(value);
fileID.setEditable(value);
destinationPath.setEditable(value);
modpackURL.setEditable(!value);
fileID.setEditable(!value);
destinationPath.setEditable(!value);
}

public void setPrimaryProgress(Task<?> task, String text) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/interface.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<TextField fx:id="destinationPath" layoutX="14.0" layoutY="154.0" prefHeight="26.0" prefWidth="350.0"/>
<Button fx:id="destinationButton" layoutX="386.0" layoutY="154.0" mnemonicParsing="false"
onAction="#chooseDestination" prefHeight="26.0" prefWidth="200.0" text="Choose destination path..."/>
<Label layoutX="88.0" layoutY="25.0" onMouseClicked="#changeTheme" text="Curse Modpack Downloader">
<Label fx:id="title" alignment="CENTER" layoutX="73.0" layoutY="27.0" onMouseClicked="#changeTheme"
prefWidth="450.0" text="Curse Modpack Downloader">
<font>
<Font size="30.0"/>
</font>
</Label>
<Button fx:id="downloadButton" layoutX="177.0" layoutY="194.0" mnemonicParsing="false" onAction="#startDownload"
<Button fx:id="downloadButton" layoutX="173.0" layoutY="194.0" mnemonicParsing="false" onAction="#startDownload"
prefHeight="46.0" prefWidth="250.0" text="Start Download">
<font>
<Font size="24.0"/>
Expand Down

0 comments on commit fdecb6d

Please sign in to comment.