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);
|
setOfferAmount(player, offer, amount + 1000);
|
||||||
return true;
|
return true;
|
||||||
case 170: // value x
|
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) {
|
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||||
player.getPlayerGrandExchange().openSearch();
|
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 Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@@ -368,11 +371,14 @@ public class GrandExchangeInterface extends ComponentPlugin {
|
|||||||
player.getPacketDispatch().sendMessage("Please select an offer first.");
|
player.getPacketDispatch().sendMessage("Please select an offer first.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||||
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||||
player.getPlayerGrandExchange().openSearch();
|
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 Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
import core.game.component.ComponentPlugin;
|
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)));
|
module.getContainer().withdraw(slot, module.getContainer().getAmount(module.getContainer().get(slot)));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||||
module.getContainer().withdraw(slot, (int) 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;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -96,8 +100,12 @@ public final class TradeInterfacePlugin extends ComponentPlugin {
|
|||||||
module.getContainer().offer(slot, player.getInventory().getAmount(player.getInventory().get(slot)));
|
module.getContainer().offer(slot, player.getInventory().getAmount(player.getInventory().get(slot)));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||||
module.getContainer().offer(slot, (int) 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;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -222,8 +222,12 @@ public final class FruitCuttingPlugin extends UseWithHandler {
|
|||||||
amount = 5;
|
amount = 5;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(player, false, "Enter the amount:", (value) -> {
|
||||||
cut(player, (int) value, slice);
|
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 Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -372,9 +372,13 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
amount = p.getBank().getLastAmountX();
|
amount = p.getBank().getLastAmountX();
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||||
p.getBank().takeItem(slot, (int) value);
|
String s = value.toString();
|
||||||
p.getBank().updateLastAmountX((int) value);
|
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;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -446,9 +450,13 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
p.getBank().addItem(slot, p.getBank().getLastAmountX());
|
p.getBank().addItem(slot, p.getBank().getLastAmountX());
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||||
p.getBank().addItem(slot, (int) value);
|
String s = value.toString();
|
||||||
p.getBank().updateLastAmountX((int) value);
|
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;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -512,8 +520,12 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
case 234:
|
case 234:
|
||||||
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
ContentAPI.sendInputDialogue(p, false, "Enter the amount:", (value) -> {
|
||||||
p.getBank().addItem(slot, (int) 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);
|
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;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user