Some more command stuff, and re-organizing the resources to fit the new package structure

This commit is contained in:
pahimar 2012-12-21 10:25:18 -05:00
parent 96d635e727
commit 754bd0bf48
54 changed files with 414 additions and 341 deletions

View file

@ -25,7 +25,51 @@ public class CommandOverlay {
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, "false");
commandSender.sendChatToPlayer("commands.ee3.overlay.turned_off");
}
else if (subCommand.toLowerCase().equals("move")) {
else if (subCommand.toLowerCase().equals("opacity")) {
if (args.length >= 2) {
try {
float opacity = Float.parseFloat(args[1]);
if ((opacity < 0F) || (opacity > 1F)) {
throw new WrongUsageException("commands.ee3.overlay.opacity.usage", new Object[0]);
}
else {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = opacity;
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME, args[1]);
commandSender.sendChatToPlayer("commands.ee3.overlay.opacity.updated");
}
}
catch (Exception e) {
throw new WrongUsageException("commands.ee3.overlay.opacity.usage", new Object[0]);
}
}
else {
throw new WrongUsageException("commands.ee3.overlay.opacity.usage", new Object[0]);
}
}
else if (subCommand.toLowerCase().equals("scale")) {
if (args.length >= 2) {
try {
float scale = Float.parseFloat(args[1]);
if (scale <= 0F) {
throw new WrongUsageException("commands.ee3.overlay.scale.usage", new Object[0]);
}
else {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = scale;
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME, args[1]);
commandSender.sendChatToPlayer("commands.ee3.overlay.scale.updated");
}
}
catch (Exception e) {
throw new WrongUsageException("commands.ee3.overlay.opacity.usage", new Object[0]);
}
}
else {
throw new WrongUsageException("commands.ee3.overlay.opacity.usage", new Object[0]);
}
}
else if (subCommand.toLowerCase().equals("position")) {
String xPosition, yPosition;

View file

@ -49,6 +49,27 @@ public class ConfigurationHandler {
ConfigurationSettings.ENABLE_PARTICLE_FX = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT);
ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT);
ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_DEFAULT).getInt(ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_DEFAULT);
try {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = Float.parseFloat(configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT).value);
if (ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE <= 0F) {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT;
}
}
catch (Exception e) {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT;
}
try {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = Float.parseFloat(configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT).value);
if ((ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY < 0F) || (ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY > 1F)) {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT;
}
}
catch (Exception e) {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT;
}
/* Block configs */
BlockIds.CALCINATOR = configuration.getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT).getInt(BlockIds.CALCINATOR_DEFAULT);

View file

@ -38,6 +38,14 @@ public class ConfigurationSettings {
public static final String TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME = "block_overlay_position";
public static final int TARGET_BLOCK_OVERLAY_POSITION_DEFAULT = 3;
public static float TARGET_BLOCK_OVERLAY_OPACITY;
public static final String TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME = "block_overlay_opacity";
public static final float TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT = 0.75F;
public static float TARGET_BLOCK_OVERLAY_SCALE;
public static final String TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME = "block_overlay_scale";
public static final float TARGET_BLOCK_OVERLAY_SCALE_DEFAULT = 2.5F;
/*
* Block related config settings
*/

View file

@ -62,9 +62,9 @@ public class TransmutationTargetOverlayHandler implements ITickHandler {
private static void renderStoneHUD(Minecraft minecraft, EntityPlayer player, ItemStack stack, float partialTicks) {
float overlayScale = 2.5F;
float overlayScale = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE;
float blockScale = overlayScale / 2;
float overlayOpacity = 0.75F;
float overlayOpacity = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY;
MovingObjectPosition rayTrace = minecraft.objectMouseOver;
ItemStack currentBlock = null;

View file

@ -11,7 +11,7 @@ package com.pahimar.ee3.lib;
*/
public class Localizations {
private static final String LANG_RESOURCE_LOCATION = "/ee3/lang/";
private static final String LANG_RESOURCE_LOCATION = "/com/pahimar/ee3/lang/";
public static String[] localeFiles = {
LANG_RESOURCE_LOCATION + "cs_CZ.xml",

View file

@ -11,8 +11,8 @@ package com.pahimar.ee3.lib;
*/
public class Sounds {
private static final String SOUND_RESOURCE_LOCATION = "ee3/sound/";
private static final String SOUND_PREFIX = "ee3.sound.";
private static final String SOUND_RESOURCE_LOCATION = "com/pahimar/ee3/sound/";
private static final String SOUND_PREFIX = "com.pahimar.ee3.sound.";
public static String[] soundFiles = {
SOUND_RESOURCE_LOCATION + "chargeDown.ogg",

View file

@ -2,9 +2,9 @@ package com.pahimar.ee3.lib;
public class Sprites {
public static final String SPRITE_SHEET_LOCATION = "/ee3/art/sprites/";
public static final String ARMOR_SHEET_LOCATION = "/ee3/art/armor/";
public static final String GUI_SHEET_LOCATION = "/ee3/art/gui/";
public static final String SPRITE_SHEET_LOCATION = "/com/pahimar/ee3/art/sprites/";
public static final String ARMOR_SHEET_LOCATION = "/com/pahimar/ee3/art/armor/";
public static final String GUI_SHEET_LOCATION = "/com/pahimar/ee3/art/gui/";
public static final String ITEM_SPRITE_SHEET = "ee3_items.png";
public static final String BLOCK_SPRITE_SHEET = "ee3_blocks.png";

View file

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB