Added an empty gui for the party button to go into, fixed vanilla top button not aligning correctly all the time when clicked.

This commit is contained in:
Luis C.M committed 2024-01-08 00:31:54 -06:00
1 parent ba30c6e094
commit cb6a2be523
3 files changed
+52 -14

No files matched your search

@@ -1,15 +1,18 @@
package noppes.npcs.client.gui.player;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.CustomItems;
import noppes.npcs.client.gui.util.*;
import org.lwjgl.opengl.GL11;
import tconstruct.client.tabs.InventoryTabQuests;
import tconstruct.client.tabs.TabRegistry;
public class GuiParty extends GuiNPCInterface implements IGuiData {
public class GuiParty extends GuiNPCInterface implements ITopButtonListener,ICustomScrollListener, IGuiData {
private final ResourceLocation resource = new ResourceLocation("customnpcs","textures/gui/standardbg.png");
private final EntityPlayer player;
@@ -23,14 +26,32 @@ public class GuiParty extends GuiNPCInterface implements IGuiData {
public void initGui(){
super.initGui();
guiTop +=10;
TabRegistry.addTabsToList(buttonList);
TabRegistry.updateTabValues(guiLeft, guiTop, InventoryTabQuests.class);
GuiMenuSideButton questsButton = new GuiMenuSideButton(100, guiLeft + xSize + 37, this.guiTop + 3, 22, 22, "");
questsButton.rightSided = 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.active = true;
partyButton.renderStack = new ItemStack(CustomItems.bag);
addButton(partyButton);
}
@Override
protected void actionPerformed(GuiButton guibutton){
initGui();
if (guibutton.id == 100) {
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer));
}
}
@Override
@@ -75,4 +96,8 @@ public class GuiParty extends GuiNPCInterface implements IGuiData {
}
@Override
public void customScrollClicked(int i, int j, int k, GuiCustomScroll guiCustomScroll) {
}
}
@@ -41,9 +41,6 @@ public class GuiQuestLog extends GuiNPCInterface implements ITopButtonListener,I
private boolean noQuests = false;
private boolean questDetails = true;
private GuiMenuSideButton questsButton;
private GuiMenuSideButton partyButton;
private HashMap<String,String> questAlertsOnOpen;
private String trackedQuestKeyOnOpen;
@@ -87,16 +84,16 @@ public class GuiQuestLog extends GuiNPCInterface implements ITopButtonListener,I
}
sideButtons.get(categories.indexOf(data.selectedCategory)).active = true;
this.questsButton = new GuiMenuSideButton(100,guiLeft + xSize + 37, this.guiTop + 3, 22, 22, "");
this.questsButton.rightSided = true;
this.questsButton.active = true;
this.questsButton.renderStack = new ItemStack(CustomItems.letter);
addButton(this.questsButton);
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);
this.partyButton = new GuiMenuSideButton(101,guiLeft + xSize + 37, this.guiTop + 3 + 21, 22, 22, "");
this.partyButton.rightSided = true;
this.partyButton.renderStack = new ItemStack(CustomItems.bag);
addButton(this.partyButton);
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);
@@ -143,6 +140,11 @@ public class GuiQuestLog extends GuiNPCInterface implements ITopButtonListener,I
data.toggleQuestAlerts();
}
initGui();
if (guibutton.id == 101) {
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new GuiParty(mc.thePlayer));
}
}
@Override
public void drawScreen(int i, int j, float f){
@@ -10,7 +10,18 @@ public class InventoryTabVanilla extends AbstractTab {
@Override
public void onTabClicked() {
TabRegistry.openInventoryGui();
Thread t = new Thread(){
@Override
public void run(){
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
TabRegistry.openInventoryGui();
}
};
t.start();
}
@Override