|
zircon元宝寄售代码也是单独独立出来的NPC寄售 可以直接照搬 完整代码附件下载。
该代码需要用户组达到影魅之刃,升级用户组可通过日常发帖,资源共享活跃获得。
[mw_shl_code=csharp,true] /// <summary>
/// 寄售
/// </summary>
public sealed class MarketPlaceDialog : DXWindow1
{
#region Properites
public DXMessageBox ConsignWindow;
public DXTabControl TabControl;
#region Search
public DXTab SearchTab;
public DXLabel SellNameLabel;
public DXLabel SellDateLabel;
public DXTextBox ItemNameBox, BuyTotalBox, SearchNumberSoldBox, SearchLastPriceBox, SearchAveragePriceBox;
public DXNumberBox BuyCountBox, BuyPriceBox;
public DXComboBox ItemTypeBox, SortBox;
public DXControl MessagePanel, BuyPanel, HistoryPanel;
public DXButton BuyButton, SearchButton, SearchButton1, ShangjiaButton;
public DXCheckBox BuyGuildBox;
public DXLabel MessageLabel;
public DXVScrollBar SearchScrollBar;
public MarketPlaceRow[] SearchRows;
public ClientMarketPlaceInfo[] SearchResults;
#endregion
#region Consign
public DXTab ConsignTab;
public DXTextBox ConsignPriceBox, ConsignCostBox, NumberSoldBox, LastPriceBox, AveragePriceBox, ConsignMessageBox;
public DXControl ConsignPanel, ConsignBuyPanel, ConsignConfirmPanel;
public DXButton ConsignButton;
public DXCheckBox ConsignGuildBox;
public DXItemGrid ConsignGrid;
public DXLabel ConsignPriceLabel;
public DXVScrollBar ConsignScrollBar;
public DXImageControl ItemImage;
public MarketPlaceRow[] ConsignRows;
#endregion
#region Store
public DXTab StoreTab;
public DXTextBox UserNameBox;
public DXTextBox StoreItemNameBox, StoreBuyTotalBox;
public DXNumberBox StoreBuyCountBox, StoreBuyPriceBox, GameGoldBox, HuntGoldBox;
public DXComboBox StoreItemTypeBox, StoreSortBox;
public DXControl StoreBuyPanel;
public DXButton StoreBuyButton, StoreSearchButton;
public DXCheckBox UseHuntGoldBox;
public DXVScrollBar StoreScrollBar;
public DXLabel StoreBuyPriceLabel;
public List<StoreInfo> StoreSearchResults;
#endregion
#region SelectedRow
public MarketPlaceRow SelectedRow
{
get => _SelectedRow;
set
{
if (_SelectedRow == value) return;
MarketPlaceRow oldValue = _SelectedRow;
_SelectedRow = value;
OnSelectedRowChanged(oldValue, value);
}
}
private MarketPlaceRow _SelectedRow;
public event EventHandler<EventArgs> SelectedRowChanged;
public void OnSelectedRowChanged(MarketPlaceRow oValue, MarketPlaceRow nValue)
{
if (oValue != null)
oValue.Selected = false;
if (nValue != null)
nValue.Selected = true;
if (nValue?.MarketInfo == null)
{
MessagePanel.Enabled = false;
MessageLabel.Text = "";
ItemImage.Index = -1;
BuyPanel.Enabled = false;
SellNameLabel.Text = "";
BuyCountBox.MinValue = 0;
BuyCountBox.ValueTextBox.TextBox.Text = "";
SellDateLabel.Text = "";
BuyPriceBox.MinValue = 0;
BuyPriceBox.ValueTextBox.TextBox.Text = "";
HistoryPanel.Enabled = false;
SearchNumberSoldBox.TextBox.Text = "";
SearchLastPriceBox.TextBox.Text = "";
SearchAveragePriceBox.TextBox.Text = "";
}
else
{
MessagePanel.Enabled = true;
MessageLabel.Text = nValue.MarketInfo.Message;
SellNameLabel.Text = nValue.MarketInfo.Seller;
SellDateLabel.Text = nValue.MarketInfo.Item.Info.ItemName;
BuyPanel.Enabled = !GameScene.Game.Observer;
BuyCountBox.MinValue = 1;
BuyCountBox.MaxValue = nValue.MarketInfo.Item.Count;
BuyCountBox.Value = 1;
BuyPriceBox.MinValue = nValue.MarketInfo.Price;
BuyPriceBox.MaxValue = nValue.MarketInfo.Price;
BuyPriceBox.Value = nValue.MarketInfo.Price;
ItemImage.Index = nValue.MarketInfo.Item.Info.Image;
ItemImage.Location = new Point(610 - ItemImage.Size.Width / 2, 200 - ItemImage.Size.Height / 2);
ItemImage.MouseEnter += (o, e) =>
{
if (nValue.MarketInfo!=null)
GameScene.Game.MouseItem = nValue.MarketInfo.Item;
};
HistoryPanel.Enabled = true;
SearchNumberSoldBox.TextBox.Text = "Searching...";
SearchLastPriceBox.TextBox.Text = "Searching...";
SearchAveragePriceBox.TextBox.Text = "Searching...";
if (nValue.MarketInfo.Item != null && nValue.MarketInfo.Item.AddedStats.Count > 0)
SellDateLabel.ForeColour = Color.FromArgb(148, 255, 206);
else
SellDateLabel.ForeColour = Color.FromArgb(255, 255, 255);
CEnvir.Enqueue(new C.MarketPlaceHistory { Index = nValue.MarketInfo.Item.Info.Index, PartIndex = nValue.MarketInfo.Item.AddedStats[Stat.ItemIndex], Display = 1 });
}
SelectedRowChanged?.Invoke(this, EventArgs.Empty);
}
#endregion
#region SelectedStoreRow
public event EventHandler<EventArgs> SelectedStoreRowChanged;[/mw_shl_code]
|
上一篇:Mir2x C++服务端含客户端全套源代码下一篇:C#传奇3 Zircon商城代码源代码
|