summaryrefslogtreecommitdiff
path: root/NET/worlds/console/GiftDialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/GiftDialog.java')
-rw-r--r--NET/worlds/console/GiftDialog.java76
1 files changed, 76 insertions, 0 deletions
diff --git a/NET/worlds/console/GiftDialog.java b/NET/worlds/console/GiftDialog.java
new file mode 100644
index 0000000..fde5afa
--- /dev/null
+++ b/NET/worlds/console/GiftDialog.java
@@ -0,0 +1,76 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.core.Std;
+/* */ import NET.worlds.scape.InventoryItem;
+/* */ import NET.worlds.scape.InventoryManager;
+/* */ import java.text.MessageFormat;
+/* */ import java.util.Hashtable;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class GiftDialog
+/* */ extends OkCancelDialog
+/* */ {
+/* */ private static final long serialVersionUID = -5698666260017940591L;
+/* */ private String inv;
+/* */ private int autoCloseTime;
+/* */
+/* */ public static String calcMsg(String inv, int duration)
+/* */ {
+/* 34 */ InventoryManager im = InventoryManager.getInventoryManager();
+/* 35 */ Hashtable<String, InventoryItem> inventory = im.parseInventoryString(inv);
+/* */
+/* */
+/* 38 */ String hr = TradeDialog.buildInvDesc(inventory);
+/* */
+/* 40 */ Object[] arguments = { new String(hr),
+/* 41 */ new String(duration / 1000) };
+/* 42 */ return MessageFormat.format(Console.message("To-claim-hr"), arguments);
+/* */ }
+/* */
+/* */ public GiftDialog(String _inv, int duration)
+/* */ {
+/* 47 */ super(Console.getFrame(), null, Console.message("A-Gift"), null, "Accept", calcMsg(_inv, duration), false);
+/* */
+/* 49 */ this.autoCloseTime = (Std.getFastTime() + duration);
+/* 50 */ this.inv = _inv;
+/* */ }
+/* */
+/* */ protected void activeCallback()
+/* */ {
+/* 55 */ super.activeCallback();
+/* */
+/* 57 */ if ((Std.getFastTime() > this.autoCloseTime) && (this.autoCloseTime != 0)) {
+/* 58 */ done(false);
+/* */ }
+/* */ }
+/* */
+/* */ protected synchronized boolean done(boolean confirmed) {
+/* 63 */ WhisperManager.whisperManager().giftDialogDone();
+/* */
+/* 65 */ if (confirmed)
+/* */ {
+/* 67 */ TradeDialog.sendTradeMessage("&|+deal>TRADE ," + this.inv); }
+/* 68 */ return super.done(confirmed);
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\GiftDialog.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file