diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/GiftDialog.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/console/GiftDialog.java')
| -rw-r--r-- | NET/worlds/console/GiftDialog.java | 76 |
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 |