public override void OnEvent(IBosServiceCollection context, TutorialEventData data) { Func <bool> isValid = () => IsActive && isDialogShowed && data.EventName == TutorialEventName.ViewOpened; BosUtils.If(isValid, trueAction: () => { if ((ViewType)data.UserData == ViewType.PlanetsView) { RemoveFinger(context, "planets"); ForceTutorialDialog(context, new TutorialDialogData { Texts = GetLocalizationStrings(context, "lbl_tut_37"), OnOk = () => { Finger(context, "moon", 10); } }); } }, falseAction: () => { }); BosUtils.If(() => IsActive && isDialogShowed && data.EventName == TutorialEventName.OpenPlanetClicked, trueAction: () => { if ((int)data.UserData == 1) { RemoveFinger(context, "moon"); CompleteSelf(context); } }, falseAction: () => { }); }
private void SendEventToNonCompleted(TutorialEventData data) { if (!IsPaused || (data.EventName == TutorialEventName.MegaBoostActivated)) { States.ForEach(state => { if (!state.IsCompleted) { state.OnEvent(Services, data); } }); } }
private void OnTutorialEvent(TutorialEventData eventData) { if (IsLoaded) { SendEventToNonCompleted(eventData); if (eventData.EventName == TutorialEventName.LegalTransferCompleted || eventData.EventName == TutorialEventName.IllegalTransferCompleted) { IsWasTransfer = true; //SkipState(TutorialStateName.TransferPersonalCash); } } }
public override void OnEvent(IBosServiceCollection context, TutorialEventData data) { if (IsActive) { if (isDialogShowed) { if (data.EventName == TutorialEventName.ViewOpened) { if ((ViewType)data.UserData == ViewType.BuyModuleView) { RemoveFinger(context, "modules"); ForceTutorialDialog(context, new TutorialDialogData { Texts = GetLocalizationStrings(context, "lbl_tut_54"), OnOk = () => CompleteSelf(context) }); } } } } }
public override void OnEvent(IBosServiceCollection context, TutorialEventData data) { if (IsActive) { if (isDialogShowed) { if (data.EventName == TutorialEventName.MegaBoostActivated) { MoveToRepeatFingerState(context); } else if (data.EventName == TutorialEventName.MegaboostStateChanged) { BoostState state = (BoostState)data.UserData; if (state == BoostState.ReadyToActivate || state == BoostState.Active) { MoveToRepeatFingerState(context); } } } } }
public override void OnEvent(IBosServiceCollection context, TutorialEventData data) { if (IsActive) { if (isDialogShowed) { if (data.EventName == TutorialEventName.MiniGameOpened) { context.TutorialService.RemoveFinger(kPositionMiniGames); context.TutorialService.CreateFinger(kCasinoButton, new TutorialFingerData { Id = kCasinoButton, IsTooltipVisible = false }); } else if (data.EventName == TutorialEventName.PlayCasinoClicked) { context.TutorialService.RemoveFinger(kCasinoButton); //CompleteSelf(context); SetStage(CHEST_TAB_STAGE); } } } }
public static void OnTutorialEvent(TutorialEventData data) => TutorialEvent?.Invoke(data);
public override void OnEvent(IBosServiceCollection context, TutorialEventData eventData) { if (IsActive) { if (eventData.EventName == TutorialEventName.ViewHided) { ViewType viewType = (ViewType)eventData.UserData; if (viewType == ViewType.TransferWarningView) { isTransferWarningClosed = true; if (Stage == DIALOG_SECOND_STAGE) { context.RunCoroutine(ShowHighlightWhenClosedTransferWarning(context)); } } } if (eventData.EventName == TutorialEventName.ViewOpened) { ViewType viewType = (ViewType)eventData.UserData; if (viewType == ViewType.ProfileView) { context.TutorialService.RemoveFinger("profile"); } } if (Stage == SHOW_FINGER_ON_TRANSFER_TAB) { if (eventData.EventName == TutorialEventName.TransferTabOpened) { context.TutorialService.RemoveFinger("transfer_tab"); context.ViewService.Show(ViewType.TutorialDialogView, new ViewData { UserData = new TutorialDialogData { Texts = new List <string> { context.ResourceService.Localization.GetString("lbl_tut_25"), context.ResourceService.Localization.GetString("lbl_tut_26") }, OnOk = () => { SetStage(NEED_SHOW_LEGAL_TRANSFER); } } }); context.TutorialService.RemoveHighlightRegion(); } } if (Stage == FINGER_ON_PROFILE_SHOWED_STAGE) { if (eventData.EventName == TutorialEventName.TransferTabOpened) { //this code moved in NEED_SHOW_LEGAL_TRANSFER } } else if (Stage == WAIT_FOR_LEGAL_TRANSFER) { if (eventData.EventName == TutorialEventName.LegalTransferCompleted) { context.TutorialService.RemoveFinger("legal"); Finger(context, "illegal", 100); SetStage(WAIT_FOR_FIRST_ILLEGAL_TRANSFER); } } else if (Stage == WAIT_FOR_FIRST_ILLEGAL_TRANSFER) { if (eventData.EventName == TutorialEventName.IllegalTransferCompleted) { context.TutorialService.RemoveFinger("illegal"); Finger(context, "illegal", 100); SetStage(WAIT_FOR_SECOND_ILLEGAL_TRANSFER); } } else if (Stage == WAIT_FOR_SECOND_ILLEGAL_TRANSFER) { if (eventData.EventName == TutorialEventName.IllegalTransferCompleted) { context.TutorialService.RemoveFinger("illegal"); SetStage(DIALOG_SECOND_STAGE); ///// /// } } else if (Stage == WAIT_FOR_OPEN_STATUS_GOODS) { if (eventData.EventName == TutorialEventName.StatusGoodsOpened) { context.TutorialService.RemoveFinger("status_goods"); SetStage(DIALOG_THIRD_STAGE); ///////////////// //SetStage(WAIT_FOR_PURCHASE_PERSONAL_PRODUCT); //context.RunCoroutine(ShowFingerOnBuyPersonalProduct()); } } else if (Stage == WAIT_FOR_PURCHASE_PERSONAL_PRODUCT) { if (eventData.EventName == TutorialEventName.PersonalProductPurchased) { context.TutorialService.RemoveFinger("buy_product"); CompleteSelf(context); //UDBG.Log($"complete self state => {IsCompleted}"); context.RunCoroutine(WaitForComplete()); } } } }
public override void OnEvent(IBosServiceCollection context, TutorialEventData data) { }
public abstract void OnEvent(IBosServiceCollection context, TutorialEventData data);