/* */ 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 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 */