void ElementSharingWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ItemInformation sharedItem = (ItemInformation)e.Result; MyInputDialog dialog = new MyInputDialog("Ссылка на " + sharedItem.Name, false, sharedItem.Share_url); dialog.ShowDialog(); }
void FilesUploadWorker_DoWork(object sender, DoWorkEventArgs e) { string[] files = (string[])e.Argument; string[] temp_arr; FileStream stream; Task <ItemInformation> task; string path = currentDir; ItemInformation[] results = new ItemInformation[files.Length]; for (int i = 0; i < files.Length; i++) { stream = File.Open(files[i], FileMode.Open); temp_arr = files[i].Split('\\'); task = client.UploadAsync(path + "/" + temp_arr[temp_arr.Length - 1], stream); try { task.Wait(); } catch (Exception err) { MessageBox.Show(err.InnerException.Message); } FilesUploadWorker.ReportProgress(0); results[i] = task.Result; } e.Result = results; }
void Awake() { itemIcon = gameObject.transform.GetChild(0).GetComponent <Image> (); inventory = GameObject.FindGameObjectWithTag("UI").transform.GetChild(1).GetComponent <PlayerInventory> (); manager = GameObject.FindGameObjectWithTag("UI").GetComponent <UIManager> (); itemInformation = GameObject.FindGameObjectWithTag("UI").transform.GetChild(1).GetChild(0).GetComponent <ItemInformation> (); }
public void Show(ItemInformation itemInfo) { canvasGroup.alpha = 1; nameText.text = itemInfo.Name; attributesText.text = itemInfo.Attributes; descriptionText.text = itemInfo.Description; }
public JsonResult CodeExist(ItemInformation aItemInformation) { return (Json(!db.ItemInformations.Where(c => c.ItemInformationId != aItemInformation.ItemInformationId) .Any(c => c.ItemCode == aItemInformation.ItemCode), JsonRequestBehavior.AllowGet)); }
void Awake() { itemIcon = gameObject.transform.GetChild (0).GetComponent<Image> (); inventory = GameObject.FindGameObjectWithTag ("UI").transform.GetChild (1).GetComponent<PlayerInventory> (); manager = GameObject.FindGameObjectWithTag ("UI").GetComponent<UIManager> (); itemInformation = GameObject.FindGameObjectWithTag ("UI").transform.GetChild (1).GetChild (0).GetComponent<ItemInformation> (); }
public void OnDrop(PointerEventData eventData) { GameObject parentObject; parentObject = DragAndDrop.itemBeingDragged.transform.parent.gameObject; int inventoryNum1 = parentObject.transform.GetComponent <ItemInformation>().itemInventoryNum; int inventoryNum2 = transform.GetComponent <ItemInformation>().itemInventoryNum; DragAndDrop thisSlot; thisSlot = transform.GetComponentInChildren <DragAndDrop>(); if (transform.CompareTag(parentObject.tag) && transform.CompareTag("Inventory")) { thisSlot.transform.SetParent(parentObject.transform); DragAndDrop.itemBeingDragged.transform.SetParent(transform); playerInventory.SwapInventory(inventoryNum1, inventoryNum2); } else if (transform.CompareTag("Shop")) { int iteminft = DragAndDrop.itemBeingDragged.transform.parent.GetComponent <ItemInformation>().itemInventoryNum; shopManager.curItem = playerInventory.chractorInventory[iteminft - 1]; shopManager.BuytoShop(); } else if (transform.CompareTag("Inventory")) { ItemInformation iteminft = DragAndDrop.itemBeingDragged.transform.parent.GetComponent <ItemInformation>(); shopManager.curItem = DragAndDrop.itemBeingDragged.transform.parent.GetComponent <ItemInformation>().itemValue; shopManager.SelltoPlayer(); } }
public void setItemInfoId(int id) { this._id = id; if (itemSprite == null) { itemSprite = GetComponent <UISprite>(); } ItemInformation itemInfo = null; ItemManager._itemInstance.itemInfoDic.TryGetValue(id, out itemInfo); try { this.it = ItemManager._itemInstance.itemList.Find(v1 => v1.ItemInfo.Id == id); } catch (System.Exception e) { Debug.LogError(e.Message.ToString()); } if (itemInfo != null) { itemSprite.spriteName = itemInfo.Icon; UIButton btn = itemSprite.transform.GetComponent <UIButton>(); if (btn != null) { btn.hoverSprite = it.ItemInfo.Icon; btn.pressedSprite = it.ItemInfo.Icon; btn.disabledSprite = it.ItemInfo.Icon; } } }
static void Main(string[] args) { bool exit = false; List <RetailItem> Items = new List <RetailItem>() { new RetailItem("Jacket", 12, 59.05), new RetailItem("Jeans", 40, 34.95), new RetailItem("Shirt", 20, 24.95) }; do { Console.WriteLine(StandardMessages.Menu()); switch (Console.ReadLine()) { case "1": ItemInformation.CreateItemInformation(Items); break; case "2": exit = true; break; } Console.WriteLine(); } while (exit == false); }
// EmptyCell和ItemCell相关操作 public void UpdateBackPackCell(ItemInformation itemInfo, int count) { if (count == 0)//删除道具格子 { } else if (count == 1)//添加道具格子 { if (emptyCellList.Count <= itemCellList.Count) { for (int i = 0; i < cellCountPerRow; i++) { emptyCellList.Add(Instantiate(emptyCellPrefab, gridLayoutGroup.transform)); } UpdateGridLayoutGroupRectSize(); } EmptyCell emptyCell = emptyCellList.Find(targetCell => targetCell.isEmpty); ItemCell itemCell = Instantiate(itemCellPrefab); itemCell.Initialization(this, emptyCell, itemInfo); BindingBackPackCell(emptyCell, itemCell); itemCellList.Add(itemCell); } else if (count > 1)//更新道具数量显示 { ItemCell itemCell = itemCellList.Find(targetCell => targetCell.itemInfo.ID == itemInfo.ID); itemCell.UpdateItemCount(count); } }
public void Enter() { PlayerPrefs.SetString("Name", charName); PlayerPrefs.SetString("Gender", gender); if (gender == "Female") { PlayerPrefs.SetString("GenderSvHCapital", "She"); PlayerPrefs.SetString("GenderSvH", "she"); PlayerPrefs.SetString("GenderHvHCapital", "Her"); PlayerPrefs.SetString("GenderHvH", "her"); } else { PlayerPrefs.SetString("GenderSvHCapital", "He"); PlayerPrefs.SetString("GenderSvH", "he"); PlayerPrefs.SetString("GenderHvhCapital", "Him"); PlayerPrefs.SetString("GenderHvh", "him"); } PlayerPrefs.SetString("Crime", ItemInformation.GetCrimesMap(crime)); PlayerPrefs.SetString("Station", ItemInformation.GetStationsMap(station)); PlayerPrefsAddOns.SetColor("SkinTone", skinTone); PlayerPrefs.SetString("Hair", hair.ToString()); PlayerPrefsAddOns.SetColor("HairColor", hairColor); PlayerPrefsAddOns.SetColor("EyeColor", eyeColor); PlayerPrefs.SetString("Top", top.ToString()); PlayerPrefsAddOns.SetColor("TopColor", topColor); PlayerPrefs.SetString("Bottoms", bottoms.ToString()); PlayerPrefsAddOns.SetColor("BottomsColor", bottomsColor); PlayerPrefs.SetString("Shoes", shoes.ToString()); PlayerPrefsAddOns.SetColor("ShoesColor", shoesColor); }
/// <summary> /// 物品信息的初始化 /// 这个以后要改的 /// 单机游戏中 /// 商店的数量是没有上限的 /// </summary> void ReadItemListInfo() { if (textAsset != null) { string str = textAsset.ToString(); string[] listArray = str.Split("\n"[0]); foreach (string lineInfo in listArray) { //ID 名称 图标 类型(Equip,Drug) 装备类型(Helm,Cloth,Weapon,Shoes,Necklace,Bracelet,Ring,Wing) 售价 星级 //品质 伤害 生命 战斗力 作用类型 作用值 描述 string[] itemStr = lineInfo.Split("|"[0]); ItemInformation itemInfo = new ItemInformation(); itemInfo.Id = GameController.ParseInt(itemStr[0]); itemInfo.Name = itemStr[1]; itemInfo.Icon = itemStr[2]; itemInfo.Itemtype = GameController.GetItemType(itemStr[3]); itemInfo.EquType = GameController.GetEquipType(itemStr[4]); itemInfo.Price = GameController.ParseFloat(itemStr[5]); itemInfo.StarLevel = GameController.ParseInt(itemStr[6]); itemInfo.QualityLevel = GameController.ParseInt(itemStr[7]); itemInfo.Damage = GameController.ParseInt(itemStr[8]); itemInfo.Hp = GameController.ParseInt(itemStr[9]); itemInfo.FightPower = GameController.ParseInt(itemStr[10]); itemInfo.InfoType = GameController.GetPlayerInfoType(itemStr[11]); itemInfo.ApplyValue = GameController.ParseInt(itemStr[12]); itemInfo.Describe = itemStr[13]; //添加到字典 itemInfoDic.Add(itemInfo.Id, itemInfo); } } else { Debug.LogError("文本物品资源为空!"); } }
private void getItem_InformationComponent() { if (itemInformation == null) { itemInformation = this.GetComponent <ItemInformation>(); } }
private void HandleItemSpawn(Coordinate position, ItemInformation itemInformation, bool onPlace) { var cell = Cells.First(c => c.X == position.X && c.Y == position.Y); cell.IsOnItem = onPlace; cell.TeamColor = itemInformation == null ? null : GetItemColor(itemInformation); }
public void AddBackpackCell(ItemInformation itemInfo) { var cell = Instantiate(cellPrefab, node); cell.Initialization(this, itemInfo); cellList.Add(cell); }
private void Item_Click(object sender, RoutedEventArgs e) { MenuItem menuItem = (MenuItem)sender; var menu = (ContextMenu)(menuItem).Parent; var element = (StackPanel)menu.PlacementTarget; string item_name = (string)((Label)element.Children[1]).Content; ItemInformation item = item_array[item_name]; switch ((string)menuItem.Header) { case "Удалить": string path = item_array[item_name].Fullpath; DeleteElementAsunc(path, item_name); break; case "Копировать": ChangeCurrentOperation(DataOperations.copy); PathFrom = item.Fullpath; break; case "Вырезать": ChangeCurrentOperation(DataOperations.cut); PathFrom = item.Fullpath; break; case "Расшарить": ShareElementAsunc(item.Fullpath); break; } }
// Vii added public static Item CreateItemFromType(Type type, ItemInformation info) { try { Item item = Activator.CreateInstance(type) as Item; if (item == null) { return(null); } if (item is BaseInstrument) { ((BaseInstrument)item).Name = info.Name; ((BaseInstrument)item).Slayer = info.Slayer; ((BaseInstrument)item).Slayer2 = info.Slayer2; ((BaseInstrument)item).Quality = info.Quality; ((BaseInstrument)item).Crafter = info.Crafter; ((BaseInstrument)item).UsesRemaining = info.UsesRemaining; } return(item); } catch { } return(null); }
public StockEntry(Mod owner, ItemInformation itemInformation, int price = 0, int stock = ShopUtilities.Infinite) { Owner = owner; ItemInformation = itemInformation; Price = price; Stock = stock; }
public void OpenShoesMenu() { if (colorPicker != null) { colorPicker.SetActive(false); } if (shoesMenu != null) { shoesMenu.SetActive(true); } CloseHairMenu(); CloseTopMenu(); CloseBottomsMenu(); float x = -33.5f; float y = 160f; ButtonGroup buttons = shoesMenu.GetComponent <ButtonGroup>(); int count = 0; if (gender == "Female") { count = ItemInformation.GetFemaleShoesCount(); } else { count = ItemInformation.GetMaleShoesCount(); } for (int i = 0; i < count; i++) { GameObject option = (GameObject)GameObject.Instantiate(buttonPrefab, new Vector3(x, y, 0), Quaternion.identity); option.transform.SetParent(shoesMenu.transform, false); option.name = i.ToString(); Texture2D shoesTex; if (gender == "Female") { shoesTex = ItemInformation.GetFemaleShoes(shoes).tex; } else { shoesTex = ItemInformation.GetMaleShoes(shoes).tex; } option.transform.GetChild(0).GetComponent <Image>().sprite = Sprite.Create(shoesTex, new Rect(0, 0, shoesTex.width, shoesTex.height), new Vector2(0.5f, 0.5f)); option.transform.GetChild(0).GetComponent <Image>().color = bottomsColor; buttons.AddToButtons(option.GetComponent <Button>()); if (i == shoes) { buttons.currSelectedButton = option.GetComponent <Button>(); } if (i % 2 == 0) { x = 33.5f; } else { x = -33.5f; y -= 60; } } activeObj = "Shoes"; }
private void ElementCutWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ChangeCurrentOperation(DataOperations.none); ItemInformation res = (ItemInformation)e.Result; Contents.Children.Add(CreatePanelItem(res.Name, res.Type)); item_array.Add(res.Name, res); }
public StockEntry(Mod owner, ItemInformation itemInformation, ShopUtilities.CheckIfAddShopStock checkDelegate, int price = 0, int stock = ShopUtilities.Infinite) { Owner = owner; ItemInformation = itemInformation; CheckDelegate = checkDelegate; Price = price; Stock = stock; }
public ActionResult DeleteConfirmed(int id) { ItemInformation iteminformation = db.ItemInformations.Find(id); db.ItemInformations.Remove(iteminformation); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Start() { itemRigidBody = GetComponent <Rigidbody>(); mesh = gameObject.transform.GetChild(0); itemDataBase = GameObject.Find("GameManager").GetComponent <ItemDataBase>(); itemInformation = itemDataBase.availableItems[itemInformationID]; rotationValue = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); rotationSpeed = Random.Range(1.1f, 3); }
public void Initialization(BackPack backpack, EmptyCell emptyCell, ItemInformation itemInfo) { this.itemInfo = itemInfo; this.backpack = backpack; this.emptyCell = emptyCell; image.sprite = itemInfo.Sprite; gameObject.name = itemInfo.Name; UpdateItemCount(1); }
public void TransferItemData(ItemInformation thisItem) { curItemInfo = ItemInformation.DeepCopy(thisItem); if (textHolder != null) { textHolder.enabled = true; textHolder.text = "x" + curItemInfo.count; } }
private static ItemInformation SetEssentialItemInformation(ItemInformation itemInformation, string uniqueName) { if (itemInformation == null) { return(null); } itemInformation.Level = GetItemLevel(uniqueName); itemInformation.UniqueName = uniqueName; return(itemInformation); }
public static ItemInformation GetItemInformation(int index) { if (itemInfoList == null) { InitializeItemInfoList(); } ItemInformation go = itemInfoList.Find(a => a.ID == index); return(go); }
void directoryCreaterWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ItemInformation info; ItemInformation item = (ItemInformation)e.Result; if (!item_array.TryGetValue(item.Name, out info)) { item_array.Add(item.Name, item); Contents.Children.Insert(1, CreatePanelItem(item.Name, item.Type)); } }
/// <summary> /// Swap Items when both Inventory slot is occupied /// </summary> /// <param name="thisInfo"> Clicked slot information, so it can be saved to a temp. variable.</param> public void SwapItems(ItemInformation thisInfo) { ItemInformation informationHolder = thisInfo; // Set Image of this slot on hovered image clickedSlot.SetImage(hoveringSlot.itemImage.sprite); // Set Image from Item holder hoveringSlot.SetImage(itemHolder.imageHolder.sprite); clickedSlot.TransferItemData(hoveringSlot.curItemInfo); hoveringSlot.TransferItemData(informationHolder); }
public CheckoutMachine() { ItemInformation itemInfo = new ItemInformation(); AllItems = itemInfo.GetAllProductData(); ShoppingBasket = new Dictionary <Item, int>(); TotalPrice = 0; Logger = new Logger(); }
public ItemInformation GetItemDataBySKU(string SKU) { ItemInformation info = new ItemInformation(); info.ItemID = GetItemIDBySKU(SKU); info.ItemTitle = GetItemTitle(int.Parse(info.ItemID)); info.ItemNumber = GetItemNumberBySKU(SKU); info.SKU = SKU; info.ConsignmentID = GetItemConsignmentID(int.Parse(info.ItemID)); return(info); }
public AudioEngine() { engine = NAudioEngine.Instance; dbDataStore = new Database(); dbDataStore.Deserialize(); BitmapImage b = new BitmapImage(); b.BeginInit(); Uri uri = new System.Uri("pack://application:,,,/Resources/jewelcase_medium.png"); b.UriSource = uri; b.EndInit(); b.Freeze(); this.DefaultImage = b; iteminfo = new ItemInformation("artist", "album", "title", "year", "00", DefaultImage); }
/// <summary> /// The add. /// </summary> /// <param name="info"> /// The info. /// </param> public void Add(ItemInformation info) { Assert.ArgumentNotNull(info, "info"); content[this.Name].Add(info.ItemDefinition.ID, info); }
public void InsertItemInfo(ItemInformation item) { bonusBoxList.Items.Add(item); }
public void InsertItemInfo(ItemInformation item) { treasureBoxList.Items.Add(item); }
public void InitializeBonusBoxInfo(String boxinfo) { String json; using (System.IO.StreamReader reader = new System.IO.StreamReader(boxinfo)) { json = reader.ReadToEnd(); } dynamic items = JsonConvert.DeserializeObject(json); foreach (var y in items) { if (y.SavePath != null) { GlobalData.SavePath = y.SavePath; continue; } var item = new ItemInformation(); item.ID = y.ID; item.Map = y.Map; item.Offset = Convert.ToInt32((String)y.Offset, 16); item.Bit = y.Bit; item.Item = y.Item; item.Line = y.Line; item.File = y.File; item.TriggerX = (Double)y.TriggerX / 1000; item.TriggerZ = (Double)y.TriggerZ / 1000; item.TriggerY = (Double)y.TriggerY / 1000; item.TriggerRange = (Double)y.TriggerRange / 1000; item.ActorX = (Double)y.ActorX / 1000; item.ActorZ = (Double)y.ActorZ / 1000; item.ActorY = (Double)y.ActorY / 1000; item.TalkScenaIndex = y.TalkScenaIndex; item.TalkFunctionIndex = y.TalkFunctionIndex; item.Description = y.Description; item.Screenshot = y.Screenshot; ItemIdMap[item.ID] = item; } }
// Use this for initialization void Start() { // Information = GetComponent<ItemInformation>(); if (Information == null) Information = new ItemInformation(); image = GetComponent<Image>(); }