= Updated config
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"Type","Key","Value"
|
||||
"Globals","mode","dev"
|
||||
"Localized Commands","beans",""
|
||||
"Localized Commands","benchmark, bench",""
|
||||
"Localized Commands","bet",""
|
||||
@@ -61,6 +62,7 @@
|
||||
"Localized Strings","BetBeansInfo","Allows you to bet your beans, set your amount after the command! Warning! House always wins!nSets of 3 will get 2x, 4 will get 10x, and 5 will get 1000x"
|
||||
"Localized Strings","BetBeansLose","Sorry, you didn't win, try again!"
|
||||
"Localized Strings","BetBeansLowBet","Please bet with at least 20 beans!"
|
||||
"Localized Strings","BetBeansMinThreshold",""
|
||||
"Localized Strings","BetBeansNotEnough","You don't have enough beans!"
|
||||
"Localized Strings","BetBeansNotValid","That's not a valid bet!"
|
||||
"Localized Strings","BetBeansWin","You won %s beans!"
|
||||
|
||||
|
@@ -16,7 +16,7 @@ public class ConfigGlobals implements IConfigSection
|
||||
|
||||
// A pile of variables being manually tracked/serialized to the config file
|
||||
private static final String startupStyleKey = "mode";
|
||||
private KittyStartupMode startupStyleValue = KittyStartupMode.Development;
|
||||
private KittyStartupMode startupStyleValue = KittyStartupMode.Dev;
|
||||
|
||||
// Constructor
|
||||
public ConfigGlobals()
|
||||
@@ -49,9 +49,9 @@ public class ConfigGlobals implements IConfigSection
|
||||
// Parse startup style
|
||||
if(key.equalsIgnoreCase(startupStyleKey))
|
||||
{
|
||||
startupStyleValue = KittyStartupMode.Development;
|
||||
startupStyleValue = KittyStartupMode.Dev;
|
||||
|
||||
if(value.equalsIgnoreCase(KittyStartupMode.Release.getValue()))
|
||||
if(value.equalsIgnoreCase(KittyStartupMode.Release.name()))
|
||||
startupStyleValue = KittyStartupMode.Release;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class ConfigGlobals implements IConfigSection
|
||||
public List<ConfigItem> produce()
|
||||
{
|
||||
List<ConfigItem> items = new ArrayList<ConfigItem>();
|
||||
items.add(new ConfigItem(getSectionTitle(), startupStyleKey, startupStyleValue.getValue()));
|
||||
items.add(new ConfigItem(getSectionTitle(), startupStyleKey, startupStyleValue.name().toLowerCase()));
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import dataStructures.KittyCore;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyStartupMode;
|
||||
import dataStructures.KittyUser;
|
||||
import main.Main;
|
||||
import net.dv8tion.jda.core.AccountType;
|
||||
@@ -382,9 +383,15 @@ public class ObjectBuilderFactory
|
||||
{
|
||||
lazyInit();
|
||||
|
||||
// Determine token based on config. Default to test token.
|
||||
String tokenToUse = Ref.TestToken;
|
||||
if(ConfigGlobals.getStartupMode() == KittyStartupMode.Release)
|
||||
tokenToUse = Ref.Token;
|
||||
|
||||
// Construct bot based on token
|
||||
kitty = new JDABuilder(AccountType.BOT)
|
||||
.setToken(Ref.TestToken).buildBlocking();
|
||||
kitty.getPresence().setGame(Game.playing("with digital yarn"));
|
||||
.setToken(tokenToUse).buildBlocking();
|
||||
kitty.getPresence().setGame(Game.playing("with a laser pointer"));
|
||||
kitty.addEventListener(new Main());
|
||||
|
||||
return new KittyCore(kitty);
|
||||
|
||||
@@ -2,15 +2,15 @@ package dataStructures;
|
||||
|
||||
public enum KittyStartupMode
|
||||
{
|
||||
Development("dev"), Release("release");
|
||||
Dev(1), Release(2);
|
||||
|
||||
private final String value;
|
||||
private KittyStartupMode(String value)
|
||||
private final int value;
|
||||
private KittyStartupMode(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
public int getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user