private void UpdateSpoData() { ctbX.Text = $"{Position.x:F3}"; ctbY.Text = $"{Position.y:F3}"; ctbZ.Text = $"{Position.z:F3}"; treeManager.InvalidateAll(); int nChildren = Acp.XHIE_fn_lEnumSpoChildren(SuperObject, treeManager.GetEnumNonGroupedSpoCallback(parentNode)); treeManager.RemoveInvalidated(); parentNode.Text = $"Children ({nChildren})"; parentNode.Expand(); }
private void UpdateWorldTree() { treeManager.InvalidateAll(); ObjectTreeManager.GetCallbackDelegate getCallbackMethod = treeManager.GetEnumCallback(GroupSpo); int nActive = Acp.XHIE_fn_lEnumSpoChildren(*(SuperObject **)Offsets.ActiveDynamicWorld, getCallbackMethod(activeWorld)); int nInactive = Acp.XHIE_fn_lEnumSpoChildren(*(SuperObject **)Offsets.InactiveDynamicWorld, getCallbackMethod(inactiveWorld)); int nSectors = Acp.XHIE_fn_lEnumSpoChildren(*(SuperObject **)Offsets.FatherSector, treeManager.GetEnumNonGroupedSpoCallback(fatherSector)); treeManager.RemoveInvalidated(GroupSpo); ChildStatusText = $"Active: {nActive} objects, Inactive: {nInactive} objects, Sectors: {nSectors} objects."; MainFrame.Instance.SetStatus(this, ChildStatusText); }
public SpoForm(Pointer <SuperObject> spo) { InitializeComponent(); SuperObject = spo; string spoNameRaw = Acp.XHIE_fn_szGetObjectName(SuperObject, Acp.XHIE_OI_TYPE.TOI_INSTANCE); spoNameUsable = spoNameRaw ?? $"{SuperObject.StructPtr->type} [{(int)SuperObject:X8}]"; Text = $"{spoNameUsable} - Properties"; Icon = Resources.IconSpo; familyName = ctbFamily.Text = Acp.XHIE_fn_szGetObjectName(SuperObject, Acp.XHIE_OI_TYPE.TOI_FAMILY) ?? "(Unknown)"; modelName = ctbModel.Text = Acp.XHIE_fn_szGetObjectName(SuperObject, Acp.XHIE_OI_TYPE.TOI_MODEL) ?? "(Unknown)"; instanceName = ctbInstance.Text = spoNameRaw ?? "(Unknown)"; ctbAddress.Text = $"0x{(int)SuperObject:X8}"; ctbType.Text = $"{SuperObject.StructPtr->type} (0x{(int)SuperObject.StructPtr->type:X})"; treeManager = new ObjectTreeManager(); treeManager.InitIcons(ctvChildren); if (SuperObject.StructPtr->type == SuperObjectType.Perso) { dsgvarManager = new DsgVarListManager(); dsgvarManager.InitIcons(clvDsgVars); Acp.XAI_fn_lEnumSpoDsgVars(SuperObject, dsgvarManager.GetInitDsgVarsCallback(clvDsgVars)); if (SuperObject.StructPtr->PersoData->dynam != null) { dynamManager = new DynamManager(SuperObject); dynamManager.InitListView(clvDynamBase, DynamicsBlockBase.DynamicsType.Base); dynamManager.InitListView(clvDynamAdvanced, DynamicsBlockBase.DynamicsType.Advanced); dynamManager.InitListView(clvDynamComplex, DynamicsBlockBase.DynamicsType.Complex); switch (dynamManager.DynamType) { case DynamicsBlockBase.DynamicsType.Base: crbDynamTypeBase.Checked = true; break; case DynamicsBlockBase.DynamicsType.Advanced: crbDynamTypeAdvanced.Checked = true; break; case DynamicsBlockBase.DynamicsType.Complex: crbDynamTypeComplex.Checked = true; break; } } else { ctpDynamics.Enabled = false; } } else { ctpDsgVars.Enabled = false; ctpDynamics.Enabled = false; } parentNode = treeManager.NewTreeNode("Children", IconId.List); ctvChildren.Nodes.Add(parentNode); MainFrame.Instance.LevelChanged += OnLevelChanged; UpdateSpoData(); }