Ejemplo n.º 1
0
 private void InventoryList_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var armor = GetArmorFromSelected();
         SelectedInventorySkill.Clear();
         var skills = armor.PrintSkills().Split('|');
         for (int i = 0; i < skills.Length - 1; i++)
         {
             SelectedInventorySkill.AppendText(skills[i]);
             SelectedInventorySkill.AppendText(Environment.NewLine);
         }
         SelectedInventorySkill.AppendText(skills.Last());
     }
     catch (NullReferenceException) { }
     catch (ArgumentOutOfRangeException) { }
 }
Ejemplo n.º 2
0
        private void UpdateAllScreens()
        {
            int s_index = InventoryList.SelectedIndex;

            InventoryList.Items.Clear();
            InventoryList.Items.Add($"~ Inventory ({_state.Player.Inventory.Inventory.Count}/100)~");
            InventoryList.Items.AddRange(_state.Player.Inventory.Inventory.ToArray());

            SelectedInventorySkill.Clear();

            skillDisplay.Clear();
            var elementals = _state.Player.ElementalAttack;

            for (int i = 0; i < elementals.Count - 1; i++)
            {
                skillDisplay.AppendText($"{_state.SManager.ElementToString(i)} +{elementals[i]}");
                skillDisplay.AppendText(Environment.NewLine);
            }
            skillDisplay.AppendText($"{_state.SManager.ElementToString(elementals.Count - 1)} +{elementals.Last()}");

            _state.HandleSelectedIndex(InventoryList, s_index);
        }
Ejemplo n.º 3
0
 private void InventoryList_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var inventory = _state.Player.Inventory.Inventory;
         var armor     = inventory[InventoryList.SelectedIndex - 1];
         SelectedInventorySkill.Clear();
         var skills = armor.PrintSkills().Split('|');
         for (int i = 0; i < skills.Length - 1; i++)
         {
             SelectedInventorySkill.AppendText(skills[i]);
             SelectedInventorySkill.AppendText(Environment.NewLine);
         }
         SelectedInventorySkill.AppendText(skills.Last());
     }
     catch (NullReferenceException) { }
     catch (ArgumentOutOfRangeException)
     {
         if (InventoryList.Items.Count > 1)
         {
             InventoryList.SelectedIndex = 1;
         }
     }
 }