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 }; }
private void ActiveConvo_OnActiveConversationUpdated(ActiveConversation conversation) { if (conversation.IsOver) { ServiceProvider.SceneService.CurrentScene.RemoveElementById(DialogGuid); return; } this.OnActiveConversationDialogChanged?.Invoke(conversation); }
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)); } }
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); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <summary> /// Adds a dialog to the current active conversation. /// </summary> /// <returns></returns> public Dialog AddDialog() { return(ActiveConversation.AddDialog()); }
private void Dialog_OnActiveConversationDialogChanged(ActiveConversation obj) { this.ImageTextureName.Set(obj.CurrentPage?.DisplayBoxTexture); }
private void Dialog_OnActiveConversationDialogChanged(ActiveConversation obj) { }