mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-27 15:33:19 +00:00
Show message while loading itempanel
This commit is contained in:
1 parent
748cfe3754
commit
763aa134bc
4 files changed
+24
No files matched your search
@@ -180,6 +180,8 @@ public class ItemList {
|
||||
// System.out.println("Executing NEI Item Loading");
|
||||
ThreadOperationTimer timer = getTimer(NEIClientConfig.getItemLoadingTimeout());
|
||||
|
||||
ItemPanels.itemPanel.setLoading(true);
|
||||
|
||||
LinkedList<ItemStack> items = new LinkedList<>();
|
||||
LinkedList<ItemStack> permutations = new LinkedList<>();
|
||||
ListMultimap<Item, ItemStack> itemMap = ArrayListMultimap.create();
|
||||
@@ -218,6 +220,8 @@ public class ItemList {
|
||||
for (ItemsLoadedCallback callback : loadCallbacks) callback.itemsLoaded();
|
||||
|
||||
updateFilter.restart();
|
||||
|
||||
ItemPanels.itemPanel.setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ public class ItemPanel extends PanelWidget {
|
||||
public Button less;
|
||||
public ItemQuantityField quantity;
|
||||
|
||||
private Label loadingLabel;
|
||||
|
||||
public static class ItemPanelSlot {
|
||||
public ItemStack item;
|
||||
public int slotIndex;
|
||||
@@ -122,6 +124,8 @@ public class ItemPanel extends PanelWidget {
|
||||
};
|
||||
|
||||
quantity = new ItemQuantityField("quantity");
|
||||
|
||||
loadingLabel = new Label(NEIClientUtils.translate("itempanel.loading"), true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -168,6 +172,9 @@ public class ItemPanel extends PanelWidget {
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
|
||||
loadingLabel.x = x + (w / 2);
|
||||
loadingLabel.y = y + (h / 2);
|
||||
|
||||
return BUTTON_SIZE + 2;
|
||||
}
|
||||
|
||||
@@ -180,6 +187,8 @@ public class ItemPanel extends PanelWidget {
|
||||
LayoutManager.addWidget(less);
|
||||
LayoutManager.addWidget(quantity);
|
||||
}
|
||||
|
||||
LayoutManager.addWidget(loadingLabel);
|
||||
}
|
||||
|
||||
protected ItemStack getDraggedStackWithQuantity(int mouseDownSlot) {
|
||||
@@ -197,4 +206,8 @@ public class ItemPanel extends PanelWidget {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setLoading(boolean loading) {
|
||||
loadingLabel.setVisible(loading);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ public class Label extends Widget {
|
||||
final boolean centered;
|
||||
final int colour;
|
||||
public String text;
|
||||
boolean visible = true;
|
||||
|
||||
public Label(String s, boolean center, int color) {
|
||||
text = s;
|
||||
@@ -20,7 +21,12 @@ public class Label extends Widget {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey) {
|
||||
if (!visible) return;
|
||||
if (centered) drawStringC(text, x, y, colour);
|
||||
else drawString(text, x, y, colour);
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ nei.bookmark.toggle.tip=Toggle visibility of the Bookmark Panel
|
||||
nei.bookmark.viewmode.toggle.tip=Toggle Bookmark View Mode
|
||||
|
||||
nei.itempanel.quantity.default=One stack
|
||||
nei.itempanel.loading=Loading ItemPanel...
|
||||
|
||||
nei.enchant=Enchant
|
||||
nei.enchant.level=Level
|
||||
|
||||
Reference in new issue
Block a user