public void EnableHangarCamera(NodeAddedEvent e, ScreenNode screen, HangarCameraDisabledNode hangar)
 {
     if (screen.screen.ShowHangar)
     {
         hangar.hangarCameraState.Esm.ChangeState <HangarCameraState.Enabled>();
     }
 }
        public void ShowTDMInfoPanel(NodeAddedEvent e, BattleTDMNode battleTDM, ScreenNode screen)
        {
            RectTransform component = screen.battleSelectScreen.BattleInfoPanelsContainer.GetComponent <RectTransform>();

            this.ResetVerticalScroll(component);
            screen.battleSelectScreen.TDMInfoPanel.gameObject.SetActive(true);
        }
Example #3
0
        public virtual ScreenNode Create(string name, RECT rect, IRenderer renderer = null, Direction dir = Direction.Horizontal, params Node[] childs)
        {
            var node = new ScreenNode(name, renderer ?? new TileRenderer(), containerCreater, windowTracker, rect, dir);

            node.PostInit(childs);
            return(node);
        }
Example #4
0
        public void PriceChanged(PriceChangedEvent e, BuyableMarketItemNode item, [JoinAll] ScreenNode screen, [JoinByScreen] SingleNode <SelectedItemComponent> selectedItem)
        {
            bool flag = item.Entity.Equals(selectedItem.component.SelectedItem);

            base.Log.InfoFormat("PriceChanged {0} item={1} itemIsSelected={2}", e, item, flag);
            GameObject buyButton  = screen.garageItemsScreen.BuyButton;
            GameObject xBuyButton = screen.garageItemsScreen.XBuyButton;

            buyButton.GetComponent <PriceButtonComponent>().Price  = e.Price;
            xBuyButton.GetComponent <PriceButtonComponent>().Price = e.XPrice;
            if (flag)
            {
                SetPriceEvent event2;
                if (buyButton.activeSelf)
                {
                    event2 = new SetPriceEvent {
                        Price     = e.Price,
                        OldPrice  = e.OldPrice,
                        XPrice    = e.XPrice,
                        OldXPrice = e.OldXPrice
                    };
                    base.ScheduleEvent(event2, buyButton.GetComponent <EntityBehaviour>().Entity);
                }
                if (xBuyButton.activeSelf)
                {
                    event2 = new SetPriceEvent {
                        Price     = e.Price,
                        OldPrice  = e.OldPrice,
                        XPrice    = e.XPrice,
                        OldXPrice = e.OldXPrice
                    };
                    base.ScheduleEvent(event2, xBuyButton.GetComponent <EntityBehaviour>().Entity);
                }
            }
        }
Example #5
0
        public GameObjectNode VisitGameObject(DazelParser.GameObjectContext context)
        {
            GameObjectTypeNode typeNode;

            switch (context.gameObjectType.Type)
            {
            case DazelLexer.SCREEN:
                typeNode = new ScreenNode();
                break;

            case DazelLexer.ENTITY:
                typeNode = new EntityNode();
                break;

            case DazelLexer.MOVE_PATTERN:
                typeNode = new MovePatternNode();
                break;

            default:
                throw new ArgumentException("Type is not a GameObjectType!");
            }

            GameObjectNode gameObjectNode = new GameObjectNode()
            {
                Token      = context.Start,
                Identifier = context.GetChild(1).GetText(),
                TypeNode   = typeNode,
                Contents   = VisitGameObjectContents(context.gameObjectBlock().gameObjectContents())
            };

            return(gameObjectNode);
        }
Example #6
0
 private void MarkItem(Entity itemEntity, List <Entity> itemsForView, ScreenNode screenNode, bool mark)
 {
     if (itemsForView.Contains(itemEntity))
     {
         screenNode.simpleHorizontalList.GetItem(itemEntity).GetComponentInChildrenIncludeInactive <TickMarkerComponent>().gameObject.SetActive(mark);
     }
 }
 public void ShowEquippedButton(NodeAddedEvent e, MountedUserItemNode item, [JoinAll] ScreenNode screenNode, [JoinByScreen] SingleNode <SelectedItemComponent> selectedItemNode)
 {
     if (ReferenceEquals(selectedItemNode.component.SelectedItem, item.Entity))
     {
         this.ShowMountButton(screenNode, false);
     }
 }
Example #8
0
        private ScreenNode CreateSut(out Mock <Node> parent, out Mock <IVirtualDesktop> virtualDesktop, out Mock <FocusTracker> focusTracker, out Mock <IContainerNodeCreater> containerCreater, out Mock <IWindowTracker> windowTracker, RECT?rect = null, Direction direction = Direction.Horizontal)
        {
            var renderer = new Mock <IRenderer>();

            parent = new Mock <Node>(new RECT(), Direction.Horizontal, null)
            {
                CallBase = true
            };
            virtualDesktop = new Mock <IVirtualDesktop>();
            focusTracker   = new Mock <FocusTracker>()
            {
                CallBase = true
            };
            containerCreater = new Mock <IContainerNodeCreater>();
            windowTracker    = new Mock <IWindowTracker>();

            var screen = new ScreenNode(
                "screen",
                renderer.Object,
                containerCreater.Object,
                windowTracker.Object,
                rect ?? new RECT(10, 20, 30, 40),
                direction);

            renderer.Setup(m => m.Update(It.IsAny <List <int> >())).Returns(() => (true, screen.Rect));
            screen.Parent = parent.Object;
            virtualDesktop.SetupGet(m => m.FocusTracker).Returns(focusTracker.Object);
            parent.SetupGet(m => m.Desktop).Returns(virtualDesktop.Object);

            return(screen);
        }
        public void AddMethodsButtons(NodeAddedEvent e, ScreenNode screen, [JoinAll] SelectedGoodsNode goods, [JoinAll] ICollection <SingleNode <PaymentMethodComponent> > methods)
        {
            List <SingleNode <PaymentMethodComponent> > collection = methods.ToList <SingleNode <PaymentMethodComponent> >();

            if (goods.Entity.HasComponent <SpecialOfferComponent>())
            {
                if (< > f__am$cache0 == null)
                {
 public void EnableHangarCameraRotation(NodeAddedEvent e, ScreenNode screen, HangarCameraRotationDisabledNode hangar)
 {
     if (screen.screen.RotateHangarCamera)
     {
         hangar.Entity.RemoveComponent <HangarCameraRotationDisabledComponent>();
         hangar.Entity.AddComponent <HangarCameraRotationEnabledComponent>();
     }
 }
Example #11
0
 public void AddVisibleItem(NodeAddedEvent e, BattleNode battle, [JoinAll] ScreenNode screen)
 {
     if (screen.visibleItemsRange.Range.Contains(battle.searchData.IndexInSearchResult))
     {
         base.Log.InfoFormat("AddVisibleItem {0}", battle.Entity.Id);
         battle.Entity.AddComponent <VisibleItemComponent>();
     }
 }
Example #12
0
        public void ScreenPartShown(ScreenPartShownEvent e, Node any, [JoinAll] ScreenNode screen, [JoinAll] UserNode user)
        {
            ShowBattleResultsScreenNotificationEvent eventInstance = new ShowBattleResultsScreenNotificationEvent {
                Index = 1
            };

            base.NewEvent(eventInstance).Attach(any).ScheduleDelayed(0.3f);
        }
        public void ShowDMButton(NodeAddedEvent e, SelectedNotArchivedDMNode battle, [JoinAll] ScreenNode screen)
        {
            GameObject enterBattleDMButton = screen.battleSelectScreen.EnterBattleDMButton;

            enterBattleDMButton.SetActive(true);
            EventSystem.current.SetSelectedGameObject(null);
            EventSystem.current.SetSelectedGameObject(enterBattleDMButton);
            this.LinkSpectatorButtonForNavigation(screen.battleSelectScreen.EnterBattleAsSpectatorButton.GetComponent <Selectable>(), enterBattleDMButton.GetComponent <Selectable>(), enterBattleDMButton.GetComponent <Selectable>());
        }
Example #14
0
        private void ActivateButton(ScreenNode screen, int packSize, int index, bool priceActivity, bool xPriceActivity)
        {
            EntityBehaviour behaviour = screen.buyItemPacksButtons.BuyButtons[index];

            behaviour.GetComponent <ItemPackButtonComponent>().Count = packSize;
            behaviour.GetComponent <UniversalPriceButtonComponent>().PriceActivity  = priceActivity;
            behaviour.GetComponent <UniversalPriceButtonComponent>().XPriceActivity = xPriceActivity;
            behaviour.gameObject.SetActive(true);
            base.NewEvent <SetBuyItemPackButtonInfoEvent>().Attach(behaviour.Entity).Schedule();
        }
 private void ShowMountButton(ScreenNode screenNode, bool interactable)
 {
     screenNode.garageItemsScreen.MountLabel.gameObject.SetActive(!interactable);
     screenNode.garageItemsScreen.MountItemButton.gameObject.SetActive(interactable);
     screenNode.garageItemsScreen.MountItemButton.gameObject.SetInteractable(interactable);
     if (interactable)
     {
         EventSystem.current.SetSelectedGameObject(screenNode.garageItemsScreen.MountItemButton.gameObject);
     }
 }
Example #16
0
 public void ResetToDefault(ButtonClickEvent e, DefaultButtonNode button, [JoinByScreen] ScreenNode screen)
 {
     InputManager.ResetToDefaultActions();
     base.ScheduleEvent <SetDefaultControlSettingsEvent>(button);
     foreach (KeyboardSettingsInputComponent component in Object.FindObjectsOfType <KeyboardSettingsInputComponent>())
     {
         component.SetText();
     }
     screen.keyboardSettingsScreen.CheckForOneKeyOnFewActions();
 }
 private void ShowMountButtonForSkinItem(ScreenNode screenNode, bool hasRestriction)
 {
     if (hasRestriction)
     {
         this.ShowMountButtonForRestrictedItem(screenNode);
     }
     else
     {
         this.ShowMountButton(screenNode, true);
     }
 }
Example #18
0
        public void ShowReward(NodeAddedEvent e, ScreenNode screen, [JoinAll] ResultsNode results)
        {
            Entity reward = results.battleResults.ResultForClient.PersonalResult.Reward;

            if (reward != null)
            {
                AddRewardGroup(screen, reward);
                base.Log.DebugFormat("ShowReward: reward={0}", reward.Id);
                base.NewEvent <ShowRewardEvent>().Attach(reward).Attach(screen).Schedule();
            }
        }
 private static GameObject GetTeamButton(TeamNode team, ScreenNode screen)
 {
     if (team.teamColor.TeamColor == TeamColor.RED)
     {
         return(screen.battleSelectScreen.EnterBattleRedButton);
     }
     if (team.teamColor.TeamColor != TeamColor.BLUE)
     {
         throw new Exception("Team button not found: " + team.teamColor.TeamColor);
     }
     return(screen.battleSelectScreen.EnterBattleBlueButton);
 }
        public void ViewUnconfirmedEmail(NodeAddedEvent e, ScreenNode screen, SelfUserWithUnconfirmedEmailNode userEmail, [JoinAll] Optional <SelfUserWithConfirmedEmailNode> confirmedOptional)
        {
            string unconfirmedEmailFormatText = this.GetUnconfirmedEmailFormatText(screen.profileAccountSectionUI);
            string email            = string.Empty;
            string unconfirmedEmail = userEmail.unconfirmedUserEmail.Email;

            if (confirmedOptional.IsPresent())
            {
                unconfirmedEmailFormatText = "%EMAIL%\n" + this.GetConfirmedEmailFormatText(screen.profileAccountSectionUI) + " " + getColorFormattedEmail(screen.profileAccountSectionUI, "%UNCEMAIL%");
                email = confirmedOptional.Get().confirmedUserEmail.Email;
            }
            screen.profileAccountSectionUI.SetEmail(unconfirmedEmailFormatText, email, unconfirmedEmail);
        }
Example #21
0
        public void InitScreen(NodeAddedEvent e, ScreenNode screen, [JoinAll] SingleNode <CountriesComponent> countries, [JoinAll] UserWithCountryNode country)
        {
            List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();

            foreach (KeyValuePair <string, string> pair in countries.component.Names)
            {
                if (pair.Key != "TR")
                {
                    list.Add(pair);
                }
            }
            if (< > f__am$cache0 == null)
            {
        public void ViewConfirmedEmail(NodeAddedEvent e, ScreenNode screen, SelfUserWithConfirmedEmailNode user, [JoinAll] Optional <SelfUserWithUnconfirmedEmailNode> unconfirmedOptional)
        {
            string format           = "%EMAIL%";
            string email            = user.confirmedUserEmail.Email;
            string unconfirmedEmail = string.Empty;

            if (unconfirmedOptional.IsPresent())
            {
                string str4 = this.GetConfirmedEmailFormatText(screen.profileAccountSectionUI) + " " + getColorFormattedEmail(screen.profileAccountSectionUI, "%UNCEMAIL%");
                format           = format + "\n" + str4;
                unconfirmedEmail = unconfirmedOptional.Get().unconfirmedUserEmail.Email;
            }
            screen.profileAccountSectionUI.SetEmail(format, email, unconfirmedEmail);
        }
Example #23
0
        public void ShowXCrystalReward(ShowRewardEvent e, ScreenNode screen, XCrystalPersonalRewardNode personalReward, [JoinBy(typeof(BattleRewardGroupComponent))] XCrystalRewardNode reward)
        {
            base.Log.DebugFormat("ShowXCrystalReward: reward={0}", personalReward.Entity.Id);
            XCrystalBonusActivationReason activationReason = personalReward.xCrystalBonusPersonalReward.ActivationReason;
            string ribbonLabel            = "x" + personalReward.xCrystalBonusPersonalReward.Multiplier.ToString();
            List <SpecialOfferItem> items = new List <SpecialOfferItem> {
                new SpecialOfferItem(0, reward.xCrystalRewardItemsConfig.SpriteUid, reward.xCrystalRewardItemsConfig.Title, ribbonLabel)
            };
            BattleResultSpecialOfferUiComponent specialOfferUI = screen.battleResultsAwardsScreen.specialOfferUI;

            specialOfferUI.ShowContent(reward.xCrystalRewardTextConfig.Title[activationReason], reward.xCrystalRewardTextConfig.Description[activationReason], items);
            specialOfferUI.SetUseDiscountButton();
            specialOfferUI.Appear();
        }
Example #24
0
        private void ShowBuyButton(PriceItemComponent priceItem, ScreenNode screenNode)
        {
            GameObject buyButton = screenNode.garageItemsScreen.BuyButton;

            buyButton.SetActive(true);
            EventSystem.current.SetSelectedGameObject(buyButton.gameObject);
            SetPriceEvent eventInstance = new SetPriceEvent {
                Price    = priceItem.Price,
                OldPrice = priceItem.OldPrice
            };

            base.ScheduleEvent(eventInstance, buyButton.GetComponent <EntityBehaviour>().Entity);
            buyButton.GetComponent <PriceButtonComponent>().Price = priceItem.Price;
        }
Example #25
0
        public void ScreenInit(NodeAddedEvent e, ScreenNode screen, [JoinAll] ResultsNode results, [JoinAll] SelfUserNode selfUser, [JoinAll] ICollection <QuestNode> quests)
        {
            BattleResultForClient         resultForClient = results.battleResults.ResultForClient;
            PersonalBattleResultForClient personalResult  = resultForClient.PersonalResult;
            bool flag  = personalResult.MaxEnergySource == EnergySource.MVP_BONUS;
            bool flag2 = (personalResult.MaxEnergySource == EnergySource.UNFAIR_MM) || (personalResult.MaxEnergySource == EnergySource.DISBALANCE_BONUS);
            GetBattleTypeEvent eventInstance = new GetBattleTypeEvent {
                WithCashback = flag || flag2
            };

            base.ScheduleEvent(eventInstance, screen);
            screen.battleResultsAwardsScreen.SetBattleType(eventInstance.BattleType);
            int userDMPlace = (resultForClient.BattleMode != BattleMode.DM) ? 0 : (resultForClient.DmUsers.IndexOf(resultForClient.FindUserResultByUserId(selfUser.Entity.Id)) + 1);

            this.ShowTitle(screen, results, userDMPlace);
            this.ShowReputation(screen, results, selfUser);
        }
Example #26
0
        public IList <ScreenInstance <TViewModel> > FindBestStack(List <ScreenInstance <TViewModel> > currentStack, ScreenInstance <TViewModel> screen)
        {
            if (!_nodePerScreenIds.TryGetValue(screen.Definition.Id, out var destinationNode))
            {
                throw new InvalidOperationException("This screen has not been registered");
            }

            var destinationScreen  = new ScreenNode <TViewModel>(destinationNode, screen);
            var currentScreenStack = currentStack.ConvertAll(x => new ScreenNode <TViewModel>(_nodePerScreenIds[x.Definition.Id], x));

            // If nothing is on navigation stack,
            //	we need to find a path in the tree to get to the screen, a simple BFS will works, just need to take the multi entry points into account
            // Else
            //	We need to find the shortest path to go from the current screen to the other
            //	correct way links must have priority (but if a down links is taken, only down links can taken after that)
            //	can only take up links that are in the navigation stack

            return(FindPathToScreenWithBFS(currentScreenStack, destinationScreen).ConvertAll(x => x.ScreenInstance));
        }
Example #27
0
        public void ShowExp(NodeAddedEvent e, ScreenNode screen, [JoinAll] ResultsNode results, [JoinAll] SelfUserNode selfUser, [JoinByLeague] LeagueNode league, [JoinAll] ModuleUpgradeConfigNode moduleUpgradeConfig, [JoinAll] RankNamesNode rankNames, [JoinAll] SingleNode <RanksExperiencesConfigComponent> ranksExperiencesConfig)
        {
            BattleResultForClient         resultForClient = results.battleResults.ResultForClient;
            PersonalBattleResultForClient personalResult  = resultForClient.PersonalResult;
            UserResult result    = resultForClient.FindUserResultByUserId(selfUser.Entity.Id);
            int        rank      = selfUser.userRank.Rank;
            int        index     = rank - 2;
            int        initValue = ((index < 0) || (index >= ranksExperiencesConfig.component.RanksExperiences.Length)) ? 0 : ranksExperiencesConfig.component.RanksExperiences[index];
            int        num4      = rank - 1;
            int        maxValue  = ((num4 < 0) || (num4 >= ranksExperiencesConfig.component.RanksExperiences.Length)) ? 0 : ranksExperiencesConfig.component.RanksExperiences[num4];

            screen.battleResultsAwardsScreen.ShowRankProgress(initValue, personalResult.RankExp, maxValue, personalResult.RankExpDelta, result.ScoreWithoutPremium, rank, rankNames.ranksNames.Names);
            Entity entity = Flow.Current.EntityRegistry.GetEntity(league.chestBattleReward.ChestId);
            GamePlayChestItemNode node = base.Select <GamePlayChestItemNode>(entity, typeof(MarketItemGroupComponent)).FirstOrDefault <GamePlayChestItemNode>();

            screen.battleResultsAwardsScreen.openChestButton.SetActive((node != null) && (node.userItemCounter.Count != 0L));
            screen.battleResultsAwardsScreen.ShowContainerProgress(personalResult.ContainerScore, personalResult.ContainerScoreDelta, result.ScoreWithoutPremium, personalResult.ContainerScoreLimit, ((personalResult.Container == null) || !personalResult.Container.HasComponent <ImageItemComponent>()) ? string.Empty : personalResult.Container.GetComponent <ImageItemComponent>().SpriteUid);
            screen.battleResultsAwardsScreen.SetTankInfo(result.HullId, result.WeaponId, result.Modules, moduleUpgradeConfig.moduleUpgradablePowerConfig);
            screen.battleResultsAwardsScreen.SetHullExp(personalResult.TankInitExp, personalResult.TankExp, personalResult.TankFinalExp, personalResult.ItemsExpDelta, result.ScoreWithoutPremium, personalResult.TankLevel);
            screen.battleResultsAwardsScreen.SetTurretExp(personalResult.WeaponInitExp, personalResult.WeaponExp, personalResult.WeaponFinalExp, personalResult.ItemsExpDelta, result.ScoreWithoutPremium, personalResult.WeaponLevel);
        }
Example #28
0
 public void SetVisibleItems(ItemsVisibilityChangedEvent e, ScreenNode screen, [JoinAll] ICollection <BattleNode> battles)
 {
     screen.Entity.RemoveComponent <VisibleItemsRangeComponent>();
     screen.Entity.AddComponent(new VisibleItemsRangeComponent(e.Range));
     foreach (BattleNode node in battles)
     {
         int        indexInSearchResult = node.searchData.IndexInSearchResult;
         IndexRange range = e.Range;
         if (!range.Contains(indexInSearchResult) && e.PrevRange.Contains(indexInSearchResult))
         {
             base.Log.InfoFormat("RemoveVisibleItem {0}", node.Entity.Id);
             node.Entity.RemoveComponent <VisibleItemComponent>();
             continue;
         }
         if (e.Range.Contains(indexInSearchResult) && !e.PrevRange.Contains(indexInSearchResult))
         {
             base.Log.InfoFormat("AddVisibleItem {0}", node.Entity.Id);
             node.Entity.AddComponent <VisibleItemComponent>();
         }
     }
 }
Example #29
0
        public void Update(UpdateEvent e, ScreenNode screen, [JoinAll] ICollection <BattleWithViewNode> battles)
        {
            if (Input.GetKeyDown(KeyCode.F8))
            {
                screen.battleSelectScreen.DebugEnabled = !screen.battleSelectScreen.DebugEnabled;
            }
            foreach (BattleWithViewNode node in battles)
            {
                string text = string.Empty;
                if (screen.battleSelectScreen.DebugEnabled)
                {
                    SearchDataComponent searchData  = node.searchData;
                    BattleEntry         battleEntry = searchData.BattleEntry;
                    text = $"id={node.Entity.Id}
index={searchData.IndexInSearchResult}
relevance={battleEntry.Relevance}
friends={battleEntry.FriendsInBattle}
server={battleEntry.Server}
lobby={battleEntry.LobbyServer}";
                }
                node.battleItemContent.SetDebugField(text);
            }
        }
Example #30
0
        private ScreenNode FindScreen(string screen, int?desktop = null)
        {
            var        desktops = desktop.HasValue ? _desktops[desktop.Value] : _desktops.ActiveDesktop;
            var        r        = _allScreens[screen];
            ScreenNode sc       = null;

            foreach (var c in desktops.Childs)
            {
                if (!r.WorkingArea.Equals(c.Rect))
                {
                    continue;
                }

                sc = c as ScreenNode;
                break;
            }

            if (sc == null)
            {
                throw new InvalidProgramException($"Could not find screen '{screen}' on desktop {desktop}.");
            }

            return(sc);
        }