mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Merge branch 'pr/n138_tsm'
This commit is contained in:
commit
b6a7a59f92
9 changed files with 75 additions and 101 deletions
|
|
@ -39,7 +39,6 @@ namespace Penumbra
|
||||||
public Dictionary< string, string > ModSortOrder { get; set; } = new();
|
public Dictionary< string, string > ModSortOrder { get; set; } = new();
|
||||||
|
|
||||||
public bool InvertModListOrder { internal get; set; }
|
public bool InvertModListOrder { internal get; set; }
|
||||||
public Vector2 ManageModsButtonOffset { get; set; } = 50 * Vector2.One;
|
|
||||||
|
|
||||||
public static Configuration Load()
|
public static Configuration Load()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Game.Gui;
|
using Dalamud.Game.Gui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.IoC;
|
using Dalamud.IoC;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
||||||
|
|
@ -27,6 +28,7 @@ namespace Penumbra
|
||||||
[PluginService][RequiredVersion("1.0")] public static Condition Conditions { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static Condition Conditions { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public static TargetManager Targets { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static TargetManager Targets { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public static ObjectTable Objects { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static ObjectTable Objects { get; private set; } = null!;
|
||||||
|
[PluginService][RequiredVersion("1.0")] public static TitleScreenMenu TitleScreenMenu { get; private set; } = null!;
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -70,6 +70,10 @@ public class Penumbra : IDalamudPlugin
|
||||||
|
|
||||||
gameUtils.ReloadResidentResources();
|
gameUtils.ReloadResidentResources();
|
||||||
|
|
||||||
|
Api = new PenumbraApi( this );
|
||||||
|
Ipc = new PenumbraIpc( pluginInterface, Api );
|
||||||
|
SubscribeItemLinks();
|
||||||
|
|
||||||
SettingsInterface = new SettingsInterface( this );
|
SettingsInterface = new SettingsInterface( this );
|
||||||
|
|
||||||
if( Config.EnableHttpApi )
|
if( Config.EnableHttpApi )
|
||||||
|
|
@ -87,10 +91,6 @@ public class Penumbra : IDalamudPlugin
|
||||||
PluginLog.Debug( "Triggered Redraw of {Player}.", p.Name );
|
PluginLog.Debug( "Triggered Redraw of {Player}.", p.Name );
|
||||||
ObjectReloader.RedrawObject( p, RedrawType.OnlyWithSettings );
|
ObjectReloader.RedrawObject( p, RedrawType.OnlyWithSettings );
|
||||||
};
|
};
|
||||||
|
|
||||||
Api = new PenumbraApi( this );
|
|
||||||
SubscribeItemLinks();
|
|
||||||
Ipc = new PenumbraIpc( pluginInterface, Api );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enable()
|
public bool Enable()
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,12 @@
|
||||||
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB3277</MSBuildWarningsAsMessages>
|
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB3277</MSBuildWarningsAsMessages>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="tsmLogo.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Dalamud">
|
<Reference Include="Dalamud">
|
||||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
|
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,42 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
using ImGuiScene;
|
||||||
using Penumbra.UI.Custom;
|
|
||||||
|
|
||||||
namespace Penumbra.UI;
|
namespace Penumbra.UI;
|
||||||
|
|
||||||
public partial class SettingsInterface
|
public partial class SettingsInterface
|
||||||
{
|
{
|
||||||
private class ManageModsButton
|
private class ManageModsButton : IDisposable
|
||||||
{
|
{
|
||||||
// magic numbers
|
|
||||||
private const int Width = 200;
|
|
||||||
private const int Height = 45;
|
|
||||||
private const string MenuButtonsName = "Penumbra Menu Buttons";
|
|
||||||
private const string MenuButtonLabel = "Manage Mods";
|
|
||||||
|
|
||||||
private const ImGuiWindowFlags ButtonFlags =
|
|
||||||
ImGuiWindowFlags.AlwaysAutoResize
|
|
||||||
| ImGuiWindowFlags.NoBackground
|
|
||||||
| ImGuiWindowFlags.NoDecoration
|
|
||||||
| ImGuiWindowFlags.NoMove
|
|
||||||
| ImGuiWindowFlags.NoScrollbar
|
|
||||||
| ImGuiWindowFlags.NoResize
|
|
||||||
| ImGuiWindowFlags.NoFocusOnAppearing
|
|
||||||
| ImGuiWindowFlags.NoSavedSettings;
|
|
||||||
|
|
||||||
private readonly SettingsInterface _base;
|
private readonly SettingsInterface _base;
|
||||||
|
private readonly TextureWrap? _icon;
|
||||||
|
private readonly TitleScreenMenu.TitleScreenMenuEntry? _entry;
|
||||||
|
|
||||||
public ManageModsButton( SettingsInterface ui )
|
public ManageModsButton( SettingsInterface ui )
|
||||||
=> _base = ui;
|
|
||||||
|
|
||||||
internal bool ForceDraw = false;
|
|
||||||
|
|
||||||
public void Draw()
|
|
||||||
{
|
{
|
||||||
if( !ForceDraw && ( Dalamud.Conditions.Any() || _base._menu.Visible ) )
|
_base = ui;
|
||||||
|
|
||||||
|
_icon = Dalamud.PluginInterface.UiBuilder.LoadImage( Path.Combine( Dalamud.PluginInterface.AssemblyLocation.DirectoryName!,
|
||||||
|
"tsmLogo.png" ) );
|
||||||
|
if( _icon != null )
|
||||||
{
|
{
|
||||||
return;
|
_entry = Dalamud.TitleScreenMenu.AddEntry( "Manage Penumbra", _icon, OnTriggered );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using var color = ImGuiRaii.PushColor( ImGuiCol.Button, 0xFF0000C8, ForceDraw );
|
private void OnTriggered()
|
||||||
|
|
||||||
var ss = ImGui.GetMainViewport().Size + ImGui.GetMainViewport().Pos;
|
|
||||||
ImGui.SetNextWindowViewport( ImGui.GetMainViewport().ID );
|
|
||||||
|
|
||||||
var windowSize = ImGuiHelpers.ScaledVector2( Width, Height );
|
|
||||||
|
|
||||||
ImGui.SetNextWindowPos( ss - windowSize - Penumbra.Config.ManageModsButtonOffset * ImGuiHelpers.GlobalScale, ImGuiCond.Always );
|
|
||||||
|
|
||||||
if( ImGui.Begin( MenuButtonsName, ButtonFlags )
|
|
||||||
&& ImGui.Button( MenuButtonLabel, windowSize ) )
|
|
||||||
{
|
{
|
||||||
_base.FlipVisibility();
|
_base.FlipVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.End();
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_icon?.Dispose();
|
||||||
|
if( _entry != null )
|
||||||
|
{
|
||||||
|
Dalamud.TitleScreenMenu.RemoveEntry( _entry );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -150,21 +150,6 @@ public partial class SettingsInterface
|
||||||
+ "This is required to enable manually editing any mod information." );
|
+ "This is required to enable manually editing any mod information." );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawManageModsButtonOffsetButton()
|
|
||||||
{
|
|
||||||
var manageModsButtonOffset = _config.ManageModsButtonOffset;
|
|
||||||
ImGui.SetNextItemWidth( 150 * ImGuiHelpers.GlobalScale );
|
|
||||||
if( ImGui.DragFloat2( "\"Manage Mods\"-Button Offset", ref manageModsButtonOffset, 1f ) )
|
|
||||||
{
|
|
||||||
_config.ManageModsButtonOffset = manageModsButtonOffset;
|
|
||||||
_configChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_base._manageModsButton.ForceDraw = ImGui.IsItemActive();
|
|
||||||
ImGuiComponents.HelpMarker(
|
|
||||||
"Shift the \"Manage Mods\"-Button displayed in the login-lobby by the given amount of pixels in X/Y-direction." );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawSortFoldersFirstBox()
|
private void DrawSortFoldersFirstBox()
|
||||||
{
|
{
|
||||||
var foldersFirst = _config.SortFoldersFirst;
|
var foldersFirst = _config.SortFoldersFirst;
|
||||||
|
|
@ -360,7 +345,6 @@ public partial class SettingsInterface
|
||||||
ImGuiCustom.VerticalDistance( DefaultVerticalSpace );
|
ImGuiCustom.VerticalDistance( DefaultVerticalSpace );
|
||||||
DrawScaleModSelectorBox();
|
DrawScaleModSelectorBox();
|
||||||
DrawSortFoldersFirstBox();
|
DrawSortFoldersFirstBox();
|
||||||
DrawManageModsButtonOffsetButton();
|
|
||||||
DrawShowAdvancedBox();
|
DrawShowAdvancedBox();
|
||||||
|
|
||||||
if( _config.ShowAdvanced )
|
if( _config.ShowAdvanced )
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ namespace Penumbra.UI
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
_manageModsButton.Dispose();
|
||||||
_menu.InstalledTab.Selector.Cache.Dispose();
|
_menu.InstalledTab.Selector.Cache.Dispose();
|
||||||
Dalamud.PluginInterface.UiBuilder.Draw -= Draw;
|
Dalamud.PluginInterface.UiBuilder.Draw -= Draw;
|
||||||
Dalamud.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfig;
|
Dalamud.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfig;
|
||||||
|
|
@ -51,7 +52,6 @@ namespace Penumbra.UI
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
_menuBar.Draw();
|
_menuBar.Draw();
|
||||||
_manageModsButton.Draw();
|
|
||||||
_menu.Draw();
|
_menu.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
Penumbra/tsmLogo.png
Normal file
BIN
Penumbra/tsmLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
10
repo.json
10
repo.json
|
|
@ -4,8 +4,8 @@
|
||||||
"Name": "Penumbra",
|
"Name": "Penumbra",
|
||||||
"Description": "Runtime mod loader and manager.",
|
"Description": "Runtime mod loader and manager.",
|
||||||
"InternalName": "Penumbra",
|
"InternalName": "Penumbra",
|
||||||
"AssemblyVersion": "0.4.7.1",
|
"AssemblyVersion": "0.4.7.2",
|
||||||
"TestingAssemblyVersion": "0.4.7.1",
|
"TestingAssemblyVersion": "0.4.7.2",
|
||||||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"DalamudApiLevel": 5,
|
"DalamudApiLevel": 5,
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
"DownloadCount": 0,
|
"DownloadCount": 0,
|
||||||
"LastUpdate": 0,
|
"LastUpdate": 0,
|
||||||
"LoadPriority": 69420,
|
"LoadPriority": 69420,
|
||||||
"DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.1/Penumbra.zip",
|
"DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.2/Penumbra.zip",
|
||||||
"DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.1/Penumbra.zip",
|
"DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.2/Penumbra.zip",
|
||||||
"DownloadLinkUpdate": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.1/Penumbra.zip",
|
"DownloadLinkUpdate": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.2/Penumbra.zip",
|
||||||
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"
|
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue