Skip to content

Instantly share code, notes, and snippets.

@Fulgen301
Last active July 26, 2021 12:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fulgen301/d3a57bc4ee6252709168082b3a1009c3 to your computer and use it in GitHub Desktop.
Save Fulgen301/d3a57bc4ee6252709168082b3a1009c3 to your computer and use it in GitHub Desktop.
GuiCompositeSettingsEx.dll documentation 0.1.0
<?xml version="1.0"?>
<doc>
<assembly>
<name>GuiCompositeSettingsEx</name>
</assembly>
<members>
<member name="T:GuiExtensions.GuiCompositeSettingsEx">
<summary>
Allows the developer to add custom settings dialog panels.
Panels consist of a key, which is also used for translation, and a delegate that is called to create the UI.
If you are not using <see cref="T:GuiExtensions.SystemGuiCompositeSettingsEx"/>, prior to any API calls, <see cref="M:GuiExtensions.GuiCompositeSettingsEx.Patch"/> must be called to patch the <see cref="T:Vintagestory.Client.NoObf.GuiCompositeSettings"/> class.
Then, panels can be added either by using <see cref="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)"/> for panels that should be used for all settings dialogs or
<see cref="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)"/> for panels that should only be used by said settings dialog.
Do not forget to call <see cref="M:GuiExtensions.GuiCompositeSettingsEx.Unpatch"/> on cleanup if you are not using <see cref="T:GuiExtensions.SystemGuiCompositeSettingsEx"/>!
<example>
<code>
public override void StartClientSide(ICoreClientAPI capi)
{
// GuiCompositeSettingsEx.Patch(); -- if not using see cref="SystemGuiCompositeSettingsEx"/>
GuiCompositeSettingsEx.AddPanel("testpanel", (settings, on) =>
{
GuiComposer composer = settings.ComposerHeaderEx("testpanel", "testpanel");
// Add your GUI elements here using standard UI elements.
// Be aware that the header is 75.0 pixels high.
composer.EndChildElements(); // title bar
composer.Compose();
settings.LoadComposer(composer);
};
}
</code>
</example>
</summary>
</member>
<member name="P:GuiExtensions.GuiCompositeSettingsEx.Patched">
<summary>
Whether the dialog has been patched.
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.Patch"/>
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.Unpatch"/>
<seealso cref="T:GuiExtensions.SystemGuiCompositeSettingsEx"/>
</summary>
</member>
<member name="T:GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate">
<summary>
Callback for panel activation. Build your GUI here.
Obtain a <see cref="T:Vintagestory.API.Client.GuiComposer"/> instance via <see cref="M:GuiExtensions.GuiCompositeSettingsEx.ComposerHeaderEx(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,System.String)"/>, then load it with <see cref="M:GuiExtensions.GuiCompositeSettingsEx.LoadComposer(Vintagestory.Client.NoObf.GuiCompositeSettings,Vintagestory.API.Client.GuiComposer)"/>.
<seealso cref="T:GuiExtensions.GuiCompositeSettingsEx"/>
</summary>
<param name="settings">The settings dialog instance.</param>
<param name="on">Whether the button is pressed.</param>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.Patch">
<summary>
Patches the dialog.
</summary>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.Unpatch">
<summary>
Unpatches the dialog.
</summary>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.DefaultButtonBounds">
<summary>
The default bounds for a menu button.
</summary>
<returns>The default bounds for a menu button.</returns>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.DefaultButtonBounds(Vintagestory.Client.NoObf.GuiCompositeSettings)">
<summary>
The default bounds for a menu button.
</summary>
<returns>The default bounds for a menu button.</returns>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)">
<summary>
Adds a settings panel for all settings dialogs.
</summary>
<param name="key">The key to use for the panel. Will be used as the key for the button and as translation string for the button name ("settings-{key}-header").</param>
<param name="delegate">The delegate to call when the panel has been selected. Should build the GUI.</param>
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)"/>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)">
<summary>
Adds a settings panel for this settings dialog only.
</summary>
<param name="this">The settings dialog instance.</param>
<param name="key">The key to use for the panel. Will be used as the key for the button and as translation string for the button name ("settings-{key}-header").</param>
<param name="delegate">The delegate to call when the panel has been selected. Should build the GUI.</param>
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)"/>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.ComposerHeaderEx(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,System.String)">
<summary>
Returns a GuiComposer instance with the dialog header already created. Must be used for dialog creation.
</summary>
<remarks>
This function calls <see cref="M:Vintagestory.API.Client.GuiComposer.BeginChildElements(Vintagestory.API.Client.ElementBounds)"/> internally, which is matched by <see cref="M:GuiExtensions.GuiCompositeSettingsEx.LoadComposer(Vintagestory.Client.NoObf.GuiCompositeSettings,Vintagestory.API.Client.GuiComposer)"/>.
</remarks>
<param name="this">The settings dialog instance.</param>
<param name="dialogName">The dialog name.</param>
<param name="currentTab">The currently selected tab. See the parameter <c>key</c> of <see cref="M:GuiExtensions.GuiCompositeSettingsEx.AddPanel(System.String,GuiExtensions.GuiCompositeSettingsEx.PanelActivatedDelegate)" />. </param>
<returns>A GuiComposer instance with the dialog header already created.</returns>
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.LoadComposer(Vintagestory.Client.NoObf.GuiCompositeSettings,Vintagestory.API.Client.GuiComposer)"/>
</member>
<member name="M:GuiExtensions.GuiCompositeSettingsEx.LoadComposer(Vintagestory.Client.NoObf.GuiCompositeSettings,Vintagestory.API.Client.GuiComposer)">
<summary>
Sets the composer as the currently used composer for the dialog panel. Must be used after a call to <see cref="M:Vintagestory.API.Client.GuiComposer.Compose(System.Boolean)"/>.
</summary>
<remarks>
This method calls <see cref="M:Vintagestory.API.Client.GuiComposer.EndChildElements"/> to match the the <see cref="M:Vintagestory.API.Client.GuiComposer.BeginChildElements(Vintagestory.API.Client.ElementBounds)"/> call for the title bar.
</remarks>
<param name="this">The settings dialog instance.</param>
<param name="composer">The composer to use. Must be obtained by a call from <see cref="M:GuiExtensions.GuiCompositeSettingsEx.ComposerHeaderEx(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,System.String)"/>.</param>
<seealso cref="M:GuiExtensions.GuiCompositeSettingsEx.ComposerHeaderEx(Vintagestory.Client.NoObf.GuiCompositeSettings,System.String,System.String)"/>
</member>
<member name="M:GuiExtensions.GuiComposeHelpers.AddMenuDropDown(Vintagestory.API.Client.GuiComposer,System.String[],System.String[],System.Int32,Vintagestory.API.Client.SelectionChangedDelegate,Vintagestory.API.Client.ElementBounds,System.String)">
<summary>
Adds a menu dropdown to the current GUI instance.
</summary>
<param name="composer">The composer instance.</param>
<param name="values">The values of the current dropdown.</param>
<param name="names">The names of those values.</param>
<param name="selectedIndex">The default selected index.</param>
<param name="onSelectionChanged">The event fired when the index is changed.</param>
<param name="bounds">The bounds of the index.</param>
<param name="key">The name of this dropdown.</param>
</member>
<member name="M:GuiExtensions.GuiComposeHelpers.AddMenuToggleButton(Vintagestory.API.Client.GuiComposer,System.String,Vintagestory.API.Client.CairoFont,Vintagestory.API.Common.Action{System.Boolean},Vintagestory.API.Client.ElementBounds,System.String)">
<summary>
Creates a menu toggle button with the given parameters.
</summary>
/// <param name="composer">The composer instance.</param>
<param name="text">The text of the button.</param>
<param name="font">The font of the text.</param>
<param name="onToggle">The event that happens once the button is toggled.</param>
<param name="bounds">The bounding box of the button.</param>
<param name="key">The name of the button for easy access.</param>
</member>
<member name="T:GuiExtensions.SystemGuiCompositeSettingsEx">
<summary>
This mod system automatically patches and unpatches the settings dialog.
</summary>
</member>
<member name="M:GuiExtensions.SystemGuiCompositeSettingsEx.ExecuteOrder">
<inheritdoc/>
</member>
<member name="M:GuiExtensions.SystemGuiCompositeSettingsEx.ShouldLoad(Vintagestory.API.Common.EnumAppSide)">
<inheritdoc/>
</member>
<member name="P:GuiExtensions.SystemGuiCompositeSettingsEx.Patched">
<summary>
Whether the dialog has been patched. See <see cref="P:GuiExtensions.GuiCompositeSettingsEx.Patched"/> for details.
</summary>
</member>
<member name="M:GuiExtensions.SystemGuiCompositeSettingsEx.StartClientSide(Vintagestory.API.Client.ICoreClientAPI)">
<inheritdoc/>
</member>
<member name="M:GuiExtensions.SystemGuiCompositeSettingsEx.Dispose">
<inheritdoc/>
</member>
</members>
</doc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment