Skip to content

Commit

Permalink
Center trade dialog when beginning trade. Cancel offer agreement when…
Browse files Browse the repository at this point in the history
… other party changes offer.
  • Loading branch information
ethanmoffat committed May 4, 2023
1 parent 0a96d42 commit 4dd21ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions EOLib/PacketHandlers/Trade/TradeOfferUpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public override bool HandlePacket(IPacket packet)
x.PlayerTwoOffer = x.PlayerTwoOffer.WithItems(player1Items);
});

_tradeRepository.PlayerOneOffer = _tradeRepository.PlayerOneOffer.WithAgrees(false);
_tradeRepository.PlayerTwoOffer = _tradeRepository.PlayerTwoOffer.WithAgrees(false);

return true;
}
}
Expand Down
5 changes: 5 additions & 0 deletions EndlessClient/Dialogs/TradeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ public TradeDialog(INativeGraphicsManager nativeGraphicsManager,
_rightItems = new List<ListDialogItem>();
_leftOffer = new TradeOffer.Builder().ToImmutable();
_rightOffer = new TradeOffer.Builder().ToImmutable();

CenterInGameView();

if (!Game.Window.AllowUserResizing)
DrawPosition = new Vector2(DrawPosition.X, 15);
}

public override void Initialize()
Expand Down

0 comments on commit 4dd21ea

Please sign in to comment.