public void UpdateGO(int index) { Twinsanity.GameObject GO = (Twinsanity.GameObject)twinsanityEditorForm.LevelData.Get_Item(TwinsanityEditorForm.CalculateIndexes(twinsanityEditorForm.TreeView1.Nodes[0].Nodes[1].Nodes[0].Nodes[index])); UnkList.Items.Clear(); OGIList.Items.Clear(); AnimList.Items.Clear(); ScrList.Items.Clear(); GOList.Items.Clear(); SoundList.Items.Clear(); SomeList.Items.Clear(); FloatList.Items.Clear(); IntList.Items.Clear(); for (int i = 0; i <= GO.UnkI32.Length - 1; i++) { UnkList.Items.Add(GO.UnkI32[i].ToString()); } for (int i = 0; i <= GO.OGI.Length - 1; i++) { OGIList.Items.Add(GO.OGI[i].ToString()); } for (int i = 0; i <= GO.Animation.Length - 1; i++) { AnimList.Items.Add(GO.Animation[i].ToString()); } for (int i = 0; i <= GO.Script.Length - 1; i++) { ScrList.Items.Add(GO.Script[i].ToString()); } for (int i = 0; i <= GO._GameObject.Length - 1; i++) { GOList.Items.Add(GO._GameObject[i].ToString()); } for (int i = 0; i <= GO.Sound.Length - 1; i++) { SoundList.Items.Add(GO.Sound[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI321.Length - 1; i++) { SomeList.Items.Add(GO.ParametersUnkI321[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI322.Length - 1; i++) { FloatList.Items.Add(GO.ParametersUnkI322[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI323.Length - 1; i++) { IntList.Items.Add(GO.ParametersUnkI323[i].ToString()); } IDVal.Text = GO.ID.ToString(); NameVal.Text = GO.Name; Class1Val.Text = GO.Class1.ToString(); Class2Val.Text = GO.Class2.ToString(); Class3Val.Text = GO.Class3.ToString(); ParamVal.Text = GO.ParametersUnkI32.ToString(); this.Text = "ID: " + IDVal.Text; }
public void UpdateTree(ref Twinsanity.GameObjects GOs, int Index) { GOTree.BeginUpdate(); for (int i = 0; i <= GOs._Item.Length - 1; i++) { Twinsanity.GameObject GO = (Twinsanity.GameObject)GOs._Item[i]; GOTree.Nodes.Add("ID: " + GO.Name); } GOTree.EndUpdate(); }
public void UpdateInstance(int index) { Twinsanity.Instance INST = (Twinsanity.Instance)twinsanityEditorForm.LevelData.Get_Item(TwinsanityEditorForm.CalculateIndexes(twinsanityEditorForm.TreeView1.Nodes[0].Nodes[IISIndex].Nodes[6].Nodes[index])); Twinsanity.GameObjects Objects = (Twinsanity.GameObjects)twinsanityEditorForm.LevelData.Item[1]._Item[0]; Twinsanity.GameObject GO = null; for (int i = 0; i <= Objects._Item.Length - 1; i++) { if (Objects._Item[i].ID == INST.ObjectID) { GO = (Twinsanity.GameObject)Objects._Item[i]; break; } } if (!(GO == null)) this.Text = "Object " + GO.Name + " (ID: " + GO.ID.ToString() + ")"; else this.Text = "Object is not defined"; InstanceID.Text = INST.ID.ToString(); ObjectID.Text = INST.ObjectID.ToString(); InstanceX.Text = INST.X.ToString(); InstanceY.Text = INST.Y.ToString(); InstanceZ.Text = INST.Z.ToString(); RotationX.Value = INST.RX; RotationY.Value = INST.RY; RotationZ.Value = INST.RZ; UpdateRotations(); Flags.Text = INST.UnkI32.ToString(); Satan.Text = INST.AfterOID.ToString(); Some.Items.Clear(); Floats.Items.Clear(); Integers.Items.Clear(); for (int i = 0; i <= INST.UnkI321Number - 1; i++) Some.Items.Add(INST.UnkI321[i]); for (int i = 0; i <= INST.UnkI322Number - 1; i++) Floats.Items.Add(INST.UnkI322[i]); for (int i = 0; i <= INST.UnkI323Number - 1; i++) Integers.Items.Add(INST.UnkI323[i]); Position.Items.Clear(); Path.Items.Clear(); Instance.Items.Clear(); for (int i = 0; i <= INST.Size1 - 1; i++) Position.Items.Add(INST.Something1[i]); for (int i = 0; i <= INST.Size2 - 1; i++) Path.Items.Add(INST.Something2[i]); for (int i = 0; i <= INST.Size3 - 1; i++) Instance.Items.Add(INST.Something3[i]); }
private void UpdateObject(int Index) { Twinsanity.Instance INST = (Twinsanity.Instance)twinsanityEditorForm.LevelData.Get_Item(TwinsanityEditorForm.CalculateIndexes(twinsanityEditorForm.TreeView1.Nodes[0].Nodes[IISIndex].Nodes[6].Nodes[Index])); Twinsanity.GameObjects Objects = (Twinsanity.GameObjects)twinsanityEditorForm.LevelData.Item[1]._Item[0]; Twinsanity.GameObject GO = null; for (int i = 0; i <= Objects._Item.Length - 1; i++) { if (Objects._Item[i].ID == INST.ObjectID) { GO = (Twinsanity.GameObject)Objects._Item[i]; break; } } if (!(GO == null)) { Label4.Text = "Instances (" + GO.Name + ")"; } else { Label4.Text = "Instances (Object is undefined)"; } }
public void ApplyGO(int index) { TwinsanityEditorForm twinsanityEditorForm = (TwinsanityEditorForm)ParentForm; Twinsanity.GameObject GO = (Twinsanity.GameObject)twinsanityEditorForm.LevelData.Get_Item(TwinsanityEditorForm.CalculateIndexes(twinsanityEditorForm.TreeView1.Nodes[0].Nodes[1].Nodes[0].Nodes[index])); GO.UnkI32Number = UnkList.Items.Count; Array.Resize(ref GO.UnkI32, GO.UnkI32Number); GO.OGINumber = OGIList.Items.Count; Array.Resize(ref GO.OGI, GO.OGINumber); GO.AnimationNumber = AnimList.Items.Count; Array.Resize(ref GO.Animation, GO.AnimationNumber); GO.ScriptNumber = ScrList.Items.Count; Array.Resize(ref GO.Script, GO.ScriptNumber); GO.GameObjectNumber = GOList.Items.Count; Array.Resize(ref GO._GameObject, GO.GameObjectNumber); GO.SoundNumber = SoundList.Items.Count; Array.Resize(ref GO.Sound, GO.SoundNumber); GO.ParametersUnkI321Number = SomeList.Items.Count; Array.Resize(ref GO.ParametersUnkI321, GO.ParametersUnkI321Number); GO.ParametersUnkI322Number = FloatList.Items.Count; Array.Resize(ref GO.ParametersUnkI322, GO.ParametersUnkI322Number); GO.ParametersUnkI323Number = IntList.Items.Count; Array.Resize(ref GO.ParametersUnkI323, GO.ParametersUnkI323Number); for (int i = 0; i <= GO.UnkI32.Length - 1; i++) { GO.UnkI32[i] = uint.Parse(UnkList.Items[i].ToString()); } for (int i = 0; i <= GO.OGI.Length - 1; i++) { GO.OGI[i] = UInt16.Parse(OGIList.Items[i].ToString()); } for (int i = 0; i <= GO.Animation.Length - 1; i++) { GO.Animation[i] = UInt16.Parse(AnimList.Items[i].ToString()); } for (int i = 0; i <= GO.Script.Length - 1; i++) { GO.Script[i] = UInt16.Parse(ScrList.Items[i].ToString()); } for (int i = 0; i <= GO._GameObject.Length - 1; i++) { GO._GameObject[i] = UInt16.Parse(GOList.Items[i].ToString()); } for (int i = 0; i <= GO.Sound.Length - 1; i++) { GO.Sound[i] = UInt16.Parse(SoundList.Items[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI321.Length - 1; i++) { GO.ParametersUnkI321[i] = uint.Parse(SomeList.Items[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI322.Length - 1; i++) { GO.ParametersUnkI322[i] = float.Parse(FloatList.Items[i].ToString()); } for (int i = 0; i <= GO.ParametersUnkI323.Length - 1; i++) { GO.ParametersUnkI323[i] = uint.Parse(IntList.Items[i].ToString()); } GO.ID = uint.Parse(IDVal.Text); GO.Name = NameVal.Text; GOTree.SelectedNode.Text = GO.Name; this.Text = "ID: " + IDVal.Text; GO.Class1 = uint.Parse(Class1Val.Text); GO.Class2 = uint.Parse(Class2Val.Text); GO.Class3 = uint.Parse(Class3Val.Text); GO.ParametersUnkI32 = uint.Parse(ParamVal.Text); GO.ParametersHeader = (uint)((GO.ParametersUnkI323Number << 16) + (GO.ParametersUnkI322Number << 8) + (GO.ParametersUnkI321Number)); twinsanityEditorForm.LevelData.Put_Item(GO, TwinsanityEditorForm.CalculateIndexes(twinsanityEditorForm.TreeView1.Nodes[0].Nodes[1].Nodes[0].Nodes[index])); }