示例#1
0
        public async void ExecuteStopCommand()
        {
            EndDialog dialog = new EndDialog();
            await dialog.ShowAsync();

            if (dialog.DiagResult == ContentDialogResult.Primary)
            {
                CurrentTripDataRepo.DriveValue = EnumHelper.DeParse(DriveStateStatus.TripCompleted);

                if (SelectedTripData.IsTripComplete != true)
                {
                    CurrentTripDataRepo.EndTime = DateTime.Now;
                    upTimer.Stop();
                    TripSummary.SetBusy(true);

                    SelectedTripData.TripEndTime    = CurrentTripDataRepo.EndTime;
                    SelectedTripData.IsTripComplete = true;
                    SelectedTripData.Pay            = CurrentTripDataRepo.SelectedPayStatus = dialog.SelectedPayStatus;
                    SelectedTripData.Mode           = CurrentTripDataRepo.SelectedPayMode = dialog.SelectedPayMode;
                    tripDataManager.SaveTrip(SelectedTripData);
                }

                geoLocationService.PositionChanged -= GeoLocationService_PositionChanged;
                geoLocationService.StopListening();
                StartCommand.RaiseCanExecuteChanged();
                StopCommand.RaiseCanExecuteChanged();
                GotoHomeTaskCommand.RaiseCanExecuteChanged();
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public EndDialogControl(EndDialog script)
        {
            InitializeComponent();

            if (script != null)
            {
                Action = script;
            }
            else
            {
                Action = new EndDialog();
            }
        }
示例#3
0
    // This is called when we move to another dialog
    void GoToNextScreen()
    {
        StopCoroutine("AutoNextScreen");
        StopCoroutine("ShowDialog");
        isShowingDialog       = false;
        canGoOnNextScreen     = false;
        playedBgFxClip        = false;
        playedCharaVoiceClip  = false;
        playedGameplayFxClip  = false;
        autoMovedToNextScreen = false;


        VNK_DialogManager.staticBgFX.Stop();
        VNK_DialogManager.staticCharaVoice.Stop();
        VNK_DialogManager.staticGameplayFX.Stop();


        if (changeBackground)         //Background02 is over Background01
        {
            if (fadeChanging)
            {
                if (VNK_DialogManager.staticBackground01.color.a != 0.0f && VNK_DialogManager.staticBackground02.color.a == 0.0f && !canFadeBack02)
                {
                    FadeBackground02(newBackground);
                }
                else if (VNK_DialogManager.staticBackground01.color.a == 0.0f && VNK_DialogManager.staticBackground02.color.a != 0.0f && !canFadeBack01)
                {
                    FadeBackground01(newBackground);
                }
            }
            else
            {
                if (VNK_DialogManager.staticBackground01.color.a != 0.0f && VNK_DialogManager.staticBackground02.color.a == 0.0f)
                {
                    VNK_DialogManager.staticBackground01.sprite = newBackground;
                }
                else if (VNK_DialogManager.staticBackground01.color.a == 0.0f && VNK_DialogManager.staticBackground02.color.a != 0.0f)
                {
                    VNK_DialogManager.staticBackground02.sprite = newBackground;
                }
            }
        }

        if (saveState)
        {
            VNK_DialogManager.SaveSavedata();
            PlayerPrefs.SetString("keyLastDialog", this.gameObject.name);

            if (saveCurrentLevel)
            {
                PlayerPrefs.SetString("keyLastLevel", levelName);
            }
        }
        if (!isLastOne)
        {
            if (wantToDestroyObj)
            {
                Destroy(objToDestroy);
            }
            if (wantToSendMessageToObj)
            {
                objToSendMessage.SendMessage(messageToSend);
            }
            VNK_DialogManager.privateID = moveToID;
        }
        if (isLastOne)
        {
            VNK_DialogManager.staticDialogText.text = "";

            if (colorReset)
            {
                VNK_DialogManager.staticDialogText.color = resetColor;
            }
            if (wantToDestroyObj)
            {
                Destroy(objToDestroy);
            }
            if (wantToSendMessageToObj)
            {
                objToSendMessage.SendMessage(messageToSend);
            }

            if (switchDialog)
            {
                if (destroyOnEnd)
                {
                    this.gameObject.GetComponent <VNK_DialogCreator>().Stop();
                    newDialog.SetActive(true);
                    VNK_DialogManager.currentDialog = newDialog;
                    newDialog.GetComponent <VNK_DialogCreator>().Play();
                    Destroy(gameObject);
                }
                if (!destroyOnEnd)
                {
                    this.gameObject.GetComponent <VNK_DialogCreator>().Stop();
                    newDialog.SetActive(true);
                    VNK_DialogManager.currentDialog = newDialog;
                    newDialog.GetComponent <VNK_DialogCreator>().Play();
                    this.gameObject.SetActive(false);
                }
            }
            if (!switchDialog)
            {
                if (destroyOnEnd)
                {
                    EndDialog e = null;//만약 챕터의 마지막 일 경우
                    e = this.gameObject.GetComponent <EndDialog>();
                    if (e != null)
                    {
                        e.callAnything();
                    }
                    Stop();
                    Destroy(gameObject);
                }
                if (!destroyOnEnd)
                {
                    EndDialog e = null;//만약 챕터의 마지막 일 경우
                    e = this.gameObject.GetComponent <EndDialog>();
                    if (e != null)
                    {
                        e.callAnything();
                    }
                    Stop();
                }
            }
        }
    }
示例#4
0
        /// <summary>
        /// Loads actions
        /// </summary>
        /// <param name="filename">Xml node</param>
        public void LoadActions(XmlNode xml)
        {
            if (xml == null || xml.Name.ToLower() != "actions")
            {
                return;
            }

            foreach (XmlNode node in xml)
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }


                switch (node.Name.ToLower())
                {
                case "teleport":
                {
                    Teleport teleport = new Teleport();
                    teleport.Load(node);
                    Actions.Add(teleport);
                }
                break;

                case "giveexperience":
                {
                    GiveExperience script = new GiveExperience();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "activate":
                {
                    ActivateTarget script = new ActivateTarget();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "changepicture":
                {
                    ChangePicture script = new ChangePicture();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "changetext":
                {
                    ChangeText script = new ChangeText();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "deactivate":
                {
                    DeactivateTarget script = new DeactivateTarget();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "disablechoice":
                {
                    DisableChoice script = new DisableChoice();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "disable":
                {
                    DisableTarget script = new DisableTarget();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "enablechoice":
                {
                    EnableChoice script = new EnableChoice();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "endchoice":
                {
                    EndChoice script = new EndChoice();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "enddialog":
                {
                    EndDialog script = new EndDialog();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "giveitem":
                {
                    GiveItem script = new GiveItem();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "healing":
                {
                    Healing script = new Healing();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "joincharacter":
                {
                    JoinCharacter script = new JoinCharacter();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "playsound":
                {
                    PlaySound script = new PlaySound();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                case "toggle":
                {
                    ToggleTarget script = new ToggleTarget();
                    script.Load(node);
                    Actions.Add(script);
                }
                break;

                default:
                {
                    Trace.WriteLine("[ScriptChoice] LoadActions() : Unknown node \"{0}\"", node.Name);
                }
                break;
                }
            }
        }
示例#5
0
        /// <summary>
        /// Loads a party
        /// </summary>
        /// <param name="filename">Xml data</param>
        /// <returns>True if team successfuly loaded, otherwise false</returns>
        public virtual bool Load(XmlNode xml)
        {
            if (xml == null)
            {
                return(false);
            }


            Action = null;

            switch (xml.Name)
            {
            case SpawnMonster.Tag:
            {
                Action = new SpawnMonster();
            }
            break;

            case EnableTarget.Tag:
            {
                Action = new EnableTarget();
            }
            break;

            case DisableTarget.Tag:
            {
                Action = new DisableTarget();
            }
            break;

            case ActivateTarget.Tag:
            {
                Action = new ActivateTarget();
            }
            break;

            case DeactivateTarget.Tag:
            {
                Action = new DeactivateTarget();
            }
            break;

            case ChangePicture.Tag:
            {
                Action = new ChangePicture();
            }
            break;

            case ChangeText.Tag:
            {
                Action = new ChangeText();
            }
            break;

            case DisableChoice.Tag:
            {
                Action = new DisableChoice();
            }
            break;

            case EnableChoice.Tag:
            {
                Action = new EnableChoice();
            }
            break;

            case EndChoice.Tag:
            {
                Action = new EndChoice();
            }
            break;

            case EndDialog.Tag:
            {
                Action = new EndDialog();
            }
            break;

            case GiveExperience.Tag:
            {
                Action = new GiveExperience();
            }
            break;

            case GiveItem.Tag:
            {
                Action = new GiveItem();
            }
            break;

            case Healing.Tag:
            {
                Action = new Healing();
            }
            break;

            case JoinCharacter.Tag:
            {
                Action = new JoinCharacter();
            }
            break;

            case PlaySound.Tag:
            {
                Action = new PlaySound();
            }
            break;

            case SetTo.Tag:
            {
                Action = new SetTo();
            }
            break;

            case Teleport.Tag:
            {
                Action = new Teleport();
            }
            break;

            case ToggleTarget.Tag:
            {
                Action = new ToggleTarget();
            }
            break;

            case DisplayMessage.Tag:
            {
                Action = new DisplayMessage();
            }
            break;

            default:
            {
                Trace.WriteLine("[ScriptBase] Load() : Unknown node \"" + xml.Name + "\" found.");
                return(false);
            }
            }

            if (Action == null)
            {
                return(false);
            }


            Action.Load(xml);

            return(true);
        }