More changes to the party menu, rhs tabs always appear, and a small loading text appears before packets are sent.

This commit is contained in:
luisc committed 2024-01-08 18:19:29 -06:00
1 parent 020e39907d
commit 0ecc94bdb0
3 files changed
+31 -12

No files matched your search

@@ -6,7 +6,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import noppes.npcs.CustomItems;
import noppes.npcs.client.CustomNpcResourceListener;
import noppes.npcs.client.gui.util.*;
import org.lwjgl.opengl.GL11;
import tconstruct.client.tabs.InventoryTabQuests;
@@ -16,12 +18,17 @@ public class GuiParty extends GuiNPCInterface implements ITopButtonListener,ICus
private final ResourceLocation resource = new ResourceLocation("customnpcs","textures/gui/standardbg.png");
private final EntityPlayer player;
private boolean receivedData;
private long renderTicks;
public GuiParty(EntityPlayer player) {
super();
this.player = player;
xSize = 280;
ySize = 180;
drawDefaultBackground = false;
//TODO: Send initial data packet
}
public void initGui(){
@@ -47,7 +54,6 @@ public class GuiParty extends GuiNPCInterface implements ITopButtonListener,ICus
protected void actionPerformed(GuiButton guibutton){
initGui();
if (guibutton.id == 100) {
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer));
@@ -56,12 +62,23 @@ public class GuiParty extends GuiNPCInterface implements ITopButtonListener,ICus
@Override
public void drawScreen(int i, int j, float f){
renderTicks++;
drawDefaultBackground();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(resource);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 252, 195);
drawTexturedModalRect(guiLeft + 252, guiTop, 188, 0, 67, 195);
super.drawScreen(i, j, f);
if(!receivedData){
String periods = "";
for (int k = 0; k < (renderTicks/10)%4; k++) {
periods += ".";
}
fontRendererObj.drawString(StatCollector.translateToLocal("gui.loading") + periods,guiLeft + xSize/2,guiTop + 80, CustomNpcResourceListener.DefaultTextColor);
return;
}
}
@Override
@@ -82,6 +99,7 @@ public class GuiParty extends GuiNPCInterface implements ITopButtonListener,ICus
@Override
public void setGuiData(NBTTagCompound compound) {
this.receivedData = true;
initGui();
}
@@ -67,6 +67,17 @@ public class GuiQuestLog extends GuiNPCInterface implements ITopButtonListener,I
noQuests = false;
GuiMenuSideButton questsButton = new GuiMenuSideButton(100, guiLeft + xSize + 37, this.guiTop + 3, 22, 22, "");
questsButton.rightSided = true;
questsButton.active = true;
questsButton.renderStack = new ItemStack(CustomItems.letter);
addButton(questsButton);
GuiMenuSideButton partyButton = new GuiMenuSideButton(101, guiLeft + xSize + 37, this.guiTop + 3 + 21, 22, 22, "");
partyButton.rightSided = true;
partyButton.renderStack = new ItemStack(CustomItems.bag);
addButton(partyButton);
if(data.categories.isEmpty()){
noQuests = true;
return;
@@ -84,17 +95,6 @@ public class GuiQuestLog extends GuiNPCInterface implements ITopButtonListener,I
}
sideButtons.get(categories.indexOf(data.selectedCategory)).active = true;
GuiMenuSideButton questsButton = new GuiMenuSideButton(100, guiLeft + xSize + 37, this.guiTop + 3, 22, 22, "");
questsButton.rightSided = true;
questsButton.active = true;
questsButton.renderStack = new ItemStack(CustomItems.letter);
addButton(questsButton);
GuiMenuSideButton partyButton = new GuiMenuSideButton(101, guiLeft + xSize + 37, this.guiTop + 3 + 21, 22, 22, "");
partyButton.rightSided = true;
partyButton.renderStack = new ItemStack(CustomItems.bag);
addButton(partyButton);
if(scroll == null)
scroll = new GuiCustomScroll(this,0);