Skip to content

Commit

Permalink
Fix config file layout mode parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
freakode committed Aug 31, 2017
1 parent e578e09 commit bea5316
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions KeysPerSecond/src/me/roan/kps/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
Expand Down Expand Up @@ -490,22 +491,11 @@ private final boolean loadNewFormat(File saveloc){
Main.graphFrame.setLocation(parsePosition(args[1]));
break;
case "textMode":
switch(args[1].toLowerCase()){
case "Vertical":
mode = RenderingMode.VERTICAL;
break;
case "Horizontal":
mode = RenderingMode.HORIZONTAL_TN;
break;
case "Horizontal_TN":
mode = RenderingMode.HORIZONTAL_TN;
break;
case "Horizontal_NT":
mode = RenderingMode.HORIZONTAL_NT;
break;
default:
modified = true;
break;
try{
String modeString = args[1].toUpperCase(Locale.ROOT);
mode = modeString.equals("HORIZONTAL") ? RenderingMode.HORIZONTAL_TN : RenderingMode.valueOf(modeString);
}catch(IllegalArgumentException e){
modified = true;
}
break;
case "rows":
Expand Down

0 comments on commit bea5316

Please sign in to comment.