Ejemplo n.º 1
0
 public void OnDialogConfirm(DialogConfirmEvent e, SingleNode <InviteToSquadDialogComponent> dialog, [JoinAll] SingleNode <SelfUserComponent> user, [JoinByBattleLobby] Optional <SingleNode <BattleLobbyComponent> > lobby)
 {
     if (!lobby.IsPresent() || lobby.Get().Entity.HasComponent <CustomBattleLobbyComponent>())
     {
         bool flag = lobby.IsPresent() && lobby.Get().Entity.HasComponent <CustomBattleLobbyComponent>();
         if (!dialog.component.invite)
         {
             AcceptRequestToSquadEvent eventInstance = new AcceptRequestToSquadEvent {
                 FromUserId    = dialog.component.FromUserId,
                 SquadId       = dialog.component.SquadId,
                 SquadEngineId = dialog.component.EngineId
             };
             base.ScheduleEvent(eventInstance, user);
         }
         else
         {
             if (flag)
             {
                 base.ScheduleEvent <ClientExitLobbyEvent>(lobby.Get());
             }
             else
             {
                 base.ScheduleEvent <CancelMatchSearchingEvent>(user);
             }
             AcceptInviteToSquadEvent eventInstance = new AcceptInviteToSquadEvent {
                 EngineId   = dialog.component.EngineId,
                 FromUserId = dialog.component.FromUserId
             };
             base.NewEvent(eventInstance).Attach(user).Schedule();
         }
     }
 }
Ejemplo n.º 2
0
 public void Logout(DialogConfirmEvent e, LogoutWindowNode node)
 {
     PlayerPrefs.DeleteKey("TOToken");
     PlayerPrefs.SetInt("SteamAuthentication", 1);
     PlayerPrefs.SetInt("RemeberMeFlag", 0);
     base.ScheduleEvent <SwitchToEntranceSceneEvent>(node);
 }
Ejemplo n.º 3
0
        public void ExitOnInviteToLobbyConfirm(DialogConfirmEvent e, SingleNode <InviteToLobbyDialogComponent> dialog, [JoinAll] SingleNode <SelfUserComponent> user, [JoinByUser] Optional <SingleNode <BattleUserComponent> > battleUser, [JoinAll] SingleNode <MatchMakingComponent> matchMaking)
        {
            ExitFromMatchMakingEvent eventInstance = new ExitFromMatchMakingEvent {
                InBattle = battleUser.IsPresent()
            };

            base.ScheduleEvent(eventInstance, matchMaking);
        }
Ejemplo n.º 4
0
        public void BuyEnergy(DialogConfirmEvent e, SingleNode <BuyEnergyDialogComponent> dialog)
        {
            PressEnergyContextBuyButtonEvent eventInstance = new PressEnergyContextBuyButtonEvent {
                Count  = dialog.component.EnergyCount,
                XPrice = dialog.component.Price
            };

            base.ScheduleEvent(eventInstance, dialog);
        }
Ejemplo n.º 5
0
 public void ChangeCountry(DialogConfirmEvent e, SingleNode <SelectCountryDialogComponent> dialog)
 {
     if (!string.IsNullOrEmpty(dialog.component.country.Value))
     {
         SelectCountryEvent eventInstance = new SelectCountryEvent {
             CountryCode = dialog.component.country.Key,
             CountryName = dialog.component.country.Value
         };
         base.ScheduleEvent(eventInstance, dialog.Entity);
         dialog.component.Hide();
     }
 }
Ejemplo n.º 6
0
        public void OnDialogConfirm(DialogConfirmEvent e, SingleNode <InviteToLobbyDialogComponent> dialog, [JoinAll] SingleNode <SelfUserComponent> user)
        {
            AcceptInviteEvent event3 = new AcceptInviteEvent {
                lobbyId  = dialog.component.lobbyId,
                engineId = dialog.component.engineId
            };
            ExitOtherLobbyAndAcceptInviteEvent eventInstance = new ExitOtherLobbyAndAcceptInviteEvent {
                AcceptInviteEvent = event3
            };

            base.NewEvent(eventInstance).Attach(user).Attach(dialog).Schedule();
        }
Ejemplo n.º 7
0
 public void UsePartOfEnergyBonus(DialogConfirmEvent e, SingleNode <CantUseAllEnergyBonusDialog> dialog, [JoinAll] UserNode user, [JoinByUser] EnergyBonusNode bonus)
 {
     base.ScheduleEvent <UseBonusEvent>(bonus);
 }
Ejemplo n.º 8
0
 public void OnDialogConfirm(DialogConfirmEvent e, SingleNode <EnterToBattleErrorDialog> inviteToLobbyDialog)
 {
     MainScreenComponent.Instance.ClearHistory();
     MainScreenComponent.Instance.ShowHome();
 }
Ejemplo n.º 9
0
 public void Exit(DialogConfirmEvent e, SingleNode <ExitGameDialog> exitDialog)
 {
     Application.Quit();
 }
Ejemplo n.º 10
0
 public void ConfirmOnDialog(DialogConfirmEvent e, SingleNode <SkipTutorialConfirmWindowComponent> skipDialog, [JoinAll] SelfUserNode selfUser, [JoinAll] ICollection <TutorialStepNode> tutorials)
 {
     this.CompleteActiveTutorial(skipDialog.Entity);
 }
Ejemplo n.º 11
0
 public void ReturnToBattle(DialogConfirmEvent e, DialogNode dialog, [JoinAll] SelfUserWithReservNode user, [JoinAll] SingleNode <ActiveScreenComponent> screen)
 {
     screen.Entity.AddComponent <LockedScreenComponent>();
     base.ScheduleEvent <ReturnToBattleEvent>(user);
 }