Example #1
0
		public string printCardVariation()
        {
			string retVariation = "";

			if(variation!=null && variation.Count>0)
            {
				foreach(dynamic rotVar in variation)
				{
					if (retVariation != "")
					{
						retVariation += ", ";
					}

					retVariation += ENumConverters.printEVariation(rotVar);
                }
            }

			return retVariation;
        }
Example #2
0
        private void RevealedPanel(EDropDownTextListPanel option)
        {
            switch (option)
            {
            case EDropDownTextListPanel.Colour:
                #region Case Colour
                colourPanel.Show();
                colourPanel.Focus();
                foreach (dynamic col in m_cardEntry.colourSet)
                {
                    dynamic indexColour = colourListbox.FindString(ENumConverters.printEColour(col));
                    colourListbox.SetSelected(indexColour, true);
                }
                #endregion
                break;

            case EDropDownTextListPanel.Language:
                #region Case Language
                languagePanel.Show();
                languagePanel.Focus();
                if (m_cardEntry.language != ELanguage.Unknown)
                {
                    dynamic indexLanguage = languageListbox.FindString(m_cardEntry.printLanguage());
                    languageListbox.SetSelected(indexLanguage, true);
                }
                #endregion
                break;

            case EDropDownTextListPanel.Rarity:
                #region Rarity
                rarityPanel.Show();
                rarityPanel.Focus();
                dynamic indexRarity = rarityListbox.FindString(m_cardEntry.printRarity());
                rarityListbox.SetSelected(indexRarity, true);
                #endregion
                break;

            case EDropDownTextListPanel.CardVariation:
                #region Case Card Variation
                cardVariationPanel.Show();
                cardVariationPanel.Focus();
                foreach (dynamic cardVar in m_cardEntry.variation)
                {
                    dynamic indexCardVariation = cardVariationListbox.FindString(ENumConverters.printEVariation(cardVar));
                    if (indexCardVariation >= 0)
                    {
                        cardVariationListbox.SetSelected(indexCardVariation, true);
                    }
                }
                #endregion
                break;

            case EDropDownTextListPanel.Types:
                #region Case Types
                #region Types Panel/List
                typesListbox.Items.Clear();
                typesListbox.Items.AddRange(Enum.GetNames(typeof(EType)));
                typesPanel.Height = LISTBOXITEMHEIGHT * (typesListbox.Items.Count <= LISTBOXITEMMAXELEMENTS ? typesListbox.Items.Count : LISTBOXITEMMAXELEMENTS);
                typesListbox.EndUpdate();
                typesListbox.SelectionMode = SelectionMode.MultiSimple;
                #endregion

                foreach (dynamic cardType in m_cardEntry.types)
                {
                    dynamic indexType = typesListbox.FindString(ENumConverters.printEType(cardType.type));
                    typesListbox.Items.RemoveAt(indexType);
                    typesListbox.Items.Insert(indexType, cardType.printFullType(StoringSubTypeElement.getEntryList().ToList <SubTypeStruct>()));
                    typesListbox.SetSelected(indexType, true);
                }
                typesPanel.Show();
                typesPanel.Focus();
                #endregion
                break;

            case EDropDownTextListPanel.Edition:
                #region Case Edition
                if (StoringEditionElement.getEntryList().Length > 0)
                {
                    string repEditStr = "";
                    #region Edition Panel/List
                    editionListbox.Items.Clear();
                    editionListbox.SelectionMode = SelectionMode.One;
                    foreach (dynamic edit in StoringEditionElement.getEntryList())
                    {
                        if (edit.id == m_cardEntry.editionID)
                        {
                            repEditStr = edit.representation;
                        }
                        editionListbox.Items.Add(edit.representation);
                    }
                    editionListbox.Items.Add(NEWELEMENTTOADD);
                    editionPanel.Height = LISTBOXITEMHEIGHT * (editionListbox.Items.Count <= LISTBOXITEMMAXELEMENTS ? editionListbox.Items.Count : LISTBOXITEMMAXELEMENTS);
                    editionListbox.EndUpdate();
                    #endregion

                    if (repEditStr != "")
                    {
                        dynamic indexEdit = editionListbox.FindString(repEditStr);
                        editionListbox.SetSelected(indexEdit, true);
                    }

                    editionPanel.Show();
                    editionPanel.Focus();
                }
                else
                {
                    if (clickCallPopUpDelegate != null)
                    {
                        clickCallPopUpDelegate(EPopUpSourceCalled.Type);
                    }
                }
                #endregion
                break;
            }
            m_currentActivePanel = option;
        }