Title screen menu button offset

This commit is contained in:
Eternita-S 2021-11-29 18:17:02 +03:00
parent 906e057943
commit f79405e656
3 changed files with 17 additions and 2 deletions

View file

@ -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()
{

View file

@ -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 ) )

View file

@ -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 )