SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Vintage Story

ImGui

VBy VSCustodian

Wrapper for GUI library

ImGui

Description

<h2><span style="font-family: verdana, geneva, sans-serif; font-size: 12pt;">You can support me on Patreon: <a title="Patreon" href="https://www.patreon.com/Maltiez"><img src="https://i.imgur.com/NQ9BHHF.png" alt="" width="48" height="48" /></a></span></h2> <hr /> <h2><span style="font-size: 14pt;">Description</span></h2> <p><span style="font-size: 12pt;">This is a library that brings <em>Dear ImGui</em> to <em>Vintage Story</em></span></p> <p><span style="font-size: 12pt;">To increase/decrease font size (and GUI size as a result), use hotkeys (CTRL + - and CTRL + = by default)</span></p> <div class="spoiler"> <div class="spoiler-toggle">Details</div> <div class="spoiler-text" spellcheck="false" data-lt-tmp-id="lt-213569" data-gramm="false"> <p><span style="font-size: 12pt;">From Dear ImGui git repository:</span></p> <blockquote> <p><span style="font-size: 12pt;">Dear ImGui is designed to <strong>enable fast iterations</strong> and to <strong>empower programmers</strong> to create <strong>content creation tools and visualization / debug tools</strong> (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal and lacks certain features commonly found in more high-level libraries.</span></p> </blockquote> <p><span style="font-size: 12pt;">Wrapper for <strong><a href="https://github.com/ImGuiNET/ImGui.NET">ImGui.NET</a></strong> which in it self is wrapper for <a href="https://github.com/ocornut/imgui"><strong>Dear ImGui</strong></a> - graphical user interface library. In order to use this wrapper you just need to add reference on <em>ImGui.NET (<span style="text-decoration: underline;"><strong>1.89.7.1</strong></span>)</em> and the mod dll itself (like with other mods dependencies, both are in this mod's archive), and add your methods for constructing ImGui windows to <code>VSImGuiModSystem.SetUpImGuiWindows</code> event. Another example: <a href="https://github.com/maltiez2/vsmod_configlib/blob/master/configlib/src/GUI/ConfigWindow.cs">github.com/maltiez2/vsmod_configlib/blob/master/configlib/src/GUI/ConfigWindow.cs</a><code></code></span></p> <p><span style="font-size: 12pt;"><span style="text-decoration: line-through;">Supports also</span> Not actually (working on it, it seems I need to follow <a href="https://github.com/ImGuiNET/ImGui.NET/issues/435">this procedure</a>, if somebody will provide this binaries I'll inculde them in mod):</span></p> <ul> <li><span style="font-size: 12pt;"><a href="https://github.com/CedricGuillemet/ImGuizmo">ImGuizmo</a></span></li> <li><span style="font-size: 12pt;"><a href="https://github.com/epezent/implot">ImPlot</a></span></li> <li><span style="font-size: 12pt;"><a href="https://github.com/Nelarius/imnodes">ImNodes</a></span></li> </ul> <p><span style="font-size: 12pt;">This mod will allow you to make development tools like tfedit or simple throw away debug/visualisation tools for working on your mod. It would not require your mod to depend on this library if you need it only for debugging. Just wrapp all the code you dont want to ship in <code>#if DEBUG #endif</code> . Bulding such tools is as easy as adding logs.</span></p> </div> </div> <p>&nbsp;</p> <p>You might want to take a look at: <a href="https://mods.vintagestory.at/toastlib"><strong>ToastLib</strong></a> for additional functionality</p> <hr /> <h2><span style="font-size: 14pt;">Features</span></h2> <ul> <li><span style="font-size: 12pt;"><strong>Quick and easy small debug tools</strong> - you can display and edit in real time any value in any part of your code no matter how deep it is with just a one line (static methods of <code>DebugWindow</code> class from <code>VSImGui</code> namespace)</span></li> <li><span style="font-size: 12pt;"><strong>No dependencies required for debug tools</strong> - just wrap all the ImGui and VSImGui methods calls you add in '<code>#if DEBUG #endif</code>'</span></li> <li><span style="font-size: 12pt;"><strong>Easy to build debug tools</strong> - add more sophisticated dev tools specific to your mod to speed up development and ease debugging (for example, <a href="https://mods.vintagestory.at/amlib">Animation Manager</a> library has in-game animation editor in its dev build)</span></li> <li><span style="font-size: 12pt;"><strong>Easy and quick to layout GUI</strong> with docking and a lot of built-in functionality like color pickers</span></li> <li><span style="font-size: 12pt;"><strong>Styles</strong> - you can change every color and size and even tile your window with a texture with a simple <code>Style</code> and <code>WindowStyle</code> classes, you can serialize style into json and load it from json</span></li> </ul> <p>&nbsp;</p> <hr /> <h2><span style="font-size: 14pt;">Examples and docs (outdated)<br /></span></h2> <p><span style="font-size: 12pt;">ImGui manual for C++, but .NET methods should have same names and similar arguments: <a href="https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html">https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html</a></span></p> <p><span style="font-size: 12pt;">ImGui wiki: <a href="https://github.com/ocornut/imgui/wiki">https://github.com/ocornut/imgui/wiki</a></span></p> <p><span style="font-size: 12pt;">Example of showing demo window: <code>api.ModLoader.GetModSystem&lt;VSImGuiModSystem&gt;().SetUpImGuiWindows += ImGuiNET.ImGui.ShowDemoWindow;</code></span></p> <div class="spoiler"> <div class="spoiler-toggle" spellcheck="false" data-lt-tmp-id="lt-547412" data-gramm="false"><span style="font-size: 12pt;">Example of adding debug widget</span></div> <div class="spoiler-text" spellcheck="false" data-lt-tmp-id="lt-491032" data-gramm="false"> <p>If you have some field or property in your class (or just some reference type value) you want to display or edit via GUI, you can call a static mehod of a DebugWindow class that will display a widget in a debug window with specified domain as name inside a tab with specified category. Given title serves as t

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.