Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Alex
2019-06-18 02:11:58 -04:00
11 changed files with 78 additions and 16 deletions
+1
View File
@@ -13,6 +13,7 @@ charactereditbio=1
charactereditname=1 charactereditname=1
characterediturl=1 characterediturl=1
choose=1 choose=1
color, colour=1
crouton=1 crouton=1
dbflush=1 dbflush=1
dbstats=1 dbstats=1
+1
View File
@@ -12,6 +12,7 @@ bet=
guildrolelist= guildrolelist=
stats= stats=
catch= catch=
color, colour=
guildroleadd= guildroleadd=
results= results=
wolfram= wolfram=
+4 -1
View File
@@ -96,6 +96,9 @@ CharacterSearchMultipleCharacter=%s is owned by %s. Unique ID is `%s`
CharacterSearchOneCharacter=I found one character with that name! \n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s` CharacterSearchOneCharacter=I found one character with that name! \n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`
CharacterSearchInfo=Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID` CharacterSearchInfo=Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID`
[CommandColor]
ColorInfo=
[CommandDoWork] [CommandDoWork]
DoWorkFinished=I finished with my work! :D DoWorkFinished=I finished with my work! :D
DoWorkInfo=Occupies a core for a few seconds DoWorkInfo=Occupies a core for a few seconds
@@ -167,7 +170,7 @@ WolframInfo=Will query wolframalpha with your question and give a full image out
WolframNoArgs=You need to provide some arguments! WolframNoArgs=You need to provide some arguments!
[CommandMap] [CommandMap]
MapInfo=Generates a map! You can pass additional information if you want with the flags `-s<seed>-w<width>-h<height>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.\n\nDefault seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s) MapInfo=Generates a map! You can pass additional information if you want with the flags `-s<seed> -w<width> -h<height>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.\n\n**Defaults**\nDefault Seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s)\n\n**Key**\nLand: ˶\nMountain: ▲\nBeach: =\nMarsh: ¥\nLava: #
MapSeed=Seed MapSeed=Seed
MapInvalid=Invalid arguments provided! MapInvalid=Invalid arguments provided!
MapVersion=Using mapgen v0.1 MapVersion=Using mapgen v0.1
+7
View File
@@ -19,7 +19,14 @@ public class CommandChoose extends Command
@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() == 0)
{
res.Call(Stats.instance.GetHelpText(input.key));
return;
}
String [] choices = input.args.split(","); String [] choices = input.args.split(",");
if(choices.length == 1) if(choices.length == 1)
{ {
res.Call(LocStrings.Stub("ChooseOne")); res.Call(LocStrings.Stub("ChooseOne"));
+52
View File
@@ -0,0 +1,52 @@
package commands;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyEmbed;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandColor extends Command
{
public CommandColor(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return LocStrings.Stub("ColorInfo"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
int sideLength = 50;
float r = 0;
float g = 0;
float b = 0;
float a = 1;
Color parsed = new Color(r, g, b, a);
BufferedImage img = new BufferedImage(sideLength, sideLength, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D graphics = img.createGraphics();
graphics.setColor(parsed);
graphics.fillRect(0, 0, sideLength, sideLength);
graphics.dispose();
KittyEmbed response = new KittyEmbed();
response.color = parsed;
response.thumbnailURL = "attachment://test.png";
res.CallEmbed(response);
//ImageIO.write(bufferedImage, "png", file);
};
}
-4
View File
@@ -26,10 +26,6 @@ public class CommandHelp extends Command
{ {
help = LocStrings.Stub("HelpDisplay"); help = LocStrings.Stub("HelpDisplay");
} }
else
{
help = "`" + input.args + "`: " + help;
}
res.Call(help); res.Call(help);
} }
+3 -3
View File
@@ -111,12 +111,12 @@ public class CommandManager
} }
// Looks up command by name. If it exists, dumps help text, otherwise returns null. // Looks up command by name. If it exists, dumps help text, otherwise returns null.
public String GetCommandHelpText(String lookup) public String GetCommandHelpText(String key)
{ {
Command command = commands.get(lookup); Command command = commands.get(key);
if(command != null) if(command != null)
return command.HelpText(); return "`" + key + "`: " + command.HelpText();
return null; return null;
} }
+1
View File
@@ -429,6 +429,7 @@ public class ObjectBuilderFactory
manager.Register(LocCommands.Stub("charactereditname"), new CommandCharacterEditName(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.Stub("charactereditname"), new CommandCharacterEditName(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("charactereditURL"), new CommandCharacterEditURL(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.Stub("charactereditURL"), new CommandCharacterEditURL(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.Stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("color, colour"), new CommandColor(KittyRole.General, KittyRating.Safe));
return manager; return manager;
} }
+2 -6
View File
@@ -4,7 +4,7 @@ import java.awt.Color;
public class KittyEmbed public class KittyEmbed
{ {
public String title = null; public String title = null; // Required, but if this remails null or is empty, it's made a blank space in Response.java.
public Color color = null; public Color color = null;
public String footerText = null; public String footerText = null;
public String authorText = null; public String authorText = null;
@@ -13,9 +13,5 @@ public class KittyEmbed
public String descriptionText = null; public String descriptionText = null;
public String bodyImageURL = null; public String bodyImageURL = null;
public String imageURL = null; public String imageURL = null;
public String thumbnailURL = null; // Did you know? This is the only field that can actually be a local image file. Use attachment://file.png as the string for it.
public KittyEmbed()
{
}
} }
+7 -2
View File
@@ -33,8 +33,10 @@ public class Response
{ {
EmbedBuilder embed = new EmbedBuilder(); EmbedBuilder embed = new EmbedBuilder();
if(embedInfo.title != null) if(embedInfo.title != null && !embedInfo.title.isEmpty())
embed.setTitle(embedInfo.title); embed.setTitle(embedInfo.title);
else
embed.setTitle(" ");
if(embedInfo.color != null) if(embedInfo.color != null)
embed.setColor(embedInfo.color); embed.setColor(embedInfo.color);
@@ -49,7 +51,10 @@ public class Response
embed.setAuthor(embedInfo.authorText, embedInfo.authorLink, embedInfo.authorImage); embed.setAuthor(embedInfo.authorText, embedInfo.authorLink, embedInfo.authorImage);
if(embedInfo.imageURL != null) if(embedInfo.imageURL != null)
embed.setImage(embedInfo.imageURL); embed.setImage(embedInfo.imageURL);
if(embedInfo.thumbnailURL != null)
embed.setThumbnail(embedInfo.thumbnailURL);
event.getChannel().sendMessage(embed.build()).queue(); event.getChannel().sendMessage(embed.build()).queue();
} }
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB