Plugins
- grimdoomer
- Posts: 1440
- Joined: Mon Oct 09, 2006 4:36 pm
Plugins
Well I have every nodetype done except enums, bitmasks, and structs. The only problem im having is getting my xmltextreader to read the contense, ex options etc. Can any one help me?
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
-
- Posts: 1262
- Joined: Sun Sep 03, 2006 10:43 pm
- Location: Michigan
- grimdoomer
- Posts: 1440
- Joined: Mon Oct 09, 2006 4:36 pm
Ok, I wrote it my self, Ill only put the enum part, because bitmasks are similar and so are structs.
I tryed many things the code in the enum8 was my last attempt. And sorry about the spacing.
Code: Select all
case "enum8":
{
ItemTag += 1;
string Name = XR.GetAttribute("name");
int Offset = System.Convert.ToInt32(XR.GetAttribute("offset"));
bool Visible = bool.Parse(XR.GetAttribute("visible"));
List<string> Temp = new List<string>(0);
while (XR.Read())
{
switch (XR.NodeType)
{
case XmlNodeType.Element:
{
do
{
Temp.Capacity += 1;
Temp.Add(XR.GetAttribute("name"));
}
while (XR.Name.ToLower() == "option");
break;
}
case XmlNodeType.EndElement:
{
break;
}
default:
{
break;
}
}
}
string[] Options = Temp.ToArray();
Map.BR.BaseStream.Position = Offset;
int Value = Map.BR.ReadByte();
Plugin.Add(new ENTEnum(Map, Name, Offset, Visible, (int)Value, Options, typeof(byte), ItemTag));
break;
}
case "enum16":
{
ItemTag += 1;
string Name = XR.GetAttribute("name");
int Offset = System.Convert.ToInt32(XR.GetAttribute("offset"));
bool Visible = bool.Parse(XR.GetAttribute("visible"));
List<string> Temp = new List<string>();
while (XR.Name.ToLower() == "option")
{
Temp.Add(XR.GetAttribute("name"));
}
string[] Options = Temp.ToArray();
Map.BR.BaseStream.Position = Offset;
int Value = Map.BR.ReadInt16();
Plugin.Add(new ENTEnum(Map, Name, Offset, Visible, (int)Value, Options, typeof(short), ItemTag));
break;
}
case "enum32":
{
ItemTag += 1;
string Name = XR.GetAttribute("name");
int Offset = System.Convert.ToInt32(XR.GetAttribute("offset"));
bool Visible = bool.Parse(XR.GetAttribute("visible"));
List<string> Temp = new List<string>();
while (XR.Name.ToLower() == "option")
{
Temp.Add(XR.GetAttribute("name"));
}
string[] Options = Temp.ToArray();
Map.BR.BaseStream.Position = Offset;
int Value = Map.BR.ReadInt32();
Plugin.Add(new ENTEnum(Map, Name, Offset, Visible, Value, Options, typeof(int), ItemTag));
break;
}
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
- LuxuriousMeat
- Posts: 824
- Joined: Thu Nov 03, 2005 6:43 pm
- Location: zzzzzzzzzzzzzzzz
- Contact:
- grimdoomer
- Posts: 1440
- Joined: Mon Oct 09, 2006 4:36 pm
Ill try that, I did look at entitys source and when I tried it it didn't work the way I wanted it to.
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.