mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 22:34:33 +00:00
Add config option for gui tab speed
This commit is contained in:
1 parent
e73e703f8c
commit
6b824f47cd
2 files changed
+24
-7
No files matched your search
@@ -86,6 +86,9 @@ public class Config {
|
||||
// Mail
|
||||
public static boolean mailAlertEnabled = true;
|
||||
|
||||
// Gui tabs (Ledger)
|
||||
public static int guiTabSpeed = 8;
|
||||
|
||||
// Hints
|
||||
public static boolean disableHints = false;
|
||||
public static final HashMap<String, String[]> hints = new HashMap<String, String[]>();
|
||||
@@ -213,6 +216,10 @@ public class Config {
|
||||
indicatorEnable.comment = "set to false to disable the mail alert box";
|
||||
mailAlertEnabled = Boolean.parseBoolean(indicatorEnable.value);
|
||||
|
||||
Property guiTabSpeedProp = config.get("tweaks.gui.tab.speed", CATEGORY_COMMON, guiTabSpeed);
|
||||
guiTabSpeedProp.comment = "set the speed at which the gui side tabs open and close.";
|
||||
guiTabSpeed = Integer.parseInt(guiTabSpeedProp.value);
|
||||
|
||||
Property clearGenome = config.get("genetics.clear.invalid.chromosomes", CATEGORY_COMMON, clearInvalidChromosomes);
|
||||
clearGenome.comment = "set to true to clear chromosomes which contain invalid alleles. might rescue your save if it is crashing after the removal of a bee addon.";
|
||||
clearInvalidChromosomes = Boolean.parseBoolean(clearGenome.value);
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.SessionVars;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -26,7 +27,6 @@ import forestry.core.utils.ForestryResource;
|
||||
*/
|
||||
public abstract class Ledger {
|
||||
|
||||
private static final int OPEN_SPEED = 8;
|
||||
protected static final int maxWidth = 124;
|
||||
protected static final int minWidth = 24;
|
||||
public static final int minHeight = 24;
|
||||
@@ -65,18 +65,28 @@ public abstract class Ledger {
|
||||
public void update() {
|
||||
// Width
|
||||
if (open && currentWidth < maxWidth) {
|
||||
currentWidth += OPEN_SPEED;
|
||||
currentWidth += Config.guiTabSpeed;
|
||||
if (currentWidth > maxWidth) {
|
||||
currentWidth = maxWidth;
|
||||
}
|
||||
} else if (!open && currentWidth > minWidth) {
|
||||
currentWidth -= OPEN_SPEED;
|
||||
currentWidth = currentWidth > minWidth ? currentWidth : minWidth;
|
||||
currentWidth -= Config.guiTabSpeed;
|
||||
if (currentWidth < minWidth) {
|
||||
currentWidth = minWidth;
|
||||
}
|
||||
}
|
||||
|
||||
// Height
|
||||
if (open && currentHeight < maxHeight) {
|
||||
currentHeight += OPEN_SPEED;
|
||||
currentHeight += Config.guiTabSpeed;
|
||||
if (currentHeight > maxHeight) {
|
||||
currentHeight = maxHeight;
|
||||
}
|
||||
} else if (!open && currentHeight > minHeight) {
|
||||
currentHeight -= OPEN_SPEED;
|
||||
currentHeight = currentHeight > minHeight ? currentHeight : minHeight;
|
||||
currentHeight -= Config.guiTabSpeed;
|
||||
if (currentHeight < minHeight) {
|
||||
currentHeight = minHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user