Пример #1
0
 public void UserInBattle(NodeAddedEvent e, UserInBattleNode userInBattle, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen, [JoinAll] Optional <SelfBattleLobbyUser> selfBattleLobbyUser)
 {
     if (!selfBattleLobbyUser.IsPresent())
     {
         this.ShowSpectatorButton(profileScreen);
     }
 }
        public void SetFriendProfileHeader(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [Context, JoinByUser] FriendUserNode friendUser)
        {
            SetScreenHeaderEvent eventInstance = new SetScreenHeaderEvent();

            eventInstance.Immediate(profileScreen.profileScreenLocalization.FriendsProfileHeaderText);
            base.ScheduleEvent(eventInstance, profileScreen);
        }
Пример #3
0
 public void ShowScreenElementsForSelfUser(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] SelfUserNode selfUser, [JoinByLeague] LeagueNode leagueNode)
 {
     profileScreen.profileScreen.selfUserAccountButtonsTab.SetActive(true);
     profileScreen.profileScreen.otherUserAccountButtonsTab.SetActive(false);
     profileScreen.profileScreen.OtherPlayerNickname.gameObject.SetActive(false);
     profileScreen.profileScreen.Avatar.SpriteUid = selfUser.userAvatar.Id;
     profileScreen.profileScreen.IsPremium        = selfUser.Entity.HasComponent <PremiumAccountBoostComponent>();
     profileScreen.profileScreen.LeagueBorder.SelectedSpriteIndex = leagueNode.leagueConfig.LeagueIndex;
 }
Пример #4
0
 public void RejectFriend(ButtonClickEvent e, SingleNode <RejectFriendButtonComponent> button, [JoinByScreen] ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] IncommingFriendNode incommingFriend, [JoinAll] SingleNode <SelfUserComponent> selfUser)
 {
     base.ScheduleEvent(new RejectFriendEvent(incommingFriend.Entity), selfUser);
 }
Пример #5
0
 public void HideOutgoingFriendButtons(NodeRemoveEvent e, OutgoingFriendNode outgoingFriend, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
 {
     profileScreen.profileScreen.RevokeFriendRow.SetActive(false);
     profileScreen.profileScreen.AddToFriendRow.SetActive(true);
 }
Пример #6
0
 public void HideRemoveFriendButton(NodeRemoveEvent e, FriendUserNode friendUser, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
 {
     profileScreen.profileScreen.RemoveFriendRow.SetActive(false);
     profileScreen.profileScreen.AddToFriendRow.SetActive(true);
 }
Пример #7
0
        public void SetStatisticsInfo(NodeAddedEvent e, ProfileSummarySectionUINode sectionUI, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] UserStatisticsNode statistics)
        {
            Dictionary <string, long> dictionary = statistics.userStatistics.Statistics;
            long parameterValue = StatsTool.GetParameterValue <string>(dictionary, "VICTORIES");

            sectionUI.profileSummarySectionUI.SetWinLossStatistics(parameterValue, StatsTool.GetParameterValue <string>(dictionary, "DEFEATS"), StatsTool.GetParameterValue <string>(dictionary, "ALL_BATTLES_PARTICIPATED") - StatsTool.GetParameterValue <string>(dictionary, "ALL_CUSTOM_BATTLES_PARTICIPATED"));
        }
Пример #8
0
 public void HideIncommingFriendButtons(NodeRemoveEvent e, IncommingFriendNode incommingFriend, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
 {
     profileScreen.profileScreen.FriendRequestRow.SetActive(false);
     profileScreen.profileScreen.AddToFriendRow.SetActive(true);
 }
Пример #9
0
 public void EnterAsSpectator(ButtonClickEvent e, SingleNode <EnterBattleAsSpectatorButtonComponent> button, [JoinAll] ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] UserInBattleNode userInBattle, [JoinAll] ClientSessionNode session, [JoinAll] Optional <SelfBattleLobbyUser> selfBattleLobbyUser)
 {
     if (!selfBattleLobbyUser.IsPresent())
     {
         base.ScheduleEvent(new EnterBattleAsSpectatorFromLobbyRequestEvent(userInBattle.battleGroup.Key), session);
     }
 }
Пример #10
0
        public void SetLevelInfo(NodeAddedEvent e, ProfileSummarySectionUINode sectionUI, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] UserStatisticsNode statistics, [JoinAll] RanksNamesNode rankNames)
        {
            GetUserLevelInfoEvent eventInstance = new GetUserLevelInfoEvent();

            base.ScheduleEvent(eventInstance, statistics);
            sectionUI.profileSummarySectionUI.SetLevelInfo(eventInstance.Info, rankNames.ranksNames.Names[eventInstance.Info.Level + 1]);
        }
Пример #11
0
 public void ShowIncommingFriendButtons(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [Context, JoinByUser] IncommingFriendNode incommingFriend)
 {
     profileScreen.profileScreen.FriendRequestRow.SetActive(true);
     profileScreen.profileScreen.AddToFriendRow.SetActive(false);
 }
Пример #12
0
 public void ShowRemoveFriendButton(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [Context, JoinByUser] FriendUserNode friendUser)
 {
     profileScreen.profileScreen.RemoveFriendRow.SetActive(true);
     profileScreen.profileScreen.AddToFriendRow.SetActive(false);
 }
Пример #13
0
 public void UserOutBattle(NodeRemoveEvent e, UserInBattleNode userInBattle, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
 {
     this.HideSpectatorButton(profileScreen);
 }
Пример #14
0
 public void SetPlayerColor(NodeRemoveEvent e, AcceptedFriendNode friend, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
 {
     profileScreen.profileScreen.SetPlayerColor(false);
 }
 public void SetNotFriendProfileHeader(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] NotFriendUserNode notFriendUser)
 {
     new SetScreenHeaderEvent().Immediate(profileScreen.profileScreenLocalization.ProfileHeaderText);
     base.ScheduleEvent <SetScreenHeaderEvent>(profileScreen);
 }
Пример #16
0
 private void ShowSpectatorButton(ProfileScreenWithUserGroupNode profileScreen)
 {
     profileScreen.profileScreen.EnterBattleAsSpectatorRow.SetActive(true);
 }
Пример #17
0
 public void SelfUserInLobby(NodeAddedEvent e, SelfBattleLobbyUser selfBattleLobbyUser, [JoinAll] ProfileScreenWithUserGroupNode profileScreen)
 {
     this.HideSpectatorButton(profileScreen);
 }
Пример #18
0
 public void RemoveFriend(ButtonClickEvent e, SingleNode <BreakOffFriendButtonComponent> button, [JoinByScreen] ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] FriendUserNode friend, [JoinAll] SingleNode <SelfUserComponent> selfUser)
 {
     base.ScheduleEvent(new BreakOffFriendEvent(friend.Entity), selfUser);
 }
 public void SetMyProfileHeader(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] SelfUserNode selfUser)
 {
     profileScreen.Entity.AddComponent(new ScreenHeaderTextComponent(profileScreen.profileScreenLocalization.MyProfileHeaderText));
 }
Пример #20
0
 public void RevokeFriend(ButtonClickEvent e, SingleNode <RevokeFriendRequestButtonComponent> button, [JoinByScreen] ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] OutgoingFriendNode outgoingFriend, [JoinAll] SingleNode <SelfUserComponent> selfUser)
 {
     base.ScheduleEvent(new RevokeFriendEvent(outgoingFriend.Entity), selfUser);
 }
        public void SetNotFriendProfileHeader(NodeRemoveEvent e, FriendUserNode friendUser, [JoinByUser] ProfileScreenWithUserGroupNode profileScreen)
        {
            SetScreenHeaderEvent eventInstance = new SetScreenHeaderEvent();

            eventInstance.Immediate(profileScreen.profileScreenLocalization.ProfileHeaderText);
            base.ScheduleEvent(eventInstance, profileScreen);
        }
Пример #22
0
 public void ShowOutgoingFriendButtons(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [Context, JoinByUser] OutgoingFriendNode outgoingFriend)
 {
     profileScreen.profileScreen.RevokeFriendRow.SetActive(true);
     profileScreen.profileScreen.AddToFriendRow.SetActive(false);
 }
Пример #23
0
        public void SetEquipmentStatisticsInfo(NodeAddedEvent e, SingleNode <MostPlayedEquipmentUIComponent> ui, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] UserStatisticsNode statistics, [JoinAll] SingleNode <SelectedPresetComponent> selectedPreset)
        {
            Dictionary <long, long> hullStatistics   = statistics.favoriteEquipmentStatistics.HullStatistics;
            Dictionary <long, long> turretStatistics = statistics.favoriteEquipmentStatistics.TurretStatistics;

            if (!hullStatistics.Any <KeyValuePair <long, long> >() && !turretStatistics.Any <KeyValuePair <long, long> >())
            {
                ui.component.SwitchState(false);
            }
            else
            {
                ui.component.SwitchState(true);
                Entity entityById = base.GetEntityById(StatsTool.GetItemWithLagestValue(hullStatistics));
                Entity entity2    = base.GetEntityById(StatsTool.GetItemWithLagestValue(turretStatistics));
                string turretUID  = entity2.GetComponent <MarketItemGroupComponent>().Key.ToString();
                ui.component.SetMostPlayed(turretUID, entity2.GetComponent <DescriptionItemComponent>().Name, entityById.GetComponent <MarketItemGroupComponent>().Key.ToString(), entityById.GetComponent <DescriptionItemComponent>().Name);
            }
        }
Пример #24
0
        public void ShowRequestFriendButtonIfNeed(NodeAddedEvent e, ProfileScreenWithUserGroupNode profileScreen, [JoinByUser] PossibleFriendNode possibleFriend, [JoinAll] SelfUserNode selfUser)
        {
            bool flag = (!selfUser.Entity.Equals(possibleFriend.Entity) && (!selfUser.friends.AcceptedFriendsIds.Contains(possibleFriend.Entity.Id) && !selfUser.friends.IncommingFriendsIds.Contains(possibleFriend.Entity.Id))) && !selfUser.friends.OutgoingFriendsIds.Contains(possibleFriend.Entity.Id);

            profileScreen.profileScreen.AddToFriendRow.SetActive(flag);
        }
Пример #25
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>());
 }