mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 23:12:59 +08:00
Updated Menyoo spooner XML import
- Added livery support for cargens - Changed default cargen paint properties to -1 to avoid all-black cars spawning - Added texture tint variation for props
This commit is contained in:
parent
6f1d148875
commit
bb453883c2
@ -87,7 +87,8 @@ namespace CodeWalker.Project
|
|||||||
public bool FrozenPos { get; set; }
|
public bool FrozenPos { get; set; }
|
||||||
public string HashName { get; set; }
|
public string HashName { get; set; }
|
||||||
public int InitialHandle { get; set; }
|
public int InitialHandle { get; set; }
|
||||||
public List<MenyooXmlObjectProperty> ObjectProperties { get; set; }
|
public List<MenyooXmlProperty> ObjectProperties { get; set; }
|
||||||
|
public List<MenyooXmlProperty> VehicleProperties { get; set; }
|
||||||
public int OpacityLevel { get; set; }
|
public int OpacityLevel { get; set; }
|
||||||
public float LodDistance { get; set; }
|
public float LodDistance { get; set; }
|
||||||
public bool IsVisible { get; set; }
|
public bool IsVisible { get; set; }
|
||||||
@ -135,18 +136,31 @@ namespace CodeWalker.Project
|
|||||||
if (enode != null)
|
if (enode != null)
|
||||||
{
|
{
|
||||||
var objprops = Xml.GetChild(enode, "ObjectProperties");
|
var objprops = Xml.GetChild(enode, "ObjectProperties");
|
||||||
ObjectProperties = new List<MenyooXmlObjectProperty>();
|
ObjectProperties = new List<MenyooXmlProperty>();
|
||||||
if (objprops != null)
|
if (objprops != null)
|
||||||
{
|
{
|
||||||
foreach (XmlNode objpropn in objprops.ChildNodes)
|
foreach (XmlNode objpropn in objprops.ChildNodes)
|
||||||
{
|
{
|
||||||
MenyooXmlObjectProperty pr = new MenyooXmlObjectProperty();
|
MenyooXmlProperty pr = new MenyooXmlProperty();
|
||||||
pr.Name = objpropn.Name;
|
pr.Name = objpropn.Name;
|
||||||
pr.Value = objpropn.InnerText;
|
pr.Value = objpropn.InnerText;
|
||||||
ObjectProperties.Add(pr);
|
ObjectProperties.Add(pr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var vehprops = Xml.GetChild(enode, "VehicleProperties");
|
||||||
|
VehicleProperties = new List<MenyooXmlProperty>();
|
||||||
|
if (vehprops != null)
|
||||||
|
{
|
||||||
|
foreach (XmlNode vehpropn in vehprops.ChildNodes)
|
||||||
|
{
|
||||||
|
MenyooXmlProperty pr = new MenyooXmlProperty();
|
||||||
|
pr.Name = vehpropn.Name;
|
||||||
|
pr.Value = vehpropn.InnerText;
|
||||||
|
VehicleProperties.Add(pr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var posrot = Xml.GetChild(enode, "PositionRotation");
|
var posrot = Xml.GetChild(enode, "PositionRotation");
|
||||||
var px = Xml.GetChildFloatInnerText(posrot, "X");
|
var px = Xml.GetChildFloatInnerText(posrot, "X");
|
||||||
var py = Xml.GetChildFloatInnerText(posrot, "Y");
|
var py = Xml.GetChildFloatInnerText(posrot, "Y");
|
||||||
@ -173,8 +187,6 @@ namespace CodeWalker.Project
|
|||||||
IsMeleeProof = Xml.GetChildBoolInnerText(node, "IsMeleeProof");
|
IsMeleeProof = Xml.GetChildBoolInnerText(node, "IsMeleeProof");
|
||||||
IsOnlyDamagedByPlayer = Xml.GetChildBoolInnerText(node, "IsOnlyDamagedByPlayer");
|
IsOnlyDamagedByPlayer = Xml.GetChildBoolInnerText(node, "IsOnlyDamagedByPlayer");
|
||||||
Attachment_isAttached = Xml.GetChildBoolAttribute(node, "Attachment", "isAttached");
|
Attachment_isAttached = Xml.GetChildBoolAttribute(node, "Attachment", "isAttached");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -186,7 +198,7 @@ namespace CodeWalker.Project
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MenyooXmlObjectProperty
|
public class MenyooXmlProperty
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
@ -2335,6 +2335,15 @@ namespace CodeWalker.Project
|
|||||||
ccg.perpendicularLength = 2.6f;
|
ccg.perpendicularLength = 2.6f;
|
||||||
ccg.position = placement.Position;
|
ccg.position = placement.Position;
|
||||||
ccg.carModel = placement.ModelHash;
|
ccg.carModel = placement.ModelHash;
|
||||||
|
ccg.bodyColorRemap1 = -1;
|
||||||
|
ccg.bodyColorRemap2 = -1;
|
||||||
|
ccg.bodyColorRemap3 = -1;
|
||||||
|
ccg.bodyColorRemap4 = -1;
|
||||||
|
|
||||||
|
if (sbyte.TryParse(placement.VehicleProperties.FirstOrDefault(p => p.Name == "Livery")?.Value, out sbyte livery))
|
||||||
|
{
|
||||||
|
ccg.livery = livery;
|
||||||
|
}
|
||||||
|
|
||||||
YmapCarGen cg = new YmapCarGen(CurrentYmapFile, ccg);
|
YmapCarGen cg = new YmapCarGen(CurrentYmapFile, ccg);
|
||||||
|
|
||||||
@ -2367,6 +2376,10 @@ namespace CodeWalker.Project
|
|||||||
cent.priorityLevel = rage__ePriorityLevel.PRI_REQUIRED;
|
cent.priorityLevel = rage__ePriorityLevel.PRI_REQUIRED;
|
||||||
cent.ambientOcclusionMultiplier = 255;
|
cent.ambientOcclusionMultiplier = 255;
|
||||||
cent.artificialAmbientOcclusion = 255;
|
cent.artificialAmbientOcclusion = 255;
|
||||||
|
if(uint.TryParse(placement.ObjectProperties.FirstOrDefault(p => p.Name == "TextureVariation")?.Value, out uint tint))
|
||||||
|
{
|
||||||
|
cent.tintValue = tint;
|
||||||
|
}
|
||||||
|
|
||||||
YmapEntityDef ent = new YmapEntityDef(CurrentYmapFile, 0, ref cent);
|
YmapEntityDef ent = new YmapEntityDef(CurrentYmapFile, 0, ref cent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user