Merge remote-tracking branch 'origin/dev' into animation-events

# Conflicts:
#	src/api
#	src/main/java/noppes/npcs/controllers/data/AnimationData.java
This commit is contained in:
luisc committed 2024-04-01 16:32:45 -05:00
commit d055d434df
377 files changed
+2385 -1098

No files matched your search

@@ -29,25 +29,25 @@ public class SubGuiNpcAvailabilityQuest extends SubGuiInterface implements GuiSe
getLabel(1).center(xSize);
int y = guiTop + 12;
this.addButton(new GuiNpcButton(0, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive"},availabitily.questAvailable.ordinal()));
this.addButton(new GuiNpcButton(0, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive", "availability.acceptable", "availability.notacceptable"},availabitily.questAvailable.ordinal()));
this.addButton(new GuiNpcButton(10, guiLeft + 96, y, 192, 20, "availability.selectquest"));
getButton(10).setEnabled(availabitily.questAvailable != EnumAvailabilityQuest.Always);
this.addButton(new GuiNpcButton(20, guiLeft + 290, y, 20, 20, "X"));
y += 23;
this.addButton(new GuiNpcButton(1, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive"},availabitily.quest2Available.ordinal()));
this.addButton(new GuiNpcButton(1, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive", "availability.acceptable", "availability.notacceptable"},availabitily.quest2Available.ordinal()));
this.addButton(new GuiNpcButton(11, guiLeft + 96, y, 192, 20, "availability.selectquest"));
getButton(11).setEnabled(availabitily.quest2Available != EnumAvailabilityQuest.Always);
this.addButton(new GuiNpcButton(21, guiLeft + 290, y, 20, 20, "X"));
y += 23;
this.addButton(new GuiNpcButton(2, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive"},availabitily.quest3Available.ordinal()));
this.addButton(new GuiNpcButton(2, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive", "availability.acceptable", "availability.notacceptable"},availabitily.quest3Available.ordinal()));
this.addButton(new GuiNpcButton(12, guiLeft + 96, y, 192, 20, "availability.selectquest"));
getButton(12).setEnabled(availabitily.quest3Available != EnumAvailabilityQuest.Always);
this.addButton(new GuiNpcButton(22, guiLeft + 290, y, 20, 20, "X"));
y += 23;
this.addButton(new GuiNpcButton(3, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive"},availabitily.quest4Available.ordinal()));
this.addButton(new GuiNpcButton(3, guiLeft + 4, y, 90, 20, new String[]{"availability.always","availability.after","availability.before","availability.whenactive", "availability.whennotactive", "availability.acceptable", "availability.notacceptable"},availabitily.quest4Available.ordinal()));
this.addButton(new GuiNpcButton(13, guiLeft + 96, y, 192, 20, "availability.selectquest"));
getButton(13).setEnabled(availabitily.quest4Available != EnumAvailabilityQuest.Always);
this.addButton(new GuiNpcButton(23, guiLeft + 290, y, 20, 20, "X"));
@@ -333,10 +333,12 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
DialogImage selectedImage = (DialogImage) dialog.dialogImages.get(Integer.valueOf(imageScroll.getSelected()));
ArrayList<Integer> keys = new ArrayList<>(dialog.dialogImages.keySet());
int keyIndex = keys.indexOf(selectedImage.id);
do {
addId = keys.get(keyIndex) + 1;
keyIndex++;
} while (dialog.dialogImages.containsKey(addId));
if (keyIndex >= 0 && keyIndex < keys.size() - 1) {
do {
addId = keys.get(keyIndex) + 1;
keyIndex++;
} while (keyIndex < keys.size() && dialog.dialogImages.containsKey(addId));
}
} else if (dialog.dialogImages.size() > 0) {
addId = (Integer) dialog.dialogImages.keySet().toArray()[dialog.dialogImages.size() - 1] + 1;
}
@@ -134,6 +134,7 @@ public class SubGuiNpcRangeProperties extends SubGuiInterface implements ITextfi
if(gss.selectedResource != null) {
soundSelected.setText(gss.selectedResource.toString());
unFocused(soundSelected);
initGui();
}
}
}
@@ -43,15 +43,14 @@ public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldLis
}
public void buttonEvent(GuiButton button){
if(button.id == 6)
npc.advanced.disablePitch =((GuiNpcButton)button).getValue() == 0;
else{
selectedField = getTextField(button.id);
setSubGui(new GuiSoundSelection(selectedField.getText()));
}
}
@Override
public void unFocused(GuiNpcTextField textfield) {
if(textfield.id == 0)
@@ -72,6 +71,7 @@ public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldLis
if(gss.selectedResource != null) {
selectedField.setText(gss.selectedResource.toString());
unFocused(selectedField);
initGui();
}
}
@@ -132,6 +132,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
if(search.equals(getTextField(55).getText()))
return;
search = getTextField(55).getText().toLowerCase();
scrollAnimations.resetScroll();
scrollAnimations.setList(getSearchList());
}
}
@@ -100,6 +100,7 @@ public class GuiNPCManageDialogs extends GuiNPCInterface2 implements IScrollGrou
if(catSearch.equals(getTextField(55).getText()))
return;
catSearch = getTextField(55).getText().toLowerCase();
catScroll.resetScroll();
catScroll.setList(getCatSearch());
}
}
@@ -108,6 +109,7 @@ public class GuiNPCManageDialogs extends GuiNPCInterface2 implements IScrollGrou
if(diagSearch.equals(getTextField(66).getText()))
return;
diagSearch = getTextField(66).getText().toLowerCase();
dialogScroll.resetScroll();
dialogScroll.setList(getDiagSearch());
}
}
@@ -146,6 +146,7 @@ public class GuiNPCManageFactions extends GuiNPCInterface2 implements IScrollDat
if(search.equals(getTextField(55).getText()))
return;
search = getTextField(55).getText().toLowerCase();
scrollFactions.resetScroll();
scrollFactions.setList(getSearchList());
}
}
@@ -17,9 +17,9 @@ public class GuiNPCManageLinkedNpc extends GuiNPCInterface2 implements IScrollDa
private GuiCustomScroll scroll;
private List<String> data = new ArrayList<String>();
private String search = "";
public static GuiScreen Instance;
public GuiNPCManageLinkedNpc(EntityNPCInterface npc){
super(npc);
Instance = this;
@@ -29,10 +29,10 @@ public class GuiNPCManageLinkedNpc extends GuiNPCInterface2 implements IScrollDa
@Override
public void initGui(){
super.initGui();
this.addButton(new GuiNpcButton(1,guiLeft + 358, guiTop + 38, 58, 20, "gui.add"));
this.addButton(new GuiNpcButton(2,guiLeft + 358, guiTop + 61, 58, 20, "gui.remove"));
if(scroll == null){
scroll = new GuiCustomScroll(this,0,0);
scroll.setSize(143, 185);
@@ -54,6 +54,7 @@ public class GuiNPCManageLinkedNpc extends GuiNPCInterface2 implements IScrollDa
return;
search = getTextField(55).getText().toLowerCase();
scroll.setList(getSearchList());
scroll.resetScroll();
}
}
}
@@ -80,7 +81,7 @@ public class GuiNPCManageLinkedNpc extends GuiNPCInterface2 implements IScrollDa
if(scroll.hasSelected())
Client.sendData(EnumPacketServer.LinkedRemove, scroll.getSelected());
}
}
@Override
@@ -99,12 +100,12 @@ public class GuiNPCManageLinkedNpc extends GuiNPCInterface2 implements IScrollDa
@Override
public void setSelected(String selected) {
}
@Override
public void save() {
}
}
@@ -105,6 +105,7 @@ public class GuiNPCManageQuest extends GuiNPCInterface2 implements IScrollGroup,
if(catSearch.equals(getTextField(55).getText()))
return;
catSearch = getTextField(55).getText().toLowerCase();
catScroll.resetScroll();
catScroll.setList(getCatSearch());
}
}
@@ -113,6 +114,7 @@ public class GuiNPCManageQuest extends GuiNPCInterface2 implements IScrollGroup,
if(questSearch.equals(getTextField(66).getText()))
return;
questSearch = getTextField(66).getText().toLowerCase();
questScroll.resetScroll();
questScroll.setList(getQuestSearch());
}
}
@@ -21,7 +21,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
private Tag tag = new Tag();
private String selected = null;
private String search = "";
public GuiNPCManageTags(EntityNPCInterface npc)
{
super(npc);
@@ -31,10 +31,10 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
public void initGui()
{
super.initGui();
this.addButton(new GuiNpcButton(0,guiLeft + 368, guiTop + 8, 45, 20, "gui.add"));
this.addButton(new GuiNpcButton(1,guiLeft + 368, guiTop + 32, 45, 20, "gui.remove"));
if(scrollTags == null){
scrollTags = new GuiCustomScroll(this,0, 0);
scrollTags.setSize(143, 185);
@@ -46,7 +46,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
if (tag.id == -1)
return;
this.addTextField(new GuiNpcTextField(0, this, guiLeft + 40, guiTop + 4, 136, 20, tag.name));
getTextField(0).setMaxStringLength(20);
addLabel(new GuiNpcLabel(0,"gui.name", guiLeft + 8, guiTop + 9));
@@ -60,7 +60,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
addButton(new GuiNpcButton(10, guiLeft + 50, guiTop + 30, 60, 20, color));
addLabel(new GuiNpcLabel(1,"gui.color", guiLeft + 8, guiTop + 35));
getButton(10).setTextColor(tag.color);
addLabel(new GuiNpcLabel(3,"faction.hidden", guiLeft + 8, guiTop + 59));
this.addButton(new GuiNpcButton(3,guiLeft + 50, guiTop + 54, 60, 20, new String[]{"gui.no","gui.yes"},tag.hideTag?1:0));
}
@@ -74,6 +74,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
if(search.equals(getTextField(55).getText()))
return;
search = getTextField(55).getText().toLowerCase();
scrollTags.resetScroll();
scrollTags.setList(getSearchList());
}
}
@@ -100,7 +101,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
while(data.containsKey(name))
name += "_";
Tag tag = new Tag(-1, name, 0x00FF00);
NBTTagCompound compound = new NBTTagCompound();
tag.writeNBT(compound);
Client.sendData(EnumPacketServer.TagSave, compound);
@@ -125,28 +126,28 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
public void setGuiData(NBTTagCompound compound) {
this.tag = new Tag();
tag.readNBT(compound);
setSelected(tag.name);
initGui();
}
@Override
public void setData(Vector<String> list, HashMap<String, Integer> data) {
String name = scrollTags.getSelected();
this.data = data;
scrollTags.setList(getSearchList());
if(name != null)
scrollTags.setSelected(name);
}
@Override
public void setSelected(String selected) {
this.selected = selected;
scrollTags.setSelected(selected);
}
@Override
public void customScrollClicked(int i, int j, int k, GuiCustomScroll guiCustomScroll) {
if(guiCustomScroll.id == 0)
@@ -156,21 +157,21 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
Client.sendData(EnumPacketServer.TagGet, data.get(selected));
}
}
public void save() {
if(selected != null && data.containsKey(selected) && tag != null){
NBTTagCompound compound = new NBTTagCompound();
tag.writeNBT(compound);
Client.sendData(EnumPacketServer.TagSave, compound);
}
}
@Override
public void unFocused(GuiNpcTextField guiNpcTextField) {
if(tag.id == -1)
if(tag.id == -1)
return;
if(guiNpcTextField.id == 0) {
String name = guiNpcTextField.getText();
if(!name.isEmpty() && !data.containsKey(name)){
@@ -191,8 +192,8 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
}
tag.color = color;
guiNpcTextField.setTextColor(tag.color);
}
}
}
@Override
@@ -25,7 +25,7 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
private String selected = null;
private ResourceLocation slot;
private String search = "";
public GuiNpcManageRecipes(EntityNPCInterface npc,ContainerManageRecipes container){
super(npc,container);
this.container = container;
@@ -39,7 +39,7 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
@Override
public void initGui(){
super.initGui();
if(scroll == null)
scroll = new GuiCustomScroll(this,0,0);
scroll.setSize(130, 180);
@@ -57,7 +57,7 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
this.addLabel(new GuiNpcLabel(0, "gui.ignoreDamage", guiLeft + 86, guiTop + 32));
this.addButton(new GuiNpcButtonYesNo(5,guiLeft + 114, guiTop + 40, 50, 20, container.recipe.ignoreDamage));
this.addLabel(new GuiNpcLabel(1, "gui.ignoreNBT", guiLeft + 86, guiTop + 82));
this.addButton(new GuiNpcButtonYesNo(6,guiLeft + 114, guiTop + 90, 50, 20, container.recipe.ignoreNBT));
@@ -119,6 +119,7 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
if(search.equals(getTextField(55).getText()))
return;
search = getTextField(55).getText().toLowerCase();
scroll.resetScroll();
scroll.setList(getSearchList());
}
}
@@ -154,7 +155,7 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
super.drawGuiContainerBackgroundLayer(f, x, y);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(slot);
for(int i = 0; i < container.width;i++){
for(int j = 0; j < container.width;j++){
drawTexturedModalRect(guiLeft + i*18 + 7, guiTop + j*18 + 34, 0, 0, 18, 18);
@@ -170,11 +171,11 @@ public class GuiNpcManageRecipes extends GuiContainerNPCInterface2 implements IS
this.getTextField(0).enabled = name != null;
this.getButton(5).setEnabled(name != null);
if(name != null)
scroll.setSelected(name);
}
@Override
public void setSelected(String selected) {
this.selected = selected;
@@ -94,6 +94,7 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
if(search.equals(getTextField(55).getText()))
return;
search = getTextField(55).getText().toLowerCase();
scrollNaturalSpawns.resetScroll();
scrollNaturalSpawns.setList(getSearchList());
}
}
@@ -429,7 +429,6 @@ public class GuiParty extends GuiCNPCInventory implements ITextfieldListener,ICu
this.trackedQuestKey = compound.getString("QuestName");
}
this.isLeader = ClientCacheHandler.party.getPartyLeaderName().equals(this.player.getCommandSenderName());
System.out.println("KEY:" + trackedQuestKey);
} else if (compound.hasKey("Disband")) {
this.isLeader = false;
} else if (compound.hasKey("PartyInvites")) {
@@ -100,6 +100,7 @@ public class GuiNpcBard extends GuiNPCInterface2 implements ISubGuiListener
if(gss.selectedResource != null) {
job.song = gss.selectedResource.toString();
getLabel(0).label = job.song;
initGui();
}
}
}
@@ -55,6 +55,7 @@ public class SubGuiNpcConversationLine extends SubGuiInterface implements ITextf
GuiSoundSelection gss = (GuiSoundSelection) subgui;
if(gss.selectedResource != null) {
sound = gss.selectedResource.toString();
initGui();
}
}
@@ -59,6 +59,7 @@ public class GuiScriptPlayers extends GuiScriptInterface {
hookList.add("dialogOpen");
hookList.add("dialogOption");
hookList.add("dialogClose");
hookList.add("scriptCommand");
hookList.add("customGuiClosed");
hookList.add("customGuiButton");
hookList.add("customGuiSlot");
@@ -101,6 +101,7 @@ public class GuiDialogSelection extends SubGuiInterface implements ICustomScroll
if(catSearch.equals(getTextField(33).getText()))
return;
catSearch = getTextField(33).getText().toLowerCase();
scrollCategories.resetScroll();
scrollCategories.setList(getCatSearch());
}
}
@@ -109,6 +110,7 @@ public class GuiDialogSelection extends SubGuiInterface implements ICustomScroll
if(dialogSearch.equals(getTextField(44).getText()))
return;
dialogSearch = getTextField(44).getText().toLowerCase();
scrollDialogs.resetScroll();
scrollDialogs.setList(getDialogSearch());
}
}
@@ -101,6 +101,7 @@ public class GuiQuestSelection extends SubGuiInterface implements ICustomScrollL
if(catSearch.equals(getTextField(33).getText()))
return;
catSearch = getTextField(33).getText().toLowerCase();
scrollCategories.resetScroll();
scrollCategories.setList(getCatSearch());
}
}
@@ -109,6 +110,7 @@ public class GuiQuestSelection extends SubGuiInterface implements ICustomScrollL
if(questSearch.equals(getTextField(44).getText()))
return;
questSearch = getTextField(44).getText().toLowerCase();
scrollQuests.resetScroll();
scrollQuests.setList(getQuestSearch());
}
}
@@ -138,6 +138,7 @@ public class GuiSoundSelection extends SubGuiInterface implements ICustomScrollL
if(catSearch.equals(getTextField(55).getText()))
return;
catSearch = getTextField(55).getText().toLowerCase();
scrollCategories.resetScroll();
scrollCategories.setList(getCatSearch());
}
}
@@ -146,6 +147,7 @@ public class GuiSoundSelection extends SubGuiInterface implements ICustomScrollL
if(soundSearch.equals(getTextField(66).getText()))
return;
soundSearch = getTextField(66).getText().toLowerCase();
scrollSounds.resetScroll();
scrollSounds.setList(getSoundSearch());
}
}
@@ -2,6 +2,7 @@ package noppes.npcs.client.gui.util;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.client.gui.roles.GuiNpcTraderSetup;
import noppes.npcs.entity.EntityNPCInterface;
import org.lwjgl.opengl.GL11;
@@ -32,13 +33,13 @@ public abstract class GuiContainerNPCInterface2 extends GuiContainerNPCInterface
public ResourceLocation getResource(String texture){
return new ResourceLocation("customnpcs","textures/gui/" + texture);
}
@Override
public void initGui()
{
super.initGui();
menu.initGui(guiLeft, guiTop + menuYOffset, xSize);
}
}
@Override
protected void mouseClicked(int i, int j, int k)
@@ -47,7 +48,7 @@ public abstract class GuiContainerNPCInterface2 extends GuiContainerNPCInterface
if(!hasSubGui())
menu.mouseClicked(i, j, k);
}
public void delete(){
npc.delete();
displayGuiScreen(null);
@@ -62,10 +63,13 @@ public abstract class GuiContainerNPCInterface2 extends GuiContainerNPCInterface
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 256, 256);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(defaultBackground2);
drawTexturedModalRect(guiLeft + xSize-230, guiTop, 26, 0, 256, 220);
if(this instanceof GuiNpcTraderSetup)
drawTexturedModalRect(guiLeft + xSize-210, guiTop, 46, 0, 256, 220);
else
drawTexturedModalRect(guiLeft + xSize-230, guiTop, 26, 0, 256, 220);
menu.drawElements(fontRendererObj, i, j, mc, f);
super.drawGuiContainerBackgroundLayer(f, i, j);
}