diff --git a/Intersect (Core)/GameObjects/Events/Commands/EventCommands.cs b/Intersect (Core)/GameObjects/Events/Commands/EventCommands.cs index c489c40825..852b5a55c4 100644 --- a/Intersect (Core)/GameObjects/Events/Commands/EventCommands.cs +++ b/Intersect (Core)/GameObjects/Events/Commands/EventCommands.cs @@ -180,6 +180,8 @@ public partial class AddChatboxTextCommand : EventCommand public string Color { get; set; } = ""; public ChatboxChannel Channel { get; set; } = ChatboxChannel.Player; + + public bool ShowChatBubble { get; set; } } public partial class SetVariableCommand : EventCommand diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.Designer.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.Designer.cs index 76735d621a..18ffe910e0 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.Designer.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.Designer.cs @@ -40,6 +40,7 @@ private void InitializeComponent() this.lblText = new System.Windows.Forms.Label(); this.btnCancel = new DarkUI.Controls.DarkButton(); this.btnSave = new DarkUI.Controls.DarkButton(); + this.chkShowChatBubble = new DarkUI.Controls.DarkCheckBox(); this.grpChatboxText.SuspendLayout(); this.SuspendLayout(); // @@ -47,6 +48,7 @@ private void InitializeComponent() // this.grpChatboxText.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); this.grpChatboxText.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); + this.grpChatboxText.Controls.Add(this.chkShowChatBubble); this.grpChatboxText.Controls.Add(this.lblCommands); this.grpChatboxText.Controls.Add(this.cmbChannel); this.grpChatboxText.Controls.Add(this.lblChannel); @@ -59,7 +61,7 @@ private void InitializeComponent() this.grpChatboxText.ForeColor = System.Drawing.Color.Gainsboro; this.grpChatboxText.Location = new System.Drawing.Point(3, 3); this.grpChatboxText.Name = "grpChatboxText"; - this.grpChatboxText.Size = new System.Drawing.Size(259, 281); + this.grpChatboxText.Size = new System.Drawing.Size(259, 295); this.grpChatboxText.TabIndex = 17; this.grpChatboxText.TabStop = false; this.grpChatboxText.Text = "Add Chatbox Text"; @@ -82,9 +84,13 @@ private void InitializeComponent() this.cmbChannel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); this.cmbChannel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); this.cmbChannel.BorderStyle = System.Windows.Forms.ButtonBorderStyle.Solid; + this.cmbChannel.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(43)))), ((int)(((byte)(43))))); + this.cmbChannel.DrawDropdownHoverOutline = false; + this.cmbChannel.DrawFocusRectangle = false; this.cmbChannel.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.cmbChannel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbChannel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cmbChannel.ForeColor = System.Drawing.Color.Gainsboro; this.cmbChannel.FormattingEnabled = true; this.cmbChannel.Items.AddRange(new object[] { "Player", @@ -92,8 +98,10 @@ private void InitializeComponent() "Global"}); this.cmbChannel.Location = new System.Drawing.Point(7, 206); this.cmbChannel.Name = "cmbChannel"; - this.cmbChannel.Size = new System.Drawing.Size(232, 21); + this.cmbChannel.Size = new System.Drawing.Size(246, 21); this.cmbChannel.TabIndex = 26; + this.cmbChannel.Text = "Player"; + this.cmbChannel.TextPadding = new System.Windows.Forms.Padding(2); // // lblChannel // @@ -109,19 +117,25 @@ private void InitializeComponent() this.cmbColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); this.cmbColor.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); this.cmbColor.BorderStyle = System.Windows.Forms.ButtonBorderStyle.Solid; + this.cmbColor.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(43)))), ((int)(((byte)(43))))); + this.cmbColor.DrawDropdownHoverOutline = false; + this.cmbColor.DrawFocusRectangle = false; this.cmbColor.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.cmbColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cmbColor.ForeColor = System.Drawing.Color.Gainsboro; this.cmbColor.FormattingEnabled = true; - this.cmbColor.Location = new System.Drawing.Point(9, 157); + this.cmbColor.Location = new System.Drawing.Point(7, 162); this.cmbColor.Name = "cmbColor"; - this.cmbColor.Size = new System.Drawing.Size(232, 21); + this.cmbColor.Size = new System.Drawing.Size(246, 21); this.cmbColor.TabIndex = 24; + this.cmbColor.Text = null; + this.cmbColor.TextPadding = new System.Windows.Forms.Padding(2); // // lblColor // this.lblColor.AutoSize = true; - this.lblColor.Location = new System.Drawing.Point(6, 141); + this.lblColor.Location = new System.Drawing.Point(6, 146); this.lblColor.Name = "lblColor"; this.lblColor.Size = new System.Drawing.Size(34, 13); this.lblColor.TabIndex = 23; @@ -136,7 +150,7 @@ private void InitializeComponent() this.txtAddText.Multiline = true; this.txtAddText.Name = "txtAddText"; this.txtAddText.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; - this.txtAddText.Size = new System.Drawing.Size(234, 100); + this.txtAddText.Size = new System.Drawing.Size(246, 100); this.txtAddText.TabIndex = 22; // // lblText @@ -150,7 +164,7 @@ private void InitializeComponent() // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(89, 252); + this.btnCancel.Location = new System.Drawing.Point(89, 264); this.btnCancel.Name = "btnCancel"; this.btnCancel.Padding = new System.Windows.Forms.Padding(5); this.btnCancel.Size = new System.Drawing.Size(75, 23); @@ -160,7 +174,7 @@ private void InitializeComponent() // // btnSave // - this.btnSave.Location = new System.Drawing.Point(7, 252); + this.btnSave.Location = new System.Drawing.Point(7, 264); this.btnSave.Name = "btnSave"; this.btnSave.Padding = new System.Windows.Forms.Padding(5); this.btnSave.Size = new System.Drawing.Size(75, 23); @@ -168,7 +182,15 @@ private void InitializeComponent() this.btnSave.Text = "Ok"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // EventCommand_ChatboxText + // chkShowChatBubble + // + this.chkShowChatBubble.Location = new System.Drawing.Point(7, 236); + this.chkShowChatBubble.Name = "chkShowChatBubble"; + this.chkShowChatBubble.Size = new System.Drawing.Size(111, 17); + this.chkShowChatBubble.TabIndex = 57; + this.chkShowChatBubble.Text = "Show Chat Bubble"; + // + // EventCommandChatboxText // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; @@ -176,7 +198,7 @@ private void InitializeComponent() this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(48))))); this.Controls.Add(this.grpChatboxText); this.Name = "EventCommandChatboxText"; - this.Size = new System.Drawing.Size(268, 287); + this.Size = new System.Drawing.Size(268, 304); this.grpChatboxText.ResumeLayout(false); this.grpChatboxText.PerformLayout(); this.ResumeLayout(false); @@ -195,5 +217,6 @@ private void InitializeComponent() private DarkComboBox cmbChannel; private System.Windows.Forms.Label lblChannel; private System.Windows.Forms.Label lblCommands; + private DarkCheckBox chkShowChatBubble; } } diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.cs index ff8eec4c2f..d6dd51c2a5 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ChatboxText.cs @@ -36,6 +36,7 @@ public EventCommandChatboxText(AddChatboxTextCommand refCommand, FrmEvent editor } cmbChannel.SelectedIndex = (int) mMyCommand.Channel; + chkShowChatBubble.Checked = mMyCommand.ShowChatBubble; } private void InitLocalization() @@ -50,6 +51,7 @@ private void InitLocalization() { cmbChannel.Items.Add(Strings.EventChatboxText.channels[i]); } + chkShowChatBubble.Text = Strings.EventChatboxText.ShowChatBubble; btnSave.Text = Strings.EventChatboxText.okay; btnCancel.Text = Strings.EventChatboxText.cancel; @@ -60,6 +62,7 @@ private void btnSave_Click(object sender, EventArgs e) mMyCommand.Text = txtAddText.Text; mMyCommand.Color = cmbColor.Text; mMyCommand.Channel = (ChatboxChannel) cmbChannel.SelectedIndex; + mMyCommand.ShowChatBubble = chkShowChatBubble.Checked; mEventEditor.FinishCommandEdit(); } diff --git a/Intersect.Editor/Localization/Strings.cs b/Intersect.Editor/Localization/Strings.cs index 3d6a7e5cd2..a670790a0d 100644 --- a/Intersect.Editor/Localization/Strings.cs +++ b/Intersect.Editor/Localization/Strings.cs @@ -1855,6 +1855,8 @@ public partial struct EventChatboxText public static LocalizedString title = @"Add Chatbox Text"; + public static LocalizedString ShowChatBubble = @"Show Chat Bubble"; + } public partial struct EventCommandList diff --git a/Intersect.Server/Entities/Events/CommandProcessing.cs b/Intersect.Server/Entities/Events/CommandProcessing.cs index e7bb8b0f3e..fcbc413265 100644 --- a/Intersect.Server/Entities/Events/CommandProcessing.cs +++ b/Intersect.Server/Entities/Events/CommandProcessing.cs @@ -162,6 +162,17 @@ Stack callStack } break; } + + if (command.ShowChatBubble) + { + PacketSender.SendChatBubbleToPlayer( + player, + instance.PageInstance.Id, + instance.PageInstance.GetEntityType(), + txt, + instance.PageInstance.MapId + ); + } } //Set Variable Commands diff --git a/Intersect.Server/Networking/PacketSender.cs b/Intersect.Server/Networking/PacketSender.cs index 2d0a552fc9..2b79123f3a 100644 --- a/Intersect.Server/Networking/PacketSender.cs +++ b/Intersect.Server/Networking/PacketSender.cs @@ -1907,6 +1907,12 @@ public static void SendChatBubble(Guid entityId, Guid mapInstanceId, EntityType SendDataToProximityOnMapInstance(mapId, mapInstanceId, new ChatBubblePacket(entityId, type, mapId, text), null, TransmissionMode.Any); } + //ChatBubblePacket + public static void SendChatBubbleToPlayer(Player player, Guid entityId, EntityType type, string text, Guid mapId) + { + player.SendPacket(new ChatBubblePacket(entityId, type, mapId, text)); + } + //QuestOfferPacket public static void SendQuestOffer(Player player, Guid questId) {