public void UpdateEquipmentTab() { tabPageEquipment.Controls.Clear(); EquipmentTab lvCharEquip = new EquipmentTab(); tabPageEquipment.Controls.Add(lvCharEquip); }
private void SetFilterToEquipment() { Dictionary <int, string> dictionary = new Dictionary <int, string>(); IEnumerator enumerator = Enum.GetValues(typeof(EquipmentTab)).GetEnumerator(); try { while (enumerator.MoveNext()) { EquipmentTab key = (EquipmentTab)enumerator.Current; string text = key.ToString(); StringBuilder stringBuilder = new StringBuilder("EQUIPMENT_TAB_"); stringBuilder.Append(text.ToUpper()); dictionary.Add((int)key, this.lang.Get(stringBuilder.ToString(), new object[0])); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } this.filterHelper = new EquipmentTabHelper(); this.filterHelper.CreateTabs(this, new Action(this.RefreshGrids), dictionary, 0); }
public void SetupTabs() { tabPageChar.Controls.Clear(); PlayerTab lvCharPlayer = new PlayerTab(); tabPageChar.Controls.Add(lvCharPlayer); tabPageStat.Controls.Clear(); frmStats lvCharStat = new frmStats(); tabPageStat.Controls.Add(lvCharStat); tabPageTrait.Controls.Clear(); TraitTab lvCharTrait = new TraitTab(); tabPageTrait.Controls.Add(lvCharTrait); tabPageEquipment.Controls.Clear(); EquipmentTab lvCharEquip = new EquipmentTab(); tabPageEquipment.Controls.Add(lvCharEquip); tabPageVehicle.Controls.Clear(); VehicleTab lvCharVehicle = new VehicleTab(); tabPageVehicle.Controls.Add(lvCharVehicle); tabPageActions.Controls.Clear(); Actions lvActions = new Actions(); tabPageActions.Controls.Add(lvActions); }
void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender is TabControl) { EquipmentTab.GetData(); MaintenanceTab.GetData(); e.Handled = true; } }
/** * Render equipment tab dynamically (add it to the TabControl) */ public void LoadEquipmentTab() { TabPage equipmentTabPage = new TabPage("Equipment"); EquipmentTab equipmentTab = new EquipmentTab(); equipmentTab.DataSetId = Constants.EQUIPMENT_DATASET_ID; equipmentTab.PagedDataProvider = _presenter; equipmentTab.PageSize = 10; equipmentTab.SelectPage(1); equipmentTabPage.Controls.Add(equipmentTab); tabOrganization.TabPages.Add(equipmentTabPage); }
private void PopulateEquipmentGrid() { EquipmentUpgradeCatalog equipmentUpgradeCatalog = Service.EquipmentUpgradeCatalog; CurrentPlayer currentPlayer = Service.CurrentPlayer; this.FindAllUpgradableEquipment(currentPlayer, equipmentUpgradeCatalog); int maxItemsPerLine = (this.equipmentToDisplay.Count + 1) / 2; this.equipmentGrid.MaxItemsPerLine = maxItemsPerLine; EquipmentTabHelper equipmentTabHelper = this.filterHelper as EquipmentTabHelper; EquipmentTab currentTab = (EquipmentTab)equipmentTabHelper.CurrentTab; List <UXElement> list = new List <UXElement>(); int i = 0; int count = this.equipmentToDisplay.Count; while (i < count) { EquipmentVO equipmentVO = this.equipmentToDisplay[i]; if (equipmentTabHelper.IsEquipmentValidForTab(equipmentVO, currentTab)) { if (this.contractHidden) { EquipmentVO nextLevel = equipmentUpgradeCatalog.GetNextLevel(equipmentVO); if (nextLevel.Uid == this.activeContract.ProductUid) { this.contractHidden = false; } } UXElement item = this.FetchEquipmentCardGridItem(currentPlayer, equipmentVO, equipmentUpgradeCatalog); list.Add(item); } i++; } UXUtils.SortListForTwoRowGrids(list, this.equipmentGrid); int j = 0; int count2 = list.Count; while (j < count2) { this.equipmentGrid.AddItem(list[j], j); j++; } list.Clear(); this.equipmentGrid.RepositionItemsFrameDelayed(new UXDragDelegate(this.FinishEquipmentGridSetup), 1); this.CheckActiveContract(); }
public BotManagerView(Machine machine) { try { Machine = machine; VirindiViewService.XMLParsers.Decal3XMLParser parser = new VirindiViewService.XMLParsers.Decal3XMLParser(); parser.ParseFromResource("ACManager.Views.botManagerView.xml", out ViewProperties Properties, out ControlGroup Controls); View = new HudView(Properties, Controls); ConfigTab = new ConfigTab(this); PortalsTab = new PortalsTab(this); GemsTab = new GemsTab(this); AdvertisementsTab = new AdvertisementsTab(this); InventoryTab = new InventoryTab(this); EquipmentTab = new EquipmentTab(this); } catch (Exception ex) { Debug.LogException(ex); } }
void SelectTab(EquipmentTab tab) { ClearChildren(); selectedTab = tab; if (tab == EquipmentTab.ArmorTab) { Debug.Log("EqC: Armor Tab"); ClearInspection(); //ARMOR if (player.EquippedArmor) { EquippedCard.SetData(player.EquippedArmor.ItemName, "", player.EquippedArmor.IconSprite, player.EquippedArmor.DamageBlock); } else { EquippedCard.SetData("Nude!?", "", null, player.BlockDamage); } //ArmorTab.transform.position += new Vector3(0, -1 * TabSelectedOffset, 0); (ArmorTab.transform as RectTransform).anchoredPosition = new Vector2(0, -1 * TabSelectedOffset); (WeaponTab.transform as RectTransform).anchoredPosition = Vector2.zero; FillAvailableArmors(); } else { Debug.Log("EqC: Weapon Tab"); ClearInspection(); //WEAPON if (player.EquippedWeapon) { EquippedCard.SetData(player.EquippedWeapon.ItemName, "", player.EquippedWeapon.IconSprite, player.EquippedWeapon.MinDamage, player.EquippedWeapon.MaxDamage); } else { EquippedCard.SetData("Unarmed", "", null, player.AttackDamage, player.AttackDamage); } (ArmorTab.transform as RectTransform).anchoredPosition = Vector2.zero; (WeaponTab.transform as RectTransform).anchoredPosition = new Vector2(0, -1 * TabSelectedOffset); FillAvailableWeapons(); } }
private List <EquipmentVO> GenerateInactiveEquipmentList() { CurrentPlayer currentPlayer = Service.CurrentPlayer; IDictionary <string, int> levels = currentPlayer.UnlockedLevels.Equipment.Levels; EquipmentUpgradeCatalog equipmentUpgradeCatalog = Service.EquipmentUpgradeCatalog; List <string> iDCollection = equipmentUpgradeCatalog.GetIDCollection(); List <SortableEquipment> list = new List <SortableEquipment>(); EquipmentTab currentTab = (EquipmentTab)this.equipmentTabs.CurrentTab; int i = 0; int count = iDCollection.Count; while (i < count) { string text = iDCollection[i]; int level = 1; if (levels.ContainsKey(text)) { level = levels[text]; } EquipmentVO byLevel = equipmentUpgradeCatalog.GetByLevel(text, level); if (currentPlayer.Faction == byLevel.Faction && !currentPlayer.ActiveArmory.Equipment.Contains(byLevel.Uid)) { if (this.equipmentTabs.IsEquipmentValidForTab(byLevel, currentTab)) { list.Add(new SortableEquipment(currentPlayer, byLevel)); } } i++; } ArmorySortUtils.SortWithPriorityList(list, new List <EquipmentSortMethod> { EquipmentSortMethod.UnlockedEquipment, EquipmentSortMethod.RequirementsMet, EquipmentSortMethod.Quality, EquipmentSortMethod.CurrentPlanet, EquipmentSortMethod.CapacitySize, EquipmentSortMethod.Alphabetical }); return(ArmorySortUtils.RemoveWrapper(list)); }
//NOTE Add combat order list //NOTE Add status label - Poisoned, Driving, Overencumbered, etc private void frmVisualator_Load(object sender, EventArgs e) { Client.Connect(); cvAudio = new Audio("Theme.mp3"); cvAudio.Ending += new System.EventHandler(this.Music_ClipEnded); Player.Merit = new string[10]; Player.Flaw = new string[10]; Player.Equipment = new string[10]; Player.Weapon = new string[5]; Player.Armor = new string[3]; Player.Discipline = new string[9]; Player.Disc_Level = new int[9]; Player.Vehicle = new string[4]; Discipline.DisciplineTable = new DataTable(); Discipline.DisciplineTable.Columns.Add("Name"); Discipline.DisciplineTable.Columns.Add("Level"); Discipline.DisciplineTable.Columns.Add("LevelName"); Discipline.DisciplineTable.Columns.Add("Action"); Discipline.DisciplineTable.Columns.Add("Attribute"); Discipline.DisciplineTable.Columns.Add("Skill"); Discipline.DisciplineTable.Columns.Add("Willpower_Cost"); Discipline.DisciplineTable.Columns.Add("Vitae_Cost"); Discipline.DisciplineTable.Columns.Add("Resist_Attribute"); Discipline.DisciplineTable.Columns.Add("Resist_Skill"); Discipline.DisciplineTable.Columns.Add("Description"); Discipline.DisciplineTable.Columns.Add("Image"); Trait.TraitTable = new DataTable(); Trait.TraitTable.Columns.Add("Name"); Trait.TraitTable.Columns.Add("Type"); Trait.TraitTable.Columns.Add("Cost"); Trait.TraitTable.Columns.Add("Attribute"); Trait.TraitTable.Columns.Add("Skill"); Trait.TraitTable.Columns.Add("Bonus"); Trait.TraitTable.Columns.Add("Impairment"); Trait.TraitTable.Columns.Add("Automatic"); Trait.TraitTable.Columns.Add("Description"); Player.Vehicle_Cargo = new DataTable(); Player.Vehicle_Cargo.Columns.Add("VehicleIndex"); Player.Vehicle_Cargo.Columns.Add("Item"); using (StreamReader r = new StreamReader("Disciplines\\Discipline.txt")) { int x = 0; string line; while ((line = r.ReadLine()) != null) { x++; int i = line.IndexOf("=") + 1; if (line.StartsWith("Discipline")) { Discipline.Name = line.Substring(i, line.Length - i); } if (line.StartsWith("Level")) { Discipline.Level = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Name")) { Discipline.LevelName = line.Substring(i, line.Length - i); } if (line.StartsWith("Action")) { Discipline.Action = line.Substring(i, line.Length - i); } if (line.StartsWith("Attribute")) { Discipline.Attribute = line.Substring(i, line.Length - i); } if (line.StartsWith("Skill")) { Discipline.Skill = line.Substring(i, line.Length - i); } if (line.StartsWith("Willpower_Cost")) { Discipline.Willpower_Cost = line.Substring(i, line.Length - i); } if (line.StartsWith("Vitae_Cost")) { Discipline.Vitae_Cost = line.Substring(i, line.Length - i); } if (line.StartsWith("Resist_Attribute")) { Discipline.Resist_Attribute = line.Substring(i, line.Length - i); } if (line.StartsWith("Resist_Skill")) { Discipline.Resist_Skill = line.Substring(i, line.Length - i); } if (line.StartsWith("Description")) { Discipline.Description = line.Substring(i, line.Length - i); } if (line.StartsWith("Image")) { Discipline.Image = line.Substring(i, line.Length - i); } if (x > 11) { Discipline.DisciplineTable.Rows.Add(Discipline.Name, Discipline.Level, Discipline.LevelName, Discipline.Action, Discipline.Attribute, Discipline.Skill, Discipline.Willpower_Cost, Discipline.Vitae_Cost, Discipline.Resist_Attribute, Discipline.Resist_Skill, Discipline.Description, Discipline.Image); x = 0; } } } using (StreamReader r = new StreamReader("Traits\\Trait.txt")) { int x = 0; string line; while ((line = r.ReadLine()) != null) { x++; int i = line.IndexOf("=") + 1; if (line.StartsWith("Name")) { Trait.Name = line.Substring(i, line.Length - i); } if (line.StartsWith("Type")) { Trait.Type = line.Substring(i, line.Length - i); } if (line.StartsWith("Cost")) { Trait.Cost = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Attribute")) { Trait.Attribute = line.Substring(i, line.Length - i); } if (line.StartsWith("Skill")) { Trait.Skill = line.Substring(i, line.Length - i); } if (line.StartsWith("Bonus")) { Trait.Bonus = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Impairment")) { Trait.Impairment = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Automatic")) { Trait.Automatic = line.Substring(i, line.Length - i); } if (line.StartsWith("Description")) { Trait.Description = line.Substring(i, line.Length - i); } if (x > 8) { Trait.TraitTable.Rows.Add(Trait.Name, Trait.Type, Trait.Cost, Trait.Attribute, Trait.Skill, Trait.Bonus, Trait.Impairment, Trait.Automatic, Trait.Description); x = 0; } } } //TODO: set character to a global variable using (StreamReader r = new StreamReader("Characters\\Coco.txt")) { int m = 0; int f = 0; int q = 0; int w = 0; int a = 0; int d = 0; int l = 0; int v = 0; string line; while ((line = r.ReadLine()) != null) { int i = line.IndexOf("=") + 1; if (line.StartsWith("Name")) { Player.Name = line.Substring(i, line.Length - i); } if (line.StartsWith("Type")) { Player.Type = line.Substring(i, line.Length - i); } if (line.StartsWith("Player")) { Player.PlayerName = line.Substring(i, line.Length - i); } if (line.StartsWith("Experience")) { Player.Experience = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Concept")) { Player.Concept = line.Substring(i, line.Length - i); } if (line.StartsWith("Clan")) { Player.Clan = line.Substring(i, line.Length - i); } if (line.StartsWith("Virtue")) { Player.Virtue = line.Substring(i, line.Length - i); } if (line.StartsWith("Covenant")) { Player.Covenant = line.Substring(i, line.Length - i); } if (line.StartsWith("Chronicle")) { Player.Chronicle = line.Substring(i, line.Length - i); } if (line.StartsWith("Vice")) { Player.Vice = line.Substring(i, line.Length - i); } if (line.StartsWith("Coterie")) { Player.Coterie = line.Substring(i, line.Length - i); } if (line.StartsWith("Image")) { Player.Image = line.Substring(i, line.Length - i); } if (line.StartsWith("Intelligence")) { Player.Intelligence = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Wits")) { Player.Wits = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Resolve")) { Player.Resolve = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Strength")) { Player.Strength = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Dexterity")) { Player.Dexterity = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Stamina")) { Player.Stamina = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Presence")) { Player.Presence = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Manipulation")) { Player.Manipulation = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Composure")) { Player.Composure = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Academics")) { Player.Academics = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Computer")) { Player.Computer = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Investigation")) { Player.Investigation = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Medicine")) { Player.Medicine = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Occult")) { Player.Occult = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Politics")) { Player.Politics = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Science")) { Player.Science = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Athletics")) { Player.Athletics = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Brawl")) { Player.Brawl = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Drive")) { Player.Drive = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Firearms")) { Player.Firearms = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Stealth")) { Player.Stealth = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Survival")) { Player.Survival = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Weaponry")) { Player.Weaponry = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("AnimalKen")) { Player.AnimalKen = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Empathy")) { Player.Empathy = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Intimidation")) { Player.Intimidation = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Persuasion")) { Player.Persuasion = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Socialize")) { Player.Socialize = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Streetwise")) { Player.Streetwise = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Subterfuge")) { Player.Subterfuge = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Expression")) { Player.Expression = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Larceny")) { Player.Larceny = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Crafts")) { Player.Crafts = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Willpower")) { Player.Willpower = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Humanity")) { Player.Humanity = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Health")) { Player.Health = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("BloodPotency")) { Player.Potency = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Vitae")) { Player.Vitae = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Size")) { Player.Size = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Defense")) { Player.Defense = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Initiative")) { Player.Initiative = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Cash")) { Player.Cash = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Speed")) { Player.Speed = Convert.ToInt32(line.Substring(i, line.Length - i)); } if (line.StartsWith("Merit")) { Player.Merit.SetValue(line.Substring(i, line.Length - i), m); m++; } if (line.StartsWith("Flaw")) { Player.Flaw.SetValue(line.Substring(i, line.Length - i), f); f++; } if (line.StartsWith("Equipment")) { Player.Equipment.SetValue(line.Substring(i, line.Length - i), q); q++; } if (line.StartsWith("Weapons")) { Player.Weapon.SetValue(line.Substring(i, line.Length - i), w); w++; } if (line.StartsWith("Armor")) { Player.Armor.SetValue(line.Substring(i, line.Length - i), a); a++; } if (line.StartsWith("Discipline")) { Player.Discipline.SetValue(line.Substring(i, line.Length - i), d); d++; } if (line.StartsWith("Disc_Level")) { Player.Disc_Level.SetValue(Convert.ToInt32(line.Substring(i, line.Length - i)), l); l++; } if (line.StartsWith("Vehicle")) { Player.Vehicle.SetValue(line.Substring(i, line.Length - i), v); v++; } if (line.StartsWith("Cargo")) { Player.Vehicle_Cargo.Rows.Add(v - 1, line.Substring(i, line.Length - i)); } } } #region Change screen by player type switch (Player.Type) { case "Werewolf": this.BackColor = Color.Sienna; pnlInteractive.BackgroundImage = Properties.Resources.Wolf_Logo; tabPageDiscipline.Text = "Rites"; lblVitae.Text = "Essence"; lblPotency.Text = "Primal Urge"; lblHumanity.Text = "Harmony"; break; case "Mage": this.BackColor = Color.DarkGreen; pnlInteractive.BackgroundImage = Properties.Resources.Mage_Logo; tabPageDiscipline.Text = "Spells"; lblVitae.Text = "Mana"; lblPotency.Text = "Gnosis"; lblHumanity.Text = "Wisdom"; break; case "Hunter": this.BackColor = Color.Black; pnlInteractive.BackgroundImage = Properties.Resources.Hunter_Logo; tabPageDiscipline.Text = "Tactics"; lblVitae.Text = "Unused"; lblPotency.Text = "Unused"; lblHumanity.Text = "Morality"; break; default: this.BackColor = Color.DarkRed; pnlInteractive.BackgroundImage = Properties.Resources.Vamp_Logo; break; } #endregion #region Potency if (Player.Potency > 0) { rdoPotency1.Checked = true; } if (Player.Potency > 1) { rdoPotency2.Checked = true; } if (Player.Potency > 2) { rdoPotency3.Checked = true; } if (Player.Potency > 3) { rdoPotency4.Checked = true; } if (Player.Potency > 4) { rdoPotency5.Checked = true; } if (Player.Potency > 5) { rdoPotency6.Checked = true; } if (Player.Potency > 6) { rdoPotency7.Checked = true; } if (Player.Potency > 7) { rdoPotency8.Checked = true; } if (Player.Potency > 8) { rdoPotency9.Checked = true; } if (Player.Potency > 9) { rdoPotency10.Checked = true; } #endregion #region Humanity if (Player.Humanity > 0) { rdoHumanity1.Checked = true; } if (Player.Humanity > 1) { rdoHumanity2.Checked = true; } if (Player.Humanity > 2) { rdoHumanity3.Checked = true; } if (Player.Humanity > 3) { rdoHumanity4.Checked = true; } if (Player.Humanity > 4) { rdoHumanity5.Checked = true; } if (Player.Humanity > 5) { rdoHumanity6.Checked = true; } if (Player.Humanity > 6) { rdoHumanity7.Checked = true; } if (Player.Humanity > 7) { rdoHumanity8.Checked = true; } if (Player.Humanity > 8) { rdoHumanity9.Checked = true; } if (Player.Humanity > 9) { rdoHumanity10.Checked = true; } #endregion #region Willpower if (Player.Willpower > 0) { rdoWill1.Checked = true; chkWill1.Checked = true; } if (Player.Willpower > 1) { rdoWill2.Checked = true; chkWill2.Checked = true; } if (Player.Willpower > 2) { rdoWill3.Checked = true; chkWill3.Checked = true; } if (Player.Willpower > 3) { rdoWill4.Checked = true; chkWill4.Checked = true; } if (Player.Willpower > 4) { rdoWill5.Checked = true; chkWill5.Checked = true; } if (Player.Willpower > 5) { rdoWill6.Checked = true; chkWill6.Checked = true; } if (Player.Willpower > 6) { rdoWill7.Checked = true; chkWill7.Checked = true; } if (Player.Willpower > 7) { rdoWill8.Checked = true; chkWill8.Checked = true; } if (Player.Willpower > 8) { rdoWill9.Checked = true; chkWill9.Checked = true; } if (Player.Willpower > 9) { rdoWill10.Checked = true; chkWill10.Checked = true; } #endregion #region Health if (Player.Health > 0) { rdoHealth1.Checked = true; chkHealth1.Checked = true; } if (Player.Health > 1) { rdoHealth2.Checked = true; chkHealth2.Checked = true; } if (Player.Health > 2) { rdoHealth3.Checked = true; chkHealth3.Checked = true; } if (Player.Health > 3) { rdoHealth4.Checked = true; chkHealth4.Checked = true; } if (Player.Health > 4) { rdoHealth5.Checked = true; chkHealth5.Checked = true; } if (Player.Health > 5) { rdoHealth6.Checked = true; chkHealth6.Checked = true; } if (Player.Health > 6) { rdoHealth7.Checked = true; chkHealth7.Checked = true; } if (Player.Health > 7) { rdoHealth8.Checked = true; chkHealth8.Checked = true; } if (Player.Health > 8) { rdoHealth9.Checked = true; chkHealth9.Checked = true; } if (Player.Health > 9) { rdoHealth10.Checked = true; chkHealth10.Checked = true; } if (Player.Health > 10) { rdoHealth11.Checked = true; chkHealth11.Checked = true; } if (Player.Health > 11) { rdoHealth12.Checked = true; chkHealth12.Checked = true; } #endregion #region Vitae if (Player.Vitae > 0) { chkVitae1.Checked = true; } if (Player.Vitae > 1) { chkVitae2.Checked = true; } if (Player.Vitae > 2) { chkVitae3.Checked = true; } if (Player.Vitae > 3) { chkVitae4.Checked = true; } if (Player.Vitae > 4) { chkVitae5.Checked = true; } if (Player.Vitae > 5) { chkVitae6.Checked = true; } if (Player.Vitae > 6) { chkVitae7.Checked = true; } if (Player.Vitae > 7) { chkVitae8.Checked = true; } if (Player.Vitae > 8) { chkVitae9.Checked = true; } if (Player.Vitae > 9) { chkVitae10.Checked = true; } if (Player.Vitae > 10) { chkVitae11.Checked = true; } if (Player.Vitae > 11) { chkVitae12.Checked = true; } if (Player.Vitae > 12) { chkVitae13.Checked = true; } if (Player.Vitae > 13) { chkVitae14.Checked = true; } if (Player.Vitae > 14) { chkVitae15.Checked = true; } if (Player.Vitae > 15) { chkVitae16.Checked = true; } if (Player.Vitae > 16) { chkVitae17.Checked = true; } if (Player.Vitae > 17) { chkVitae18.Checked = true; } if (Player.Vitae > 18) { chkVitae19.Checked = true; } if (Player.Vitae > 19) { chkVitae20.Checked = true; } #endregion lblExperience.Text = Player.Experience.ToString(); PlayerTab lvCharPlayer = new PlayerTab(); tabPageChar.Controls.Add(lvCharPlayer); frmStats lvCharStat = new frmStats(); tabPageStat.Controls.Add(lvCharStat); TraitTab lvCharTrait = new TraitTab(); tabPageTrait.Controls.Add(lvCharTrait); DisciplineTab lvCharDisc = new DisciplineTab(); tabPageDiscipline.Controls.Add(lvCharDisc); EquipmentTab lvCharEquip = new EquipmentTab(); tabPageEquipment.Controls.Add(lvCharEquip); VehicleTab lvCharVehicle = new VehicleTab(); tabPageVehicle.Controls.Add(lvCharVehicle); tabPageCombat.Controls.Add(cvChatCombat); tabPageAll.Controls.Add(cvChatAll); }
public bool IsEquipmentValidForTab(EquipmentVO vo, EquipmentTab selectedTab) { if (selectedTab == EquipmentTab.All) { return(true); } TroopUpgradeCatalog troopUpgradeCatalog = Service.Get <TroopUpgradeCatalog>(); IDataController dataController = Service.Get <IDataController>(); if (vo.EffectUids == null) { return(false); } int i = 0; int num = vo.EffectUids.Length; while (i < num) { EquipmentEffectVO optional = dataController.GetOptional <EquipmentEffectVO>(vo.EffectUids[i]); if (optional == null) { Service.Get <StaRTSLogger>().Error("CMS Error: EffectUids is empty for EquipmentEffectVO " + optional.Uid); return(false); } switch (selectedTab) { case EquipmentTab.Troops: if (optional.AffectedTroopIds != null && optional.AffectedTroopIds.Length != 0) { int j = 0; int num2 = optional.AffectedTroopIds.Length; while (j < num2) { if (troopUpgradeCatalog.GetMinLevel(optional.AffectedTroopIds[j]).Type != TroopType.Hero) { return(true); } j++; } } break; case EquipmentTab.Heroes: if (optional.AffectedTroopIds != null && optional.AffectedTroopIds.Length != 0) { int k = 0; int num3 = optional.AffectedTroopIds.Length; while (k < num3) { if (troopUpgradeCatalog.GetMinLevel(optional.AffectedTroopIds[k]).Type == TroopType.Hero) { return(true); } k++; } } break; case EquipmentTab.Structures: if (optional.AffectedBuildingIds != null && optional.AffectedBuildingIds.Length != 0) { return(true); } break; } i++; } return(false); }
public bool IsEquipmentValidForTab(EquipmentVO vo, EquipmentTab selectedTab) { if (selectedTab == EquipmentTab.All) { return(true); } TroopUpgradeCatalog troopUpgradeCatalog = Service.TroopUpgradeCatalog; StaticDataController staticDataController = Service.StaticDataController; if (vo.EffectUids == null) { return(false); } int i = 0; int num = vo.EffectUids.Length; while (i < num) { EquipmentEffectVO optional = staticDataController.GetOptional <EquipmentEffectVO>(vo.EffectUids[i]); if (optional == null) { Service.Logger.Error("CMS Error: EffectUids is empty for EquipmentEffectVO " + optional.Uid); return(false); } if (selectedTab != EquipmentTab.Structures) { if (selectedTab != EquipmentTab.Troops) { if (selectedTab == EquipmentTab.Heroes) { if (optional.AffectedTroopIds != null && optional.AffectedTroopIds.Length > 0) { int j = 0; int num2 = optional.AffectedTroopIds.Length; while (j < num2) { if (troopUpgradeCatalog.GetMinLevel(optional.AffectedTroopIds[j]).Type == TroopType.Hero) { return(true); } j++; } } } } else if (optional.AffectedTroopIds != null && optional.AffectedTroopIds.Length > 0) { int k = 0; int num3 = optional.AffectedTroopIds.Length; while (k < num3) { if (troopUpgradeCatalog.GetMinLevel(optional.AffectedTroopIds[k]).Type != TroopType.Hero) { return(true); } k++; } } } else if (optional.AffectedBuildingIds != null && optional.AffectedBuildingIds.Length > 0) { return(true); } i++; } return(false); }