Пример #1
0
        private void InitEditView()
        {
            UXLabel element = base.GetElement <UXLabel>("LabelTitleSquadCreate");

            element.Text = this.lang.Get("EDIT_SQUAD", new object[0]);
            this.labelInstructions.Visible = false;
            UXLabel element2 = base.GetElement <UXLabel>("LabelBtnDone");

            element2.Text = this.lang.Get("BUTTON_DONE", new object[0]);
            this.buttonPurchase.Visible = false;
            this.buttonEdit.OnClicked   = new UXButtonClickedDelegate(this.OnEditClicked);
            Squad currentSquad = Service.SquadController.StateManager.GetCurrentSquad();

            this.inputName.Text                  = currentSquad.SquadName;
            this.inputName.EnableInput           = false;
            this.inputDescription.Text           = currentSquad.Description;
            this.spriteSelectedSymbol.SpriteName = currentSquad.Symbol;
            this.symbolName = currentSquad.Symbol;
            string     name     = this.ConvertSymbolNameToCheckboxId(currentSquad.Symbol);
            UXCheckbox element3 = base.GetElement <UXCheckbox>(name);

            element3.DelayedSelect(true);
            this.UpdateEnrollmentType(currentSquad.InviteType == 1);
            this.scoreReq = currentSquad.RequiredTrophies;
            this.UpdateScoreReq(0);
        }
Пример #2
0
        protected void InitPlanetSlots()
        {
            this.selectPlanetGrid = base.GetElement <UXGrid>("SelectPlanetGrid");
            UXElement element = base.GetElement <UXElement>("SelectPlanetTemplate");

            element.Visible = true;
            this.selectPlanetGrid.SetTemplateItem("SelectPlanetCard");
            element.Visible = false;
            this.unlockablePlanetList.Clear();
            CurrentPlayer currentPlayer = Service.CurrentPlayer;

            foreach (PlanetVO current in Service.StaticDataController.GetAll <PlanetVO>())
            {
                if (current.PlayerFacing && !currentPlayer.UnlockedPlanets.Contains(current.Uid) && currentPlayer.Map.Planet.Uid != current.Uid)
                {
                    UXCheckbox uXCheckbox = (UXCheckbox)this.selectPlanetGrid.CloneTemplateItem(current.Uid);
                    UXLabel    subElement = this.selectPlanetGrid.GetSubElement <UXLabel>(current.Uid, "LabelSelectPlanetName");
                    if (!this.reqMet && !this.tutorialMode)
                    {
                        uXCheckbox.RadioGroup = 0;
                        uXCheckbox.SetSelectable(false);
                        uXCheckbox.Selected = false;
                    }
                    uXCheckbox.OnSelected = new UXCheckboxSelectedDelegate(this.PlanetSelected);
                    UXTexture subElement2 = this.selectPlanetGrid.GetSubElement <UXTexture>(current.Uid, "SpriteSelectPlanetImagePlanet");
                    subElement2.LoadTexture("PlanetEnvIcon-" + current.Abbreviation);
                    subElement.Text       = LangUtils.GetPlanetDisplayName(current);
                    uXCheckbox.Tag        = current;
                    uXCheckbox.RadioGroup = 0;
                    uXCheckbox.DelayedSelect(false);
                    this.selectPlanetGrid.AddItem(uXCheckbox, current.Order);
                    this.unlockablePlanetList.Add(uXCheckbox);
                }
            }
            if (this.unlockablePlanetList.Count == 0)
            {
                base.GetElement <UXElement>("ButtonPrimary").Visible = false;
                base.GetElement <UXElement>("BtnInstantBuy").Visible = false;
                this.buttonTutorialConfirm.Visible = false;
            }
            this.selectPlanetGrid.RepositionItems();
            this.selectPlanetGrid.IsScrollable = true;
            this.selectPlanetGrid.ScrollToItem(0);
        }