mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +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 bool InvertModListOrder { internal get; set; }
|
||||
public Vector2 ManageModsButtonOffset { get; set; } = 50 * Vector2.One;
|
||||
|
||||
public static Configuration Load()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,32 +1,34 @@
|
|||
using Dalamud.Data;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.ClientState;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Game.ClientState.Objects;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Game.Gui;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
||||
|
||||
namespace Penumbra
|
||||
{
|
||||
public class Dalamud
|
||||
{
|
||||
public static void Initialize(DalamudPluginInterface pluginInterface)
|
||||
=> pluginInterface.Create<Dalamud>();
|
||||
|
||||
// @formatter:off
|
||||
[PluginService][RequiredVersion("1.0")] public static DalamudPluginInterface PluginInterface { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static CommandManager Commands { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static SigScanner SigScanner { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static DataManager GameData { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static ClientState ClientState { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static ChatGui Chat { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static Framework Framework { 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 ObjectTable Objects { get; private set; } = null!;
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.ClientState;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Game.ClientState.Objects;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Game.Gui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
||||
|
||||
namespace Penumbra
|
||||
{
|
||||
public class Dalamud
|
||||
{
|
||||
public static void Initialize(DalamudPluginInterface pluginInterface)
|
||||
=> pluginInterface.Create<Dalamud>();
|
||||
|
||||
// @formatter:off
|
||||
[PluginService][RequiredVersion("1.0")] public static DalamudPluginInterface PluginInterface { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static CommandManager Commands { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static SigScanner SigScanner { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static DataManager GameData { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static ClientState ClientState { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static ChatGui Chat { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static Framework Framework { 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 ObjectTable Objects { get; private set; } = null!;
|
||||
[PluginService][RequiredVersion("1.0")] public static TitleScreenMenu TitleScreenMenu { get; private set; } = null!;
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
|
|
@ -70,6 +70,10 @@ public class Penumbra : IDalamudPlugin
|
|||
|
||||
gameUtils.ReloadResidentResources();
|
||||
|
||||
Api = new PenumbraApi( this );
|
||||
Ipc = new PenumbraIpc( pluginInterface, Api );
|
||||
SubscribeItemLinks();
|
||||
|
||||
SettingsInterface = new SettingsInterface( this );
|
||||
|
||||
if( Config.EnableHttpApi )
|
||||
|
|
@ -87,10 +91,6 @@ public class Penumbra : IDalamudPlugin
|
|||
PluginLog.Debug( "Triggered Redraw of {Player}.", p.Name );
|
||||
ObjectReloader.RedrawObject( p, RedrawType.OnlyWithSettings );
|
||||
};
|
||||
|
||||
Api = new PenumbraApi( this );
|
||||
SubscribeItemLinks();
|
||||
Ipc = new PenumbraIpc( pluginInterface, Api );
|
||||
}
|
||||
|
||||
public bool Enable()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@
|
|||
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB3277</MSBuildWarningsAsMessages>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="tsmLogo.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Dalamud">
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
|
||||
|
|
@ -62,7 +68,7 @@
|
|||
<PackageReference Include="SharpZipLib" Version="1.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.PlayerWatch\Penumbra.PlayerWatch.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
@ -72,4 +78,4 @@
|
|||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -1,59 +1,42 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Dalamud.Interface;
|
||||
using ImGuiNET;
|
||||
using Penumbra.UI.Custom;
|
||||
using ImGuiScene;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
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 )
|
||||
=> _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()
|
||||
{
|
||||
_base.FlipVisibility();
|
||||
}
|
||||
|
||||
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 ) )
|
||||
public void Dispose()
|
||||
{
|
||||
_icon?.Dispose();
|
||||
if( _entry != null )
|
||||
{
|
||||
_base.FlipVisibility();
|
||||
Dalamud.TitleScreenMenu.RemoveEntry( _entry );
|
||||
}
|
||||
|
||||
ImGui.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -150,21 +150,6 @@ public partial class SettingsInterface
|
|||
+ "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()
|
||||
{
|
||||
var foldersFirst = _config.SortFoldersFirst;
|
||||
|
|
@ -360,7 +345,6 @@ public partial class SettingsInterface
|
|||
ImGuiCustom.VerticalDistance( DefaultVerticalSpace );
|
||||
DrawScaleModSelectorBox();
|
||||
DrawSortFoldersFirstBox();
|
||||
DrawManageModsButtonOffsetButton();
|
||||
DrawShowAdvancedBox();
|
||||
|
||||
if( _config.ShowAdvanced )
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ namespace Penumbra.UI
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
_manageModsButton.Dispose();
|
||||
_menu.InstalledTab.Selector.Cache.Dispose();
|
||||
Dalamud.PluginInterface.UiBuilder.Draw -= Draw;
|
||||
Dalamud.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfig;
|
||||
|
|
@ -51,7 +52,6 @@ namespace Penumbra.UI
|
|||
public void Draw()
|
||||
{
|
||||
_menuBar.Draw();
|
||||
_manageModsButton.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",
|
||||
"Description": "Runtime mod loader and manager.",
|
||||
"InternalName": "Penumbra",
|
||||
"AssemblyVersion": "0.4.7.1",
|
||||
"TestingAssemblyVersion": "0.4.7.1",
|
||||
"AssemblyVersion": "0.4.7.2",
|
||||
"TestingAssemblyVersion": "0.4.7.2",
|
||||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||
"ApplicableVersion": "any",
|
||||
"DalamudApiLevel": 5,
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
"DownloadCount": 0,
|
||||
"LastUpdate": 0,
|
||||
"LoadPriority": 69420,
|
||||
"DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.1/Penumbra.zip",
|
||||
"DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/0.4.7.1/Penumbra.zip",
|
||||
"DownloadLinkUpdate": "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.2/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"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue