Compare commits

..
Author SHA1 Message Date
くぁーりぃ 6d9ec0c0da Backport some of REI bookmark features (#296)
* add placeholder bookmark drop

* add item panel to bookmark panel injection support

* fix outofboundsexception

* fix drag'n drop voids bookmark

* add itemstack moving animation

* implement pop animation

* fix crashes

* disable ItemPanel Animation

* disable pop animation on bookmark load

* spotlessapply

* disable move animation on gui scale

* add config option
2022-09-18 12:08:16 +02:00
3 changed files with 21 additions and 7 deletions

No files matched your search

@@ -30,14 +30,17 @@ public class AnimatedItemStack {
}
public void drawItem(int x, int y, boolean smallAmount, String stackSize, boolean blockMoveAnimOnce) {
if (doPopAnim && currentScale < 1) {
drawPoppingItem(x, y, smallAmount, stackSize);
return;
}
if (doMoveAnim && (lastPosX != x || lastPosY != y) && !blockMoveAnimOnce) {
drawMovingItem(x, y, smallAmount, stackSize);
return;
if (NEIClientConfig.areBookmarksAnimated()) {
if (doPopAnim && currentScale < 1) {
drawPoppingItem(x, y, smallAmount, stackSize);
return;
}
if (doMoveAnim && (lastPosX != x || lastPosY != y) && !blockMoveAnimOnce) {
drawMovingItem(x, y, smallAmount, stackSize);
return;
}
}
currentScale = 1;
lastPosX = x;
lastPosY = y;
GuiContainerManager.drawItem(x, y, itemStack, smallAmount, stackSize);
@@ -237,6 +237,10 @@ public class NEIClientConfig {
.setComment("Use NBT in Bookmarks")
.getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.useNBTInBookmarks", true));
tag.getTag("inventory.bookmarksAnimationEnabled")
.setComment("REI Style Animation in Bookmarks")
.getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.bookmarksAnimationEnabled", true));
tag.getTag("inventory.showRecipeMarker")
.setComment("Show Recipe Marker")
.getBooleanValue(false);
@@ -504,6 +508,10 @@ public class NEIClientConfig {
return getBooleanSetting("inventory.useNBTInBookmarks");
}
public static boolean areBookmarksAnimated() {
return getBooleanSetting("inventory.bookmarksAnimationEnabled");
}
public static boolean showRecipeMarker() {
return getBooleanSetting("inventory.showRecipeMarker");
}
@@ -146,6 +146,9 @@ nei.options.inventory.saveCurrentRecipeInBookmarksEnabled.false=Disabled
nei.options.inventory.useNBTInBookmarks=Use NBT in Bookmarks
nei.options.inventory.useNBTInBookmarks.true=Yes
nei.options.inventory.useNBTInBookmarks.false=No
nei.options.inventory.bookmarksAnimationEnabled=REI Style Animation in Bookmarks
nei.options.inventory.bookmarksAnimationEnabled.true=Yes
nei.options.inventory.bookmarksAnimationEnabled.false=No
nei.options.inventory.showRecipeMarker=Show Recipe Marker
nei.options.inventory.showRecipeMarker.true=Yes
nei.options.inventory.showRecipeMarker.false=No