|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
|
using System.Drawing;
|
|
|
using System.Linq;
|
|
|
using System.Windows.Forms;
|
|
|
+using NTERA.Console.RenderItem;
|
|
|
|
|
|
namespace NTERA.Console
|
|
|
{
|
|
@@ -28,6 +29,24 @@ namespace NTERA.Console
|
|
|
|
|
|
public void WriteItem(IRenderItem item)
|
|
|
{
|
|
|
+ var list = Items[Items.Count - 1];
|
|
|
+
|
|
|
+ var lastItem = list.LastOrDefault();
|
|
|
+
|
|
|
+ if (lastItem != null)
|
|
|
+ {
|
|
|
+ if (lastItem is TextRenderItem lastTextItem && item is TextRenderItem newTextItem)
|
|
|
+ {
|
|
|
+ if (lastTextItem.TextBrush.Color == newTextItem.TextBrush.Color)
|
|
|
+ {
|
|
|
+ lastTextItem.Text += newTextItem.Text;
|
|
|
+
|
|
|
+ AddedItem?.Invoke(item);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Items[Items.Count - 1].Add(item);
|
|
|
|
|
|
AddedItem?.Invoke(item);
|