Skip to content

Commit

Permalink
Aesthetic UI edits, readying for v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DC37 committed Mar 14, 2016
1 parent 8bc8c8b commit 2a54420
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/smp/components/buttons/LoadButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ private void loadSong() {
} catch (NullPointerException e) {
try {
StaffSequence loaded = MPCDecoder.decode(inputFile);
init = new File(inputFile.getParent());
String fname = Utilities.populateStaff(loaded, inputFile,
true, theStaff, controller);
controller.getNameTextField().setText(fname);
Expand Down Expand Up @@ -133,6 +134,7 @@ private void loadArrangement() {
inputFile = f.showOpenDialog(null);
if (inputFile == null)
return;
init = new File(inputFile.getParent());
StaffArrangement loaded = Utilities.loadArrangement(inputFile);
Utilities.normalizeArrangement(loaded, inputFile);
Utilities.populateStaffArrangement(loaded, inputFile, false,
Expand All @@ -144,6 +146,7 @@ private void loadArrangement() {
try {
StaffArrangement loaded = MPCDecoder
.decodeArrangement(inputFile);
init = new File(inputFile.getParent());
Utilities.normalizeArrangement(loaded, inputFile);
Utilities.populateStaffArrangement(loaded, inputFile, true,
theStaff, controller);
Expand Down
5 changes: 1 addition & 4 deletions src/smp/components/general/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,11 @@ public static String populateStaff(StaffSequence loaded, File inputFile,
theStaff.setSequenceFile(inputFile);
StateMachine.setTempo(loaded.getTempo());
theStaff.updateCurrTempo();
if (theStaff.getControlPanel().getScrollbar().valueProperty().get() > loaded
.getTheLines().size() - Values.NOTELINES_IN_THE_WINDOW) {
theStaff.setLocation(0);
}
theStaff.getControlPanel()
.getScrollbar()
.setMax(loaded.getTheLines().size()
- Values.NOTELINES_IN_THE_WINDOW);
theStaff.setLocation(0);
theStaff.getNoteMatrix().redraw();
String fname = inputFile.getName();
try {
Expand Down
4 changes: 3 additions & 1 deletion src/smp/components/staff/sequences/mpc/MPCDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ private static StaffArrangement parseFiles(String str, File inputFile)
StaffArrangement theArr = new StaffArrangement();

for (String s : str.split("\n")) {
File f = new File(inputFile.getParent() + "\\" + s + "]MarioPaint.txt");
s = s.replace("/", "_");
String st = inputFile.getParent() + "\\" + s + "]MarioPaint.txt";
File f = new File(st);
StaffSequence seq = decode(f);
theArr.add(seq, f);
theArr.getTheSequenceNames().add(s);
Expand Down
16 changes: 14 additions & 2 deletions src/smp/fx/SplashScreen.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package smp.fx;

import smp.components.Values;
import smp.stateMachine.Settings;
import javafx.application.Preloader;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
Expand All @@ -13,7 +15,7 @@
* implementation that persisted from 2012.08.17 to 2014.12.30. The basic
* portion of this is taken directly from
* http://docs.oracle.com/javafx/2/deployment/preloaders.htm
*
*
* @author RehdBlob
* @since 2014.12.30
*/
Expand All @@ -39,10 +41,20 @@ private Scene createPreloaderScene() {
}

/** Creates and starts the preloader window. */
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
stage.setScene(createPreloaderScene());
stage.setTitle("Loading...");
double c = java.lang.Math.random();
if (c < 0.2) {
stage.setTitle("Loading...");
} else if (c < 0.5) {
stage.setTitle("SMP" + Settings.version);
} else if (c < 0.8) {
stage.setTitle("Made by: RehdBlob");
} else {
stage.setTitle("Loading...");
}
stage.show();
}

Expand Down

0 comments on commit 2a54420

Please sign in to comment.