public void RegisterScriptHeader(string header) { Script newHeader = new Script("__Plugin" + _editorInterface.pluginID + ".ash", header, true); AutoComplete.ConstructCache(newHeader); _scriptHeaders.Add(newHeader); }
private void scintilla_OnBeforeShowingAutoComplete(object sender, EventArgs e) { if (_editorTextModifiedSinceLastCopy) { UpdateScriptObjectWithLatestTextInWindow(); } AutoComplete.ConstructCache(_script); }
private void GoToDefinition(string structName, string memberName) { ScriptToken found = null; Script foundInScript = null; List <Script> scriptsToSearch = new List <Script>(); scriptsToSearch.AddRange(_agsEditor.GetAllScriptHeaders()); scriptsToSearch.Add(_script); foreach (Script script in scriptsToSearch) { found = FindTokenInScript(script, structName, memberName); foundInScript = script; if ((found != null) && (script.IsHeader)) { // Always prefer the definition in the main script to // the import in the header Script mainScript = _agsEditor.CurrentGame.Scripts.FindMatchingScriptOrHeader(script); if (!mainScript.AutoCompleteData.Populated) { AutoComplete.ConstructCache(mainScript); } ScriptToken foundInScriptBody = FindTokenInScript(mainScript, structName, memberName); if (foundInScriptBody != null) { found = foundInScriptBody; foundInScript = mainScript; } } if (found != null) { break; } } if ((found == null) && (structName == null)) { found = FindTokenAsLocalVariable(memberName, false); } if (found != null) { if (foundInScript.FileName == AGSEditor.BUILT_IN_HEADER_FILE_NAME) { Factory.GUIController.LaunchHelpForKeyword(_goToDefinition); } else if (foundInScript.FileName == Tasks.AUTO_GENERATED_HEADER_NAME) { Factory.GUIController.ShowMessage("This variable is internally defined by AGS and probably corresponds to an in-game entity such as a Character or Inventory Item.", MessageBoxIcon.Information); } else { Factory.GUIController.ZoomToFile(foundInScript.FileName, ZoomToFileZoomType.ZoomToCharacterPosition, found.StartsAtCharacterIndex); } } }
protected override void OnWindowActivated() { _agsEditor.RegenerateScriptHeader(_room); if (_editorTextModifiedSinceLastCopy) { UpdateScriptObjectWithLatestTextInWindow(); } AutoComplete.RequestBackgroundCacheUpdate(_script); ActivateTextEditor(); }
/// <summary> /// Updates this script's autocomplete cache and all the controls that depend on it. /// </summary> private void UpdateAutocompleteAndControls(bool force) { if (!force && !ContainsFocus) { return; // only update for the active pane to avoid expensive combo Add operations } AutoComplete.ConstructCache(_script, _agsEditor.GetImportedScriptHeaders(_script)); UpdateStructHighlighting(); UpdateFunctionList(); }
protected override void OnWindowActivated() { _agsEditor.RegenerateScriptHeader(_room); if (_editorTextModifiedSinceLastCopy) { UpdateScriptObjectWithLatestTextInWindow(); } AutoComplete.RequestBackgroundCacheUpdate(_script); ActivateTextEditor(); Factory.GUIController.ShowCuppit("You've opened a script editor. This is where you set up how the game will react to various events like the player clicking on things. Read the Scripting Tutorial in the manual to get started.", "Script editor introduction"); }
public void SaveChanges() { if (_editorTextModifiedSinceLastCopy) { UpdateScriptObjectWithLatestTextInWindow(); } if (scintilla.IsModified) { _script.SaveToDisk(); scintilla.SetSavePoint(); if (_script.IsHeader) { AutoComplete.ConstructCache(_script); } } }
void IAGSEditor.RebuildAutocompleteCache(Script script) { AutoComplete.ConstructCache(script); }
void IAGSEditor.RebuildAutocompleteCache(Script script) { AutoComplete.ConstructCache(script, _agsEditor.GetImportedScriptHeaders(script)); }