From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/console/GiftDialog.java | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 NET/worlds/console/GiftDialog.java (limited to 'NET/worlds/console/GiftDialog.java') 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 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 -- cgit v1.2.3