mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 08:52:52 +08:00
Added default attribute names for XML vectors reading
This commit is contained in:
parent
e44b2ef095
commit
08d60877ee
@ -288,12 +288,12 @@ namespace CodeWalker.GameFiles
|
||||
TextureSetName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "TextureSetName"));
|
||||
DiffuseMapName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "DiffuseMapName"));
|
||||
NormalMapName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "NormalMapName"));
|
||||
FontExtents = Xml.GetChildVector4Attributes(node, "FontExtents", "x", "y", "z", "w");
|
||||
MaxLettersOnPlate = Xml.GetChildVector2Attributes(node, "MaxLettersOnPlate", "x", "y");
|
||||
FontExtents = Xml.GetChildVector4Attributes(node, "FontExtents");
|
||||
MaxLettersOnPlate = Xml.GetChildVector2Attributes(node, "MaxLettersOnPlate");
|
||||
FontColor = Xml.GetChildUIntAttribute(node, "FontColor", "value");
|
||||
FontOutlineColor = Xml.GetChildUIntAttribute(node, "FontOutlineColor", "value");
|
||||
IsFontOutlineEnabled = Xml.GetChildBoolAttribute(node, "IsFontOutlineEnabled", "value");
|
||||
FontOutlineMinMaxDepth = Xml.GetChildVector2Attributes(node, "FontOutlineMinMaxDepth", "x", "y");
|
||||
FontOutlineMinMaxDepth = Xml.GetChildVector2Attributes(node, "FontOutlineMinMaxDepth");
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
@ -111,11 +111,11 @@ namespace CodeWalker.GameFiles
|
||||
fTotalDuration = Xml.GetChildFloatAttribute(node, "fTotalDuration", "value");
|
||||
cFaceDir = Xml.GetChildInnerText(node, "cFaceDir");
|
||||
iCutsceneFlags = Xml.GetChildRawUintArray(node, "iCutsceneFlags");
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset", "x", "y", "z");
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset");
|
||||
fRotation = Xml.GetChildFloatAttribute(node, "fRotation", "value");
|
||||
cExtraRoom = Xml.GetChildInnerText(node, "cExtraRoom");
|
||||
vExtraRoomPos = Xml.GetChildVector3Attributes(node, "vExtraRoomPos", "x", "y", "z");
|
||||
vTriggerOffset = Xml.GetChildVector3Attributes(node, "vTriggerOffset", "x", "y", "z");
|
||||
vExtraRoomPos = Xml.GetChildVector3Attributes(node, "vExtraRoomPos");
|
||||
vTriggerOffset = Xml.GetChildVector3Attributes(node, "vTriggerOffset");
|
||||
pCutsceneObjects = ReadObjectArray(node, "pCutsceneObjects");
|
||||
pCutsceneLoadEventList = ReadObjectArray(node, "pCutsceneLoadEventList");
|
||||
pCutsceneEventList = ReadObjectArray(node, "pCutsceneEventList");
|
||||
@ -419,7 +419,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
cSceneName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "cSceneName"));
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset", "x", "y", "z");
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset");
|
||||
fStartTime = Xml.GetChildFloatAttribute(node, "fStartTime", "value");
|
||||
fRotation = Xml.GetChildFloatAttribute(node, "fRotation", "value");
|
||||
fPitch = Xml.GetChildFloatAttribute(node, "fPitch", "value");
|
||||
@ -585,7 +585,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
fRadius = Xml.GetChildFloatAttribute(node, "fRadius", "value");
|
||||
}
|
||||
}
|
||||
@ -634,9 +634,9 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection", "x", "y", "z");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour", "x", "y", "z");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
fIntensity = Xml.GetChildFloatAttribute(node, "fIntensity", "value");
|
||||
fFallOff = Xml.GetChildFloatAttribute(node, "fFallOff", "value");
|
||||
fConeAngle = Xml.GetChildFloatAttribute(node, "fConeAngle", "value");
|
||||
@ -688,9 +688,9 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection", "x", "y", "z");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour", "x", "y", "z");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
fIntensity = Xml.GetChildFloatAttribute(node, "fIntensity", "value");
|
||||
fFallOff = Xml.GetChildFloatAttribute(node, "fFallOff", "value");
|
||||
fConeAngle = Xml.GetChildFloatAttribute(node, "fConeAngle", "value");
|
||||
@ -773,7 +773,7 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
base.ReadXml(node);
|
||||
StreamingName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "StreamingName"));
|
||||
vStartPosition = Xml.GetChildVector3Attributes(node, "vStartPosition", "x", "y", "z");
|
||||
vStartPosition = Xml.GetChildVector3Attributes(node, "vStartPosition");
|
||||
}
|
||||
}
|
||||
[TC(typeof(EXP))] public class CutParticleEffectObject : CutNamedObject // rage__cutfParticleEffectObject
|
||||
@ -825,7 +825,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
fRadius = Xml.GetChildFloatAttribute(node, "fRadius", "value");
|
||||
}
|
||||
}
|
||||
@ -1013,7 +1013,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset", "x", "y", "z");
|
||||
vOffset = Xml.GetChildVector3Attributes(node, "vOffset");
|
||||
fRotation = Xml.GetChildFloatAttribute(node, "fRotation", "value");
|
||||
fPitch = Xml.GetChildFloatAttribute(node, "fPitch", "value");
|
||||
fRoll = Xml.GetChildFloatAttribute(node, "fRoll", "value");
|
||||
@ -1077,8 +1077,8 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vRotationQuaternion = Xml.GetChildVector4Attributes(node, "vRotationQuaternion", "x", "y", "z", "w").ToQuaternion();
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
vRotationQuaternion = Xml.GetChildVector4Attributes(node, "vRotationQuaternion").ToQuaternion();
|
||||
fNearDrawDistance = Xml.GetChildFloatAttribute(node, "fNearDrawDistance", "value");
|
||||
fFarDrawDistance = Xml.GetChildFloatAttribute(node, "fFarDrawDistance", "value");
|
||||
fMapLodScale = Xml.GetChildFloatAttribute(node, "fMapLodScale", "value");
|
||||
@ -1121,8 +1121,8 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
bUseTimeCycleValues = Xml.GetChildBoolAttribute(node, "bUseTimeCycleValues", "value");
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection", "x", "y", "z");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour", "x", "y", "z");
|
||||
vDirection = Xml.GetChildVector3Attributes(node, "vDirection");
|
||||
vColour = Xml.GetChildVector3Attributes(node, "vColour");
|
||||
fIntensity = Xml.GetChildFloatAttribute(node, "fIntensity", "value");
|
||||
}
|
||||
}
|
||||
@ -1202,8 +1202,8 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition", "x", "y", "z");
|
||||
vRotation = Xml.GetChildVector4Attributes(node, "vRotation", "x", "y", "z", "w").ToQuaternion();
|
||||
vPosition = Xml.GetChildVector3Attributes(node, "vPosition");
|
||||
vRotation = Xml.GetChildVector4Attributes(node, "vRotation").ToQuaternion();
|
||||
fWidth = Xml.GetChildFloatAttribute(node, "fWidth", "value");
|
||||
fHeight = Xml.GetChildFloatAttribute(node, "fHeight", "value");
|
||||
Colour = Xml.GetChildUIntAttribute(node, "Colour", "value");
|
||||
@ -1236,7 +1236,7 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
base.ReadXml(node);
|
||||
cameraCutHashName = XmlMeta.GetHash(Xml.GetChildInnerText(node, "cameraCutHashName"));
|
||||
position = Xml.GetChildVector3Attributes(node, "position", "x", "y", "z");
|
||||
position = Xml.GetChildVector3Attributes(node, "position");
|
||||
radius = Xml.GetChildFloatAttribute(node, "radius", "value");
|
||||
interpTime = Xml.GetChildFloatAttribute(node, "interpTime", "value");
|
||||
cascadeIndex = Xml.GetChildIntAttribute(node, "cascadeIndex", "value");
|
||||
@ -1268,8 +1268,8 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
vInitialBoneRotation = Xml.GetChildVector4Attributes(node, "vInitialBoneRotation", "x", "y", "z", "w").ToQuaternion();
|
||||
vInitialBoneOffset = Xml.GetChildVector3Attributes(node, "vInitialBoneOffset", "x", "y", "z");
|
||||
vInitialBoneRotation = Xml.GetChildVector4Attributes(node, "vInitialBoneRotation").ToQuaternion();
|
||||
vInitialBoneOffset = Xml.GetChildVector3Attributes(node, "vInitialBoneOffset");
|
||||
iAttachParentId = Xml.GetChildIntAttribute(node, "iAttachParentId", "value");
|
||||
iAttachBoneHash = (ushort)Xml.GetChildUIntAttribute(node, "iAttachBoneHash", "value");
|
||||
}
|
||||
|
@ -5472,23 +5472,23 @@ namespace CodeWalker.GameFiles
|
||||
Flags0 = Xml.GetChildUIntAttribute(node, "Flags0", "value");
|
||||
Shape = Xml.GetEnumValue<Dat151ZoneShape>(Xml.GetChildInnerText(node, "Shape"));
|
||||
Flags1 = Xml.GetChildUIntAttribute(node, "Flags1", "value");
|
||||
OuterPos = Xml.GetChildVector3Attributes(node, "OuterPos", "x", "y", "z");
|
||||
OuterSize = Xml.GetChildVector3Attributes(node, "OuterSize", "x", "y", "z");
|
||||
OuterVec1 = Xml.GetChildVector4Attributes(node, "OuterVec1", "x", "y", "z", "w");
|
||||
OuterVec2 = Xml.GetChildVector4Attributes(node, "OuterVec2", "x", "y", "z", "w");
|
||||
OuterPos = Xml.GetChildVector3Attributes(node, "OuterPos");
|
||||
OuterSize = Xml.GetChildVector3Attributes(node, "OuterSize");
|
||||
OuterVec1 = Xml.GetChildVector4Attributes(node, "OuterVec1");
|
||||
OuterVec2 = Xml.GetChildVector4Attributes(node, "OuterVec2");
|
||||
OuterAngle = Xml.GetChildUIntAttribute(node, "OuterAngle", "value");
|
||||
OuterVec3 = Xml.GetChildVector3Attributes(node, "OuterVec3", "x", "y", "z");
|
||||
InnerPos = Xml.GetChildVector3Attributes(node, "InnerPos", "x", "y", "z");
|
||||
InnerSize = Xml.GetChildVector3Attributes(node, "InnerSize", "x", "y", "z");
|
||||
InnerVec1 = Xml.GetChildVector4Attributes(node, "InnerVec1", "x", "y", "z", "w");
|
||||
InnerVec2 = Xml.GetChildVector4Attributes(node, "InnerVec2", "x", "y", "z", "w");
|
||||
OuterVec3 = Xml.GetChildVector3Attributes(node, "OuterVec3");
|
||||
InnerPos = Xml.GetChildVector3Attributes(node, "InnerPos");
|
||||
InnerSize = Xml.GetChildVector3Attributes(node, "InnerSize");
|
||||
InnerVec1 = Xml.GetChildVector4Attributes(node, "InnerVec1");
|
||||
InnerVec2 = Xml.GetChildVector4Attributes(node, "InnerVec2");
|
||||
InnerAngle = Xml.GetChildUIntAttribute(node, "InnerAngle", "value");
|
||||
InnerVec3 = Xml.GetChildVector3Attributes(node, "InnerVec3", "x", "y", "z");
|
||||
UnkVec1 = Xml.GetChildVector4Attributes(node, "UnkVec1", "x", "y", "z", "w");
|
||||
UnkVec2 = Xml.GetChildVector4Attributes(node, "UnkVec2", "x", "y", "z", "w");
|
||||
InnerVec3 = Xml.GetChildVector3Attributes(node, "InnerVec3");
|
||||
UnkVec1 = Xml.GetChildVector4Attributes(node, "UnkVec1");
|
||||
UnkVec2 = Xml.GetChildVector4Attributes(node, "UnkVec2");
|
||||
UnkHash0 = XmlRel.GetHash(Xml.GetChildInnerText(node, "UnkHash0"));
|
||||
UnkHash1 = XmlRel.GetHash(Xml.GetChildInnerText(node, "UnkHash1"));
|
||||
UnkVec3 = Xml.GetChildVector2Attributes(node, "UnkVec3", "x", "y");
|
||||
UnkVec3 = Xml.GetChildVector2Attributes(node, "UnkVec3");
|
||||
Flags2 = Xml.GetChildUIntAttribute(node, "Flags2", "value");
|
||||
Unk14 = (byte)Xml.GetChildUIntAttribute(node, "Unk14", "value");
|
||||
Unk15 = (byte)Xml.GetChildUIntAttribute(node, "Unk15", "value");
|
||||
@ -5931,7 +5931,7 @@ namespace CodeWalker.GameFiles
|
||||
Flags0 = Xml.GetChildUIntAttribute(node, "Flags0", "value");
|
||||
Flags1 = Xml.GetChildUIntAttribute(node, "Flags1", "value");
|
||||
Flags2 = Xml.GetChildUIntAttribute(node, "Flags2", "value");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position");
|
||||
Flags3 = Xml.GetChildUIntAttribute(node, "Flags3", "value");
|
||||
Hash1 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Hash1"));
|
||||
Hash2 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Hash2"));
|
||||
@ -6120,7 +6120,7 @@ namespace CodeWalker.GameFiles
|
||||
Flags = Xml.GetChildUIntAttribute(node, "Flags", "value");
|
||||
Unk01 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk01"));
|
||||
RadioStation = XmlRel.GetHash(Xml.GetChildInnerText(node, "RadioStation"));
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position");
|
||||
Unk06 = Xml.GetChildFloatAttribute(node, "Unk06", "value");
|
||||
Unk07 = Xml.GetChildFloatAttribute(node, "Unk07", "value");
|
||||
Unk08 = Xml.GetChildIntAttribute(node, "Unk08", "value");
|
||||
@ -9315,7 +9315,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
Unk01 = Xml.GetChildUIntAttribute(node, "Unk01", "value");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02", "x", "y", "z", "w");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02");
|
||||
Unk03 = Xml.GetChildIntAttribute(node, "Unk03", "value");
|
||||
Unk04 = Xml.GetChildIntAttribute(node, "Unk04", "value");
|
||||
Unk05 = Xml.GetChildIntAttribute(node, "Unk05", "value");
|
||||
@ -9404,7 +9404,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
Unk01 = Xml.GetChildUIntAttribute(node, "Unk01", "value");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02", "x", "y", "z", "w");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02");
|
||||
Unk03 = Xml.GetChildIntAttribute(node, "Unk03", "value");
|
||||
Unk04 = Xml.GetChildIntAttribute(node, "Unk04", "value");
|
||||
Unk05 = Xml.GetChildUIntAttribute(node, "Unk05", "value");
|
||||
@ -9484,7 +9484,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
Unk01 = Xml.GetChildUIntAttribute(node, "Unk01", "value");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02", "x", "y", "z", "w");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02");
|
||||
Unk03 = Xml.GetChildFloatAttribute(node, "Unk03", "value");
|
||||
Unk04 = Xml.GetChildUIntAttribute(node, "Unk04", "value");
|
||||
Unk05 = Xml.GetChildUIntAttribute(node, "Unk05", "value");
|
||||
@ -9590,7 +9590,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
Unk01 = Xml.GetChildUIntAttribute(node, "Unk01", "value");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02", "x", "y", "z", "w");
|
||||
Unk02 = Xml.GetChildVector4Attributes(node, "Unk02");
|
||||
Unk03 = Xml.GetChildFloatAttribute(node, "Unk03", "value");
|
||||
Unk04 = Xml.GetChildUIntAttribute(node, "Unk04", "value");
|
||||
Unk05 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk05"));
|
||||
@ -15320,7 +15320,7 @@ namespace CodeWalker.GameFiles
|
||||
Unk01 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk01"));
|
||||
Unk02 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk02"));
|
||||
Unk03 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk03"));
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position");
|
||||
Unk04 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk04"));
|
||||
Unk05 = Xml.GetChildFloatAttribute(node, "Unk05", "value");
|
||||
Unk06 = Xml.GetChildFloatAttribute(node, "Unk06", "value");
|
||||
@ -17704,7 +17704,7 @@ namespace CodeWalker.GameFiles
|
||||
Alarm = XmlRel.GetHash(Xml.GetChildInnerText(node, "Alarm"));
|
||||
Unk04 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk04"));
|
||||
Unk05 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk05"));
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position");
|
||||
Unk06 = XmlRel.GetHash(Xml.GetChildInnerText(node, "Unk06"));
|
||||
}
|
||||
}
|
||||
@ -19600,8 +19600,8 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
Vec1 = Xml.GetChildVector3Attributes(node, "Vec1", "x", "y", "z");
|
||||
Vec2 = Xml.GetChildVector3Attributes(node, "Vec2", "x", "y", "z");
|
||||
Vec1 = Xml.GetChildVector3Attributes(node, "Vec1");
|
||||
Vec2 = Xml.GetChildVector3Attributes(node, "Vec2");
|
||||
}
|
||||
}
|
||||
[TC(typeof(EXP))] public class Dat4ConfigVariableList : Dat4ConfigData
|
||||
@ -20013,15 +20013,15 @@ namespace CodeWalker.GameFiles
|
||||
Unk7 = Xml.GetChildFloatAttribute(node, "Unk7", "value");
|
||||
UnkItems = XmlRel.ReadItemArray<UnkItem>(node, "UnkItems");
|
||||
UnkItemsCount = (UnkItems?.Length ?? 0);
|
||||
UnkVec1 = Xml.GetChildVector4Attributes(node, "UnkVec1", "x", "y", "z", "w");
|
||||
UnkVec2 = Xml.GetChildVector4Attributes(node, "UnkVec2", "x", "y", "z", "w");
|
||||
UnkVec3 = Xml.GetChildVector4Attributes(node, "UnkVec3", "x", "y", "z", "w");
|
||||
UnkVec4 = Xml.GetChildVector4Attributes(node, "UnkVec4", "x", "y", "z", "w");
|
||||
UnkVec5 = Xml.GetChildVector4Attributes(node, "UnkVec5", "x", "y", "z", "w");
|
||||
UnkVec6 = Xml.GetChildVector4Attributes(node, "UnkVec6", "x", "y", "z", "w");
|
||||
UnkVec7 = Xml.GetChildVector4Attributes(node, "UnkVec7", "x", "y", "z", "w");
|
||||
UnkVec8 = Xml.GetChildVector4Attributes(node, "UnkVec8", "x", "y", "z", "w");
|
||||
UnkVec9 = Xml.GetChildVector4Attributes(node, "UnkVec9", "x", "y", "z", "w");
|
||||
UnkVec1 = Xml.GetChildVector4Attributes(node, "UnkVec1");
|
||||
UnkVec2 = Xml.GetChildVector4Attributes(node, "UnkVec2");
|
||||
UnkVec3 = Xml.GetChildVector4Attributes(node, "UnkVec3");
|
||||
UnkVec4 = Xml.GetChildVector4Attributes(node, "UnkVec4");
|
||||
UnkVec5 = Xml.GetChildVector4Attributes(node, "UnkVec5");
|
||||
UnkVec6 = Xml.GetChildVector4Attributes(node, "UnkVec6");
|
||||
UnkVec7 = Xml.GetChildVector4Attributes(node, "UnkVec7");
|
||||
UnkVec8 = Xml.GetChildVector4Attributes(node, "UnkVec8");
|
||||
UnkVec9 = Xml.GetChildVector4Attributes(node, "UnkVec9");
|
||||
UnkVecs1 = Xml.GetChildRawVector4Array(node, "UnkVecs1");
|
||||
UnkVecs2 = Xml.GetChildRawVector4Array(node, "UnkVecs2");
|
||||
UnkVecs3 = Xml.GetChildRawVector4Array(node, "UnkVecs3");
|
||||
|
@ -208,18 +208,18 @@ namespace CodeWalker.GameFiles
|
||||
aimCameraName = Xml.GetChildInnerText(node, "aimCameraName");
|
||||
bonnetCameraName = Xml.GetChildInnerText(node, "bonnetCameraName");
|
||||
povCameraName = Xml.GetChildInnerText(node, "povCameraName");
|
||||
FirstPersonDriveByIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByIKOffset", "x", "y", "z");
|
||||
FirstPersonDriveByUnarmedIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByUnarmedIKOffset", "x", "y", "z");
|
||||
FirstPersonProjectileDriveByIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonProjectileDriveByIKOffset", "x", "y", "z");
|
||||
FirstPersonProjectileDriveByPassengerIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonProjectileDriveByPassengerIKOffset", "x", "y", "z");
|
||||
FirstPersonDriveByRightPassengerIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByRightPassengerIKOffset", "x", "y", "z");
|
||||
FirstPersonDriveByRightPassengerUnarmedIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByRightPassengerUnarmedIKOffset", "x", "y", "z");
|
||||
FirstPersonMobilePhoneOffset = Xml.GetChildVector3Attributes(node, "FirstPersonMobilePhoneOffset", "x", "y", "z");
|
||||
FirstPersonPassengerMobilePhoneOffset = Xml.GetChildVector3Attributes(node, "FirstPersonPassengerMobilePhoneOffset", "x", "y", "z");
|
||||
PovCameraOffset = Xml.GetChildVector3Attributes(node, "PovCameraOffset", "x", "y", "z");
|
||||
PovCameraVerticalAdjustmentForRollCage = Xml.GetChildVector3Attributes(node, "PovCameraVerticalAdjustmentForRollCage", "x", "y", "z");
|
||||
PovPassengerCameraOffset = Xml.GetChildVector3Attributes(node, "PovPassengerCameraOffset", "x", "y", "z");
|
||||
PovRearPassengerCameraOffset = Xml.GetChildVector3Attributes(node, "PovRearPassengerCameraOffset", "x", "y", "z");
|
||||
FirstPersonDriveByIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByIKOffset");
|
||||
FirstPersonDriveByUnarmedIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByUnarmedIKOffset");
|
||||
FirstPersonProjectileDriveByIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonProjectileDriveByIKOffset");
|
||||
FirstPersonProjectileDriveByPassengerIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonProjectileDriveByPassengerIKOffset");
|
||||
FirstPersonDriveByRightPassengerIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByRightPassengerIKOffset");
|
||||
FirstPersonDriveByRightPassengerUnarmedIKOffset = Xml.GetChildVector3Attributes(node, "FirstPersonDriveByRightPassengerUnarmedIKOffset");
|
||||
FirstPersonMobilePhoneOffset = Xml.GetChildVector3Attributes(node, "FirstPersonMobilePhoneOffset");
|
||||
FirstPersonPassengerMobilePhoneOffset = Xml.GetChildVector3Attributes(node, "FirstPersonPassengerMobilePhoneOffset");
|
||||
PovCameraOffset = Xml.GetChildVector3Attributes(node, "PovCameraOffset");
|
||||
PovCameraVerticalAdjustmentForRollCage = Xml.GetChildVector3Attributes(node, "PovCameraVerticalAdjustmentForRollCage");
|
||||
PovPassengerCameraOffset = Xml.GetChildVector3Attributes(node, "PovPassengerCameraOffset");
|
||||
PovRearPassengerCameraOffset = Xml.GetChildVector3Attributes(node, "PovRearPassengerCameraOffset");
|
||||
vfxInfoName = Xml.GetChildInnerText(node, "vfxInfoName");
|
||||
shouldUseCinematicViewMode = Xml.GetChildBoolAttribute(node, "shouldUseCinematicViewMode", "value");
|
||||
shouldCameraTransitionOnClimbUpDown = Xml.GetChildBoolAttribute(node, "shouldCameraTransitionOnClimbUpDown", "value");
|
||||
@ -287,7 +287,7 @@ namespace CodeWalker.GameFiles
|
||||
rewards = GetStringItemArray(node, "rewards");
|
||||
cinematicPartCamera = GetStringItemArray(node, "cinematicPartCamera");
|
||||
NmBraceOverrideSet = Xml.GetChildInnerText(node, "NmBraceOverrideSet");
|
||||
buoyancySphereOffset = Xml.GetChildVector3Attributes(node, "buoyancySphereOffset", "x", "y", "z");
|
||||
buoyancySphereOffset = Xml.GetChildVector3Attributes(node, "buoyancySphereOffset");
|
||||
buoyancySphereSizeScale = Xml.GetChildFloatAttribute(node, "buoyancySphereSizeScale", "value");
|
||||
var tnode = node.SelectSingleNode("pOverrideRagdollThreshold");
|
||||
if (tnode != null)
|
||||
|
@ -423,14 +423,14 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
public virtual void ReadXml(XmlNode node)
|
||||
{
|
||||
BoxMin = Xml.GetChildVector3Attributes(node, "BoxMin", "x", "y", "z");
|
||||
BoxMax = Xml.GetChildVector3Attributes(node, "BoxMax", "x", "y", "z");
|
||||
BoxCenter = Xml.GetChildVector3Attributes(node, "BoxCenter", "x", "y", "z");
|
||||
SphereCenter = Xml.GetChildVector3Attributes(node, "SphereCenter", "x", "y", "z");
|
||||
BoxMin = Xml.GetChildVector3Attributes(node, "BoxMin");
|
||||
BoxMax = Xml.GetChildVector3Attributes(node, "BoxMax");
|
||||
BoxCenter = Xml.GetChildVector3Attributes(node, "BoxCenter");
|
||||
SphereCenter = Xml.GetChildVector3Attributes(node, "SphereCenter");
|
||||
SphereRadius = Xml.GetChildFloatAttribute(node, "SphereRadius", "value");
|
||||
Margin = Xml.GetChildFloatAttribute(node, "Margin", "value");
|
||||
Volume = Xml.GetChildFloatAttribute(node, "Volume", "value");
|
||||
Unknown_60h = Xml.GetChildVector3Attributes(node, "Inertia", "x", "y", "z");
|
||||
Unknown_60h = Xml.GetChildVector3Attributes(node, "Inertia");
|
||||
MaterialIndex = (byte)Xml.GetChildUIntAttribute(node, "MaterialIndex", "value");
|
||||
MaterialColorIndex = (byte)Xml.GetChildUIntAttribute(node, "MaterialColourIndex", "value");
|
||||
ProceduralId = (byte)Xml.GetChildUIntAttribute(node, "ProceduralID", "value");
|
||||
@ -441,9 +441,9 @@ namespace CodeWalker.GameFiles
|
||||
Unknown_3Ch = (byte)Xml.GetChildUIntAttribute(node, "UnkType", "value");
|
||||
if (Parent != null)
|
||||
{
|
||||
Position = Xml.GetChildVector3Attributes(node, "CompositePosition", "x", "y", "z");
|
||||
Orientation = Xml.GetChildVector4Attributes(node, "CompositeRotation", "x", "y", "z", "w").ToQuaternion();
|
||||
Scale = Xml.GetChildVector3Attributes(node, "CompositeScale", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "CompositePosition");
|
||||
Orientation = Xml.GetChildVector4Attributes(node, "CompositeRotation").ToQuaternion();
|
||||
Scale = Xml.GetChildVector3Attributes(node, "CompositeScale");
|
||||
var f = new BoundCompositeChildrenFlags();
|
||||
f.Flags1 = Xml.GetChildEnumInnerText<EBoundCompositeFlags>(node, "CompositeFlags1");
|
||||
f.Flags2 = Xml.GetChildEnumInnerText<EBoundCompositeFlags>(node, "CompositeFlags2");
|
||||
@ -1163,7 +1163,7 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
base.ReadXml(node);
|
||||
|
||||
CenterGeom = Xml.GetChildVector3Attributes(node, "GeometryCenter", "x", "y", "z");
|
||||
CenterGeom = Xml.GetChildVector3Attributes(node, "GeometryCenter");
|
||||
Unknown_9Ch = Xml.GetChildFloatAttribute(node, "UnkFloat1", "value");
|
||||
Unknown_ACh = Xml.GetChildFloatAttribute(node, "UnkFloat2", "value");
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
Value = Xml.GetChildVector3Attributes(node, "Value", "x", "y", "z");
|
||||
Value = Xml.GetChildVector3Attributes(node, "Value");
|
||||
}
|
||||
}
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))] public class AnimChannelStaticQuaternion : AnimChannel
|
||||
@ -1153,7 +1153,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
Value = new Quaternion(Xml.GetChildVector4Attributes(node, "Value", "x", "y", "z", "w"));
|
||||
Value = new Quaternion(Xml.GetChildVector4Attributes(node, "Value"));
|
||||
}
|
||||
}
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))] public class AnimChannelIndirectQuantizeFloat : AnimChannel
|
||||
@ -4165,7 +4165,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
Value = Xml.GetChildVector3Attributes(node, "Value", "x", "y", "z");
|
||||
Value = Xml.GetChildVector3Attributes(node, "Value");
|
||||
Unknown_02Ch = Xml.GetChildFloatAttribute(node, "Unknown2C", "value");
|
||||
}
|
||||
}
|
||||
@ -4208,7 +4208,7 @@ namespace CodeWalker.GameFiles
|
||||
public override void ReadXml(XmlNode node)
|
||||
{
|
||||
base.ReadXml(node);
|
||||
Value = Xml.GetChildVector4Attributes(node, "Value", "x", "y", "z", "w");
|
||||
Value = Xml.GetChildVector4Attributes(node, "Value");
|
||||
}
|
||||
}
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeHashString : ClipPropertyAttribute
|
||||
|
@ -1653,10 +1653,10 @@ namespace CodeWalker.GameFiles
|
||||
ParentIndex = (short)Xml.GetChildIntAttribute(node, "ParentIndex", "value");
|
||||
NextSiblingIndex = (short)Xml.GetChildIntAttribute(node, "SiblingIndex", "value");
|
||||
Flags = Xml.GetChildEnumInnerText<EBoneFlags>(node, "Flags");
|
||||
Translation = Xml.GetChildVector3Attributes(node, "Translation", "x", "y", "z");
|
||||
Rotation = Xml.GetChildVector4Attributes(node, "Rotation", "x", "y", "z", "w").ToQuaternion();
|
||||
Scale = Xml.GetChildVector3Attributes(node, "Scale", "x", "y", "z");
|
||||
TransformUnk = Xml.GetChildVector4Attributes(node, "TransformUnk", "x", "y", "z", "w");
|
||||
Translation = Xml.GetChildVector3Attributes(node, "Translation");
|
||||
Rotation = Xml.GetChildVector4Attributes(node, "Rotation").ToQuaternion();
|
||||
Scale = Xml.GetChildVector3Attributes(node, "Scale");
|
||||
TransformUnk = Xml.GetChildVector4Attributes(node, "TransformUnk");
|
||||
}
|
||||
|
||||
public override IResourceBlock[] GetReferences()
|
||||
@ -1972,8 +1972,8 @@ namespace CodeWalker.GameFiles
|
||||
Init();
|
||||
BoneId = (ushort)Xml.GetChildUIntAttribute(node, "BoneId", "value");
|
||||
Unknown_Ah = (ushort)Xml.GetChildUIntAttribute(node, "UnknownA", "value");
|
||||
Min = Xml.GetChildVector3Attributes(node, "Min", "x", "y", "z");
|
||||
Max = Xml.GetChildVector3Attributes(node, "Max", "x", "y", "z");
|
||||
Min = Xml.GetChildVector3Attributes(node, "Min");
|
||||
Max = Xml.GetChildVector3Attributes(node, "Max");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2001,8 +2001,8 @@ namespace CodeWalker.GameFiles
|
||||
public void ReadXml(XmlNode node)
|
||||
{
|
||||
BoneId = (ushort)Xml.GetChildUIntAttribute(node, "BoneId", "value");
|
||||
Min = Xml.GetChildVector3Attributes(node, "Min", "x", "y", "z");
|
||||
Max = Xml.GetChildVector3Attributes(node, "Max", "x", "y", "z");
|
||||
Min = Xml.GetChildVector3Attributes(node, "Min");
|
||||
Max = Xml.GetChildVector3Attributes(node, "Max");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2502,8 +2502,8 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
ShaderID = (ushort)Xml.GetChildUIntAttribute(node, "ShaderIndex", "value");
|
||||
var aabb = new AABB_s();
|
||||
aabb.Min = Xml.GetChildVector4Attributes(node, "BoundingBoxMin", "x", "y", "z", "w");
|
||||
aabb.Max = Xml.GetChildVector4Attributes(node, "BoundingBoxMax", "x", "y", "z", "w");
|
||||
aabb.Min = Xml.GetChildVector4Attributes(node, "BoundingBoxMin");
|
||||
aabb.Max = Xml.GetChildVector4Attributes(node, "BoundingBoxMax");
|
||||
AABB = aabb;
|
||||
var bnode = node.SelectSingleNode("BoneIDs");
|
||||
if (bnode != null)
|
||||
@ -3666,7 +3666,7 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
public void ReadXml(XmlNode node)
|
||||
{
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(node, "Position");
|
||||
ColorR = (byte)Xml.GetChildUIntAttribute(node, "Colour", "r");
|
||||
ColorG = (byte)Xml.GetChildUIntAttribute(node, "Colour", "g");
|
||||
ColorB = (byte)Xml.GetChildUIntAttribute(node, "Colour", "b");
|
||||
@ -3679,7 +3679,7 @@ namespace CodeWalker.GameFiles
|
||||
TimeFlags = Xml.GetChildUIntAttribute(node, "TimeFlags", "value");
|
||||
Falloff = Xml.GetChildFloatAttribute(node, "Falloff", "value");
|
||||
FalloffExponent = Xml.GetChildFloatAttribute(node, "FalloffExponent", "value");
|
||||
CullingPlaneNormal = Xml.GetChildVector3Attributes(node, "CullingPlaneNormal", "x", "y", "z");
|
||||
CullingPlaneNormal = Xml.GetChildVector3Attributes(node, "CullingPlaneNormal");
|
||||
CullingPlaneOffset = Xml.GetChildFloatAttribute(node, "CullingPlaneOffset", "value");
|
||||
Unknown_45h = (byte)Xml.GetChildUIntAttribute(node, "Unknown45", "value");
|
||||
Unknown_46h = (ushort)Xml.GetChildUIntAttribute(node, "Unknown46", "value");
|
||||
@ -3699,11 +3699,11 @@ namespace CodeWalker.GameFiles
|
||||
ShadowNearClip = Xml.GetChildFloatAttribute(node, "ShadowNearClip", "value");
|
||||
CoronaIntensity = Xml.GetChildFloatAttribute(node, "CoronaIntensity", "value");
|
||||
CoronaZBias = Xml.GetChildFloatAttribute(node, "CoronaZBias", "value");
|
||||
Direction = Xml.GetChildVector3Attributes(node, "Direction", "x", "y", "z");
|
||||
Tangent = Xml.GetChildVector3Attributes(node, "Tangent", "x", "y", "z");
|
||||
Direction = Xml.GetChildVector3Attributes(node, "Direction");
|
||||
Tangent = Xml.GetChildVector3Attributes(node, "Tangent");
|
||||
ConeInnerAngle = Xml.GetChildFloatAttribute(node, "ConeInnerAngle", "value");
|
||||
ConeOuterAngle = Xml.GetChildFloatAttribute(node, "ConeOuterAngle", "value");
|
||||
Extent = Xml.GetChildVector3Attributes(node, "Extent", "x", "y", "z");
|
||||
Extent = Xml.GetChildVector3Attributes(node, "Extent");
|
||||
ProjectedTextureHash = XmlMeta.GetHash(Xml.GetChildInnerText(node, "ProjectedTextureHash"));
|
||||
}
|
||||
}
|
||||
@ -4181,10 +4181,10 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
public virtual void ReadXml(XmlNode node, string ddsfolder)
|
||||
{
|
||||
BoundingCenter = Xml.GetChildVector3Attributes(node, "BoundingSphereCenter", "x", "y", "z");
|
||||
BoundingCenter = Xml.GetChildVector3Attributes(node, "BoundingSphereCenter");
|
||||
BoundingSphereRadius = Xml.GetChildFloatAttribute(node, "BoundingSphereRadius", "value");
|
||||
BoundingBoxMin = Xml.GetChildVector4Attributes(node, "BoundingBoxMin", "x", "y", "z", "w");
|
||||
BoundingBoxMax = Xml.GetChildVector4Attributes(node, "BoundingBoxMax", "x", "y", "z", "w");
|
||||
BoundingBoxMin = Xml.GetChildVector4Attributes(node, "BoundingBoxMin");
|
||||
BoundingBoxMax = Xml.GetChildVector4Attributes(node, "BoundingBoxMax");
|
||||
LodDistHigh = Xml.GetChildFloatAttribute(node, "LodDistHigh", "value");
|
||||
LodDistMed = Xml.GetChildFloatAttribute(node, "LodDistMed", "value");
|
||||
LodDistLow = Xml.GetChildFloatAttribute(node, "LodDistLow", "value");
|
||||
|
@ -411,7 +411,7 @@ namespace CodeWalker.GameFiles
|
||||
AreaID = (ushort)Xml.GetChildUIntAttribute(node, "AreaID", "value");
|
||||
NodeID = (ushort)Xml.GetChildUIntAttribute(node, "NodeID", "value");
|
||||
StreetName = XmlYnd.GetTextHash(Xml.GetChildInnerText(node, "StreetName"));
|
||||
Vector3 p = Xml.GetChildVector3Attributes(node, "Position", "x", "y", "z");
|
||||
Vector3 p = Xml.GetChildVector3Attributes(node, "Position");
|
||||
PositionX = (short)(p.X * 4.0f);
|
||||
PositionY = (short)(p.Y * 4.0f);
|
||||
PositionZ = (short)(p.Z * 32.0f);
|
||||
@ -515,7 +515,7 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
public void ReadXml(XmlNode node, List<byte> allHeightmapDataList)
|
||||
{
|
||||
Vector2 p = Xml.GetChildVector2Attributes(node, "Position", "x", "y");
|
||||
Vector2 p = Xml.GetChildVector2Attributes(node, "Position");
|
||||
float minz = Xml.GetChildFloatAttribute(node, "MinZ", "value");
|
||||
float maxz = Xml.GetChildFloatAttribute(node, "MaxZ", "value");
|
||||
HeightmapDimX = (byte)Xml.GetChildUIntAttribute(node, "SizeX", "value");
|
||||
|
@ -112,7 +112,7 @@ namespace CodeWalker
|
||||
}
|
||||
|
||||
|
||||
public static bool GetChildBoolAttribute(XmlNode node, string name, string attribute)
|
||||
public static bool GetChildBoolAttribute(XmlNode node, string name, string attribute = "value")
|
||||
{
|
||||
if (node == null) return false;
|
||||
string val = node.SelectSingleNode(name)?.Attributes[attribute]?.InnerText;
|
||||
@ -120,7 +120,7 @@ namespace CodeWalker
|
||||
bool.TryParse(val, out b);
|
||||
return b;
|
||||
}
|
||||
public static int GetChildIntAttribute(XmlNode node, string name, string attribute)
|
||||
public static int GetChildIntAttribute(XmlNode node, string name, string attribute = "value")
|
||||
{
|
||||
if (node == null) return 0;
|
||||
string val = node.SelectSingleNode(name)?.Attributes[attribute]?.InnerText;
|
||||
@ -128,7 +128,7 @@ namespace CodeWalker
|
||||
int.TryParse(val, out i);
|
||||
return i;
|
||||
}
|
||||
public static uint GetChildUIntAttribute(XmlNode node, string name, string attribute)
|
||||
public static uint GetChildUIntAttribute(XmlNode node, string name, string attribute = "value")
|
||||
{
|
||||
if (node == null) return 0;
|
||||
string val = node.SelectSingleNode(name)?.Attributes[attribute]?.InnerText;
|
||||
@ -144,7 +144,7 @@ namespace CodeWalker
|
||||
}
|
||||
return i;
|
||||
}
|
||||
public static float GetChildFloatAttribute(XmlNode node, string name, string attribute)
|
||||
public static float GetChildFloatAttribute(XmlNode node, string name, string attribute = "value")
|
||||
{
|
||||
if (node == null) return 0;
|
||||
string val = node.SelectSingleNode(name)?.Attributes[attribute]?.InnerText;
|
||||
@ -152,26 +152,26 @@ namespace CodeWalker
|
||||
FloatUtil.TryParse(val, out f);
|
||||
return f;
|
||||
}
|
||||
public static string GetChildStringAttribute(XmlNode node, string name, string attribute)
|
||||
public static string GetChildStringAttribute(XmlNode node, string name, string attribute = "value")
|
||||
{
|
||||
if (node == null) return string.Empty;
|
||||
string val = node.SelectSingleNode(name)?.Attributes[attribute]?.InnerText;
|
||||
return val;
|
||||
}
|
||||
public static Vector2 GetChildVector2Attributes(XmlNode node, string name, string x, string y)
|
||||
public static Vector2 GetChildVector2Attributes(XmlNode node, string name, string x = "x", string y = "y")
|
||||
{
|
||||
float fx = GetChildFloatAttribute(node, name, x);
|
||||
float fy = GetChildFloatAttribute(node, name, y);
|
||||
return new Vector2(fx, fy);
|
||||
}
|
||||
public static Vector3 GetChildVector3Attributes(XmlNode node, string name, string x, string y, string z)
|
||||
public static Vector3 GetChildVector3Attributes(XmlNode node, string name, string x = "x", string y = "y", string z = "z")
|
||||
{
|
||||
float fx = GetChildFloatAttribute(node, name, x);
|
||||
float fy = GetChildFloatAttribute(node, name, y);
|
||||
float fz = GetChildFloatAttribute(node, name, z);
|
||||
return new Vector3(fx, fy, fz);
|
||||
}
|
||||
public static Vector4 GetChildVector4Attributes(XmlNode node, string name, string x, string y, string z, string w)
|
||||
public static Vector4 GetChildVector4Attributes(XmlNode node, string name, string x = "x", string y = "y", string z = "z", string w = "w")
|
||||
{
|
||||
float fx = GetChildFloatAttribute(node, name, x);
|
||||
float fy = GetChildFloatAttribute(node, name, y);
|
||||
|
@ -132,7 +132,7 @@ namespace CodeWalker.World
|
||||
CloudHatFrags = fraglist.ToArray();
|
||||
|
||||
DesiredTransitionTimeSec = Xml.GetChildFloatAttribute(xml, "mDesiredTransitionTimeSec", "value");
|
||||
CamPositionScaler = Xml.GetChildVector3Attributes(xml, "mCamPositionScaler", "x", "y", "z");
|
||||
CamPositionScaler = Xml.GetChildVector3Attributes(xml, "mCamPositionScaler");
|
||||
AltitudeScrollScaler = Xml.GetChildFloatAttribute(xml, "mAltitudeScrollScaler", "value");
|
||||
}
|
||||
|
||||
@ -170,9 +170,9 @@ namespace CodeWalker.World
|
||||
|
||||
public void Init(XmlElement xml)
|
||||
{
|
||||
Position = Xml.GetChildVector3Attributes(xml, "mPosition", "x", "y", "z");
|
||||
Rotation = Xml.GetChildVector3Attributes(xml, "mRotation", "x", "y", "z");
|
||||
Scale = Xml.GetChildVector3Attributes(xml, "mScale", "x", "y", "z");
|
||||
Position = Xml.GetChildVector3Attributes(xml, "mPosition");
|
||||
Rotation = Xml.GetChildVector3Attributes(xml, "mRotation");
|
||||
Scale = Xml.GetChildVector3Attributes(xml, "mScale");
|
||||
Name = Xml.GetChildInnerText(xml, "mName");
|
||||
|
||||
List<CloudHatFragLayer> layerlist = new List<CloudHatFragLayer>();
|
||||
@ -192,8 +192,8 @@ namespace CodeWalker.World
|
||||
TransitionAlphaRange = Xml.GetChildFloatAttribute(xml, "mTransitionAlphaRange", "value");
|
||||
TransitionMidPoint = Xml.GetChildFloatAttribute(xml, "mTransitionMidPoint", "value");
|
||||
Enabled = Xml.GetChildBoolAttribute(xml, "mEnabled", "value");
|
||||
AngularVelocity = Xml.GetChildVector3Attributes(xml, "mAngularVelocity", "x", "y", "z");
|
||||
AnimBlendWeights = Xml.GetChildVector3Attributes(xml, "mAnimBlendWeights", "x", "y", "z");
|
||||
AngularVelocity = Xml.GetChildVector3Attributes(xml, "mAngularVelocity");
|
||||
AnimBlendWeights = Xml.GetChildVector3Attributes(xml, "mAnimBlendWeights");
|
||||
|
||||
string uvvelocitystr = Xml.GetChildInnerText(xml, "mUVVelocity").Trim();
|
||||
string[] uvvelocities = uvvelocitystr.Split('\n');
|
||||
|
Loading…
Reference in New Issue
Block a user