From f79405e65679ed60fb0a0f8969931af941c457d4 Mon Sep 17 00:00:00 2001 From: Eternita-S Date: Mon, 29 Nov 2021 18:17:02 +0300 Subject: [PATCH] Title screen menu button offset --- Penumbra/Configuration.cs | 2 ++ Penumbra/UI/LaunchButton.cs | 2 +- Penumbra/UI/MenuTabs/TabSettings.cs | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Penumbra/Configuration.cs b/Penumbra/Configuration.cs index 1a9fb2b4..716d5ede 100644 --- a/Penumbra/Configuration.cs +++ b/Penumbra/Configuration.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Numerics; using Dalamud.Configuration; using Dalamud.Logging; @@ -36,6 +37,7 @@ namespace Penumbra public Dictionary< string, string > ModSortOrder { get; set; } = new(); public bool InvertModListOrder { internal get; set; } + public Vector2 ManageModsButtonOffset { get; set; } = Vector2.Zero; public static Configuration Load() { diff --git a/Penumbra/UI/LaunchButton.cs b/Penumbra/UI/LaunchButton.cs index f146b23f..0c8c05d9 100644 --- a/Penumbra/UI/LaunchButton.cs +++ b/Penumbra/UI/LaunchButton.cs @@ -41,7 +41,7 @@ namespace Penumbra.UI var ss = ImGui.GetMainViewport().Size + ImGui.GetMainViewport().Pos; ImGui.SetNextWindowViewport( ImGui.GetMainViewport().ID ); - ImGui.SetNextWindowPos( ss - WindowPosOffset, ImGuiCond.Always ); + ImGui.SetNextWindowPos( ss - WindowPosOffset + Penumbra.Config.ManageModsButtonOffset, ImGuiCond.Always ); if( ImGui.Begin( MenuButtonsName, ButtonFlags ) && ImGui.Button( MenuButtonLabel, WindowSize ) ) diff --git a/Penumbra/UI/MenuTabs/TabSettings.cs b/Penumbra/UI/MenuTabs/TabSettings.cs index 8db86756..f5b6ffe6 100644 --- a/Penumbra/UI/MenuTabs/TabSettings.cs +++ b/Penumbra/UI/MenuTabs/TabSettings.cs @@ -34,6 +34,7 @@ namespace Penumbra.UI private const string LabelDisableNotifications = "Disable filesystem change notifications"; private const string LabelEnableHttpApi = "Enable HTTP API"; private const string LabelReloadResource = "Reload Player Resource"; + private const string LabelManageModsOffset = "\"Manage mods\" title screen button offset"; private readonly SettingsInterface _base; private readonly Configuration _config; @@ -155,7 +156,18 @@ namespace Penumbra.UI if( ImGui.Checkbox( LabelShowAdvanced, ref showAdvanced ) ) { _config.ShowAdvanced = showAdvanced; - _configChanged = true; + _configChanged = true; + } + } + + private void DrawManageModsButtonOffset() + { + var manageModsButtonOffset = _config.ManageModsButtonOffset; + ImGui.SetNextItemWidth( 150f ); + if( ImGui.DragFloat2( LabelManageModsOffset, ref manageModsButtonOffset, 1f ) ) + { + _config.ManageModsButtonOffset = manageModsButtonOffset; + _configChanged = true; } } @@ -305,6 +317,7 @@ namespace Penumbra.UI ImGuiCustom.VerticalDistance( DefaultVerticalSpace ); DrawScaleModSelectorBox(); DrawSortFoldersFirstBox(); + DrawManageModsButtonOffset(); DrawShowAdvancedBox(); if( _config.ShowAdvanced )