private void ShowILVL() { ItemRec record = StaticDB.itemDB.GetRecord(this.m_itemID); if (record == null) { Debug.LogWarning(string.Concat(new object[] { "Invalid Item ID ", this.m_itemID, " from Quest ID ", this.m_questID, ". Ignoring for showing iLevel on map." })); return; } if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gear) && (record.ClassID == 2 || record.ClassID == 3 || record.ClassID == 4 || record.ClassID == 6)) { WrapperItemStats?itemStats = ItemStatCache.instance.GetItemStats(this.m_itemID, this.m_itemContext, this.m_itemInstance); if (itemStats != null) { this.m_quantityArea.gameObject.SetActive(true); this.m_quantity.text = StaticDB.GetString("ILVL", null) + " " + itemStats.Value.ItemLevel; } else { ItemStatCache instance = ItemStatCache.instance; instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Combine(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated)); } } }
private void HandleArtifactKnowledgeInfoChanged() { if (!this.m_isArtifactResearch) { return; } ItemRec record = StaticDB.itemDB.GetRecord(this.m_charShipmentRec.DummyItemID); this.m_itemName.text = record.Display + this.GetCurrentArtifactPowerText(); this.ClearAndHideLootArea(); this.AddInventoryItems(); this.UpdateAKStatus(); this.UpdateItemSlots(); this.UpdateRecruitButtonState(); this.AddInventoryItems(); if (ArtifactKnowledgeData.s_artifactKnowledgeInfo != null && this.m_akLevelBefore != ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel) { this.m_artifactKnowledgeLevelIncreasedLabel.gameObject.SetActive(true); this.m_artifactKnowledgeLevelIncreasedLabel.text = string.Concat(new object[] { StaticDB.GetString("ARTIFACT_KNOWLEDGE_INCREASED_TO", "Artifact Knowledge Increased to"), " ", StaticDB.GetString("LVL", "LvL"), " ", ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel }); } else { this.m_artifactKnowledgeLevelIncreasedLabel.gameObject.SetActive(false); } }
public void SetArmament(WrapperFollowerArmamentExt item, int garrFollowerID) { this.m_garrFollowerID = garrFollowerID; this.m_item = item; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); this.m_armamentName.text = record.Display; SpellTooltipRec spellTooltipRec = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (spellTooltipRec == null) { this.m_armamentDescription.text = string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID }); } else { this.m_armamentDescription.text = spellTooltipRec.Description; } this.m_armamentDescription.text = WowTextParser.parser.Parse(this.m_armamentDescription.text, item.SpellID); if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_armamentIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Concat(string.Empty, record.IconFileDataID); } this.m_armamentQuantity.text = (item.Quantity <= 1 ? string.Empty : string.Concat(string.Empty, item.Quantity)); }
} // end PrintCurrData //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void PrintCurrentData(int changes) { /* *Purpose: Prints Changed database for today report *Pre: needs a database to print *Post: prints database that outlines today only */ ItemRec BookRec = new ItemRec(); // creates new record to store StreamWriter sw; // intialize writer sw = new StreamWriter(TODAY); // opens up writer for updated database // runs through main list and prints each sw.WriteLine("Updated Database: " + numBooks.ToString() + " Books with " + changes + " changes today"); sw.WriteLine(); sw.WriteLine("ISBN: " + "Fullname " + "# Own/Loan "); this.FirstPos(); for (int book = 0; book < this.GetLength(); book++) { BookRec = this.Retrieve();// gets record sw.WriteLine(BookRec.ISBN + SPACE + BookRec.authorName + SPACE + BookRec.numOwned.ToString() + SPACE + BookRec.numOnLoan.ToString()); this.NextPos(); // goes to next position } // ends main list sw.Close(); // end writer } // end PrintCurrData
public static string GetItemDescription(ItemRec itemRec) { string str; string empty = string.Empty; int num = ( from effectRec in StaticDB.itemEffectDB.GetRecordsByParentID(itemRec.ID) select effectRec.SpellID).FirstOrDefault <int>((int id) => id != 0); if (num > 0) { SpellTooltipRec record = StaticDB.spellTooltipDB.GetRecord(num); if (record == null) { Debug.Log(string.Concat("GetItemDescription: spellID ", num, " not found in spellTooltipDB.")); } else { str = empty; empty = string.Concat(new string[] { str, "<color=#", GeneralHelpers.s_friendlyColor, ">", WowTextParser.parser.Parse(record.Description, num), "</color>" }); } } if (itemRec.Description != null && itemRec.Description != string.Empty) { if (empty != string.Empty) { empty = string.Concat(empty, "\n\n"); } if (itemRec.ID != 141028 && itemRec.ID != 137565 && itemRec.ID != 137560 && itemRec.ID != 137561) { str = empty; empty = string.Concat(new string[] { str, "<color=#", GeneralHelpers.s_defaultColor, ">\"", WowTextParser.parser.Parse(itemRec.Description, 0), "\"</color>" }); } } return(empty); }
private void ItemUpdated(BaseItem item) { lock (_libraryChangedSyncLock) { if (WriteTimer == null) { WriteTimer = new Timer(TimerCallback, null, WriteDelay, Timeout.Infinite); } else { WriteTimer.Change(WriteDelay, Timeout.Infinite); } var itemRec = new ItemRec { Guid = item.Id, #if EMBY ItemId = item.GetClientId(), #endif Status = ItemStatus.Updated, Type = item.GetClientTypeName() }; _logger.LogDebug($"InfuseSync saving updated item {item.Id}"); _itemsUpdated.Add(itemRec); } }
public void SetArmament(MobileFollowerArmament item, FollowerDetailView followerDetailView) { this.m_armamentItem = item; this.m_followerDetailView = followerDetailView; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); this.m_equipmentName.set_text(GeneralHelpers.GetItemQualityColorTag(record.OverallQualityID) + record.Display + "</color>"); SpellTooltipRec record2 = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (record2 != null) { this.m_equipmentDescription.set_text(record2.Description); } else { this.m_equipmentDescription.set_text(string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID })); } this.m_equipmentDescription.set_text(WowTextParser.parser.Parse(this.m_equipmentDescription.get_text(), item.SpellID)); this.m_equipmentDescription.set_supportRichText(WowTextParser.parser.IsRichText()); if (this.m_iconErrorText != null) { this.m_iconErrorText.get_gameObject().SetActive(false); } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_equipmentIcon.set_sprite(sprite); } else if (this.m_iconErrorText != null) { this.m_iconErrorText.get_gameObject().SetActive(true); this.m_iconErrorText.set_text(string.Empty + record.IconFileDataID); } this.m_equipmentQuantity.set_text((item.Quantity <= 1) ? string.Empty : (string.Empty + item.Quantity)); JamGarrisonFollower jamGarrisonFollower = PersistentFollowerData.followerDictionary.get_Item(this.m_followerDetailView.GetCurrentFollower()); if (jamGarrisonFollower != null && jamGarrisonFollower.CurrentMissionID != 0) { this.m_useItemButtonLabel.set_text(StaticDB.GetString("ON_MISSION", null)); this.m_useItemButtonLabel.set_color(new Color(0.5f, 0.5f, 0.5f, 1f)); this.m_useItemButton.set_interactable(false); } else if (jamGarrisonFollower != null && (jamGarrisonFollower.ItemLevelArmor + jamGarrisonFollower.ItemLevelWeapon) / 2 >= 850) { this.m_useItemButtonLabel.set_text(FollowerInventoryListItem.m_maxiLevelString); this.m_useItemButtonLabel.set_color(new Color(0.5f, 0.5f, 0.5f, 1f)); this.m_useItemButton.set_interactable(false); } else { this.m_useItemButtonLabel.set_text(StaticDB.GetString("USE_ITEM", null)); } }
/* create new param */ public static void AddUserEffectSpecParam( UserEffectSpecRec Spec, out int Index) { ItemRec Item = new ItemRec(); Index = Spec.Items.Length; Array.Resize(ref Spec.Items, Spec.Items.Length + 1); Spec.Items[Index] = Item; Item.ParamEnvelope = NewEnvelope(); Item.ParamLFO = NewLFOListSpecifier(); }
private void SetCharShipmentItem(CharShipmentRec charShipmentRec) { ItemRec record = StaticDB.itemDB.GetRecord(charShipmentRec.DummyItemID); if (record == null) { return; } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_troopPortraitImage.sprite = sprite; } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void StoreData(string inputFile) { /* *Purpose: Stores data into records *Pre: needs the file books to a record *Post: fills a list of structs (records) */ // variables StreamReader sr; // reader string info, fName, lName; // holds lines of record info, and names int spcLoc; int pos = 0; numBooks = 0; //intialize pdm counter sr = new StreamReader(inputFile); // opens file info = sr.ReadLine(); // read next line of file while (info != EOF) // while not end of file { ItemRec BookRec = new ItemRec(); // creates new record spcLoc = info.IndexOf(SPACE); // gets space location BookRec.ISBN = info.Substring(pos, spcLoc); // gets book id info = info.Remove(pos, spcLoc + ONE); // whittles down info spcLoc = info.IndexOf(SPACE);// gets space location fName = info.Substring(pos, spcLoc); // get first name info = info.Remove(pos, spcLoc + ONE);// whittles down info spcLoc = info.IndexOf(SPACE);// gets space location lName = info.Substring(pos, spcLoc); // get last name info = info.Remove(pos, spcLoc + ONE);// whittles down info BookRec.authorName = fName + SPACE + lName; // finds name spcLoc = info.IndexOf(SPACE);// gets space location // gets # of owned books BookRec.numOwned = Convert.ToByte(info.Substring(pos, spcLoc)); info = info.Remove(pos, spcLoc + ONE);// whittles down info // gets # of loaned books BookRec.numOnLoan = Convert.ToByte(info.Substring(pos)); this.Insert(BookRec); // inserts to main list numBooks++; // adds to num books info = sr.ReadLine(); // read next line of file } // end while } // end store data
private void ItemRemoved(BaseItem item) { lock (_libraryChangedSyncLock) { if (WriteTimer == null) { WriteTimer = new Timer(TimerCallback, null, WriteDelay, Timeout.Infinite); } else { WriteTimer.Change(WriteDelay, Timeout.Infinite); } #if EMBY long?seriesId; #else Guid?seriesId; #endif int?seasonNumber; if (item is Season season) { seriesId = season.SeriesId; seasonNumber = season.IndexNumber; } else { seriesId = null; seasonNumber = null; } var itemRec = new ItemRec { Guid = item.Id, #if EMBY ItemId = item.GetClientId(), #endif SeriesId = seriesId, Season = seasonNumber, Status = ItemStatus.Removed, Type = item.GetClientTypeName() }; _logger.LogDebug($"InfuseSync saving removed item {item.Id}"); _itemsRemoved.Add(itemRec); } }
//hàm khởi ₫ộng các giá tr5i ₫ầu của chương trình static void Khoidong() { int i, j; int row, col; String buf; do //chờ nhập kích thước bàn cờ { Console.Write("Nhập số hàng (cột) của bàn cờ: "); buf = Console.ReadLine(); Size = Int32.Parse(buf); } while (Size <= 3 || Size > 9); do //chờ nhập chỉ số hàng xuất phát { Console.Write("Nhập chỉ số hàng xuất phát của con mã : "); buf = Console.ReadLine(); row = Int32.Parse(buf); } while (row < 0 || Size <= row); do //chờ nhập chỉ số cột xuất phát { Console.Write("Nhập chỉ số cột xuất phát của con mã : "); buf = Console.ReadLine(); col = Int32.Parse(buf); } while (col < 0 || Size <= col); //phân phối vùng nhớ chứa array Banco và danh sach Nuocdi Banco = new int[Size, Size]; Nuocdi = new ItemRec[Size * Size]; for (i = 0; i < Size * Size; i++) { Nuocdi[i] = new ItemRec(); } //khởi ₫ộng trạng thái ₫ầu cho các vị trí for (i = 0; i < Size; i++) { for (j = 0; j < Size; j++) { Banco[i, j] = -1; // con mã chưa ₫i qua ô [i,j] } } SoNghiem = 0; // Thiết lập nước ₫i ₫ầu tiên của con mã Nuocdi[0].x = col; Nuocdi[0].y = row; Nuocdi[0].huong = 0; SoNuocdi = 0; //chọn khả năng ₫i tiếp của vị trí ₫ầu tiên của con mã Banco[Nuocdi[SoNuocdi].x, Nuocdi[SoNuocdi].y] = 0; }
private void SetCharShipmentItem(MobileClientShipmentType shipmentType, CharShipmentRec charShipmentRec, bool isSealOfFateHack = false) { this.m_rightStackLayoutElement.minHeight = 120f; this.m_isTroop = false; this.m_charShipmentRec = charShipmentRec; this.m_troopSpecificArea.SetActive(false); this.m_itemSpecificArea.SetActive(true); this.m_troopName.gameObject.SetActive(false); this.m_itemName.gameObject.SetActive(true); ItemRec record = StaticDB.itemDB.GetRecord(charShipmentRec.DummyItemID); if (record == null) { Debug.LogError("Invalid Item ID: " + charShipmentRec.DummyItemID); this.m_troopName.text = "Invalid Item ID: " + charShipmentRec.DummyItemID; return; } this.m_itemDisplay.InitReward(MissionRewardDisplay.RewardType.item, charShipmentRec.DummyItemID, 1, 0, record.IconFileDataID); this.m_isArtifactResearch = (record.ID == 139390 || record.ID == 146745); this.m_itemName.text = record.Display + ((!this.m_isArtifactResearch) ? string.Empty : this.GetCurrentArtifactPowerText()); Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_troopSnapshotImage.sprite = sprite; } this.m_itemResourceCostText.gameObject.SetActive(!isSealOfFateHack); this.m_itemResourceIcon.gameObject.SetActive(!isSealOfFateHack); if (!isSealOfFateHack) { this.m_itemResourceCostText.text = string.Empty + shipmentType.CurrencyCost; Sprite sprite2 = GeneralHelpers.LoadCurrencyIcon(shipmentType.CurrencyTypeID); if (sprite2 != null) { this.m_itemResourceIcon.sprite = sprite2; } } this.UpdateAKStatus(); this.UpdateItemSlots(); this.UpdateRecruitButtonState(); }
public void SetArmament(MobileFollowerArmament item, int garrFollowerID) { this.m_garrFollowerID = garrFollowerID; this.m_item = item; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); this.m_armamentName.set_text(record.Display); SpellTooltipRec record2 = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (record2 != null) { this.m_armamentDescription.set_text(record2.Description); } else { this.m_armamentDescription.set_text(string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID })); } this.m_armamentDescription.set_text(WowTextParser.parser.Parse(this.m_armamentDescription.get_text(), item.SpellID)); if (this.m_iconErrorText != null) { this.m_iconErrorText.get_gameObject().SetActive(false); } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_armamentIcon.set_sprite(sprite); } else if (this.m_iconErrorText != null) { this.m_iconErrorText.get_gameObject().SetActive(true); this.m_iconErrorText.set_text(string.Empty + record.IconFileDataID); } this.m_armamentQuantity.set_text((item.Quantity <= 1) ? string.Empty : (string.Empty + item.Quantity)); }
} // end checker //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void PrintCurrentData() { /* *Purpose: Prints Changed database for tomorrow's use *Pre: needs a database to print *Post: prints database */ ItemRec BookRec = new ItemRec(); // creates new record to store StreamWriter sw; // intialize writer sw = new StreamWriter(UPDATED); // opens up writer for updated database // runs through main list and prints each this.FirstPos(); for (int book = 0; book < this.GetLength(); book++) { BookRec = this.Retrieve();// gets record sw.WriteLine(BookRec.ISBN + SPACE + BookRec.authorName + SPACE + BookRec.numOwned.ToString() + SPACE + BookRec.numOnLoan.ToString()); this.NextPos(); // goes to next position } // ends main list sw.Close(); // end writer } // end PrintCurrData
public void AddInventoryItems() { if (this.m_isArtifactResearch) { ItemRec record = StaticDB.itemDB.GetRecord(this.m_charShipmentRec.DummyItemID); if (record == null) { return; } MissionRewardDisplay[] componentsInChildren = this.m_lootItemArea.GetComponentsInChildren <MissionRewardDisplay>(); foreach (MissionRewardDisplay missionRewardDisplay in componentsInChildren) { Object.DestroyImmediate(missionRewardDisplay.gameObject); } for (int j = 0; j < ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInBags; j++) { MissionRewardDisplay missionRewardDisplay2 = Object.Instantiate <MissionRewardDisplay>(this.m_artifactResearchNotesDisplayPrefab); missionRewardDisplay2.transform.SetParent(this.m_lootItemArea.transform, false); missionRewardDisplay2.InitReward(MissionRewardDisplay.RewardType.item, record.ID, 1, 0, record.IconFileDataID); UiAnimMgr.instance.PlayAnim("ItemReadyToUseGlowLoop", missionRewardDisplay2.transform, Vector3.zero, 1.2f, 0f); } this.m_lootDisplayArea.SetActive(ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInBags > 0); } }