示例#1
0
 public SimpleLuaValueEditor(LuaForAGSEditorComponent component, VisualLuaTableValue parentTable, VisualLuaValueType newValueType)
 {
     this.component = component;
     this.creatingType = newValueType;
     this.parentTable = parentTable;
     InitializeComponent();
 }
示例#2
0
 public static VisualLuaValue GetFromXml(LuaForAGSEditorComponent editorComponent, string ns, XmlNode node)
 {
     string name = node.Name;
     switch (node.Attributes["Type"].Value)
     {
         case "Number":
             VisualLuaNumberValue num = new VisualLuaNumberValue(editorComponent, ns);
             num.FromXml(node);
             return num;
         case "String":
             VisualLuaStringValue str = new VisualLuaStringValue(editorComponent, ns);
             str.FromXml(node);
             return str;
         case "Boolean":
             VisualLuaBooleanValue bl = new VisualLuaBooleanValue(editorComponent, ns);
             bl.FromXml(node);
             return bl;
         case "Table":
             VisualLuaTableValue tbl = new VisualLuaTableValue(editorComponent, ns);
             tbl.FromXml(node);
             return tbl;
     }
     return null;
 }
        public LuaForAGSEditorComponent(IAGSEditor editor)
        {
            main_L = InvokeLua.luaL_newstate();
            InvokeLua.lua_atpanic(main_L, InvokeLua.ExceptionPanicHandler);
            this.editor = editor;
            editor.GUIController.RegisterIcon("LuaIcon", GetIcon("lua.ico"));
            editor.GUIController.RegisterIcon("LuaGreyIcon", GetIcon("luagrey.ico"));
            editor.GUIController.RegisterIcon("CogIcon", GetIcon("cog.ico"));
            editor.GUIController.RegisterIcon("EmptyIcon", GetIcon("empty.ico"));
            editor.GUIController.RegisterIcon("silk:table", GetIcon("table.ico"));
            editor.GUIController.RegisterIcon("silk:world", GetIcon("world.ico"));
            editor.GUIController.RegisterIcon("silk:wrench", GetIcon("wrench.ico"));
            editor.GUIController.RegisterIcon("silk:textfield", GetIcon("textfield.ico"));
            editor.GUIController.RegisterIcon("silk:contrast", GetIcon("contrast.ico"));
            editor.GUIController.RegisterIcon("silk:page_white_lightning", GetIcon("page_white_lightning.ico"));
            editor.GUIController.ProjectTree.AddTreeRoot(this, CONTROL_ID_LUA, "Lua", "LuaIcon");

            editor.GUIController.AddMenu(this, LUA_MENU, "Lua", editor.GUIController.FileMenuID);
            MenuCommands newCommands = new MenuCommands(LUA_MENU);
            newCommands.Commands.Add(new MenuCommand(LUA_CONVERT_MENUOPTION, "Open Code Converter..."));
            editor.GUIController.AddMenuItems(this, newCommands);

            IsPluginEnabled = false;
            globalsTable = new VisualLuaTableValue(this, VISUAL_ROOT);
            globalsTable.Name = "_G";
            globalsTable.IsGlobalScope = true;

            codeConvertPane = new CodeConvertPane(editor);
            codeConvertContentDoc = new ContentDocument(codeConvertPane, "Convert AGS->Lua Script", this);
        }