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