private void luaCodeEditor_ToolTipNeeded(object sender, FastColoredTextBoxNS.ToolTipNeededEventArgs e) { if (!string.IsNullOrEmpty(e.HoveredWord)) { if (pico8help.ContainsKey(e.HoveredWord)) { Pico8ApiHelp help = pico8help[e.HoveredWord]; e.ToolTipTitle = help.Code; e.ToolTipText = help.Description; } } }
private void readPico8API() { string api = Properties.Resources.pico8api; pico8help = new Dictionary <string, Pico8ApiHelp>(); string[] lines = api.Split('\n'); foreach (string line in lines) { string full = line.Trim(); Pico8ApiHelp help = new Pico8ApiHelp(); help.Name = full.Substring(0, full.IndexOf("(")); help.Code = full.Substring(0, full.IndexOf("--")).Trim(); help.Description = full.Substring(full.IndexOf("--") + 2).Trim(); pico8help.Add(help.Name, help); } }