Пример #1
0
        void InventoryList_Click(object sender, int row, int col)
        {
            try
            {
                int id;

                if (int.TryParse(((HudStaticText)inventoryList[row][2]).Text, out id))
                {
                    var wo = CoreManager.Current.WorldFilter[id];

                    if (wo != null)
                    {
                        if (wo.Container != CoreManager.Current.CharacterFilter.Id)
                        {
                            CoreManager.Current.Actions.UseItem(wo.Container, 0);
                        }
                        //CoreManager.Current.Actions.SelectItem(wo.Container);

                        CoreManager.Current.Actions.SelectItem(id);

                        var itemInfo = new ItemInfo.ItemInfo(wo);
                        inventoryItemText.Text = itemInfo.ToString();
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Пример #2
0
        void ExportObjects(List <WorldObject> worldObjects)
        {
            worldObjects.Sort(new WorldObjectSorter());

            StringBuilder output = new StringBuilder();

            foreach (WorldObject obj in worldObjects)
            {
                ItemInfo.ItemInfo info = new ItemInfo.ItemInfo(obj);

                output.AppendLine(info.ToString());
            }

            System.Windows.Forms.Clipboard.SetText(output.ToString());
        }
Пример #3
0
		void InventoryList_Click(object sender, int row, int col)
		{
			try
			{
				int id;

				if (int.TryParse(((HudStaticText)inventoryList[row][2]).Text, out id))
				{
					CoreManager.Current.Actions.SelectItem(id);

					var wo = CoreManager.Current.WorldFilter[id];

					if (wo != null)
					{
						var itemInfo = new ItemInfo.ItemInfo(wo);
						inventoryItemText.Text = itemInfo.ToString();
					}
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Пример #4
0
		void InventorySearch_Change(object sender, EventArgs e)
		{
			try
			{
				inventoryList.ClearRows();

				var regex = new Regex(inventorySearch.Text, RegexOptions.IgnoreCase);

				foreach (var wo in CoreManager.Current.WorldFilter.GetInventory())
				{
					var itemInfo = new ItemInfo.ItemInfo(wo);

					if (regex.IsMatch(itemInfo.ToString()))
					{
						HudList.HudListRowAccessor newRow = inventoryList.AddRow();

						((HudPictureBox)newRow[0]).Image = wo.Icon + 0x6000000;
						((HudStaticText)newRow[1]).Text = wo.Name;
						((HudStaticText)newRow[2]).Text = wo.Id.ToString(CultureInfo.InvariantCulture);
					}
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Пример #5
0
        void InventorySearch_Change(object sender, EventArgs e)
        {
            try
            {
                inventoryList.ClearRows();

                var regex = new Regex(inventorySearch.Text, RegexOptions.IgnoreCase);

                foreach (var wo in CoreManager.Current.WorldFilter.GetInventory())
                {
                    var itemInfo = new ItemInfo.ItemInfo(wo);

                    if (regex.IsMatch(itemInfo.ToString()))
                    {
                        HudList.HudListRowAccessor newRow = inventoryList.AddRow();

                        ((HudPictureBox)newRow[0]).Image = wo.Icon + 0x6000000;
                        ((HudStaticText)newRow[1]).Text  = wo.Name;
                        ((HudStaticText)newRow[2]).Text  = wo.Id.ToString(CultureInfo.InvariantCulture);
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }