You can now use things like "500k" for amounts in trade, GE and bank interfaces.
This commit is contained in:
@@ -335,11 +335,14 @@ public class GrandExchangeInterface extends ComponentPlugin {
|
||||
setOfferAmount(player, offer, amount + 1000);
|
||||
return true;
|
||||
case 170: // value x
|
||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||
player.getPlayerGrandExchange().openSearch();
|
||||
}
|
||||
setOfferAmount(player, offer, (int) value);
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
setOfferAmount(player, offer, Integer.parseInt(s));
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return false;
|
||||
@@ -368,11 +371,14 @@ public class GrandExchangeInterface extends ComponentPlugin {
|
||||
player.getPacketDispatch().sendMessage("Please select an offer first.");
|
||||
return true;
|
||||
}
|
||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||
player.getPlayerGrandExchange().openSearch();
|
||||
}
|
||||
setOfferValue(player, offer, (int) value);
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
setOfferAmount(player, offer, Integer.parseInt(s));
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package core.game.interaction.inter;
|
||||
|
||||
import api.ContentAPI;
|
||||
import core.game.component.Component;
|
||||
import core.game.component.ComponentDefinition;
|
||||
import core.game.component.ComponentPlugin;
|
||||
|
||||
@@ -68,8 +68,12 @@ public final class TradeInterfacePlugin extends ComponentPlugin {
|
||||
module.getContainer().withdraw(slot, module.getContainer().getAmount(module.getContainer().get(slot)));
|
||||
break;
|
||||
case 234:
|
||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||
module.getContainer().withdraw(slot, (int) value);
|
||||
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
module.getContainer().withdraw(slot, val);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
break;
|
||||
@@ -96,8 +100,12 @@ public final class TradeInterfacePlugin extends ComponentPlugin {
|
||||
module.getContainer().offer(slot, player.getInventory().getAmount(player.getInventory().get(slot)));
|
||||
break;
|
||||
case 234:
|
||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||
module.getContainer().offer(slot, (int) value);
|
||||
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
module.getContainer().offer(slot, val);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -222,8 +222,12 @@ public final class FruitCuttingPlugin extends UseWithHandler {
|
||||
amount = 5;
|
||||
break;
|
||||
case 4:
|
||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||
cut(player, (int) value, slice);
|
||||
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
cut(player, val, slice);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return true;
|
||||
|
||||
@@ -372,9 +372,13 @@ public final class BankingPlugin extends OptionHandler {
|
||||
amount = p.getBank().getLastAmountX();
|
||||
break;
|
||||
case 234:
|
||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||
p.getBank().takeItem(slot, (int) value);
|
||||
p.getBank().updateLastAmountX((int) value);
|
||||
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
p.getBank().takeItem(slot, val);
|
||||
p.getBank().updateLastAmountX(val);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
break;
|
||||
@@ -446,9 +450,13 @@ public final class BankingPlugin extends OptionHandler {
|
||||
p.getBank().addItem(slot, p.getBank().getLastAmountX());
|
||||
break;
|
||||
case 234:
|
||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||
p.getBank().addItem(slot, (int) value);
|
||||
p.getBank().updateLastAmountX((int) value);
|
||||
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
p.getBank().addItem(slot, val);
|
||||
p.getBank().updateLastAmountX(val);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
break;
|
||||
@@ -512,8 +520,12 @@ public final class BankingPlugin extends OptionHandler {
|
||||
});
|
||||
return true;
|
||||
case 234:
|
||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||
p.getBank().addItem(slot, (int) value);
|
||||
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||
String s = value.toString();
|
||||
s = s.replace("k","000");
|
||||
s = s.replace("K","000");
|
||||
int val = Integer.parseInt(s);
|
||||
p.getBank().addItem(slot, val);
|
||||
InterfaceContainer.generateItems(p, p.getInventory().toArray(), new String[]{"Examine", "Deposit-X", "Deposit-All", "Deposit-10", "Deposit-5", "Deposit-1",}, 11, 15, 5, 7);
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user