Merge branch 'develop'

This commit is contained in:
Matthew Cech
2019-06-19 23:00:35 -07:00
16 changed files with 39 additions and 35 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import core.Command; import core.Command;
import core.Config;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
@@ -53,7 +54,7 @@ public class CommandTeey extends Command
return; return;
teeyeeFile = new File(yeeteeFilename); teeyeeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/teey/frames/", "teey ", 24, 18); ImageOverlayBuilder builder = new ImageOverlayBuilder(Config.AssetDirectory + "teey/frames/", "teey ", 24, 18);
builder.overlay(ImageIO.read(teeyeeFile), name); builder.overlay(ImageIO.read(teeyeeFile), name);
} }
catch (IOException e) catch (IOException e)
+2 -1
View File
@@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import core.Command; import core.Command;
import core.Config;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
@@ -53,7 +54,7 @@ public class CommandYeet extends Command
return; return;
yeeteeFile = new File(yeeteeFilename); yeeteeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/yeet/frames/", "yeet ", 24, 18); ImageOverlayBuilder builder = new ImageOverlayBuilder(Config.AssetDirectory + "yeet/frames/", "yeet ", 24, 18);
builder.overlay(ImageIO.read(yeeteeFile), name); builder.overlay(ImageIO.read(yeeteeFile), name);
} }
catch (IOException e) catch (IOException e)
@@ -29,7 +29,7 @@ public class BenchmarkCommandCompare extends BenchmarkCommand
if(entries.size() < 1) if(entries.size() < 1)
output += "Couldn't find any models containing `" + inputSplit[i] + "`!"; output += "Couldn't find any models containing `" + inputSplit[i] + "`!";
output += BenchmarkCommandInfo.FormatInfo(entries.get(0)); output += BenchmarkCommandInfo.formatInfo(entries.get(0));
output += lineDelimiter; output += lineDelimiter;
if(entries.size() > 1) if(entries.size() > 1)
@@ -14,7 +14,7 @@ public class BenchmarkCommandInfo extends BenchmarkCommand
{ {
static final String lineDelimiter = "\n"; static final String lineDelimiter = "\n";
public static String FormatInfo(BenchmarkEntry entry) public static String formatInfo(BenchmarkEntry entry)
{ {
String output = ""; String output = "";
@@ -24,7 +24,7 @@ public class BenchmarkCommandInfo extends BenchmarkCommand
return output; return output;
} }
public static KittyEmbed FormatInfoEmbed(BenchmarkEntry entry) public static KittyEmbed formatInfoEmbed(BenchmarkEntry entry)
{ {
// Populate general embed info // Populate general embed info
KittyEmbed embed = new KittyEmbed(); KittyEmbed embed = new KittyEmbed();
@@ -85,7 +85,7 @@ public class BenchmarkCommandInfo extends BenchmarkCommand
List<BenchmarkEntry> sortedEntries = manager.evaluateLevenshteinDistance(entries, searchString); List<BenchmarkEntry> sortedEntries = manager.evaluateLevenshteinDistance(entries, searchString);
BenchmarkEntry entry = sortedEntries.get(0); BenchmarkEntry entry = sortedEntries.get(0);
KittyEmbed embed = FormatInfoEmbed(entry); KittyEmbed embed = formatInfoEmbed(entry);
if(entries.size() > 1) if(entries.size() > 1)
embed.footerText += " (Chose the " + entry.model + " from " + entries.size() + " potential components. To see others, try the command 'benchmark find " + searchString +"')"; embed.footerText += " (Chose the " + entry.model + " from " + entries.size() + " potential components. To see others, try the command 'benchmark find " + searchString +"')";
+4 -5
View File
@@ -8,7 +8,6 @@ import core.rpg.RPGWeapon;
public class RPGCommandInfo extends RPGCommand public class RPGCommandInfo extends RPGCommand
{ {
@Override @Override
public String onRun(RPGState state, RPGInput input) public String onRun(RPGState state, RPGInput input)
{ {
@@ -27,7 +26,7 @@ public class RPGCommandInfo extends RPGCommand
case "hand": case "hand":
case "att": case "att":
case "attack": case "attack":
out = WeaponStats(state.player.getWeapon()); out = weaponStats(state.player.getWeapon());
break; break;
case "armour": case "armour":
@@ -44,7 +43,7 @@ public class RPGCommandInfo extends RPGCommand
case "dress": case "dress":
case "wear": case "wear":
case "outfit": case "outfit":
out = ArmorStats(state.player.getArmor()); out = armorStats(state.player.getArmor());
break; break;
} }
@@ -54,7 +53,7 @@ public class RPGCommandInfo extends RPGCommand
return out; return out;
} }
private String WeaponStats(RPGWeapon weapon) private String weaponStats(RPGWeapon weapon)
{ {
if(weapon == null) if(weapon == null)
return null; return null;
@@ -72,7 +71,7 @@ public class RPGCommandInfo extends RPGCommand
return out; return out;
} }
private String ArmorStats(RPGArmor armor) private String armorStats(RPGArmor armor)
{ {
if(armor == null) if(armor == null)
return null; return null;
+2 -1
View File
@@ -23,8 +23,9 @@ public class CommandEnabler extends BaseKeyValueFile
// Local variables // Local variables
private HashMap<String, Boolean> enabledMap; // Quick lookup private HashMap<String, Boolean> enabledMap; // Quick lookup
private ArrayList<String> keyList; // Tracking ordering for later private ArrayList<String> keyList; // Tracking ordering for later
private final static String name = "commands.config"; private final static String name = Config.AssetDirectory + "commands.config";
// Constructor
public CommandEnabler() public CommandEnabler()
{ {
super(name); super(name);
+1
View File
@@ -5,4 +5,5 @@ import java.awt.Color;
public final class Config public final class Config
{ {
public static final Color ColorDefault = new Color(7*16, 8*16, 9*16); // A slate-grey public static final Color ColorDefault = new Color(7*16, 8*16, 9*16); // A slate-grey
public static final String AssetDirectory = "./assets/";
} }
+1 -1
View File
@@ -10,7 +10,7 @@ import dataStructures.Pair;
// is performed with general strings in the application // is performed with general strings in the application
public class LocCommands extends BaseLocFile public class LocCommands extends BaseLocFile
{ {
public static final String fileName = "locCommands.config"; public static final String fileName = Config.AssetDirectory + "locCommands.config";
public static final String function = "LocCommands.stub"; public static final String function = "LocCommands.stub";
private static LocCommands instance; private static LocCommands instance;
+1 -1
View File
@@ -9,7 +9,7 @@ import utils.io.FileMonitor;
// can then be localized. // can then be localized.
public class LocStrings extends BaseLocFile public class LocStrings extends BaseLocFile
{ {
public static final String fileName = "locStrings.config"; public static final String fileName = Config.AssetDirectory + "locStrings.config";
public static final String function = "LocStrings.stub"; public static final String function = "LocStrings.stub";
private static LocStrings instance; private static LocStrings instance;
+1 -1
View File
@@ -492,7 +492,7 @@ public class ObjectBuilderFactory
lazyInit(); lazyInit();
if(pluginManager == null) if(pluginManager == null)
pluginManager = new PluginManager("./plugins/"); pluginManager = new PluginManager(Config.AssetDirectory + "plugins/");
return pluginManager; return pluginManager;
} }
+2 -1
View File
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import core.Config;
import dataStructures.Pair; import dataStructures.Pair;
import utils.io.DirectoryMonitor; import utils.io.DirectoryMonitor;
import utils.io.FileUtils; import utils.io.FileUtils;
@@ -16,7 +17,7 @@ import utils.io.MonitoredFile;
public class BenchmarkManager public class BenchmarkManager
{ {
// Variables // Variables
public final String directory = "assets/userbench/"; public final String directory = Config.AssetDirectory + "userbench/";
public final String extension = ".csv"; public final String extension = ".csv";
public final String lineDelimiter = "\n"; public final String lineDelimiter = "\n";