/// <summary> /// Ends and executes the current text batch. /// </summary> public static void EndTextBatch() { var data = DataHolder.TerminalData; DebugUtil.Assert(!data.Batching, "THERE'S NO TEXT BATCH HAPPENING!"); data.Batching = false; while (data.BatchEntries.Count > 0) { var entry = SList.Dequeue(data.BatchEntries); switch (entry.EntryType) { case TerminalEntryType.SingleText: ShowText(entry.Texts[0]); break; case TerminalEntryType.DualText: ShowDualText(entry.Texts[0], entry.Texts[1]); break; default: DebugUtil.Log(string.Format("THE TEXT ENTRY TYPE {0} IS NOT IMPLEMENTED!", entry.EntryType), Color.red, DebugUtil.DebugCondition.Always, DebugUtil.LogType.Info); break; } } UpdateTableAndScroll(); }
public static void RemoveTextEntries(int quantity, TerminalEntryRemoveType removeType) { var allEntries = DataHolder.TerminalData.AllEntries; quantity = Math.Min(quantity, allEntries.Count); if (quantity == 0) { return; } switch (removeType) { case TerminalEntryRemoveType.OlderEntries: for (int i = 0; i < quantity; i++) { var item = SList.Dequeue(allEntries); GameObject.Destroy(item.SceneObject); } break; case TerminalEntryRemoveType.NewerEntries: for (int i = 0; i < quantity; i++) { var item = SList.Pop(allEntries); GameObject.Destroy(item.SceneObject); } break; default: DebugUtil.Error(string.Format("TERMINAL ENTRY REMOVE TYPE '{0}' NOT IMPLEMENTED!", removeType)); break; } UpdateTableAndScroll(); }