public NotesComponent(IAGSEditor editor) { this.editor = editor; editor.GUIController.RegisterIcon(ID_ICON_ROOT, Notes.Properties.Resources.PluginIcon); editor.GUIController.RegisterIcon(ID_ICON_LEAF, Notes.Properties.Resources.Leaf); editor.GUIController.ProjectTree.AddTreeRoot(this, ID_NODE_ROOT, "Notes", ID_ICON_ROOT); }
public AndroidBuilderPlugin(IAGSEditor editor) { _editor = editor; _editor.AddComponent(AndroidBuilderComponent.Instance); _editor.GUIController.RegisterIcon(ICON_KEY, Properties.Resources.PluginIcon); _pane = new ContentDocument(AndroidBuilderPane.Instance, "Android", AndroidBuilderComponent.Instance, ICON_KEY); BuildTargetsInfo.RegisterBuildTarget(BuildTargetAndroid.Instance); AGS_VERSION_CURRENT = new AGSVersion(_editor.Version); }
public Component(IAGSEditor editor) { LocalEditor = editor; LocalEditor.GUIController.RegisterIcon(ICON_NAME, Properties.Resources.AGSTheme); LocalEditor.GUIController.ProjectTree.AddTreeRoot(this, CONTROL_ID_ROOT_NODE, COMPONENT_ID, ICON_NAME); LocalEditor.GUIController.ProjectTree.BeforeShowContextMenu += new BeforeShowContextMenuHandler(ProjectTree_BeforeShowContextMenu); this.MenuCommand = LocalEditor.GUIController.CreateMenuCommand(this, COMPONENT_MENU_COMMAND, CONTROL_ROOT_NAME); Init(); }
public void RefreshProjectTree(IAGSEditor editor, string selectedNodeID) { foreach (IEditorComponent component in editor.Components) { if ((component.ComponentID == "Scripts") && (component is IRePopulatableComponent)) { if (selectedNodeID == null) { (component as IRePopulatableComponent).RePopulateTreeView(); } else { (component as IRePopulatableComponent).RePopulateTreeView(selectedNodeID); } return; } } }
public LuaScriptEditPane(LuaForAGSEditorComponent parentComponent, IAGSEditor owningEditor, LuaScriptFileInfo scriptInfo) { this.parentComponent = parentComponent; ScriptInfo = scriptInfo; InitializeComponent(); editor = owningEditor; textBox1.Select(0, 0); textBox1.Hide(); scintillaWrapper = new Scintilla(); scintilla = scintillaWrapper.NativeInterface; scintillaWrapper.Parent = this; scintillaWrapper.Location = textBox1.Location; scintillaWrapper.Size = textBox1.Size; scintillaWrapper.Anchor = textBox1.Anchor; scintilla.RegisterImage(1, ResourceManager.GetResourceAsString("table.xpm")); scintilla.SetMarginWidthN(0, 32); scintilla.SetMarginTypeN(0, (int)MarginType.Number); scintillaWrapper.Folding.Flags = FoldFlag.LineAfterContracted; scintilla.SetMarginWidthN(2, 16); scintilla.SetMarginTypeN(2, (int)MarginType.Symbol); scintilla.MarkerDefine((int)MarkerOutline.FolderOpen, (int)MarkerSymbol.BoxMinus); scintilla.MarkerDefine((int)MarkerOutline.Folder, (int)MarkerSymbol.BoxPlus); scintilla.MarkerDefine((int)MarkerOutline.FolderSub, (int)MarkerSymbol.VLine); scintilla.MarkerDefine((int)MarkerOutline.FolderTail, (int)MarkerSymbol.LCorner); scintilla.MarkerDefine((int)MarkerOutline.FolderEnd, (int)MarkerSymbol.BoxPlusConnected); scintilla.MarkerDefine((int)MarkerOutline.FolderOpenMid, (int)MarkerSymbol.BoxMinusConnected); scintilla.MarkerDefine((int)MarkerOutline.FolderMidTail, (int)MarkerSymbol.TCorner); scintilla.SetMarginSensitiveN(2, true); /* scintillaWrapper.Folding.Flags = FoldFlag.LineBeforeContracted | FoldFlag.LineAfterExpanded; scintilla.SetMarginWidthN(2, 16); scintilla.SetMarginTypeN(2, (int)MarginType.Symbol); scintilla.MarkerDefine((int)MarkerOutline.FolderOpen, (int)MarkerSymbol.BoxMinus); scintilla.MarkerDefine((int)MarkerOutline.Folder, (int)MarkerSymbol.BoxPlus); scintilla.MarkerDefine((int)MarkerOutline.FolderSub, (int)MarkerSymbol.VLine); scintilla.MarkerDefine((int)MarkerOutline.FolderTail, (int)MarkerSymbol.LCorner); scintilla.MarkerDefine((int)MarkerOutline.FolderEnd, (int)MarkerSymbol.BoxPlusConnected); scintilla.MarkerDefine((int)MarkerOutline.FolderOpenMid, (int)MarkerSymbol.BoxMinusConnected); scintilla.MarkerDefine((int)MarkerOutline.FolderMidTail, (int)MarkerSymbol.TCorner); scintilla.SetMarginSensitiveN(2, true); */ scintillaWrapper.Font = codeFont; for (int i = 0; i <= 32; i++) { scintillaWrapper.Styles[i].Font = codeFont; } scintillaWrapper.Lexing.Lexer = Lexer.Lua; scintillaWrapper.Styles[0].ForeColor = Color.FromArgb(0, 0, 0); scintillaWrapper.Styles[1].ForeColor = Color.FromArgb(0, 127, 0); scintillaWrapper.Styles[2].ForeColor = Color.FromArgb(0, 127, 0); scintillaWrapper.Styles[3].ForeColor = Color.FromArgb(127, 127, 127); scintillaWrapper.Styles[4].ForeColor = Color.FromArgb(0, 150, 175); scintillaWrapper.Styles[5].ForeColor = Color.FromArgb(0, 0, 127); scintillaWrapper.Styles[5].Bold = true; scintillaWrapper.Styles[6].ForeColor = Color.FromArgb(170, 0, 170); scintillaWrapper.Styles[7].ForeColor = Color.FromArgb(170, 0, 170); scintillaWrapper.Styles[8].ForeColor = Color.FromArgb(170, 0, 170); scintillaWrapper.Styles[9].ForeColor = Color.FromArgb(0, 0, 0); // Standard library keywords scintillaWrapper.Styles[12].ForeColor = Color.FromArgb(0, 0, 0); scintillaWrapper.Styles[12].BackColor = Color.FromArgb(224, 192, 224); scintillaWrapper.Styles[12].Bold = true; scintillaWrapper.Styles[12].IsSelectionEolFilled = true; // Brace match scintillaWrapper.Styles[34].ForeColor = Color.FromArgb(47, 47, 255); scintillaWrapper.Styles[34].Bold = true; // Brace mismatch scintillaWrapper.Styles[35].ForeColor = Color.FromArgb(255, 47, 47); scintillaWrapper.Styles[35].Bold = true; scintillaWrapper.Styles[13].ForeColor = Color.FromArgb(120, 156, 124); scintillaWrapper.Styles[13].Bold = true; scintillaWrapper.Styles[13].IsSelectionEolFilled = true; scintilla.UpdateUI += Scintilla_UpdateUI; scintillaWrapper.AutoComplete.CancelAtStart = false; scintillaWrapper.AutoComplete.AutoHide = false; scintillaWrapper.AutoComplete.MaxHeight = 8; scintillaWrapper.AutoComplete.MaxWidth = 100; scintillaWrapper.AutoComplete.StopCharacters = ")}; "; scintillaWrapper.Indentation.UseTabs = false; scintillaWrapper.Indentation.TabWidth = 2; scintillaWrapper.Indentation.IndentWidth = 2; scintillaWrapper.Caret.HighlightCurrentLine = true; scintillaWrapper.Caret.CurrentLineBackgroundColor = Color.FromArgb(232, 232, 255); scintillaWrapper.Lexing.SetKeywords(0, @" and break do else elseif end false for function if in local nil not or repeat return then true until while"); scintillaWrapper.Lexing.SetKeywords(1, @" _G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine.create coroutine.resume coroutine.running coroutine.status coroutine.wrap coroutine.yield debug.debug debug.getfenv debug.gethook debug.getinfo debug.getlocal debug.getmetatable debug.getregistry debug.getupvalue debug.setfenv debug.sethook debug.setlocal debug.setmetatable debug.setupvalue debug.traceback io.close io.flush io.input io.lines io.open io.output io.popen io.read io.stderr io.stdin io.stdout io.tmpfile io.type io.write math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.cosh math.deg math.exp math.floor math.fmod math.frexp math.huge math.ldexp math.log math.log10 math.max math.min math.modf math.pi math.pow math.rad math.random math.randomseed math.sin math.sinh math.sqrt math.tan math.tanh os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname package.cpath package.loaded package.loaders package.loadlib package.path package.preload package.seeall string.byte string.char string.dump string.find string.format string.gmatch string.gsub string.len string.lower string.match string.rep string.reverse string.sub string.upper table.concat table.insert table.maxn table.remove table.sort"); scintillaWrapper.CharAdded += Scintilla_CharAdded; scintillaWrapper.Scrolling.HorizontalWidth = 80; SetText(File.ReadAllText(path)); scintilla.SetSavePoint(); scintillaWrapper.UndoRedo.EmptyUndoBuffer(); }
public LuaPlugin(IAGSEditor editor) { editor.AddComponent(new LuaForAGSEditorComponent(editor)); }
public NotesPlugin(IAGSEditor editor) { editor.AddComponent(new NotesComponent(editor)); }
public void RefreshProjectTree(IAGSEditor editor) { RefreshProjectTree(editor, null); }
public PluginLoader(IAGSEditor editor) { editor.AddComponent(new Component(editor)); }
public NotesPane(IAGSEditor editor, NotesComponent parent) { InitializeComponent(); this.editor = editor; this.parent = parent; }
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); }