From 2a544203b16ba273dd6cf9da63bd2bfcc098b1aa Mon Sep 17 00:00:00 2001 From: dc37 Date: Sun, 13 Mar 2016 23:04:02 -0500 Subject: [PATCH] Aesthetic UI edits, readying for v1.0.0 --- src/smp/components/buttons/LoadButton.java | 3 +++ src/smp/components/general/Utilities.java | 5 +---- .../staff/sequences/mpc/MPCDecoder.java | 4 +++- src/smp/fx/SplashScreen.java | 16 ++++++++++++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/smp/components/buttons/LoadButton.java b/src/smp/components/buttons/LoadButton.java index 645310b6..98a74dd6 100644 --- a/src/smp/components/buttons/LoadButton.java +++ b/src/smp/components/buttons/LoadButton.java @@ -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); @@ -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, @@ -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); diff --git a/src/smp/components/general/Utilities.java b/src/smp/components/general/Utilities.java index 33036c7c..18f14aec 100644 --- a/src/smp/components/general/Utilities.java +++ b/src/smp/components/general/Utilities.java @@ -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 { diff --git a/src/smp/components/staff/sequences/mpc/MPCDecoder.java b/src/smp/components/staff/sequences/mpc/MPCDecoder.java index 148a8e6d..b9cc3db7 100644 --- a/src/smp/components/staff/sequences/mpc/MPCDecoder.java +++ b/src/smp/components/staff/sequences/mpc/MPCDecoder.java @@ -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); diff --git a/src/smp/fx/SplashScreen.java b/src/smp/fx/SplashScreen.java index f0d3a7b0..3f92a883 100644 --- a/src/smp/fx/SplashScreen.java +++ b/src/smp/fx/SplashScreen.java @@ -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; @@ -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 */ @@ -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(); }