Min/Max Party Size, Execute Command for, Lang Updates

This commit is contained in:
Kam committed 2024-03-04 05:15:50 -05:00
1 parent 6e59aa3a27
commit 64d8d00fad
7 files changed
+169 -41

No files matched your search

@@ -24,42 +24,68 @@ public class SubGuiNpcPartyOptions extends SubGuiInterface implements ITextfield
{
super.initGui();
int y = 0;
//Allow party - T/F button
addButton(new GuiNpcButton(0, guiLeft + 130, guiTop + 10, 60, 20,
addButton(new GuiNpcButton(0, guiLeft + 130, guiTop + 10 + y, 60, 20,
new String[]{"gui.no", "gui.yes"}, options.allowParty ? 1 : 0));
addLabel(new GuiNpcLabel(1, "party.allowParty", guiLeft + 10, guiTop + 17));
addLabel(new GuiNpcLabel(1, "party.allowParty", guiLeft + 10, guiTop + 17 + y));
if (options.allowParty) {
y += 23;
//Only party - enum button
addButton(new GuiNpcButton(24, guiLeft + 130, guiTop + 10 + y, 60, 20,
new String[]{"gui.no", "gui.yes"}, options.onlyParty ? 1 : 0));
addLabel(new GuiNpcLabel(24, "party.only", guiLeft + 10, guiTop + 17 + y));
y += 23;
//Party requirements - enum button
addButton(new GuiNpcButton(5, guiLeft + 130, guiTop + 35, 60, 20,
addButton(new GuiNpcButton(5, guiLeft + 130, guiTop + 10 + y, 60, 20,
EnumPartyRequirements.values(), options.partyRequirements.ordinal()));
addLabel(new GuiNpcLabel(6, "party.partyRequirements", guiLeft + 10, guiTop + 42));
//Party rewards - enum button
addButton(new GuiNpcButton(10, guiLeft + 130, guiTop + 60, 60, 20,
EnumPartyExchange.values(), options.rewardControl.ordinal()));
addLabel(new GuiNpcLabel(11, "party.partyRewards", guiLeft + 10, guiTop + 67));
//Complete for - enum button
addButton(new GuiNpcButton(15, guiLeft + 130, guiTop + 85, 60, 20,
EnumPartyExchange.values(), options.completeFor.ordinal()));
addLabel(new GuiNpcLabel(16, "party.completeFor", guiLeft + 10, guiTop + 92));
addLabel(new GuiNpcLabel(6, "party.partyRequirements", guiLeft + 10, guiTop + 17 + y));
y += 23;
//Objective Requirement - enum button
addButton(new GuiNpcButton(18, guiLeft + 130, guiTop + 110, 60, 20,
addButton(new GuiNpcButton(18, guiLeft + 130, guiTop + 10 + y, 60, 20,
EnumPartyObjectives.values(), options.objectiveRequirement.ordinal()));
addLabel(new GuiNpcLabel(19, "party.objectiveRequirement", guiLeft + 10, guiTop + 117));
addLabel(new GuiNpcLabel(19, "quest.objectives", guiLeft + 10, guiTop + 17 + y));
y += 23;
//Party rewards - enum button
addButton(new GuiNpcButton(10, guiLeft + 130, guiTop + 10 + y, 60, 20,
EnumPartyExchange.values(), options.rewardControl.ordinal()));
addLabel(new GuiNpcLabel(11, "quest.reward", guiLeft + 10, guiTop + 17 + y));
y += 23;
//Complete for - enum button
addButton(new GuiNpcButton(15, guiLeft + 130, guiTop + 10 + y, 60, 20,
EnumPartyExchange.values(), options.completeFor.ordinal()));
addLabel(new GuiNpcLabel(16, "party.completeFor", guiLeft + 10, guiTop + 17 + y));
y += 23;
//Commmand for - enum button
addButton(new GuiNpcButton(25, guiLeft + 130, guiTop + 10 + y, 60, 20,
EnumPartyExchange.values(), options.executeCommand.ordinal()));
addLabel(new GuiNpcLabel(25, "party.commandFor", guiLeft + 10, guiTop + 17 + y));
y += 23;
//min party size - number field
GuiNpcTextField minField = new GuiNpcTextField(21, this, guiLeft + 60, guiTop + 10 + y,
30, 20, String.valueOf(options.minPartySize));
minField.integersOnly = true;
minField.setMinMaxDefault(1, Integer.MAX_VALUE, 1);
addTextField(minField);
addLabel(new GuiNpcLabel(21, "party.minPartySize", guiLeft + 10, guiTop + 17 + y));
//max party size - number field
GuiNpcTextField textField = new GuiNpcTextField(20, this, guiLeft + 130, guiTop + 135,
40, 20, String.valueOf(options.maxPartySize));
textField.integersOnly = true;
textField.setMinMaxDefault(1, Integer.MAX_VALUE, 4);
addTextField(textField);
addLabel(new GuiNpcLabel(20, "party.maxPartySize", guiLeft + 10, guiTop + 142));
GuiNpcTextField maxField = new GuiNpcTextField(20, this, guiLeft + 160, guiTop + 10 + y,
30, 20, String.valueOf(options.maxPartySize));
maxField.integersOnly = true;
maxField.setMinMaxDefault(1, Integer.MAX_VALUE, 4);
addTextField(maxField);
addLabel(new GuiNpcLabel(20, "party.maxPartySize", guiLeft + 110, guiTop + 17 + y));
}
addButton(new GuiNpcButton(66, guiLeft + 20, guiTop + 192, 90, 20, "gui.done"));
addButton(new GuiNpcButton(66, guiLeft + 200, guiTop + 192, 50, 20, "gui.done"));
}
protected void actionPerformed(GuiButton guibutton)
@@ -81,6 +107,12 @@ public class SubGuiNpcPartyOptions extends SubGuiInterface implements ITextfield
case 18:
options.objectiveRequirement = EnumPartyObjectives.valueOf(guibutton.displayString);
break;
case 24:
options.onlyParty = !options.onlyParty;
break;
case 25:
options.executeCommand = EnumPartyExchange.valueOf(guibutton.displayString);
break;
case 66:
close();
break;
@@ -91,7 +123,12 @@ public class SubGuiNpcPartyOptions extends SubGuiInterface implements ITextfield
@Override
public void unFocused(GuiNpcTextField textfield) {
if (textfield.id == 20) {
options.maxPartySize = textfield.getInteger();
options.setMaxPartySize(textfield.getInteger());
initGui();
}
if (textfield.id == 21) {
options.setMinPartySize(textfield.getInteger());
initGui();
}
}
}