Skip to content

Commit 4574703

Browse files
authored
enhancement: trade offer accepted (AscensionGameDev#2236)
- The trade button is now disabled upon pressing it. - Players will now receive an informative message when the counterparty accepts theirs offer, indicating readiness for the trade to proceed.
1 parent 508a36a commit 4574703

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Intersect.Client/Interface/Game/Trades/TradingWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public FloatRect RenderBounds()
200200
void trade_Clicked(Base sender, ClickedEventArgs arguments)
201201
{
202202
mTrade.Text = Strings.Trading.pending;
203+
mTrade.IsDisabled = true;
203204
PacketSender.SendAcceptTrade();
204205
}
205206

Intersect.Server.Core/Localization/Strings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,9 @@ public sealed partial class TradingNamespace : LocaleNamespace
14871487
public readonly LocalizedString itemsdropped =
14881488
@"Out of inventory space. Some of your items have been dropped on the ground!";
14891489

1490+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
1491+
public readonly LocalizedString OfferAccepted = @"{00} has accepted your offer. Please confirm the trade.";
1492+
14901493
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
14911494
public readonly LocalizedString offerinvalid = @"Invalid item selected to offer!";
14921495

Intersect.Server.Core/Networking/PacketHandler.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,6 +2267,12 @@ public void HandlePacket(Client client, AcceptTradePacket packet)
22672267
player.Trading.Counterparty.Trading.Counterparty = null;
22682268
player.Trading.Counterparty = null;
22692269
}
2270+
else
2271+
{
2272+
PacketSender.SendChatMsg(
2273+
player.Trading.Counterparty, Strings.Trading.OfferAccepted.ToString(player.Name), ChatMessageType.Trading, CustomColors.Alerts.Accepted
2274+
);
2275+
}
22702276
}
22712277

22722278
//DeclineTradePacket

0 commit comments

Comments
 (0)