Add option to change waila amounts to stack+remainder.

This commit is contained in:
Justin Aquadro committed 2015-11-22 00:51:05 -05:00
1 parent 8be3131e41
commit 11bbbe8fb9
3 files changed
+14

No files matched your search

@@ -154,6 +154,8 @@ storageDrawers.config.prop.enableDebugLogging=Enable Debug Logging
storageDrawers.config.prop.enableDebugLogging.tooltip=Prints extra information to the logs.
storageDrawers.config.prop.enableTape=Enable Tape
storageDrawers.config.prop.enableTape.tooltip=For moving drawers with contents.
storageDrawers.config.prop.wailaStackRemainder=WAILA amount presentation
storageDrawers.config.prop.wailaStackRemainder.tooltip=How item amounts are displayed by WAILA.
storageDrawers.config.addons=Addons
storageDrawers.config.addons.tooltip=Configure global addon pack settings.
@@ -76,6 +76,7 @@ public class ConfigManager
public boolean enableFallbackRecipes;
public boolean invertShift;
public boolean debugTrace;
public boolean stackRemainderWaila;
public int level2Mult;
public int level3Mult;
@@ -234,6 +235,7 @@ public class ConfigManager
cache.enableSidedOutput = config.get(Configuration.CATEGORY_GENERAL, "enableSidedOutput", true).setLanguageKey(LANG_PREFIX + "prop.enableSidedOutput").getBoolean();
cache.enableItemConversion = config.get(Configuration.CATEGORY_GENERAL, "enableItemConversion", true).setLanguageKey(LANG_PREFIX + "prop.enableItemConversion").getBoolean();
cache.enableFallbackRecipes = config.get(Configuration.CATEGORY_GENERAL, "enableFallbackRecipes", true).setLanguageKey(LANG_PREFIX + "prop.enableFallbackRecipes").setRequiresMcRestart(true).getBoolean();
cache.stackRemainderWaila = !config.get(Configuration.CATEGORY_GENERAL, "wailaStackRemainder", "exact", null, new String[]{"exact", "stack + remainder"}).setLanguageKey(LANG_PREFIX + "prop.wailaStackRemainder").getString().equals("exact");
cache.invertShift = config.get(Configuration.CATEGORY_GENERAL, "invertShift", false,
"Inverts how shift works with drawers. If this is true, shifting will only give one item, where regular clicks will give a full stack. Leave false for default behavior.")
.setLanguageKey(LANG_PREFIX + "prop.invertShift").getBoolean();
@@ -78,6 +78,16 @@ public class Waila extends IntegrationModule
if (drawer instanceof IFractionalDrawer && ((IFractionalDrawer) drawer).getConversionRate() > 1)
name = stackName + ((i == 0) ? " [" : " [+") + ((IFractionalDrawer) drawer).getStoredItemRemainder() + "]";
else if (StorageDrawers.config.cache.stackRemainderWaila) {
int stacks = drawer.getStoredItemCount() / drawer.getStoredItemStackSize();
int remainder = drawer.getStoredItemCount() - (stacks * drawer.getStoredItemStackSize());
if (stacks > 0 && remainder > 0)
name = stackName + " [" + stacks + "x" + drawer.getStoredItemStackSize() + " + " + remainder + "]";
else if (stacks > 0)
name = stackName + " [" + stacks + "x" + drawer.getStoredItemStackSize() + "]";
else
name = stackName + " [" + remainder + "]";
}
else
name = stackName + " [" + drawer.getStoredItemCount() + "]";
}