Skip to content

Commit dcfd32a

Browse files
committed
Fixed remaining functional issues with NodeToggle
1 parent 543c1e9 commit dcfd32a

8 files changed

Lines changed: 18 additions & 13 deletions

File tree

Build/VirginGeneric.dll

6 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-231 Bytes
Binary file not shown.

Source/Virgin_Kalactic/VirginGeneric/AssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
// Change them to the values specific to your project.
66

77
[assembly: AssemblyTitle("VirginGeneric")]
8-
[assembly: AssemblyDescription("")]
8+
[assembly: AssemblyDescription("General purpose utilities for various things")]
99
[assembly: AssemblyConfiguration("")]
10-
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyCompany("Virgin Kalactic")]
1111
[assembly: AssemblyProduct("")]
12-
[assembly: AssemblyCopyright("Tyler")]
12+
[assembly: AssemblyCopyright("Greys")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

1616
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
1717
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
1818
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
1919

20-
[assembly: AssemblyVersion("1.0.*")]
20+
[assembly: AssemblyVersion("0.3.*")]
2121

2222
// The following attributes are used to specify the signing key for the assembly,
2323
// if desired. See the Mono documentation for more information about signing.

Source/Virgin_Kalactic/VirginGeneric/NodeUtilities.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private void populateToggle (AttachNode node)
3737
{
3838
Debug.Log ("-Creating Event for: " + node.id);
3939

40-
BaseEvent item = new BaseEvent(new BaseEventList(part, this), node.id, () => toggle(node.id));
40+
BaseEvent item = new BaseEvent(new BaseEventList(part, this), node.GetHashCode().ToString(), () => toggle(node.GetHashCode()));
4141
item.active = true;
4242
item.guiActiveEditor = true;
4343
item.guiName = node.id + " || Active";
@@ -46,19 +46,24 @@ private void populateToggle (AttachNode node)
4646

4747
}
4848

49-
public void toggle (string caller)
49+
public void toggle (int caller)
5050
{
51-
Debug.Log ("toggling AttachNode: " + caller);
52-
AttachNode node = part.attachNodes.Find(a => a.id == caller);
51+
int hashcode = caller.GetHashCode();
52+
AttachNode node = aNList.Find(a => a.GetHashCode() == caller.GetHashCode());
53+
Debug.Log ("Toggling Node: " + node.id);
5354

54-
if (node != null)
55+
56+
if (part.attachNodes.Contains(node))
5557
{
58+
Debug.Log("Node Exists, Removing");
5659
part.attachNodes.Remove(node);
57-
Events[node.id].guiName = node.id + " || Inactive";
60+
Events[node.GetHashCode().ToString()].guiName = node.id + " || Inactive";
5861
} else {
59-
part.attachNodes.Add (aNList.Find(a => a.id == caller));
60-
Events[node.id].guiName = node.id + " || Active";
62+
Debug.Log("Node Absent, Adding");
63+
part.attachNodes.Add (node);
64+
Events[node.GetHashCode().ToString()].guiName = node.id + " || Active";
6165
}
66+
Debug.Log ("Toggle Complete");
6267
}
6368

6469
}
7.76 KB
Binary file not shown.

Source/Virgin_Kalactic/Virgin_Kalactic.userprefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<File FileName="NodeFix\NodeFix.cs" Line="13" Column="41" />
66
<File FileName="VirginAnimators\VirginAnimators" Line="21" Column="1" />
77
<File FileName="BetterPart\BetterPart.cs" Line="118" Column="28" />
8-
<File FileName="VirginGeneric\NodeUtilities.cs" Line="44" Column="37" />
8+
<File FileName="VirginGeneric\NodeUtilities.cs" Line="57" Column="56" />
99
<File FileName="AdvancedGenerator\AdvGenerator.cs" Line="250" Column="7" />
1010
</Files>
1111
</MonoDevelop.Ide.Workbench>

0 commit comments

Comments
 (0)