Skip to content

Commit 4e4afe1

Browse files
committed
Merge branch 'staging'
2 parents cee228a + 54e3c32 commit 4e4afe1

26 files changed

+2607
-7568
lines changed

CathodeLib/Properties/Resources.Designer.cs

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CathodeLib/Properties/Resources.resx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,19 @@
124124
<data name="composite_entity_names" type="System.Resources.ResXFileRef, System.Windows.Forms">
125125
<value>..\Resources\NodeDBs\composite_entity_names.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
126126
</data>
127+
<data name="composite_parameter_info" type="System.Resources.ResXFileRef, System.Windows.Forms">
128+
<value>..\Resources\NodeDBs\composite_parameter_info.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
129+
</data>
127130
<data name="composite_paths" type="System.Resources.ResXFileRef, System.Windows.Forms">
128131
<value>..\Resources\NodeDBs\composite_paths.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
129132
</data>
130-
<data name="entity_parameter_names" type="System.Resources.ResXFileRef, System.Windows.Forms">
131-
<value>..\Resources\NodeDBs\entity_parameter_names.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
133+
<data name="cathode_shortguid_lut" type="System.Resources.ResXFileRef, System.Windows.Forms">
134+
<value>..\Resources\NodeDBs\cathode_shortguid_lut.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
132135
</data>
133136
<data name="sound_names" type="System.Resources.ResXFileRef, System.Windows.Forms">
134137
<value>..\Resources\sound_names.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
135138
</data>
139+
<data name="cathode_entity_lut" type="System.Resources.ResXFileRef, System.Windows.Forms">
140+
<value>..\Resources\NodeDBs\cathode_entity_lut.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
141+
</data>
136142
</root>
77.5 KB
Binary file not shown.
-8.25 KB
Binary file not shown.
327 KB
Binary file not shown.
240 KB
Binary file not shown.
-895 Bytes
Binary file not shown.
-218 KB
Binary file not shown.

CathodeLib/Scripts/CATHODE/Commands.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//#define DO_PRETTY_COMPOSITES
2-
31
using CATHODE.Scripting;
42
using CATHODE.Scripting.Internal;
53
using CathodeLib;
@@ -37,6 +35,10 @@ public Commands(string path) : base(path) { }
3735
private ShortGuid[] _entryPoints = null;
3836
private Composite[] _entryPointObjects = null;
3937

38+
//Set this value to true before initialising your Commands object to load with non-capitalised composite names.
39+
//Changing this value AFTER loading will not make any difference to the loaded Commands object, only future ones.
40+
public static bool UsePrettyPaths = false;
41+
4042
#region FILE_IO
4143
override protected bool LoadInternal()
4244
{
@@ -151,10 +153,12 @@ override protected bool LoadInternal()
151153
//Read script ID and string name
152154
reader_parallel.BaseStream.Position = (scriptStartOffset * 4) + 4;
153155
composite.name = Utilities.ReadString(reader_parallel);
154-
#if DO_PRETTY_COMPOSITES
155-
string prettyPath = CompositePathDB.GetPrettyPathForComposite(composite.shortGUID);
156-
if (prettyPath != "") composite.name = prettyPath;
157-
#endif
156+
if (UsePrettyPaths)
157+
{
158+
string prettyPath = CompositeUtils.GetPrettyPath(composite.shortGUID);
159+
if (prettyPath != "") composite.name = prettyPath;
160+
composite.name = composite.name.Replace("/", "\\");
161+
}
158162
Utilities.Align(reader_parallel, 4);
159163

160164
//Pull data from those offsets
@@ -360,8 +364,8 @@ override protected bool LoadInternal()
360364
CAGEAnimation.Event.Keyframe keyframe = new CAGEAnimation.Event.Keyframe();
361365
reader_parallel.BaseStream.Position += 4;
362366
keyframe.secondsSinceStart = reader_parallel.ReadSingle();
363-
keyframe.start = Utilities.Consume<ShortGuid>(reader_parallel);
364-
keyframe.unk3 = Utilities.Consume<ShortGuid>(reader_parallel);
367+
keyframe.startEvent = Utilities.Consume<ShortGuid>(reader_parallel);
368+
keyframe.reverseEvent = Utilities.Consume<ShortGuid>(reader_parallel);
365369
reader_parallel.BaseStream.Position += 8;
366370
thisParamSet.keyframes.Add(keyframe);
367371
}
@@ -1034,8 +1038,8 @@ override protected bool SaveInternal()
10341038
CAGEAnimation.Event.Keyframe key = cageAnimationEntities[i][p].events[pp].keyframes[ppp];
10351039
writer.Write((Int32)1);
10361040
writer.Write(key.secondsSinceStart);
1037-
Utilities.Write<ShortGuid>(writer, key.start);
1038-
Utilities.Write<ShortGuid>(writer, key.unk3);
1041+
Utilities.Write<ShortGuid>(writer, key.startEvent);
1042+
Utilities.Write<ShortGuid>(writer, key.reverseEvent);
10391043
writer.Write(keyframeRefs.Count == 0 ? 3 : 4);
10401044
writer.Write((Int32)0);
10411045
}

CathodeLib/Scripts/CATHODE/CommandsPAK/Components/Composite.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,34 @@ public void RemoveAllFunctionEntitiesOfType(FunctionType type)
7272
}
7373

7474
/* Add a new function entity */
75-
public FunctionEntity AddFunction(FunctionType function, bool autopopulateParameters = false)
75+
public FunctionEntity AddFunction(FunctionType function)
7676
{
7777
FunctionEntity func = null;
7878
switch (function) {
7979
case FunctionType.CAGEAnimation:
80-
func = new CAGEAnimation(autopopulateParameters);
80+
func = new CAGEAnimation();
8181
break;
8282
case FunctionType.TriggerSequence:
83-
func = new TriggerSequence(autopopulateParameters);
83+
func = new TriggerSequence();
8484
break;
8585
default:
86-
func = new FunctionEntity(function, autopopulateParameters);
86+
func = new FunctionEntity(function);
8787
break;
8888
}
8989
functions.Add(func);
9090
return func;
9191
}
92-
public FunctionEntity AddFunction(Composite composite, bool autopopulateParameters = false)
92+
public FunctionEntity AddFunction(Composite composite)
9393
{
94-
FunctionEntity func = new FunctionEntity(composite.shortGUID, autopopulateParameters);
94+
FunctionEntity func = new FunctionEntity(composite);
9595
functions.Add(func);
9696
return func;
9797
}
9898

9999
/* Add a new variable entity */
100-
public VariableEntity AddVariable(string parameter, DataType type, bool addDefaultParam = false)
100+
public VariableEntity AddVariable(string parameter, DataType type)
101101
{
102-
VariableEntity vari = new VariableEntity(parameter, type, addDefaultParam);
102+
VariableEntity vari = new VariableEntity(parameter, type);
103103
variables.Add(vari);
104104
return vari;
105105
}

0 commit comments

Comments
 (0)