public void Expand(MemoryObjectInfoUI obj) { if (obj.memoryObject != null) { ShowObject(obj.memoryObject); } }
public void Shrink(MemoryObjectInfoUI obj) { if (currentObject.memoryObject == rootObject) { return; } if (obj.memoryObject._parent != null) { ShowObject(obj.memoryObject._parent); } }
public void ShowObject(ObjectMemoryInfo obj, bool changePage = false) { HideCurrent(); if (!changePage) { currentIndex = 0; } int i = 0; currentObject = new MemoryObjectInfoUI(obj, new Vector2(0.25f, 0.95f), this); obj.Expand(); if (obj.children.Count == 0) { _plugin.Puts("No children!"); _plugin.Puts(IsValueType(obj._target).ToString()); return; } bool nextPageNeeded = false; Vector2 pos = new Vector2(0.25f, 0.90f); foreach (var item in obj.children) { //_plugin.Puts($"i: {i}, currentIndex: {currentIndex}"); if (i < currentIndex) { i++; continue; } if (i >= currentIndex + objectsPerScreen && (obj.children.Count != objectsPerScreen)) { nextPageNeeded = true; break; } shownObjects.Add(new MemoryObjectInfoUI(item, pos, this, false)); pos.y -= (0.90f / objectsPerScreen); i++; } foreach (var method in obj.methods) { if (i < currentIndex) { i++; continue; } if (i >= currentIndex + objectsPerScreen) { nextPageNeeded = true; break; } shownObjects.Add(new MemoryObjectInfoUI(method, pos, this, obj)); pos.y -= (0.90f / objectsPerScreen); i++; } nextPage.HideAll(); if (nextPageNeeded) { nextPage.Show(_player); } prevPage.HideAll(); if (currentIndex > 0) { prevPage.Show(_player); } }