private bool LoadCard(int cardid)
        {
            if (!Program.CardData.ContainsKey(cardid))
            {
                return(false);
            }

            Clearbtn_Click(null, EventArgs.Empty);
            CardInfos info = Program.CardData[cardid];

            CardID.Text = info.Id.ToString(CultureInfo.InvariantCulture);
            Alias.Text  = info.AliasId.ToString(CultureInfo.InvariantCulture);
            for (int i = 0; i < m_formats.Count; i++)
            {
                if (m_formats[i] == info.Ot)
                {
                    CardFormats.SelectedIndex = i;
                    break;
                }
            }
            Level.SelectedIndex = info.Level - 1;
            for (int i = 0; i < m_cardRaces.Count; i++)
            {
                if (m_cardRaces[i] == info.Race)
                {
                    Race.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < m_cardAttributes.Count; i++)
            {
                if (m_cardAttributes[i] == info.Attribute)
                {
                    CardAttribute.SelectedIndex = i;
                    break;
                }
            }
            ATK.Text             = info.Atk.ToString(CultureInfo.InvariantCulture);
            DEF.Text             = info.Def.ToString(CultureInfo.InvariantCulture);
            CardName.Text        = info.Name;
            CardDescription.Text = info.Description;
            foreach (string effect in info.EffectStrings)
            {
                EffectList.Items.Add(effect);
            }
            SetCardTypes(info.GetCardTypes());

            int index = m_setCodes.IndexOf(info.SetCode & 0xffff);

            SetCodeLst.SelectedIndex = index;
            index = m_setCodes.IndexOf(info.SetCode >> 0x10);
            OtherSetCodeLst.SelectedIndex = index;

            SetCategoryCheckBoxs(info.Category);

            m_loadedCard = info.Id;

            return(true);
        }
Exemple #2
0
        private bool LoadCard(int cardid)
        {
            if (!Program.CardData.ContainsKey(cardid))
            {
                return(false);
            }

            Clearbtn_Click(null, EventArgs.Empty);
            CardInfos info = Program.CardData[cardid];

            CardID.Text = info.Id.ToString(CultureInfo.InvariantCulture);
            Alias.Text  = info.AliasId.ToString(CultureInfo.InvariantCulture);
            for (int i = 0; i < m_formats.Count; i++)
            {
                if (m_formats[i] == info.Ot)
                {
                    CardFormats.SelectedIndex = i;
                    break;
                }
            }
            Level.SelectedIndex  = (int)info.Level - 1;
            RScale.SelectedIndex = (int)info.RScale;
            LScale.SelectedIndex = (int)info.LScale;
            for (int i = 0; i < m_cardRaces.Count; i++)
            {
                if (m_cardRaces[i] == info.Race)
                {
                    Race.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < m_cardAttributes.Count; i++)
            {
                if (m_cardAttributes[i] == info.Attribute)
                {
                    CardAttribute.SelectedIndex = i;
                    break;
                }
            }
            ATK.Text             = info.Atk.ToString(CultureInfo.InvariantCulture);
            DEF.Text             = info.Def.ToString(CultureInfo.InvariantCulture);
            CardName.Text        = info.Name;
            CardDescription.Text = info.Description;
            foreach (string effect in info.EffectStrings)
            {
                EffectList.Items.Add(effect);
            }
            SetCardTypes(info.GetCardTypes());

            long setcode = info.SetCode & 0xffff;

            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeOne.SelectedItem = m_setCodes[(int)setcode];
            }
            else
            {
                SetCodeOne.SelectedItem = m_setCodes[0];
            }
            setcode = info.SetCode >> 16 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeTwo.SelectedItem = m_setCodes[(int)setcode];
            }
            else
            {
                SetCodeTwo.SelectedItem = m_setCodes[0];
            }
            setcode = info.SetCode >> 32 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeThree.SelectedItem = m_setCodes[(int)setcode];
            }
            else
            {
                SetCodeThree.SelectedItem = m_setCodes[0];
            }
            setcode = info.SetCode >> 48 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeFour.SelectedItem = m_setCodes[(int)setcode];
            }
            else
            {
                SetCodeFour.SelectedItem = m_setCodes[0];
            }
            SetCategoryCheckBoxs(info.Category);

            m_loadedCard = info.Id;

            return(true);
        }
Exemple #3
0
        private bool LoadCard(int cardid)
        {
            if (!CardManager.ContainsCard(cardid))
            {
                return(false);
            }

            Clearbtn_Click(null, EventArgs.Empty);
            CardInfos info = CardManager.GetCard(cardid);

            CardID.Text = info.Id.ToString(CultureInfo.InvariantCulture);
            Alias.Text  = info.AliasId.ToString(CultureInfo.InvariantCulture);
            for (int i = 0; i < m_formats.Count; i++)
            {
                if (m_formats[i] == (info.Ot & 0x3))
                {
                    CardFormats.SelectedIndex = i;
                    break;
                }
            }
            Level.SelectedIndex  = (int)info.Level - 1;
            RScale.SelectedIndex = (int)info.RScale;
            LScale.SelectedIndex = (int)info.LScale;
            for (int i = 0; i < m_cardRaces.Count; i++)
            {
                if (m_cardRaces[i] == info.Race)
                {
                    Race.SelectedIndex = i;
                    break;
                }
            }
            for (int i = 0; i < m_cardAttributes.Count; i++)
            {
                if (m_cardAttributes[i] == info.Attribute)
                {
                    CardAttribute.SelectedIndex = i;
                    break;
                }
            }
            ATK.Text       = info.Atk.ToString(CultureInfo.InvariantCulture);
            DEF.Text       = info.Def.ToString(CultureInfo.InvariantCulture);
            chkPre.Checked = (info.Ot & 0x4) > 0;

            CardName.Text        = info.Name;
            CardDescription.Text = info.Description;
            foreach (string effect in info.EffectStrings)
            {
                EffectList.Items.Add(effect);
            }
            SetCardTypes(info.GetCardTypes());
            if (CardTypeList.CheckedItems.Contains("Link"))
            {
                SetCardMarkers(info.GetLinkMarkers());
                linkMarkerPanel.Enabled = true;
            }

            long setcode = info.SetCode & 0xffff;

            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeOne.SelectedItem = (int)setcode;
            }
            else
            {
                SetCodeOne.SelectedItem = m_setCodes[0];
            }
            setcode = info.SetCode >> 16 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeTwo.SelectedItem = (int)setcode;
            }
            else
            {
                SetCodeTwo.SelectedItem = m_setCodes[0];
            }
            setcode = info.SetCode >> 32 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeThree.SelectedItem = (int)setcode;
            }
            else
            {
                SetCodeThree.SelectedItem = 0;
            }
            setcode = info.SetCode >> 48 & 0xffff;
            if (m_setCodes.ContainsKey((int)setcode))
            {
                SetCodeFour.SelectedItem = (int)setcode;
            }
            else
            {
                SetCodeFour.SelectedItem = m_setCodes[0];
            }
            SetCategoryCheckBoxs(info.Category);

            m_loadedCard = info.Id;

            CDBSelect.SelectedIndex = info.source - 1;

            return(true);
        }