Esempio n. 1
0
 private void CMRUpgradeDef_Click(object sender, EventArgs e)
 {
     if (!TravianData.Villages.ContainsKey(SelectVillage))
         return;
     foreach (ListViewItem x in m_researchstatus.listViewUpgrade.SelectedItems)
     {
         if (x.SubItems[3].BackColor != Color.White)
         {
             var Q = new ResearchQueue
             {
                 UpCall = tr,
                 VillageID = SelectVillage,
                 ResearchType = ResearchQueue.TResearchType.UpDefence,
                 Aid = m_researchstatus.listViewUpgrade.Items.IndexOf(x) + 1
             };
             TravianData.Villages[SelectVillage].Queue.Add(Q);
             lvi(Q);
         }
     }
 }
Esempio n. 2
0
        private void CMRUpgradeDefTo_Click(object sender, EventArgs e)
        {
            if (!TravianData.Villages.ContainsKey(SelectVillage))
                return;
            var CV = TravianData.Villages[SelectVillage];
            foreach (ListViewItem x in m_researchstatus.listViewUpgrade.SelectedItems)
            {
                if (x.SubItems[3].BackColor != Color.White)
                {
                    int Bid = m_researchstatus.listViewUpgrade.Items.IndexOf(x) + 1;

                    BuildToLevel btl = new BuildToLevel()
                    {
                        BuildingName = tr.GetAidLang(TravianData.Tribe, Bid),
                        DisplayName = dl.GetAidLang(TravianData.Tribe, Bid),
                        CurrentLevel = CV.Upgrades[Bid].DefenceLevel,
                        TargetLevel = CV.ArmouryLevel,
                        mui = mui
                    };
                    if (btl.ShowDialog() == DialogResult.OK)
                    {
                        if (btl.Return < 0)
                            continue;

                        var Q = new ResearchQueue
                        {
                            UpCall = tr,
                            VillageID = SelectVillage,
                            TargetLevel = btl.Return,
                            ResearchType = ResearchQueue.TResearchType.UpDefence,
                            Aid = m_researchstatus.listViewUpgrade.Items.IndexOf(x) + 1
                        };
                        CV.Queue.Add(Q);
                        lvi(Q);
                    }
                }
            }
        }