void IEditorComponent.FromXml(XmlNode node)
{
globalsTable.Clear();
if (node != null)
{
XmlElement xmlLua = node["Lua"];
if (xmlLua != null)
{
/*
XmlElement rooms = lua["Rooms"];
if (rooms != null)
{
foreach (XmlNode roomNode in rooms.ChildNodes)
{
if (roomNode is XmlElement && roomNode.Name == "Room")
{
CachedRoomInfo roomInfo = new CachedRoomInfo((XmlElement)roomNode);
RoomInfoCache[roomInfo.Number] = roomInfo;
}
}
}
*/
if (xmlLua.HasAttribute("Enabled"))
{
IsPluginEnabled = bool.Parse(xmlLua.GetAttribute("Enabled"));
}
if (xmlLua.HasAttribute("ShownEnableMessage"))
{
ShownEnableMessage = bool.Parse(xmlLua.GetAttribute("ShownEnableMessage"));
}
if (xmlLua.HasAttribute("ShownDisableMessage"))
{
ShownDisableMessage = bool.Parse(xmlLua.GetAttribute("ShownDisableMessage"));
}
XmlElement xmlLuaScriptFolderRoot = xmlLua["LuaScriptFolderRoot"];
if (xmlLuaScriptFolderRoot != null)
{
restoredScriptsInfo = xmlLuaScriptFolderRoot;
}
XmlElement xmlCompileTimeScripts = xmlLua["CompileTimeScripts"];
if (xmlCompileTimeScripts != null)
{
restoredCompileScripts = new List<string>();
foreach (XmlNode xmlScript in xmlCompileTimeScripts)
{
if (xmlScript.NodeType == XmlNodeType.Element && xmlScript.Name == "Script")
{
restoredCompileScripts.Add(xmlScript.InnerText);
}
}
}
else
{
restoredCompileScripts = null;
}
XmlElement xml_G = xmlLua["_G"];
if (xml_G != null)
{
MessageBox.Show(xml_G.OuterXml);
globalsTable.FromXml(xml_G);
}
}
}
}