= Updated Localizer to LocStrings
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandBeansShow extends Command
|
||||
@@ -9,11 +9,11 @@ public class CommandBeansShow extends Command
|
||||
public CommandBeansShow(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("BeansShowInfo"); };
|
||||
public String HelpText() { return LocStrings.Stub("BeansShowInfo"); };
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(String.format(Localizer.Stub("BeansShowDisplay"), user.GetBeans()));
|
||||
res.Call(String.format(LocStrings.Stub("BeansShowDisplay"), user.GetBeans()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package commands;
|
||||
import java.util.Random;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandBetBeans extends Command
|
||||
@@ -11,7 +11,7 @@ public class CommandBetBeans extends Command
|
||||
public CommandBetBeans(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("BetBeansInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("BetBeansInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -24,19 +24,19 @@ public class CommandBetBeans extends Command
|
||||
bet = Integer.parseInt(input.args);
|
||||
if(bet < 50)
|
||||
{
|
||||
res.Call(Localizer.Stub("BetBeansLowBet"));
|
||||
res.Call(LocStrings.Stub("BetBeansLowBet"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("BetBeansNotValid"));
|
||||
res.Call(LocStrings.Stub("BetBeansNotValid"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(user.GetBeans() < bet)
|
||||
{
|
||||
res.Call(Localizer.Stub("BetBeansNotEnough"));
|
||||
res.Call(LocStrings.Stub("BetBeansNotEnough"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,12 +51,12 @@ public class CommandBetBeans extends Command
|
||||
|
||||
if(win == 0)
|
||||
{
|
||||
res.Call(Localizer.Stub("BetBeansLose"));
|
||||
res.Call(LocStrings.Stub("BetBeansLose"));
|
||||
return;
|
||||
}
|
||||
|
||||
user.ChangeBeans(bet*win);
|
||||
res.Call(String.format(Localizer.Stub("BetBeansWin"), "" + (bet*win)));
|
||||
res.Call(String.format(LocStrings.Stub("BetBeansWin"), "" + (bet*win)));
|
||||
}
|
||||
|
||||
private int getWinning(int [] slots)
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import utils.ImageUtils;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CommandBlurry extends Command
|
||||
public CommandBlurry(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("BlurryInfo"); };
|
||||
public String HelpText() { return LocStrings.Stub("BlurryInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class CommandBoop extends Command
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("BoopInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("BoopInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -69,14 +69,14 @@ public class CommandBoop extends Command
|
||||
if(input.mentions == null)
|
||||
{
|
||||
boopTracker.ApplyBoop();
|
||||
res.Call(String.format(Localizer.Stub("BoopStandard"), user.name, boopTracker.HowMany()));
|
||||
res.Call(String.format(LocStrings.Stub("BoopStandard"), user.name, boopTracker.HowMany()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(input.mentions.length == 1)
|
||||
{
|
||||
boopTracker.ApplyBoop();
|
||||
res.Call(String.format(Localizer.Stub("BoopPerson"), user.name, input.mentions[0].name));
|
||||
res.Call(String.format(LocStrings.Stub("BoopPerson"), user.name, input.mentions[0].name));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class CommandBoop extends Command
|
||||
booped += "and " + input.mentions[i].name;
|
||||
}
|
||||
|
||||
res.Call(String.format(Localizer.Stub("BoopMultiple"), user.name, booped));
|
||||
res.Call(String.format(LocStrings.Stub("BoopMultiple"), user.name, booped));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandChangeIndicator extends Command
|
||||
@@ -9,7 +9,7 @@ public class CommandChangeIndicator extends Command
|
||||
public CommandChangeIndicator(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("ChangeIndicatorInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("ChangeIndicatorInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -17,11 +17,11 @@ public class CommandChangeIndicator extends Command
|
||||
String arg = input.args.trim();
|
||||
if(arg.length() == 0)
|
||||
{
|
||||
res.Call(Localizer.Stub("ChangeIndicatorError"));
|
||||
res.Call(LocStrings.Stub("ChangeIndicatorError"));
|
||||
return;
|
||||
}
|
||||
|
||||
guild.SetCommandIndicator(arg.substring(0, 1));
|
||||
res.Call(String.format(Localizer.Stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
|
||||
res.Call(String.format(LocStrings.Stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandChoose extends Command
|
||||
public CommandChoose(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("ChooseInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("ChooseInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -22,10 +22,10 @@ public class CommandChoose extends Command
|
||||
String [] choices = input.args.split(",");
|
||||
if(choices.length == 1)
|
||||
{
|
||||
res.Call(Localizer.Stub("ChooseOne"));
|
||||
res.Call(LocStrings.Stub("ChooseOne"));
|
||||
return;
|
||||
}
|
||||
|
||||
res.Call(String.format(Localizer.Stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
||||
res.Call(String.format(LocStrings.Stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import network.NetworkColiru;
|
||||
|
||||
@@ -12,14 +12,14 @@ public class CommandColiru extends Command
|
||||
public CommandColiru(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("ColiruInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("ColiruInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
{
|
||||
res.Call(Localizer.Stub("ColiruError"));
|
||||
res.Call(LocStrings.Stub("ColiruError"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CommandDoWork extends Command
|
||||
public CommandDoWork(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("DoWorkInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("DoWorkInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -28,6 +28,6 @@ public class CommandDoWork extends Command
|
||||
thispieceofshit += Math.log((double)i);
|
||||
}
|
||||
|
||||
res.Call(Localizer.Stub("DoWorkFinished"));
|
||||
res.Call(LocStrings.Stub("DoWorkFinished"));
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,47 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandEightBall extends Command
|
||||
{
|
||||
String [] answers =
|
||||
{
|
||||
Localizer.Stub("EightBallYes1")
|
||||
, Localizer.Stub("EightBallYes2")
|
||||
, Localizer.Stub("EightBallYes3")
|
||||
, Localizer.Stub("EightBallYes4")
|
||||
, Localizer.Stub("EightBallYes5")
|
||||
, Localizer.Stub("EightBallYes6")
|
||||
, Localizer.Stub("EightBallYes7")
|
||||
, Localizer.Stub("EightBallYes8")
|
||||
, Localizer.Stub("EightBallYes9")
|
||||
, Localizer.Stub("EightBallYes10")
|
||||
LocStrings.Stub("EightBallYes1")
|
||||
, LocStrings.Stub("EightBallYes2")
|
||||
, LocStrings.Stub("EightBallYes3")
|
||||
, LocStrings.Stub("EightBallYes4")
|
||||
, LocStrings.Stub("EightBallYes5")
|
||||
, LocStrings.Stub("EightBallYes6")
|
||||
, LocStrings.Stub("EightBallYes7")
|
||||
, LocStrings.Stub("EightBallYes8")
|
||||
, LocStrings.Stub("EightBallYes9")
|
||||
, LocStrings.Stub("EightBallYes10")
|
||||
|
||||
, Localizer.Stub("EightBallMaybe1")
|
||||
, Localizer.Stub("EightBallMaybe2")
|
||||
, Localizer.Stub("EightBallMaybe3")
|
||||
, Localizer.Stub("EightBallMaybe4")
|
||||
, Localizer.Stub("EightBallMaybe5")
|
||||
, LocStrings.Stub("EightBallMaybe1")
|
||||
, LocStrings.Stub("EightBallMaybe2")
|
||||
, LocStrings.Stub("EightBallMaybe3")
|
||||
, LocStrings.Stub("EightBallMaybe4")
|
||||
, LocStrings.Stub("EightBallMaybe5")
|
||||
|
||||
, Localizer.Stub("EightBallNo1")
|
||||
, Localizer.Stub("EightBallNo2")
|
||||
, Localizer.Stub("EightBallNo3")
|
||||
, Localizer.Stub("EightBallNo4")
|
||||
, Localizer.Stub("EightBallNo5")
|
||||
, LocStrings.Stub("EightBallNo1")
|
||||
, LocStrings.Stub("EightBallNo2")
|
||||
, LocStrings.Stub("EightBallNo3")
|
||||
, LocStrings.Stub("EightBallNo4")
|
||||
, LocStrings.Stub("EightBallNo5")
|
||||
};
|
||||
|
||||
public CommandEightBall(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("EightBallInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("EightBallInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
res.Call(Localizer.Stub("EightBallError"));
|
||||
res.Call(LocStrings.Stub("EightBallError"));
|
||||
|
||||
res.Call(answers[(int) (Math.random()*answers.length)]);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandGiveBeans extends Command
|
||||
@@ -9,7 +9,7 @@ public class CommandGiveBeans extends Command
|
||||
public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("GiveBeansInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("GiveBeansInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -20,20 +20,20 @@ public class CommandGiveBeans extends Command
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("GiveBeansInvalid"));
|
||||
res.Call(LocStrings.Stub("GiveBeansInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(input.mentions == null)
|
||||
{
|
||||
res.Call(Localizer.Stub("GiveBeansNoneMentioned"));
|
||||
res.Call(LocStrings.Stub("GiveBeansNoneMentioned"));
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < input.mentions.length; i++)
|
||||
{
|
||||
input.mentions[i].ChangeBeans(beans);
|
||||
res.Call(String.format(Localizer.Stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
|
||||
res.Call(String.format(LocStrings.Stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CommandHelp extends Command
|
||||
public CommandHelp(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("HelpInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("HelpInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -24,7 +24,7 @@ public class CommandHelp extends Command
|
||||
|
||||
if(help == null)
|
||||
{
|
||||
help = Localizer.Stub("HelpDisplay");
|
||||
help = LocStrings.Stub("HelpDisplay");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.Stats;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
@@ -26,7 +26,7 @@ public class CommandHelpBuilder extends Command {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("HelpBuilderInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("HelpBuilderInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -15,11 +15,11 @@ public class CommandInfo extends Command
|
||||
public CommandInfo(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("InfoInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("InfoInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(Localizer.Stub("InfoResponse"));
|
||||
res.Call(LocStrings.Stub("InfoResponse"));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import offline.Ref;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class CommandInvite extends Command
|
||||
public CommandInvite(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("InviteInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("InviteInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import network.NetworkJDoodle;
|
||||
|
||||
@@ -12,14 +12,14 @@ public class CommandJDoodle extends Command
|
||||
public CommandJDoodle(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("JDoodleInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("JDoodleInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
{
|
||||
res.Call(Localizer.Stub("JDoodleError"));
|
||||
res.Call(LocStrings.Stub("JDoodleError"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package commands;
|
||||
import java.util.Random;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -23,7 +23,7 @@ public class CommandMap extends Command
|
||||
public CommandMap(KittyRole roleLevel, KittyRating contentRating) { super(roleLevel, contentRating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return String.format(Localizer.Stub("MapInfo"), "" + MaxWidth, "" + MaxHeight); }
|
||||
public String HelpText() { return String.format(LocStrings.Stub("MapInfo"), "" + MaxWidth, "" + MaxHeight); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -60,7 +60,7 @@ public class CommandMap extends Command
|
||||
}
|
||||
catch(NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("MapInvalid"));
|
||||
res.Call(LocStrings.Stub("MapInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,10 +76,10 @@ public class CommandMap extends Command
|
||||
}
|
||||
|
||||
// Response header creation
|
||||
header += Localizer.Stub("MapVersion") + "\n";
|
||||
header += Localizer.Stub("MapSeed") + ": `" + seed + "`, ";
|
||||
header += Localizer.Stub("MapWidth") + "`"+ width +"`, ";
|
||||
header += Localizer.Stub("MapHeight") + ": `"+ height + "`\n";
|
||||
header += LocStrings.Stub("MapVersion") + "\n";
|
||||
header += LocStrings.Stub("MapSeed") + ": `" + seed + "`, ";
|
||||
header += LocStrings.Stub("MapWidth") + "`"+ width +"`, ";
|
||||
header += LocStrings.Stub("MapHeight") + ": `"+ height + "`\n";
|
||||
|
||||
// Response body creation
|
||||
body += "```\n";
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -23,7 +23,7 @@ public class CommandPerish extends Command
|
||||
public CommandPerish(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PerishInfo"); };
|
||||
public String HelpText() { return LocStrings.Stub("PerishInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ public class CommandPing extends Command
|
||||
public CommandPing(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PingInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("PingInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(Localizer.Stub("PingResponse"));
|
||||
res.Call(LocStrings.Stub("PingResponse"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandPollManage extends Command
|
||||
public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PollMangeInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("PollMangeInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class CommandPollResults extends Command
|
||||
public CommandPollResults(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PollResultsInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("PollResultsInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -28,7 +28,7 @@ public class CommandPollResults extends Command
|
||||
|
||||
for(int i = 0; i < votes.size(); i++)
|
||||
{
|
||||
results += String.format(Localizer.Stub("PollResultsResponse"), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
||||
results += String.format(LocStrings.Stub("PollResultsResponse"), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
||||
}
|
||||
|
||||
res.Call(results);
|
||||
|
||||
@@ -8,18 +8,18 @@ public class CommandPollShow extends Command
|
||||
public CommandPollShow(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PollShowInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("PollShowInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(!guild.polling)
|
||||
{
|
||||
res.Call(Localizer.Stub("PollShowNoPoll"));
|
||||
res.Call(LocStrings.Stub("PollShowNoPoll"));
|
||||
return;
|
||||
}
|
||||
String poll = String.format(Localizer.Stub("PollShowPoll"), guild.poll);
|
||||
poll += Localizer.Stub("PollShowChoices");
|
||||
String poll = String.format(LocStrings.Stub("PollShowPoll"), guild.poll);
|
||||
poll += LocStrings.Stub("PollShowChoices");
|
||||
for(int i = 0; i < guild.choices.size(); i++)
|
||||
{
|
||||
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
|
||||
|
||||
@@ -8,7 +8,7 @@ public class CommandPollVote extends Command
|
||||
public CommandPollVote(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("PollVoteInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("PollVoteInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -17,7 +17,7 @@ public class CommandPollVote extends Command
|
||||
{
|
||||
if(guild.hasVoted.contains(user.uniqueID))
|
||||
{
|
||||
res.Call(Localizer.Stub("PollVoteAlreadyVoted"));
|
||||
res.Call(LocStrings.Stub("PollVoteAlreadyVoted"));
|
||||
return;
|
||||
}
|
||||
try
|
||||
@@ -25,23 +25,23 @@ public class CommandPollVote extends Command
|
||||
int voteNum = Integer.parseInt(input.args)-1;
|
||||
if(voteNum >= guild.choices.size() || voteNum < 0)
|
||||
{
|
||||
res.Call(String.format(Localizer.Stub("PollVoteNotValidVote"), voteNum));
|
||||
res.Call(String.format(LocStrings.Stub("PollVoteNotValidVote"), voteNum));
|
||||
return;
|
||||
}
|
||||
|
||||
KittyPoll polled = guild.choices.get(voteNum);
|
||||
polled.votes++;
|
||||
guild.hasVoted.add(user.uniqueID);
|
||||
res.Call(Localizer.Stub("PollVoteSuccess") + " `" + polled.choice + "`!");
|
||||
res.Call(LocStrings.Stub("PollVoteSuccess") + " `" + polled.choice + "`!");
|
||||
return;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("PollVoteNotValidNumber"));
|
||||
res.Call(LocStrings.Stub("PollVoteNotValidNumber"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
res.Call(Localizer.Stub("PollVoteNoPoll"));
|
||||
res.Call(LocStrings.Stub("PollVoteNoPoll"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.RPManager;
|
||||
import dataStructures.*;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandRPEnd extends Command
|
||||
public CommandRPEnd (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RPEndInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("RPEndInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -33,11 +33,11 @@ public class CommandRPEnd extends Command
|
||||
if(sending != null)
|
||||
{
|
||||
res.CallFile(sending, "txt");
|
||||
res.Call(Localizer.Stub("RPEndFileOut"));
|
||||
res.Call(LocStrings.Stub("RPEndFileOut"));
|
||||
}
|
||||
else
|
||||
{
|
||||
res.Call(Localizer.Stub("RPEndError"));
|
||||
res.Call(LocStrings.Stub("RPEndError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.rpg.RPGFramework;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
@@ -23,7 +23,7 @@ public class CommandRPG extends Command
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RPGInfo"); };
|
||||
public String HelpText() { return LocStrings.Stub("RPGInfo"); };
|
||||
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class CommandRPG extends Command
|
||||
|
||||
if(result == null)
|
||||
{
|
||||
res.Call(Localizer.Stub("RPGInvalid"));
|
||||
res.Call(LocStrings.Stub("RPGInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package commands;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.RPManager;
|
||||
import dataStructures.*;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CommandRPStart extends Command
|
||||
public CommandRPStart (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RPStartInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("RPStartInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -15,7 +15,7 @@ public class CommandRating extends Command
|
||||
public CommandRating(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RatingInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("RatingInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -55,11 +55,11 @@ public class CommandRating extends Command
|
||||
}
|
||||
|
||||
if(newRating != null)
|
||||
res.Call(Localizer.Stub("RatingChanged") + " " + newRating);
|
||||
res.Call(LocStrings.Stub("RatingChanged") + " " + newRating);
|
||||
else
|
||||
res.Call(Localizer.Stub("RatingInvalid") + " `" + input.args + "`");
|
||||
res.Call(LocStrings.Stub("RatingInvalid") + " `" + input.args + "`");
|
||||
|
||||
if(newRating.equals("Filtered"))
|
||||
res.Call(Localizer.Stub("RatingWarning"));
|
||||
res.Call(LocStrings.Stub("RatingWarning"));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandRole extends Command
|
||||
@@ -9,20 +9,20 @@ public class CommandRole extends Command
|
||||
public CommandRole (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RoleInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("RoleInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.isEmpty())
|
||||
{
|
||||
res.Call(Localizer.Stub("RoleStandardResponse") + " " + user.GetRole().name() + "!");
|
||||
res.Call(LocStrings.Stub("RoleStandardResponse") + " " + user.GetRole().name() + "!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(user.GetRole().getValue() < KittyRole.Admin.getValue())
|
||||
{
|
||||
res.Call(String.format(Localizer.Stub("RoleError"), KittyRole.Admin.toString()));
|
||||
res.Call(String.format(LocStrings.Stub("RoleError"), KittyRole.Admin.toString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CommandRole extends Command
|
||||
break;
|
||||
|
||||
default:
|
||||
res.Call(Localizer.Stub("RoleNeededRole"));
|
||||
res.Call(LocStrings.Stub("RoleNeededRole"));
|
||||
return;
|
||||
}
|
||||
String users = "";
|
||||
@@ -56,6 +56,6 @@ public class CommandRole extends Command
|
||||
users += input.mentions[i].name + " ";
|
||||
}
|
||||
|
||||
res.Call(String.format(Localizer.Stub("RoleChanged"), users, newRole.name()));
|
||||
res.Call(String.format(LocStrings.Stub("RoleChanged"), users, newRole.name()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CommandRoll extends Command
|
||||
public CommandRoll(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("RollInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("RollInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -27,7 +27,7 @@ public class CommandRoll extends Command
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
res.Call(Localizer.Stub("RollError"));
|
||||
res.Call(LocStrings.Stub("RollError"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.DatabaseManager;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.Stats;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
@@ -20,7 +20,7 @@ public class CommandShutdown extends Command
|
||||
public CommandShutdown(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("ShutdownInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("ShutdownInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import utils.ImageUtils;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CommandStark extends Command
|
||||
public CommandStark(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("StarkInfo"); };
|
||||
public String HelpText() { return LocStrings.Stub("StarkInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import core.CommandManager.ThreadData;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
@@ -17,7 +17,7 @@ public class CommandStats extends Command
|
||||
public CommandStats(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("StatsInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("StatsInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -23,7 +23,7 @@ public class CommandTeey extends Command
|
||||
private static Long num = 0l;
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("TeeyInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("TeeyInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import network.NetworkTwitter;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CommandTweet extends Command
|
||||
public CommandTweet(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("TweetInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("TweetInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -20,7 +20,7 @@ public class CommandTweet extends Command
|
||||
try {
|
||||
res.Call(tweet.tweet(input.args));
|
||||
} catch (Exception e) {
|
||||
res.Call(Localizer.Stub("TweetError"));
|
||||
res.Call(LocStrings.Stub("TweetError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package commands;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.*;
|
||||
import network.*;
|
||||
import utils.ImageUtils;
|
||||
@@ -15,13 +15,13 @@ public class CommandWolfram extends Command
|
||||
public CommandWolfram(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("WolframInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("WolframInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args == null || input.args.trim().length() == 0)
|
||||
res.Call(Localizer.Stub("WolframNoArgs"));
|
||||
res.Call(LocStrings.Stub("WolframNoArgs"));
|
||||
|
||||
try
|
||||
{
|
||||
@@ -31,7 +31,7 @@ public class CommandWolfram extends Command
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("WolframError"));
|
||||
res.Call(LocStrings.Stub("WolframError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
@@ -23,7 +23,7 @@ public class CommandYeet extends Command
|
||||
private static Long num = 0l;
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("YeetInfo"); }
|
||||
public String HelpText() { return LocStrings.Stub("YeetInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -6,14 +6,14 @@ import utils.LogFilter;
|
||||
// A quick-and-dirty localization tool that scrapes the project for calls to itself, then
|
||||
// generates/updates a file externally (phrases.config) with all the stub values as keys that
|
||||
// can then be localized.
|
||||
public class Localizer extends LocBase
|
||||
public class LocStrings extends LocBase
|
||||
{
|
||||
public static final String fileName = "localization.config";
|
||||
public static final String function = "Localizer.Stub";
|
||||
public static final String fileName = "locStrings.config";
|
||||
public static final String function = "LocStrings.Stub";
|
||||
|
||||
private static Localizer instance;
|
||||
private static LocStrings instance;
|
||||
|
||||
public Localizer()
|
||||
public LocStrings()
|
||||
{
|
||||
super(fileName, function);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ObjectBuilderFactory
|
||||
|
||||
// Localization classes - these are singletons, but should be initialized before almost all other
|
||||
// things so their inclusion in the factory is to ensure they're started at the correct time.
|
||||
@SuppressWarnings("unused") private static Localizer locStrings;
|
||||
@SuppressWarnings("unused") private static LocStrings locStrings;
|
||||
@SuppressWarnings("unused") private static LocCommands locCommands;
|
||||
|
||||
// Lazy initialization multithreaded mutex stuff to prevent explosions.
|
||||
@@ -66,7 +66,7 @@ public class ObjectBuilderFactory
|
||||
// Start by reading from things that are external. Because
|
||||
// we require these things to be resolved before the rest of the application,
|
||||
// we place them here.
|
||||
locStrings = new Localizer();
|
||||
locStrings = new LocStrings();
|
||||
locCommands = new LocCommands();
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user