Exemple #1
0
 public void ShowLeaguePlaceInfo(UpdateTopLeagueInfoEvent e, UserWithLeagueNode selfUser, [JoinAll] LeaguePlaceUINode leaguePlaceUI, [JoinByUser] UserWithLeagueNode user)
 {
     if (e.UserId.Equals(user.Entity.Id))
     {
         leaguePlaceUI.leaguePlaceUI.SetPlace(e.Place);
     }
 }
 public void PutReputationToEnter(UpdateTopLeagueInfoEvent e, UserWithLeagueNode userWithLeagueNode, [JoinAll] SingleNode <LeagueRewardUIComponent> screen, [JoinAll] TopLeagueNode topLeague)
 {
     screen.component.PlaceInTopLeague = e.Place;
     screen.component.PutReputationToEnter(topLeague.Entity.Id, e.LastPlaceReputation);
     screen.component.UpdateLeagueRewardUI();
 }
        public void InitLeagueScreen(NodeAddedEvent e, SingleNode <LeagueRewardUIComponent> screen, [JoinAll] ICollection <LeagueNode> leagueNodes, [JoinAll] UserWithLeagueNode userWithLeagueNode, [JoinAll] SingleNode <SeasonEndDateComponent> leaguesConfig)
        {
            Entity entity = null;

            foreach (LeagueNode node in SortedLeagues(leagueNodes))
            {
                screen.component.AddLeagueItem(node.Entity).Init(node.Entity);
                if (node.leagueGroup.Key == userWithLeagueNode.leagueGroup.Key)
                {
                    entity = node.Entity;
                }
            }
            screen.component.SetChestScoreLimit(userWithLeagueNode.gameplayChestScore.Limit);
            screen.component.SetLeaguesCount(leagueNodes.Count);
            screen.component.SelectUserLeague(entity, userWithLeagueNode.userReputation.Reputation);
            screen.component.SetSeasonEndDate(leaguesConfig.component.EndDate);
            screen.component.SelectBar(0);
        }
 public void AttachLeagueRewardDialogToUserGroup(NodeAddedEvent e, SingleNode <LeagueRewardDialog> leagueRewardDialog, [JoinAll] UserWithLeagueNode userWithLeagueNode)
 {
     userWithLeagueNode.userGroup.Attach(leagueRewardDialog.Entity);
 }
Exemple #5
0
 public void SetLeagueInfo(NodeAddedEvent e, ProfileSummarySectionUINode sectionUI, ProfileScreenWithUserGroupNode profileScreen, [Context] LeagueUINode uiNode, [JoinByUser] UserWithLeagueNode user, [JoinByLeague, Context] LeagueNode league)
 {
     uiNode.leagueUI.SetLeague(league.leagueName.Name, league.leagueIcon.SpriteUid, user.userReputation.Reputation);
     sectionUI.profileSummarySectionUI.showRewardsButton.SetActive(user.Entity.HasComponent <SelfUserComponent>());
 }
Exemple #6
0
        public void Fill(NodeAddedEvent e, [Combine] LeagueSeasonEndRewardNotificationNode notification, EndSeasonDialogNode popup, [JoinAll] UserWithLeagueNode user, [JoinAll] Optional <SingleNode <WindowsSpaceComponent> > screens)
        {
            PopupDialogComponent popupDialog = popup.popupDialog;
            Entity entity = Flow.Current.EntityRegistry.GetEntity(notification.leagueSeasonEndRewardNotification.LeagueId);

            popupDialog.itemsContainer.DestroyChildren();
            popupDialog.leagueIcon.SpriteUid = entity.GetComponent <LeagueIconComponent>().SpriteUid;
            popupDialog.leagueIcon.GetComponent <Image>().preserveAspect = true;
            int num = 0;

            foreach (KeyValuePair <long, int> pair in notification.leagueSeasonEndRewardNotification.Reward)
            {
                popupDialog.itemPrefab.GetComponent <AnimationTriggerDelayBehaviour>().dealy = (num + 1) * popupDialog.itemsShowDelay;
                LeagueEntranceItemComponent component2 = Object.Instantiate <LeagueEntranceItemComponent>(popupDialog.itemPrefab, popupDialog.itemsContainer, false);
                Entity entity2 = Flow.Current.EntityRegistry.GetEntity(pair.Key);
                int    num2    = pair.Value;
                component2.preview.SpriteUid = entity2.GetComponent <ImageItemComponent>().SpriteUid;
                bool flag = num2 > 1;
                component2.text.text = entity2.GetComponent <DescriptionItemComponent>().Name + (!flag ? string.Empty : " x");
                component2.gameObject.SetActive(true);
                if (flag)
                {
                    component2.count.Value = num2;
                }
                else
                {
                    component2.count.gameObject.SetActive(false);
                }
                num++;
            }
            popupDialog.Show(!screens.IsPresent() ? new List <Animator>() : screens.Get().component.Animators);
        }