Merge branch 'develop'
This commit is contained in:
@@ -58,4 +58,4 @@ fetch=
|
|||||||
crouton=
|
crouton=
|
||||||
invite=
|
invite=
|
||||||
|
|
||||||
|
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
local time = os.time();
|
local time = os.time();
|
||||||
|
|
||||||
function plugin(message, user)
|
function plugin(message, user)
|
||||||
if(string.match(string.lower(message), "purple"))then
|
if(string.match(string.lower(message), "purple"))then
|
||||||
local timedif = os.time() - time;
|
local timedif = os.time() - time;
|
||||||
time = os.time();
|
time = os.time();
|
||||||
days = (timedif / (60*60*24));
|
days = (timedif / (60*60*24));
|
||||||
hours = ((timedif / (60*60)) % 24);
|
hours = ((timedif / (60*60)) % 24);
|
||||||
mins = ((timedif / (60)) % 60);
|
mins = ((timedif / (60)) % 60);
|
||||||
secs = timedif % 60;
|
secs = timedif % 60;
|
||||||
return "*GASP!!!* \n" .. user.name .. " said **THE** word! It's been " .. round(days) .. " days, " .. round(hours) .. " hours, " .. round(mins) .. " minutes, and " .. round(secs) .. " seconds since the last time!";
|
return "*GASP!!!* \n" .. user.name .. " said **THE** word! It's been " .. round(days) .. " days, " .. round(hours) .. " hours, " .. round(mins) .. " minutes, and " .. round(secs) .. " seconds since the last time!";
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
function round(num)
|
function round(num)
|
||||||
return math.floor(num + 0.5)
|
return math.floor(num + 0.5)
|
||||||
end
|
end
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -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 +"')";
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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/";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user