Trade Menu Spreadsheet
Implemented generic spreadsheet component for the Trade menu with sortable and resizable data columns
This commit is contained in:
parent
e3de7158fd
commit
8036585ebc
46 changed files with 21429 additions and 17151 deletions
35
Assets/Scripts/EventLog.cs
Normal file
35
Assets/Scripts/EventLog.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class EventLog : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI Log;
|
||||
public int LineCount = 16;
|
||||
|
||||
private SizedQueue<string> LogMessages;
|
||||
private StringBuilder LogText;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
LogMessages = new SizedQueue<string>(LineCount);
|
||||
LogText = new StringBuilder();
|
||||
Log.text = LogText.ToString();
|
||||
}
|
||||
|
||||
public void LogMessage(string text)
|
||||
{
|
||||
LogMessage(text, Color.white);
|
||||
}
|
||||
|
||||
public void LogMessage(string text, Color color)
|
||||
{
|
||||
LogMessages.Enqueue($"<color=#{ColorUtility.ToHtmlStringRGB(color)}>{text}");
|
||||
LogText.Clear();
|
||||
foreach (var s in LogMessages) LogText.AppendLine(s);
|
||||
Log.text = LogText.ToString();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue