mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 23:32:41 +08:00
Scenario bug fixes for modelsets and types/groups
This commit is contained in:
@@ -130,12 +130,9 @@ namespace CodeWalker.Project.Panels
|
||||
if (types == null)
|
||||
{ return; }
|
||||
|
||||
var stypes = types.GetScenarioTypes();
|
||||
var stypes = types.GetScenarioTypeRefs();
|
||||
if (stypes == null) return;
|
||||
|
||||
var stgroups = types.GetScenarioTypeGroups();
|
||||
if (stgroups == null) return;
|
||||
|
||||
var pmsets = types.GetPedModelSets();
|
||||
if (pmsets == null) return;
|
||||
|
||||
@@ -150,17 +147,9 @@ namespace CodeWalker.Project.Panels
|
||||
ScenarioChainNodeTypeComboBox.Items.Add("");
|
||||
foreach (var stype in stypes)
|
||||
{
|
||||
ScenarioTypeRef? typeRef = new ScenarioTypeRef(stype);
|
||||
ScenarioPointTypeComboBox.Items.Add(typeRef);
|
||||
ScenarioClusterPointTypeComboBox.Items.Add(typeRef);
|
||||
ScenarioChainNodeTypeComboBox.Items.Add(typeRef);
|
||||
}
|
||||
foreach (var stgroup in stgroups)
|
||||
{
|
||||
ScenarioTypeRef? typeRef = new ScenarioTypeRef(stgroup);
|
||||
ScenarioPointTypeComboBox.Items.Add(typeRef);
|
||||
ScenarioClusterPointTypeComboBox.Items.Add(typeRef);
|
||||
ScenarioChainNodeTypeComboBox.Items.Add(typeRef);
|
||||
ScenarioPointTypeComboBox.Items.Add(stype);
|
||||
ScenarioClusterPointTypeComboBox.Items.Add(stype);
|
||||
ScenarioChainNodeTypeComboBox.Items.Add(stype);
|
||||
}
|
||||
|
||||
ScenarioPointModelSetComboBox.Items.Clear();
|
||||
@@ -838,7 +827,7 @@ namespace CodeWalker.Project.Panels
|
||||
if (populatingui) return;
|
||||
if (CurrentScenarioNode == null) return;
|
||||
if (CurrentScenarioNode.MyPoint == null) return;
|
||||
ScenarioTypeRef? stype = ScenarioPointTypeComboBox.SelectedItem as ScenarioTypeRef?;
|
||||
ScenarioTypeRef stype = ScenarioPointTypeComboBox.SelectedItem as ScenarioTypeRef;
|
||||
lock (ProjectForm.ProjectSyncRoot)
|
||||
{
|
||||
if (CurrentScenarioNode.MyPoint.Type != stype)
|
||||
@@ -1722,7 +1711,7 @@ namespace CodeWalker.Project.Panels
|
||||
if (populatingui) return;
|
||||
if (CurrentScenarioNode == null) return;
|
||||
if (CurrentScenarioNode.ChainingNode == null) return;
|
||||
ScenarioTypeRef? stype = ScenarioChainNodeTypeComboBox.SelectedItem as ScenarioTypeRef?;
|
||||
ScenarioTypeRef stype = ScenarioChainNodeTypeComboBox.SelectedItem as ScenarioTypeRef;
|
||||
lock (ProjectForm.ProjectSyncRoot)
|
||||
{
|
||||
if (CurrentScenarioNode.ChainingNode.Type != stype)
|
||||
@@ -2144,7 +2133,7 @@ namespace CodeWalker.Project.Panels
|
||||
if (populatingui) return;
|
||||
if (CurrentScenarioNode == null) return;
|
||||
if (CurrentScenarioNode.ClusterMyPoint == null) return;
|
||||
ScenarioTypeRef? stype = ScenarioClusterPointTypeComboBox.SelectedItem as ScenarioTypeRef?;
|
||||
ScenarioTypeRef stype = ScenarioClusterPointTypeComboBox.SelectedItem as ScenarioTypeRef;
|
||||
lock (ProjectForm.ProjectSyncRoot)
|
||||
{
|
||||
if (CurrentScenarioNode.ClusterMyPoint.Type != stype)
|
||||
|
||||
@@ -6143,10 +6143,10 @@ namespace CodeWalker.Project
|
||||
if (f.ShowDialog() == DialogResult.Cancel) return;
|
||||
|
||||
var stypes = Scenarios.ScenarioTypes; //these are loaded by Scenarios.Init
|
||||
ScenarioType defaulttype = null;
|
||||
ScenarioTypeRef defaulttype = null;
|
||||
if (stypes != null)
|
||||
{
|
||||
defaulttype = stypes.GetScenarioType(1194480618); //"drive";
|
||||
defaulttype = stypes.GetScenarioTypeRef(1194480618); //"drive";
|
||||
}
|
||||
|
||||
AmbientModelSet defaultmodelset = null;
|
||||
@@ -6184,7 +6184,7 @@ namespace CodeWalker.Project
|
||||
var action = CScenarioChainingEdge__eAction.Move;
|
||||
var navMode = CScenarioChainingEdge__eNavMode.Direct;
|
||||
var navSpeed = CScenarioChainingEdge__eNavSpeed.Unk_00_3279574318;
|
||||
var stype = new ScenarioTypeRef(defaulttype);
|
||||
var stype = defaulttype;
|
||||
var modelset = defaultmodelset;
|
||||
var flags = defaultflags;
|
||||
var ok = true;
|
||||
@@ -6216,22 +6216,10 @@ namespace CodeWalker.Project
|
||||
if (vals.Length > 6)
|
||||
{
|
||||
var sthash = JenkHash.GenHash(vals[6].Trim().ToLowerInvariant());
|
||||
var st = stypes?.GetScenarioType(sthash);
|
||||
if (st != null)
|
||||
stype = stypes?.GetScenarioTypeRef(sthash);
|
||||
if (stype == null)
|
||||
{
|
||||
stype = new ScenarioTypeRef(st);
|
||||
}
|
||||
else
|
||||
{
|
||||
var stg = stypes?.GetScenarioTypeGroup(sthash);
|
||||
if (stg != null)
|
||||
{
|
||||
stype = new ScenarioTypeRef(stg);
|
||||
}
|
||||
else
|
||||
{
|
||||
stype = new ScenarioTypeRef(defaulttype);
|
||||
}
|
||||
stype = defaulttype;
|
||||
}
|
||||
}
|
||||
if (vals.Length > 7)
|
||||
|
||||
+10
-2
@@ -1412,7 +1412,11 @@ namespace CodeWalker
|
||||
MCScenarioPoint vpoint = sn.MyPoint ?? sn.ClusterMyPoint;
|
||||
if ((vpoint != null) && (vpoint?.Type?.IsVehicle ?? false))
|
||||
{
|
||||
var vhash = vpoint.ModelSet?.NameHash ?? vpoint.Type?.VehicleModelSetHash ?? 0;
|
||||
var vhash = vpoint.ModelSet?.NameHash ?? 493038497;//"none"
|
||||
if ((vhash == 0) || (vhash == 493038497))
|
||||
{
|
||||
vhash = vpoint.Type?.VehicleModelSetHash ?? 0;
|
||||
}
|
||||
if ((vhash == 0) && (sn.ChainingNode?.Chain?.Edges != null) && (sn.ChainingNode.Chain.Edges.Length > 0))
|
||||
{
|
||||
var fedge = sn.ChainingNode.Chain.Edges[0]; //for chain nodes, show the first node's model...
|
||||
@@ -1420,7 +1424,11 @@ namespace CodeWalker
|
||||
if (fnode != null)
|
||||
{
|
||||
vpoint = fnode.MyPoint ?? fnode.ClusterMyPoint;
|
||||
vhash = vpoint.ModelSet?.NameHash ?? vpoint.Type?.VehicleModelSetHash ?? 0;
|
||||
vhash = vpoint.ModelSet?.NameHash ?? 493038497;//"none"
|
||||
if ((vhash == 0) || (vhash == 493038497))
|
||||
{
|
||||
vhash = vpoint.Type?.VehicleModelSetHash ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user