+EA 23.268 Nightly - Plugin.UI
February 9, 2026
2 files modified. 1 new file created.
Important Changes
None.
BookList
cs
{
public class Item
{
public string[] lines;
public string title;
public string author;
public string id;
public string cat;
public int chance = 100;
public int skin;cs
public static void Init()
{
dict = new Dictionary<string, Dictionary<string, Item>>();
AddDir("Book", CorePath.CorePackage.Book);
AddDir("Scroll", CorePath.CorePackage.Scroll);
if (dict == null)
{
dict = new Dictionary<string, Dictionary<string, Item>>();
AddDir("Book", CorePath.CorePackage.Book);
AddDir("Scroll", CorePath.CorePackage.Scroll);
}
static void AddDir(string id, string path)
{
DirectoryInfo directoryInfo = new DirectoryInfo(path);static void AddDir(string id, string path)
cs
string[] array = streamReader.ReadLine().Split(',');
Item item = new Item
{
cat = id,
title = array[0],
author = ((array.Length >= 2 && !array[1].IsEmpty()) ? "nameAuthor".lang(array[1]) : "unknownAuthor".lang()),
chance = ((array.Length >= 3) ? array[2].ToInt() : 100),static void AddDir(string id, string path)
cs
public static Item GetRandomItem(string idCat = "Book")
{
return dict[idCat].Where((KeyValuePair<string, Item> p) => p.Value.chance != 0).ToList().RandomItem()
Init();
return dict[idCat].Where((KeyValuePair<string, Item> p) => p.Value.chance != 0).ToList().RandomItemWeighted((KeyValuePair<string, Item> p) => p.Value.chance)
.Value;
}
public static Item GetItem(string id, string idCat = "Book")
{
Init();
return dict[idCat].TryGetValue(id) ?? dict["Book"]["_default"];
}
}+BottleMessageList
File Created
cs
using System.Collections.Generic;
using System.Linq;
public class BottleMessageList
{
public static List<BookList.Item> list;
public static void Init()
{
if (list == null)
{
list = new List<BookList.Item>();
string[] dialog = Lang.GetDialog("rumor", "bottle");
int num = 0;
string[] array = dialog;
for (int i = 0; i < array.Length; i++)
{
string[] array2 = array[i].Split('|');
list.Add(new BookList.Item
{
id = (num.ToString() ?? ""),
author = array2[0],
title = array2[1],
lines = new string[4]
{
"",
"",
"{center}",
array2[2]
}
});
num++;
}
}
}
public static BookList.Item GetRandomItem()
{
Init();
return list.RandomItemWeighted((BookList.Item p) => p.chance);
}
public static BookList.Item GetItem(string id)
{
Init();
return list.First((BookList.Item p) => p.id == id) ?? list[0];
}
}UIBook
cs
public void BuildPages()
{
pages.Clear();
string[] array = IO.LoadTextArray(CorePath.CorePackage.Help + idFile);
string[] array = bookItem?.lines ?? IO.LoadTextArray(CorePath.CorePackage.Help + idFile);
if (idFile == "version" && Lang.langCode == "CN")
{
array = IO.LoadTextArray(CorePath.CorePackage.TextEN + idFile);