fucking crap treeview... Latest outline mode work.
git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@13 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
parent
be66c127c1
commit
84e1ebfc00
10 changed files with 60 additions and 14 deletions
|
@ -60,7 +60,8 @@ namespace LSLEditor
|
|||
Constants = 3,
|
||||
Class = 4,
|
||||
Vars = 5,
|
||||
Properties = 6
|
||||
Properties = 6,
|
||||
States = 7
|
||||
}
|
||||
|
||||
public struct KeyWordInfo
|
||||
|
@ -137,6 +138,9 @@ namespace LSLEditor
|
|||
case "Vars":
|
||||
type = KeyWordTypeEnum.Vars;
|
||||
break;
|
||||
case "States":
|
||||
type = KeyWordTypeEnum.States;
|
||||
break;
|
||||
case "Enum":
|
||||
if (!Properties.Settings.Default.CodeCompletionAnimation)
|
||||
continue;
|
||||
|
|
|
@ -523,6 +523,7 @@ namespace LSLEditor
|
|||
|
||||
private void EndUpdate()
|
||||
{
|
||||
doOutline();
|
||||
intUpdate = Math.Max(0, intUpdate - 1);
|
||||
|
||||
if (intUpdate > 0) // only the last one
|
||||
|
@ -2032,7 +2033,9 @@ namespace LSLEditor
|
|||
return;
|
||||
}
|
||||
Dictionary<int, Helpers.OutlineHelper> list = new Dictionary<int, LSLEditor.Helpers.OutlineHelper>();
|
||||
using (StringReader reader = new StringReader(this.Text))
|
||||
string ttext = this.Text;
|
||||
ttext.Replace("\r\n", "");
|
||||
using (StringReader reader = new StringReader(ttext))
|
||||
{
|
||||
string line;
|
||||
|
||||
|
@ -2040,30 +2043,46 @@ namespace LSLEditor
|
|||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
|
||||
line = line.Trim();
|
||||
line = line.Split('(')[0];
|
||||
string[] words = line.Split(' ');
|
||||
foreach (string word in words)
|
||||
{
|
||||
Debug.WriteLine("ww:"+word);
|
||||
if (keyWords.ContainsKeyWord(word))
|
||||
{
|
||||
KeyWordInfo k = keyWords.GetKeyWordInfo(word);
|
||||
Debug.WriteLine("w:"+word);
|
||||
Debug.WriteLine("k:" + k.type);
|
||||
if (!list.ContainsKey(lineNumber))
|
||||
{
|
||||
switch (k.type)
|
||||
{
|
||||
|
||||
case KeyWordTypeEnum.Functions:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
Debug.WriteLine(k);
|
||||
// Debug.WriteLine(k);
|
||||
break;
|
||||
case KeyWordTypeEnum.Events:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
break;
|
||||
case KeyWordTypeEnum.Constants:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
break;
|
||||
case KeyWordTypeEnum.Class:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
break;
|
||||
case KeyWordTypeEnum.Vars:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
break;
|
||||
case KeyWordTypeEnum.States:
|
||||
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2073,17 +2092,42 @@ namespace LSLEditor
|
|||
}
|
||||
}
|
||||
//TODO: parse dict and create the outline in the treeview
|
||||
//WILL SOMEONE PLEASE FUCKING FINISH THIS!
|
||||
p.treeView1.Nodes.Clear();
|
||||
string lastState = "none";
|
||||
string lastevent = "none";
|
||||
foreach (LSLEditor.Helpers.OutlineHelper k in list.Values)
|
||||
{
|
||||
TreeNode b = new TreeNode();
|
||||
b.Name = k.info.name;
|
||||
Debug.WriteLine(b.Name);
|
||||
p.treeView1.Nodes.Add(b);
|
||||
|
||||
|
||||
//Debug.WriteLine(b.Name);
|
||||
if (k.info.type == KeyWordTypeEnum.States)
|
||||
{
|
||||
|
||||
|
||||
lastState = k.info.name;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (k.info.type == KeyWordTypeEnum.Events)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// p.treeView1.Nodes.Add(states);
|
||||
p.treeView1.ExpandAll();
|
||||
|
||||
}
|
||||
|
||||
public void SaveCurrentFile(string strPath)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<Word name="{" />
|
||||
<Word name="}" />
|
||||
</Words>
|
||||
<Words name="States" color="#0000ff" slcolor="#801A4D">
|
||||
<Words icon="States" name="States" color="#0000ff" slcolor="#801A4D">
|
||||
<Word name="default">
|
||||
All scripts must have a
|
||||
<font color="blue">default</font>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,4 @@
|
|||
integer a()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano)
|
||||
default
|
||||
{
|
||||
|
@ -12,5 +9,6 @@ default
|
|||
touch_start(integer total_number)
|
||||
{
|
||||
llSay(0, "Touched: "+(string)total_number);
|
||||
integer a = 1;
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -73,7 +73,7 @@
|
|||
<Word name="{" />
|
||||
<Word name="}" />
|
||||
</Words>
|
||||
<Words name="States" color="#0000ff" slcolor="#801A4D">
|
||||
<Words icon="States" name="States" color="#0000ff" slcolor="#801A4D">
|
||||
<Word name="default">
|
||||
All scripts must have a
|
||||
<font color="blue">default</font>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue