Esempio n. 1
0
        public Option(OptionsList optionsList, ActiveConversation activeConversation, ReplyOption replyOption, int i, int numOptions)
        {
            this._activeConversation = activeConversation;
            this._optionIndex        = i;

            float height = (optionsList.Size.Y - ConversationMessage.Height) / numOptions;
            float width  = optionsList.Size.X;

            this.Size.Set(width, height);

            float top  = optionsList.Position.Y + ConversationMessage.Height + height * i;
            float left = optionsList.Position.X;

            this.Position.Set(left, top);

            this.Caption.Set(replyOption.ReplyText);
            this.Font.Set(Fonts.Default);
            this.FontSize.Set(14);

            this.RenderText.FontColor       = RGBA.White;
            this.RenderText.BorderColor     = RGBA.Black;
            this.RenderText.BorderThickness = 1f;

            this.RenderText.Alignment = new TextAlignment()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Middle,
                Size = this.Size
            };
        }
Esempio n. 2
0
        private void ActiveConvo_OnActiveConversationUpdated(ActiveConversation conversation)
        {
            if (conversation.IsOver)
            {
                ServiceProvider.SceneService.CurrentScene.RemoveElementById(DialogGuid);
                return;
            }

            this.OnActiveConversationDialogChanged?.Invoke(conversation);
        }
Esempio n. 3
0
        private void ActiveConversationDialog_OnActiveConversationDialogChanged(ActiveConversation activeConversation)
        {
            this._children.Clear();

            var options = activeConversation.CurrentPage !.ReplyOptions;

            for (int i = 0; i < options.Count; i++)
            {
                this.AddChild(new Option(this, activeConversation, options[i], i, options.Count));
            }
        }
Esempio n. 4
0
        private ActiveConversationDialog(string id) : base(DialogGuid)
        {
            var camera = ServiceProvider.Canvas.GetCamera();

            this.Size.Set(new ScalingVector(camera.Size, 1, 0.4f));
            this.Position.Set(new ScalingVector(camera.Size, 0, 0.6f));

            var convoService = AstroSoarServiceProvider.ConversationService;
            var activeConvo  = new ActiveConversation(convoService.Load(id));

            activeConvo.OnActiveConversationUpdated += this.ActiveConvo_OnActiveConversationUpdated;

            this._background = new Background(this);
            this.AddChild(new ConversationMessage(this));
            this.AddChild(new DisplayBox(this));
            this.AddChild(new OptionsList(this));

            this.OnActiveConversationDialogChanged?.Invoke(activeConvo);
        }
Esempio n. 5
0
 /// <summary>
 /// Finds a dialog by id in the active conversation.
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Dialog FindDialogById(int id)
 {
     return(ActiveConversation.FindDialogById(id));
 }
Esempio n. 6
0
 /// <summary>
 /// Removes a dialog from the current active conversation using the dialog id.
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool RemoveDialog(int id)
 {
     return(ActiveConversation.RemoveDialog(id));
 }
Esempio n. 7
0
 /// <summary>
 /// Removes a dialog from the current active conversation.
 /// </summary>
 /// <param name="dialog"></param>
 /// <returns></returns>
 public bool RemoveDialog(Dialog dialog)
 {
     return(ActiveConversation.RemoveDialog(dialog));
 }
Esempio n. 8
0
 /// <summary>
 /// Adds a dialog to the current active conversation.
 /// </summary>
 /// <returns></returns>
 public Dialog AddDialog()
 {
     return(ActiveConversation.AddDialog());
 }
Esempio n. 9
0
 private void Dialog_OnActiveConversationDialogChanged(ActiveConversation obj)
 {
     this.ImageTextureName.Set(obj.CurrentPage?.DisplayBoxTexture);
 }
Esempio n. 10
0
 private void Dialog_OnActiveConversationDialogChanged(ActiveConversation obj)
 {
 }