public override void drawMutable() { ImGui.Indent(); if (ImGui.CollapsingHeader($"{_name} [{_list.Count}]###{_name}", ImGuiTreeNodeFlags.FramePadding)) { ImGui.Indent(); if (!_isArray) { if (ImGui.Button("Add Element")) { if (_elementType == typeof(string)) { _list.Add(""); } else { _list.Add(Activator.CreateInstance(_elementType)); } } ImGui.SameLine(ImGui.GetWindowWidth() - ImGui.GetItemRectSize().X - ImGui.GetStyle().ItemInnerSpacing.X); // ImGui.SameLine( 0, ImGui.GetWindowWidth() * 0.65f - ImGui.GetItemRectSize().X + ImGui.GetStyle().ItemInnerSpacing.X - ImGui.GetStyle().IndentSpacing ); if (ImGui.Button("Clear")) { ImGui.OpenPopup("Clear Data"); } if (NezImGui.SimpleDialog("Clear Data", "Are you sure you want to clear the data?")) { _list.Clear(); Debug.log($"list count: {_list.Count}"); } } ImGui.PushItemWidth(-ImGui.GetStyle().IndentSpacing); for (var i = 0; i < _list.Count; i++) { if (_elementType == typeof(int)) { drawWidget((int)Convert.ChangeType(_list[i], _elementType), i); } else if (_elementType == typeof(float)) { drawWidget((float)Convert.ChangeType(_list[i], _elementType), i); } else if (_elementType == typeof(string)) { drawWidget((string)Convert.ChangeType(_list[i], _elementType), i); } else if (_elementType == typeof(Vector2)) { drawWidget((Vector2)Convert.ChangeType(_list[i], _elementType), i); } } ImGui.PopItemWidth(); ImGui.Unindent(); } ImGui.Unindent(); }
public virtual void OnGUIInspector(object userData) { Component component = userData as Component; if (component == null) { return; } if (ImGui.CollapsingHeader("Component##Inspector", treeNodeFlags)) { float textWidth = Math.Min(ImGui.GetContentRegionAvail().X * 0.75f, 300); ImGui.SetNextItemWidth(textWidth); pos = component.gameObject.transform.position; ImGui.DragFloat3("##Position##Component##Inspector", ref pos); ImGui.SameLine(); component.gameObject.transform.position = pos; ImGui.Text("Position"); ImGui.SetNextItemWidth(textWidth); rot = component.gameObject.transform.rotation.eulerAngles; ImGui.DragFloat3("##Rotation#Component##Inspector", ref rot); ImGui.SameLine(); FireEngine.Quaternion quaternion = FireEngine.Quaternion.identity; quaternion.eulerAngles = rot; component.gameObject.transform.rotation = quaternion; ImGui.Text("Rotation"); ImGui.SetNextItemWidth(textWidth); scl = component.gameObject.transform.scale; ImGui.DragFloat3("##Scale##Component##Inspector", ref scl); ImGui.SameLine(); component.gameObject.transform.scale = scl; ImGui.Text("Scale"); } }
// Draw information about the resident resource files. public unsafe void DrawDebugResidentResources() { if (!ImGui.CollapsingHeader("Resident Resources")) { return; } if (Penumbra.ResidentResources.Address == null || Penumbra.ResidentResources.Address->NumResources == 0) { return; } using var table = ImRaii.Table("##ResidentResources", 2, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit, -Vector2.UnitX); if (!table) { return; } for (var i = 0; i < Penumbra.ResidentResources.Address->NumResources; ++i) { var resource = Penumbra.ResidentResources.Address->ResourceList[i]; ImGui.TableNextColumn(); ImGui.TextUnformatted($"0x{( ulong )resource:X}"); ImGui.TableNextColumn(); Text(resource); } }
public void DrawDisplaysTab() { ImGui.BeginChild("###displaysScroll", ImGui.GetWindowSize() - (ImGui.GetStyle().WindowPadding * 2) - new Vector2(0, ImGui.GetCursorPosY())); if (ImGui.Button("添加新的显示区域")) { var guid = Guid.NewGuid(); MonitorDisplays.Add(guid, new MonitorDisplay { Guid = guid, Name = $"Display {MonitorDisplays.Count + 1}" }); Save(); } if (MonitorDisplays.Count == 0) { ImGui.Text("添加一个显示区域来开始使用。"); } Guid?deletedMonitor = null; foreach (var m in MonitorDisplays.Values) { if (ImGui.CollapsingHeader($"{m.Name}###configDisplay{m.Guid}")) { m.DrawConfigEditor(this, plugin, ref deletedMonitor); } } if (deletedMonitor.HasValue) { MonitorDisplays.Remove(deletedMonitor.Value); Save(); } ImGui.EndChild(); }
protected void DrawConnections() { if (!connections.AssertDrawable()) { connections.SetOwner(stateMachine.Value); return; } if (ImGui.CollapsingHeader("Connections:")) { using (new ScopeIndent()) { foreach (var connectionPair in connections.Value) { ImGui.Text($"- {connectionPair.Key.Name}"); using (new ScopeIndent()) { foreach (var pair in connectionPair.Value) { ImGui.Text($"-> {pair.Key.ToString()} > {pair.Value.Name}"); } } } } } }
public static void show(ref bool isOpen) { if (Core.scene == null || !isOpen) { return; } ImGui.SetNextWindowPos(new Num.Vector2(0, 25), ImGuiCond.FirstUseEver); ImGui.SetNextWindowSize(new Num.Vector2(300, Screen.height / 2), ImGuiCond.FirstUseEver); if (ImGui.Begin("Scene Graph", ref isOpen)) { if (Core.scene.rawPostProcessorList.length > 0 && ImGui.CollapsingHeader("Post Processors")) { drawPostProcessors(); } if (ImGui.CollapsingHeader("Entities (double-click label to inspect)", ImGuiTreeNodeFlags.DefaultOpen)) { for (var i = Core.scene.entities.count - 1; i >= 0; i--) { drawEntity(Core.scene.entities[i]); } } ImGui.End(); } }
public void Display() { var width = ImGui.GetWindowWidth() * 0.5f; ImGui.BeginChild(_entityState.Name, new System.Numerics.Vector2(240, 200), true, ImGuiWindowFlags.AlwaysAutoResize); foreach (var storetype in CargoResourceStores) { if (ImGui.CollapsingHeader(storetype.HeaderText + "###" + _entityState.Name + storetype.StorageTypeName, ImGuiTreeNodeFlags.CollapsingHeader)) { foreach (CargoItemVM item in storetype.CargoItems.ToArray()) { if (ImGui.Selectable(item.ItemName)) { SelectedItem = item; } ImGui.SameLine(); ImGui.Text(item.ItemMassPerUnit); ImGui.SameLine(); ImGui.Text(item.NumberOfItems); ImGui.SameLine(); ImGui.Text(item.TotalMass); } } } ImGui.EndChild(); }
public override void DrawMutable() { var isOpen = ImGui.CollapsingHeader($"{_name}", ImGuiTreeNodeFlags.FramePadding); if (AllowsEffectRemoval) { NezImGui.ShowContextMenuTooltip(); } if (AllowsEffectRemoval && ImGui.BeginPopupContextItem()) { if (ImGui.Selectable("Remove Effect")) { SetValue(null); _isTargetDestroyed = true; } ImGui.EndPopup(); } if (isOpen && !_isTargetDestroyed) { foreach (var i in _inspectors) { i.Draw(); } } }
// Draw general information about mod and collection state. private void DrawDebugTabGeneral() { if (!ImGui.CollapsingHeader("General")) { return; } using var table = ImRaii.Table("##DebugGeneralTable", 2, ImGuiTableFlags.SizingFixedFit, new Vector2(-1, ImGui.GetTextLineHeightWithSpacing() * 1)); if (!table) { return; } var manager = Penumbra.ModManager; PrintValue("Penumbra Version", $"{Penumbra.Version} {DebugVersionString}"); PrintValue("Git Commit Hash", Penumbra.CommitHash); PrintValue("Current Collection", Penumbra.CollectionManager.Current.Name); PrintValue(" has Cache", Penumbra.CollectionManager.Current.HasCache.ToString()); PrintValue("Default Collection", Penumbra.CollectionManager.Default.Name); PrintValue(" has Cache", Penumbra.CollectionManager.Default.HasCache.ToString()); PrintValue("Mod Manager BasePath", manager.BasePath.Name); PrintValue("Mod Manager BasePath-Full", manager.BasePath.FullName); PrintValue("Mod Manager BasePath IsRooted", Path.IsPathRooted(Penumbra.Config.ModDirectory).ToString()); PrintValue("Mod Manager BasePath Exists", Directory.Exists(manager.BasePath.FullName).ToString()); PrintValue("Mod Manager Valid", manager.Valid.ToString()); PrintValue("Path Resolver Enabled", _window._penumbra.PathResolver.Enabled.ToString()); PrintValue("Music Manager Streaming Disabled", (!_window._penumbra.MusicManager.StreamingEnabled).ToString()); PrintValue("Web Server Enabled", (_window._penumbra.WebServer != null).ToString()); }
public void Show(ref bool isOpen) { if (Core.Scene == null || !isOpen) { return; } ImGui.SetNextWindowPos(new Num.Vector2(0, 25), ImGuiCond.FirstUseEver); ImGui.SetNextWindowSize(new Num.Vector2(300, Screen.Height / 2), ImGuiCond.FirstUseEver); if (ImGui.Begin("Scene Graph", ref isOpen)) { if (ImGui.CollapsingHeader("Post Processors")) { _postProcessorsPane.Draw(); } if (ImGui.CollapsingHeader("Renderers")) { _renderersPane.Draw(); } if (ImGui.CollapsingHeader("Entities (double-click label to inspect)", ImGuiTreeNodeFlags.DefaultOpen)) { _entityPane.Draw(); } ImGui.End(); } }
void DrawSettings() { _frameRateArray[_frameRateArrayIndex] = ImGui.GetIO().Framerate; _frameRateArrayIndex = (_frameRateArrayIndex + 1) % _frameRateArray.Length; ImGui.PlotLines("##hidelabel", ref _frameRateArray[0], _frameRateArray.Length, _frameRateArrayIndex, $"FPS: {ImGui.GetIO().Framerate:0}", 0, 60, new Num.Vector2(ImGui.GetContentRegionAvail().X, 50)); NezImGui.SmallVerticalSpace(); if (ImGui.CollapsingHeader("Core Settings", ImGuiTreeNodeFlags.DefaultOpen)) { ImGui.Checkbox("exitOnEscapeKeypress", ref Core.ExitOnEscapeKeypress); ImGui.Checkbox("pauseOnFocusLost", ref Core.PauseOnFocusLost); ImGui.Checkbox("debugRenderEnabled", ref Core.DebugRenderEnabled); } if (ImGui.CollapsingHeader("Core.defaultSamplerState", ImGuiTreeNodeFlags.DefaultOpen)) { #if !FNA ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f); NezImGui.DisableNextWidget(); #endif var currentTextureFilter = (int)Core.DefaultSamplerState.Filter; if (ImGui.Combo("Filter", ref currentTextureFilter, _textureFilters, _textureFilters.Length)) { Core.DefaultSamplerState.Filter = (TextureFilter)Enum.Parse(typeof(TextureFilter), _textureFilters[currentTextureFilter]); } #if !FNA ImGui.PopStyleVar(); #endif } }
public void Draw() { ImGui.PushID(_scopeId); var isOpen = ImGui.CollapsingHeader(_postProcessor.GetType().Name.Replace("PostProcessor", string.Empty)); NezImGui.ShowContextMenuTooltip(); if (ImGui.BeginPopupContextItem()) { if (ImGui.Selectable("Remove PostProcessor")) { isOpen = false; Core.Scene.RemovePostProcessor(_postProcessor); ImGui.CloseCurrentPopup(); } ImGui.EndPopup(); } if (isOpen) { ImGui.Indent(); foreach (var inspector in _inspectors) { inspector.Draw(); } ImGui.Unindent(); } ImGui.PopID(); }
public void Draw() { ImGui.PushID(_scopeId); var isOpen = ImGui.CollapsingHeader(_name); NezImGui.ShowContextMenuTooltip(); if (ImGui.BeginPopupContextItem()) { if (ImGui.Selectable("Remove Renderer")) { if (Core.Scene is ECScene s) { isOpen = false; s.RemoveRenderer(_renderer); ImGui.CloseCurrentPopup(); } } ImGui.EndPopup(); } if (isOpen) { ImGui.Indent(); _materialInspector.Draw(); ImGui.Checkbox("shouldDebugRender", ref Renderer.ShouldDebugRender); var value = Renderer.RenderTargetClearColor.ToNumerics(); if (ImGui.ColorEdit4("renderTargetClearColor", ref value)) { Renderer.RenderTargetClearColor = value.ToXNAColor(); } if (Renderer.Camera != null) { if (NezImGui.LabelButton("Camera", Renderer.Camera.Entity.Name)) { Core.GetGlobalManager <ImGuiManager>().StartInspectingEntity(Renderer.Camera.Entity); } } ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f); NezImGui.DisableNextWidget(); var tempBool = Renderer.WantsToRenderToSceneRenderTarget; ImGui.Checkbox("wantsToRenderToSceneRenderTarget", ref tempBool); NezImGui.DisableNextWidget(); tempBool = Renderer.WantsToRenderAfterPostProcessors; ImGui.Checkbox("wantsToRenderAfterPostProcessors", ref tempBool); ImGui.PopStyleVar(); ImGui.Unindent(); } ImGui.PopID(); }
public bool Draw(ref object obj, bool isRecursing) { var properties = obj.GetType() .GetProperties() .Where(p => p.GetCustomAttribute <EditorIgnore>() == null || (p.GetCustomAttribute <EditorIgnore>().IgnoreOnRecursion&& isRecursing)) .Where(p => p.GetMethod != null && p.GetMethod.IsPublic && p.GetMethod.GetParameters().Length == 0); var anyChanged = false; foreach (var prop in properties) { var value = prop.GetValue(obj); ImGui.Indent(); var foundEditor = false; foreach (var kvp in _editors) { if (kvp.Key.IsAssignableFrom(prop.PropertyType)) { foundEditor = true; var writable = prop.SetMethod != null && prop.SetMethod.IsPublic && prop.SetMethod.GetParameters().Length == 1; var editor = kvp.Value; var(changed, newValue) = editor.DrawEditor($"{prop.Name} ({prop.PropertyType})", value, writable); if (changed && writable) { prop.SetValue(obj, newValue); anyChanged = true; } } } if (!foundEditor && value != null && prop.GetCustomAttribute <GenericEditor>() != null) { if (ImGui.CollapsingHeader($"{prop.Name} ({prop.PropertyType})", ImGuiTreeNodeFlags.DefaultOpen)) { anyChanged = Draw(ref value, true) || anyChanged; } } ImGui.Unindent(); } var functions = obj.GetType() .GetMethods() .Where(m => !m.ContainsGenericParameters && m.GetParameters().Length == 0 && m.ReturnType == typeof(void)); foreach (var function in functions) { ImGui.PushID($"{obj.GetType().Name}-function-{function.Name}"); ImGui.Text(function.Name); ImGui.SameLine(); if (ImGui.Button("Invoke")) { function.Invoke(obj, new object[0]); } ImGui.PopID(); } return(anyChanged); }
protected override void Draw() { if (ImGui.CollapsingHeader("Property")) { DrawInstancePropertyTable(GetClass().PropList); } //valueInputWindow.OnGUI(); }
protected override void Draw() { if (ImGui.CollapsingHeader("Field")) { DrawInstanceFieldTable(GetClass().FieldList); } //valueInputWindow.OnGUI(); }
private static void RenderEntity(Entity e) { ImGui.Text(e.GetType().Name); ImGui.Separator(); pos.X = e.X; pos.Y = e.Y; if (ImGui.DragFloat2("Position", ref pos)) { e.X = pos.X; e.Y = pos.Y; } size.X = e.Width; size.Y = e.Height; if (ImGui.DragFloat2("Size", ref size)) { e.Width = size.X; e.Height = size.Y; } ImGui.InputInt("Depth", ref e.Depth); ImGui.Checkbox("Always active", ref e.AlwaysActive); ImGui.SameLine(); ImGui.Checkbox("Always visible", ref e.AlwaysVisible); ImGui.Checkbox("On screen", ref e.OnScreen); ImGui.Checkbox("Done", ref e.Done); e.RenderImDebug(); ImGui.Separator(); if (ImGui.CollapsingHeader("Components")) { foreach (var component in e.Components) { if (ImGui.TreeNode(component.Key.Name)) { component.Value.RenderDebug(); ImGui.TreePop(); } } } if (ImGui.CollapsingHeader("Tags")) { for (var i = 0; i < BitTag.Total; i++) { if (e.HasTag(BitTag.Tags[i])) { ImGui.BulletText(BitTag.Tags[i].Name); } } } }
public virtual void OnGUI() { if (camera) { if (ImGui.Begin("HUD")) { if (ImGui.CollapsingHeader("Camera", ref openCamera)) { ImGui.PushItemWidth(120); ImGui.TextUnformatted("pos : " + camera.Node.Position.ToString("0.00")); ImGui.TextUnformatted("rot : " + camera.Node.Rotation.EulerAngles.ToString("0.00")); ImGui.SliderFloat("Rotate Speed: ", ref rotSpeed, 1, 100); ImGui.SliderFloat("Move Speed: ", ref moveSpeed, 1, 1000); ImGui.Checkbox("Show Hierarchy", ref showHierarchy); ImGui.SameLine(); ImGui.Checkbox("Show Inspector", ref showInspector); ImGui.PopItemWidth(); } } ImGui.End(); } Environment env = scene?.GetComponent <Environment>(); if (env) { if (ImGui.Begin("HUD")) { if (ImGui.CollapsingHeader("Lighting", ref openCamera)) { env.AmbientColor = ImGUI.Color4("Ambient Color", env.AmbientColor); env.SunlightColor = ImGUI.Color4("Sunlight Color", env.SunlightColor); Vector3 dir = (Vector3)env.SunlightDir; ImGui.SliderFloat3("Light dir", ref dir, -1.0f, 1.0f); env.SunlightDir = (vec3)dir; } } ImGui.End(); } if (showHierarchy) { ShowHierarchy(); } if (showInspector) { ShowInspector(); } if (selectedModel != null) { ShowModel(); } }
public static bool DrawHeader(this DebugField field, string text) { if (!field.AssertDrawable()) { return(false); } return(ImGui.CollapsingHeader(text)); }
public override void DrawMutable() { if (ImGui.CollapsingHeader(_name)) { foreach (AbstractTypeInspector inspector in _inspectors) { inspector.Draw(); } } }
protected override void Draw() { if (ImGui.CollapsingHeader("Method")) { DrawMethodTable(GetClass().MethodList); DrawMethodTable(GetClass().GetMethodList); DrawMethodTable(GetClass().SetMethodList); } //methodInvokeWindow.OnGUI(); }
public override void drawMutable() { if (ImGui.CollapsingHeader(_name)) { foreach (var inspector in _inspectors) { inspector.draw(); } } }
private void UiBuilder_ItemsWithoutText() { if (!ImGui.CollapsingHeader("Non-text Matching")) { return; } if (ImGui.Checkbox("Desynthesis", ref plugin.Configuration.DesynthDialogEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("Don't blame me when you destroy something important."); if (ImGui.Checkbox("Desynthesis (Bulk)", ref plugin.Configuration.DesynthBulkDialogEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("That little checkbox when wanting to bulk desynthesize. The checkbox isn't actually clicked, but it works."); if (ImGui.Checkbox("Materialize", ref plugin.Configuration.MaterializeDialogEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("The dialog that extracts materia from items."); if (ImGui.Checkbox("Item Inspection Result", ref plugin.Configuration.ItemInspectionResultEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("Eureka/Bozja lockboxes, forgotten fragments, and more."); if (ImGui.Checkbox("Assign on Retainer Venture Request", ref plugin.Configuration.RetainerTaskAskEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("The final dialog before sending out a retainer."); if (ImGui.Checkbox("Reassign on Retainer Venture Result", ref plugin.Configuration.RetainerTaskResultEnabled)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("Where you receive the item and can resend on the same task."); if (ImGui.Checkbox("Grand Company Expert Delivery Reward", ref plugin.Configuration.GrandCompanySupplyReward)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("Don't blame me when you give away something important."); if (ImGui.Checkbox("Shop Card Dialog", ref plugin.Configuration.ShopCardDialog)) { plugin.SaveConfiguration(); } ImGuiEx.TextTooltip("When selling Triple Triad cards."); }
protected override void Draw() { if (ImGui.CollapsingHeader("Property")) { DrawTable(m_InstancePropertys, "##PropertyTable" + ClassName); } if (ImGui.CollapsingHeader("Static Property")) { DrawTable(m_StaticPropertys, "##StaticPropertyTable" + ClassName); } }
public void Render() { if (ImGui.Begin("Objects")) { if (ImGui.CollapsingHeader("Dynamic Objects")) { foreach (var obj in GameSystems.Object.EnumerateNonProtos()) { if (obj.HasFlag(ObjectFlag.INVENTORY) || obj.IsStatic()) { continue; } RenderObjectNode(obj); } } if (ImGui.CollapsingHeader("Static Objects")) { foreach (var obj in GameSystems.Object.EnumerateNonProtos()) { if (obj.HasFlag(ObjectFlag.INVENTORY) || !obj.IsStatic()) { continue; } RenderObjectNode(obj); } } if (ImGui.CollapsingHeader("Prototypes")) { foreach (var objectType in ObjectTypes) { if (ImGui.CollapsingHeader(objectType.ToString())) { foreach (var proto in GameSystems.Proto.EnumerateProtos(objectType)) { var header = proto.id.PrototypeId + " - " + GameSystems.MapObject.GetDisplayName(proto); if (ImGui.TreeNode(header)) { RenderObjectInfo(proto); ImGui.TreePop(); } } } } } ImGui.End(); } }
private static void Run(SpawnPointModel model) { for (int i = 0; i < model.SpawnPoints.Count; i++) { var spawnGroup = model.SpawnPoints[i]; if (ImGui.CollapsingHeader($"Spawn group #{i}")) { Run(spawnGroup, i); } } }
protected override void Draw() { if (ImGui.CollapsingHeader("Method##" + m_ClassName)) { DrawTable(m_InstanceMethods, "ClassMethod##" + m_ClassName); } if (ImGui.CollapsingHeader("Static Method##" + m_ClassName)) { DrawTable(m_StaticMethods, "InstanceClassMethod##" + m_ClassName); } }
protected override void Draw() { if (ImGui.CollapsingHeader("Fields##" + m_ClassName)) { DrawFieldTable(m_InstanceFields, "ClassInstanceFields##" + m_ClassName); } if (ImGui.CollapsingHeader("Static Fields##" + m_ClassName)) { DrawFieldTable(m_StaticFields, "ClassStaticFields##" + m_ClassName); } }
public override void OnGUIInspector(object userData) { base.OnGUIInspector(userData); Transform transform = userData as Transform; if (transform == null) { return; } Renderer renderer = transform.gameObject.GetComponent <Renderer>(); if (renderer == null) { return; } Material[] mats = renderer.GetMaterials(); if (mat_size < 0) { mat_size = mats.Length; mat_size_ori = mat_size; } if (ImGui.CollapsingHeader("Renderer##Inspector", treeNodeFlags)) { if (ImGui.TreeNodeEx("Materials##Renderer##Inspector", treeNodeFlags)) { if (ImGui.DragInt("Size", ref mat_size, 1, 0, int.MaxValue)) { } for (int i = 0; i < mat_size; ++i) { ImGui.Text($"Element {i}"); ImGui.SameLine(); if (i < mat_size_ori) { ImGui.Text(mats[i].name); } else { ImGui.Text(""); } ImGui.SameLine(); if (ImGui.Button($"o##{i}##Click#Materials#renderer#Inspector")) { } } ImGui.TreePop(); } } }
// Draw information about the character utility class from SE, // displaying all files, their sizes, the default files and the default sizes. public unsafe void DrawDebugCharacterUtility() { if (!ImGui.CollapsingHeader("Character Utility")) { return; } using var table = ImRaii.Table("##CharacterUtility", 6, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit, -Vector2.UnitX); if (!table) { return; } for (var i = 0; i < CharacterUtility.RelevantIndices.Length; ++i) { var idx = CharacterUtility.RelevantIndices[i]; var resource = ( ResourceHandle * )Penumbra.CharacterUtility.Address->Resources[idx]; ImGui.TableNextColumn(); ImGui.TextUnformatted($"0x{( ulong )resource:X}"); ImGui.TableNextColumn(); Text(resource); ImGui.TableNextColumn(); ImGui.Selectable($"0x{resource->GetData().Data:X}"); if (ImGui.IsItemClicked()) { var(data, length) = resource->GetData(); if (data != IntPtr.Zero && length > 0) { ImGui.SetClipboardText(string.Join("\n", new ReadOnlySpan <byte>(( byte * )data, length).ToArray().Select(b => b.ToString("X2")))); } } ImGuiUtil.HoverTooltip("Click to copy bytes to clipboard."); ImGui.TableNextColumn(); ImGui.TextUnformatted($"{resource->GetData().Length}"); ImGui.TableNextColumn(); ImGui.Selectable($"0x{Penumbra.CharacterUtility.DefaultResources[ i ].Address:X}"); if (ImGui.IsItemClicked()) { ImGui.SetClipboardText(string.Join("\n", new ReadOnlySpan <byte>(( byte * )Penumbra.CharacterUtility.DefaultResources[i].Address, Penumbra.CharacterUtility.DefaultResources[i].Size).ToArray().Select(b => b.ToString("X2")))); } ImGuiUtil.HoverTooltip("Click to copy bytes to clipboard."); ImGui.TableNextColumn(); ImGui.TextUnformatted($"{Penumbra.CharacterUtility.DefaultResources[ i ].Size}"); } }