public void Close()
        {
            this.Character.CloseDialog(this);
            this.Prism.OnDialogClosed(this);

            DialogHandler.SendLeaveDialogMessage(this.Character.Client, this.DialogType);
        }
예제 #2
0
    /// <summary>
    /// Set template
    /// </summary>
    /// <param name="commandContext">Command context</param>
    /// <param name="appointmentId">Id of the appointment</param>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    public async Task <bool> SetTemplate(CommandContextContainer commandContext, long appointmentId)
    {
        var success = false;

        var dialogHandler = new DialogHandler(commandContext);

        await using (dialogHandler.ConfigureAwait(false))
        {
            var templateId = await dialogHandler.Run <RaidTemplateSelectionDialogElement, long>()
                             .ConfigureAwait(false);

            if (templateId > 0)
            {
                using (var dbFactory = RepositoryFactory.CreateInstance())
                {
                    success = dbFactory.GetRepository <RaidAppointmentRepository>()
                              .Refresh(obj => obj.Id == appointmentId,
                                       obj => obj.TemplateId = templateId);

                    if (success)
                    {
                        await RefreshAppointment(appointmentId).ConfigureAwait(false);
                    }
                }
            }
        }

        return(success);
    }
예제 #3
0
        public void Close()
        {
            Character.CloseDialog(this);
            TaxCollector.OnDialogClosed(this);

            DialogHandler.SendLeaveDialogMessage(Character.Client, DialogType);
        }
예제 #4
0
        private void ClipPolygons()
        {
            if (Polygons.Count != 2)
            {
                throw new InvalidOperationException("Clipping is only possible for two and exactly two polygons");
            }

            if (Clipper == null)
            {
                throw new InvalidOperationException("No polygon clipper set");
            }

            var resultPolygon = Clipper.GetIntersectedPolygon(Polygons[0].Points, Polygons[1].Points);

            if (resultPolygon.IsEmpty)
            {
                DialogHandler?.ShowMessageBox("No overlap");
            }
            else
            {
                Polygons.Clear();
                var color = GenerateRandomColor();
                Polygons.Add(new Polygon
                {
                    Description = "Clipped Polygon",
                    Points      = resultPolygon,
                    StrokeColor = color,
                    FillColor   = Color.FromArgb(128, color)
                });
            }
        }
예제 #5
0
 public void triggerDialog(string dialogName)
 {
     Debug.Log("Show dialog " + dialogName);
     currentDialog = dialogues.transform.Find(dialogName).GetComponent <DialogHandler>();
     textPanelGameObject.SetActive(true);
     nextDialog();
 }
        private readonly VoiceToText _voiceToText; //Speech recognition from cognative services 

        public MainWindow()
        {
            UiLog.Info("bio info UI started");
            InitializeComponent();
            _messageSide = MessageSide.BioInfoSide;
            Messages = new MessageCollection
            {
                new Message
                {
                    Side = MessageSide.BioInfoSide,
                    Text = "Welcome to the B,M,S, Bio Info A,I Terminal. How may I help you today?"
                }
            };

            _updater = new BioInfoUpdater(); // version checks & updates
            _dialogHandler = new DialogHandler(this); // DialogHandler
            _bioInfoVoice = new SpeechSynthesizer();
            _voiceToText = new VoiceToText();

            DataContext = Messages;
            _scrollViewerScrollToEndAnim = new DoubleAnimation
            {
                Duration = TimeSpan.FromSeconds(1),
                EasingFunction = new SineEase()
            };
            Storyboard.SetTarget(_scrollViewerScrollToEndAnim, this);
            Storyboard.SetTargetProperty(_scrollViewerScrollToEndAnim, new PropertyPath(_verticalOffsetProperty));

            _scrollViewerStoryboard = new Storyboard();
            _scrollViewerStoryboard.Children.Add(_scrollViewerScrollToEndAnim);
            Resources.Add("foo", _scrollViewerStoryboard);
            tbTextInput.Focus();
        }
예제 #7
0
    void OnDialogHandlerLifetimeEnded(GameObject sender)
    {
        DialogHandler handler    = sender.GetComponent <DialogHandler>();
        DialogSO      nextDialog = handler.dialogSO.nextDialog;


        if (!handler.dialogSO.isWithNext)        // not in the same line
        {
            foreach (var item in dialogContainer)
            {
                item.GetComponent <DialogHandler>().FadeOutTransition();
            }
            dialogContainer.Clear();
        }

        if (nextDialog != null)
        {
            //still on the same character talk
            if (nextDialog.actor == actor)
            {
                Talk(nextDialog);
            }
            else
            {
                handler.OnObjectDestroyed += OnDialogHandlerObjectDestroyed;
            }
        }
    }
예제 #8
0
        /// <summary>
        /// The on create method.
        /// </summary>
        /// <param name="savedInstanceState">The saved instance state.</param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //Start by calling the base create method.
            base.OnCreate(savedInstanceState);

            //Initialize the essentials with Androids activity and bundle.
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            //Create the dialog handler.
            this.dialogHandler = new DialogHandler(this);

            //Set the context view to the main view.
            this.SetContentView(Resource.Layout.activity_main);

            //Set the tool bar.
            this.SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar));

            //From here on in we need permissions so we need to check and see if we have them.
            //If we do we'll continue, if not we'll wait until the permissions have been resolved.
            if (this.CheckPermissions())
            {
                //Create the location database handler.
                this.locationDatabaseHandler = new LocationDatabaseHandler();

                //Setup the location manager.
                this.SetupLocationManager();

                //Setup the list view.
                this.SetupListView();
            }
        }
예제 #9
0
        /// <summary>
        /// Generic method that deletes a row from a given table (type) from the database, via HTTP requests.
        /// </summary>
        /// <param name="id">The ID that corresponds to the Booking that needs to be deleted (Comes from the SelectedBooking property in UserBookingsVM).</param>
        /// <param name="uriIdentifier">The string that represents the table (in plural) that gets called in the URL to call HTTP requests. For exampel: api/Bookings, where "Bookings" needs to be specified in the uriIdentifier.</param>
        public static void DeleteFromDatabaseAsync(string uriIdentifier, int id)
        {
            HttpClientHandler handler = new HttpClientHandler();

            handler.UseDefaultCredentials = true;
            using (var client = new HttpClient(handler))
            {
                client.BaseAddress = new Uri(serverUrl);
                client.DefaultRequestHeaders.Clear();
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                try
                {
                    var response = client.DeleteAsync("api/" + uriIdentifier + "/" + id).Result;
                }
                catch (ArgumentNullException e)
                {
                    DialogHandler.Dialog(e.Message + "\nPrøv at genstart programmet og prøv derefter igen", "Parameter blev ikke fundet");
                }
                catch (InvalidOperationException e)
                {
                    DialogHandler.Dialog(e.Message + "\nKontant appens administratorer for yderligere hjælp", "Ugyldig aktion");
                }
                catch (HttpRequestException e)
                {
                    DialogHandler.Dialog(e.Message + "\nPrøv igen senere\nTjek eventuelt din forbindelse til internettet", "Ingen kontakt med serveren");
                }
                catch (Exception)
                {
                    DialogHandler.Dialog("Der gik noget galt ved sletning af dette object\nKontakt programmets administratorer for yderligere hjælp", "Noget gik galt");
                }
            }
        }
    override public void StartSpeech()
    {
        if (!quest)
        {
            Debug.LogError("There is no quest set in the inspector for the Conversation Descision.");
            return;
        }

        DialogHandler dh = DialogHandler.Instance;

        if (!dh)
        {
            Debug.LogError("There is no Dialog Handler instance in the current scene/s");
            return;
        }

        if (!quest.IsUnlocked)
        {
            beforeUnlockedConversation.StartSpeech();
        }
        else if (!quest.IsCompleted)
        {
            afterUnlockedConversation.StartSpeech();
        }
        else
        {
            afterCompletedConversation.StartSpeech();
        }
    }
예제 #11
0
파일: MainMenu.cs 프로젝트: aPisC/JxBP_2019
    public void Continue()
    {
        List <Sprite> sp  = new List <Sprite>();
        List <int>    ids = new List <int>();

        for (int i = 0; i < characterSprites.Length; i++)
        {
            if (SaveHandler.GetSave(i) != null)
            {
                sp.Add(characterSprites[i]);
                ids.Add(i);
            }
        }

        SliderHandler.OpenScene(sp, (i) => {
            if (i != -1)
            {
                MapGenerator.saveid = ids[i];
                Sprite[] ff         = new Sprite[1];
                ff[0] = FunfactSprites[Random.Range(0, FunfactSprites.Length)];
                DialogHandler.OpenDialogScene(ff, () => UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene"), 0);
                //UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene");
            }
            else
            {
                UnityEngine.SceneManagement.SceneManager.LoadScene("Menu");
            }
        });
    }
예제 #12
0
    /// <summary>
    /// Adding a one time event
    /// </summary>
    /// <param name="commandContext">Command context</param>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    public async Task AddOneTimeEvent(CommandContextContainer commandContext)
    {
        var data = await DialogHandler.RunForm <CreateOneTimeEventFormData>(commandContext, false)
                   .ConfigureAwait(false);

        if (data != null)
        {
            using (var dbFactory = RepositoryFactory.CreateInstance())
            {
                var appointmentTime = dbFactory.GetRepository <CalendarAppointmentTemplateRepository>()
                                      .GetQuery()
                                      .Where(obj => obj.Id == data.TemplateId)
                                      .Select(obj => obj.AppointmentTime)
                                      .First();

                if (dbFactory.GetRepository <CalendarAppointmentRepository>()
                    .Add(new CalendarAppointmentEntity
                {
                    CalendarAppointmentScheduleId = null,
                    CalendarAppointmentTemplateId = data.TemplateId,
                    TimeStamp = data.Day.Add(appointmentTime)
                }))
                {
                    await _messageBuilder.RefreshMessages(commandContext.Guild.Id)
                    .ConfigureAwait(false);
                }
            }
        }
    }
예제 #13
0
    public void CheckForUpdate()
    {
        if (DialogHandler.NpcResponse == null)
        {
            return;
        }
        DialogModel.NpcName.text = DialogHandler.DialogNpc != null?DialogHandler.DialogNpc.GetName() : DialogHandler.CustomDialogName;

        DialogModel.NpcText.text = DialogHandler.NpcResponse.DialogText;

        DialogModel.NpcImage.sprite = DialogHandler.DialogNpc != null?GeneralMethods.CreateSprite(DialogHandler.DialogNpc.GetImage()) : DialogHandler.CustomDialogSprite;

        DialogModel.PlayerResponseHolder.transform.DestroyChildren();

        DialogHandler.CheckResponses();
        var        responses   = DialogHandler.GetResponses();
        GameObject firstButton = null;

        foreach (var response in responses)
        {
            var go = Instantiate(PlayerResponsePrefab, Vector3.zero, Quaternion.identity) as GameObject;
            go.transform.SetParent(DialogModel.PlayerResponseHolder.transform, false);
            var playerResponseModel = go.GetComponent <PlayerResponseModel>();
            playerResponseModel.Init(response, response.DialogText);
            firstButton = firstButton ?? go;
        }

        EventSystem.SetSelectedGameObject(firstButton);
    }
예제 #14
0
 public MainWindow()
 {
     _dialogHandler     = new DialogHandler();
     _resEdit           = new ResourceEdit();
     _entityContentList = new List <EntityContent>();
     InitializeComponent();
 }
예제 #15
0
 void Start()
 {
     sliderHandler = GameObject.Find("SliderHandler").GetComponent <SliderHandler>();
     dialogHandler = GameObject.Find("DialogBorder").GetComponent <DialogHandler>();
     computerAI    = GameObject.Find("ComputerAI").GetComponent <ComputerAI>();
     diceHandler   = GameObject.Find("DicePanel").GetComponent <DiceHandler>();
     buttonHandler = GameObject.Find("ButtonHandler").GetComponent <ButtonHandler>();
 }
예제 #16
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.Log("Multiple PropertyPurchaseHandler. Something went wrong");
     }
     instance = this;
 }
예제 #17
0
    /// <summary>
    /// Managing the templates
    /// </summary>
    /// <param name="commandContext">Command context</param>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    public async Task RunAssistantAsync(CommandContextContainer commandContext)
    {
        bool repeat;

        do
        {
            repeat = await DialogHandler.Run <CalendarTemplateSetupDialogElement, bool>(commandContext).ConfigureAwait(false);
        }while (repeat);
    }
예제 #18
0
 void Awake()
 {
     playerMovement   = GetComponent <Movement>();
     dialogController = GetComponent <DialogHandler>();
     westFacing       = new Vector2(-1, 0);
     northFacing      = new Vector2(0, 1);
     eastFacing       = new Vector2(1, 0);
     southFacing      = new Vector2(0, -1);
 }
예제 #19
0
    public static void AddDestroyAction(DialogHandler handler, UnityAction action)
    {
        if (handler == null)
        {
            return;
        }

        handler.destroyedAction += action;
    }
예제 #20
0
    public static void OpenDialogScene(IList <Sprite> sprites, Action then, float timeout = 0, bool clickAllowed = true)
    {
        UnityEngine.SceneManagement.SceneManager.LoadScene("DialogScene");
        DialogHandler dh = GameObject.FindObjectOfType <DialogHandler>();

        crossSceneAfter   = then;
        crossSceneSprites = sprites;
        crossSceneTimeout = timeout;
        allowClick        = clickAllowed;
    }
예제 #21
0
    /// <summary>
    /// Editing a existing account
    /// </summary>
    /// <param name="commandContext">Command context</param>
    /// <param name="name">Name</param>
    /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
    private async Task Edit(CommandContextContainer commandContext, string name)
    {
        bool repeat;

        do
        {
            repeat = await DialogHandler.Run <AccountEditDialogElement, bool>(commandContext, dialogContext => dialogContext.SetValue("AccountName", name))
                     .ConfigureAwait(false);
        }while (repeat);
    }
예제 #22
0
    void OnDialogHandlerObjectDestroyed(GameObject sender)
    {
        DialogHandler handler    = sender.GetComponent <DialogHandler>();
        DialogSO      nextDialog = handler.dialogSO.nextDialog;

        if (nextDialog != null)
        {
            ActorSingleton.shared(nextDialog.actor.ToString()).Talk(nextDialog);
        }
    }
예제 #23
0
 public void addDosis(float dosis)
 {
     maxDosis    = map.width * map.height * 65;
     this.dosis += dosis;
     if (this.dosis >= maxDosis)
     {
         MapGenerator m = GetComponent <MapGenerator>();
         SaveHandler.SaveGame(MapGenerator.saveid, m.width, m.height, m.cells);
         DialogHandler.OpenDialogScene(TreatmentFinishedSprites, () => UnityEngine.SceneManagement.SceneManager.LoadScene("Menu"), 3000, false);
     }
 }
예제 #24
0
    public void startDialog(DialogHandler handler, string initialText)
    {
        currentHandler = handler;

        ActiveDialog = true;
        if (!hasStartedDialog)
        {
            hasStartedDialog = true;
            initiateDialog(initialText);
        }
    }
예제 #25
0
    private string fullText        = "";   //the full text to show.

    private void Awake()
    {
        if (singleton_ && singleton_ != this)
        {
            Destroy(this);
        }
        else
        {
            singleton_ = this;
        }
    }
예제 #26
0
    void Start()
    {
        player      = manager.getPlayer();
        cardObjects = new List <GameObject>();

        dialogHandler = selectDialog.GetComponentInChildren <DialogHandler>();
        dialogHandler.setActionManager(this);

        skipButton.GetComponent <Button>().onClick.AddListener(skip);

        showSpecialCards();
    }
예제 #27
0
    public void ShowTestDialog()
    {
        var handler = DialogHandler.ShowDialog(
            "タイトル",
            "恥の多い生涯を送って来ました。自分には、人間の生活というものが、見当つかないのです。自分は東北の田舎に生れましたので、汽車をはじめて見たのは、よほど大きくなってからでした。自分は停車場のブリッジを、上って、降りて、そうしてそれが線路をまたぎ越えるために造られたものだという事には全然気づかず、ただそれは停車場の構内を外国の遊戯場みたいに、複雑に楽しく、ハイカラにするためにのみ、設備せられてあるものだ",
            "失格",
            "合格");

        DialogHandler.SetNoAction(handler, () => { Debug.Log("失格"); });
        DialogHandler.SetYesAction(handler, () => { Debug.Log("合格"); });
        DialogHandler.AddDestroyAction(handler, () => { Debug.Log("人類滅亡"); });
    }
예제 #28
0
 public void AddExporter(IExporter exporter)
 {
     OnBeginDialogs         += new DialogsHandler(exporter.BeginDialogs);
     OnBeginDialog          += new DialogHandler(exporter.BeginDialog);
     OnBeginMessage         += new AbsMessageHandler(exporter.BeginMessage);
     OnExportMessage        += new MessageHandler(exporter.ExportMessage);
     OnExportMessageService += new MessageServiceHandler(exporter.ExportMessageService);
     OnEndMessage           += new AbsMessageHandler(exporter.EndMessage);
     OnEndDialog            += new DialogHandler(exporter.EndDialog);
     OnEndDialogs           += new DialogsHandler(exporter.EndDialogs);
     OnAbort += new Action(exporter.Abort);
 }
        public ManageDataSetViewModel(IDataSetManager dataSetManager, DialogHandler dialogHandler)
        {
            _dataSetManager = dataSetManager;
            _dialogHandler  = dialogHandler;

            AddCommand               = new RelayCommand(async() => await Add());
            CloneDatasetCommand      = new RelayCommand(async() => await Add(SelectedDataSet));
            ImportDocumentCommand    = new RelayCommand(ImportJson <object>);
            ImportTagCommand         = new RelayCommand(ImportJson <Tag>);
            ImportDocumentCsvCommand = new RelayCommand(ImportCsv <object>);
            ImportTagCsvCommand      = new RelayCommand(ImportCsv <Tag>);
            DoubleClickCommand       = new RelayCommand(() =>
            {
                if (SelectedDataSet != null)
                {
                    Messenger.Default.Send(new UpdateMessage(UpdateType.OpenNewTab,
                                                             new HeaderedItemViewModel(SelectedDataSet.Name + " -Data",
                                                                                       new ManageData {
                        DataContext = new ManageDataViewModel(SelectedDataSet, _dialogHandler)
                    }, true)));
                }
            });
            DeleteCommand = new RelayCommand(Delete);
            RenameCommand = new RelayCommand(Rename);
            LoadedCommand = new RelayCommand(async() =>
            {
                try
                {
                    Mouse.SetCursor(Cursors.Arrow);
                    if (_loadedFirst)
                    {
                        _loadedFirst = false;
                        await _dialogHandler.ShowProgress(null, async() =>
                        {
                            DispatcherHelper.CheckBeginInvokeOnUI(() => DataSets.Clear());
                            var response = await _dataSetManager.GetDataSetsAsync();
                            if (ResponseValidator.Validate(response))
                            {
                                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                                {
                                    response.ResponseObject.ToList().ForEach(ds => DataSets.Add(ds));
                                });
                            }
                        });
                    }
                }
                catch (Exception exception)
                {
                    Messenger.Default.Send(exception);
                }
            });
        }
예제 #30
0
    private void Awake()
    {
        player = this.gameObject;
        GameObject gh = GameObject.Find("GameHandler");

        cam              = transform.Find("PlayerCamera").gameObject.GetComponent <Camera>();
        gameHandler      = gh.GetComponent <GameHandler>();
        guiHandler       = gh.GetComponent <GUIHandler>();
        dialogHandler    = gh.GetComponent <DialogHandler>();
        crosshair        = GameObject.Find("Crosshair").GetComponent <Image>();
        crosshair.sprite = crosshairImage[0];
        inventory        = GetComponent <Inventory>();
    }
예제 #31
0
    //    public static SunDialogue[] SunDialogues;
    // Use this for initialization
    void Start()
    {
        if (Instance != null)
        {
            Debug.LogError("More than one Dialog Handler in scene!");
            return;
        }
        Instance = this;

        DialogUI = gameObject.GetComponentsInChildren<Image>();

        NPCDialogues = FindObjectsOfType(typeof(NPCDialogue)) as NPCDialogue[];

        //SunDialogues = FindObjectsOfType(typeof(SunDialogue)) as SunDialogue[];

        ToggleUI(false);
    }
예제 #32
0
	void Start () {
		handler = GameObject.Find("DialogHandler").GetComponent<DialogHandler>();
	}