mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 17:05:10 +08:00
Fixing carcols file loading, VehicleForm tools panel added
This commit is contained in:
@@ -785,8 +785,8 @@ namespace CodeWalker.GameFiles
|
||||
public bool turnOffExtra { get; set; }
|
||||
public bool disableBonnetCamera { get; set; }
|
||||
public bool allowBonnetSlide { get; set; }
|
||||
public byte weaponSlot { get; set; } //SByte?
|
||||
public byte Unk_2656206330 { get; set; } //SByte?
|
||||
public sbyte weaponSlot { get; set; }
|
||||
public sbyte Unk_2656206330 { get; set; }
|
||||
public bool disableProjectileDriveby { get; set; }
|
||||
public bool disableDriveby { get; set; }
|
||||
public int Unk_161724223 { get; set; }
|
||||
@@ -832,12 +832,12 @@ namespace CodeWalker.GameFiles
|
||||
turnOffExtra = Xml.GetChildBoolAttribute(node, "turnOffExtra", "value");
|
||||
disableBonnetCamera = Xml.GetChildBoolAttribute(node, "disableBonnetCamera", "value");
|
||||
allowBonnetSlide = Xml.GetChildBoolAttribute(node, "allowBonnetSlide", "value");
|
||||
weaponSlot = (byte)Xml.GetChildIntAttribute(node, "weaponSlot", "value");
|
||||
Unk_2656206330 = (byte)Xml.GetChildIntAttribute(node, "Unk_2656206330", "value");
|
||||
weaponSlot = (sbyte)Xml.GetChildIntAttribute(node, "weaponSlot", "value");
|
||||
Unk_2656206330 = (sbyte)Xml.GetChildIntAttribute(node, "hash_9E527DFA", "value");//TODO: fix
|
||||
disableProjectileDriveby = Xml.GetChildBoolAttribute(node, "disableProjectileDriveby", "value");
|
||||
disableDriveby = Xml.GetChildBoolAttribute(node, "disableDriveby", "value");
|
||||
Unk_161724223 = Xml.GetChildIntAttribute(node, "Unk_161724223", "value");
|
||||
Unk_484538291 = Xml.GetChildIntAttribute(node, "Unk_484538291", "value");
|
||||
Unk_161724223 = Xml.GetChildIntAttribute(node, "hash_09A3B73F", "value");//TODO: fix
|
||||
Unk_484538291 = Xml.GetChildIntAttribute(node, "hash_1CE177B3", "value");//TODO: fix
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@@ -1482,6 +1482,7 @@ namespace CodeWalker.GameFiles
|
||||
var allCarCols = new List<CarColsFile>();
|
||||
var allCarModCols = new List<CarModColsFile>();
|
||||
var allCarVariations = new List<CarVariationsFile>();
|
||||
var allCarVariationsDict = new Dictionary<MetaHash, CVehicleModelInfoVariation_418053801>();
|
||||
var allVehicleLayouts = new List<VehicleLayoutsFile>();
|
||||
|
||||
var addVehicleFiles = new Action<IEnumerable<RpfFile>>((from) =>
|
||||
@@ -1527,8 +1528,15 @@ namespace CodeWalker.GameFiles
|
||||
if ((entry.NameLower == "carvariations.ymt") || (entry.NameLower == "carvariations.meta"))
|
||||
{
|
||||
var cf = RpfMan.GetFile<CarVariationsFile>(entry);
|
||||
if (cf.VehicleModelInfo != null)
|
||||
{ }
|
||||
if (cf.VehicleModelInfo?.variationData != null)
|
||||
{
|
||||
foreach (var variation in cf.VehicleModelInfo.variationData)
|
||||
{
|
||||
var name = variation.modelName.ToLowerInvariant();
|
||||
var hash = JenkHash.GenHash(name);
|
||||
allCarVariationsDict[hash] = variation;
|
||||
}
|
||||
}
|
||||
allCarVariations.Add(cf);
|
||||
}
|
||||
if (entry.NameLower.StartsWith("vehiclelayouts") && entry.NameLower.EndsWith(".meta"))
|
||||
|
||||
@@ -696,13 +696,14 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public static MetaHash GetHash(string str)
|
||||
{
|
||||
if (str == null) return 0;
|
||||
if (string.IsNullOrEmpty(str)) return 0;
|
||||
if (str.StartsWith("hash_"))
|
||||
{
|
||||
return (MetaHash) Convert.ToUInt32(str.Substring(5), 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
JenkIndex.Ensure(str);
|
||||
return JenkHash.GenHash(str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user