mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-03 14:23:43 +01:00
Use external library for API interface and IPC.
This commit is contained in:
parent
b3f048bfe6
commit
918d5db6a6
69 changed files with 4026 additions and 1873 deletions
|
|
@ -13,6 +13,7 @@ using System.Collections.Concurrent;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Penumbra.Api.Enums;
|
||||
|
||||
namespace Penumbra.UI.Classes;
|
||||
|
||||
|
|
|
|||
|
|
@ -444,11 +444,11 @@ public partial class ConfigWindow
|
|||
{
|
||||
if( !ImGui.CollapsingHeader( "IPC" ) )
|
||||
{
|
||||
_window._penumbra.Ipc.Tester.UnsubscribeEvents();
|
||||
_window._penumbra.IpcProviders.Tester.UnsubscribeEvents();
|
||||
return;
|
||||
}
|
||||
|
||||
_window._penumbra.Ipc.Tester.Draw();
|
||||
_window._penumbra.IpcProviders.Tester.Draw();
|
||||
}
|
||||
|
||||
// Helper to print a property and its value in a 2-column table.
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Lumina.Data.Parsing;
|
|||
using Lumina.Excel.GeneratedSheets;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.GameData.ByteString;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using Dalamud.Interface.Components;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
|
@ -236,7 +237,7 @@ public partial class ConfigWindow
|
|||
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Plus.ToIconString(), window._iconButtonSize,
|
||||
tt, !nameValid, true ) )
|
||||
{
|
||||
Penumbra.ModManager.AddModGroup( mod, SelectType.Single, _newGroupName );
|
||||
Penumbra.ModManager.AddModGroup( mod, GroupType.Single, _newGroupName );
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
|
|
@ -496,7 +497,7 @@ public partial class ConfigWindow
|
|||
ImGui.TableNextColumn();
|
||||
|
||||
|
||||
if( group.Type == SelectType.Single )
|
||||
if( group.Type == GroupType.Single )
|
||||
{
|
||||
if( ImGui.RadioButton( "##default", group.DefaultSettings == optionIdx ) )
|
||||
{
|
||||
|
|
@ -532,7 +533,7 @@ public partial class ConfigWindow
|
|||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if( group.Type == SelectType.Multi )
|
||||
if( group.Type == GroupType.Multi )
|
||||
{
|
||||
if( Input.Priority( "##Priority", groupIdx, optionIdx, group.OptionPriority( optionIdx ), out var priority,
|
||||
50 * ImGuiHelpers.GlobalScale ) )
|
||||
|
|
@ -564,7 +565,7 @@ public partial class ConfigWindow
|
|||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
var canAddGroup = mod.Groups[ groupIdx ].Type != SelectType.Multi || mod.Groups[ groupIdx ].Count < IModGroup.MaxMultiOptions;
|
||||
var canAddGroup = mod.Groups[ groupIdx ].Type != GroupType.Multi || mod.Groups[ groupIdx ].Count < IModGroup.MaxMultiOptions;
|
||||
var validName = _newOptionName.Length > 0 && _newOptionNameIdx == groupIdx;
|
||||
var tt = canAddGroup
|
||||
? validName ? "Add a new option to this group." : "Please enter a name for the new option."
|
||||
|
|
@ -636,11 +637,11 @@ public partial class ConfigWindow
|
|||
// Draw a combo to select single or multi group and switch between them.
|
||||
private void DrawGroupCombo( IModGroup group, int groupIdx )
|
||||
{
|
||||
static string GroupTypeName( SelectType type )
|
||||
static string GroupTypeName( GroupType type )
|
||||
=> type switch
|
||||
{
|
||||
SelectType.Single => "Single Group",
|
||||
SelectType.Multi => "Multi Group",
|
||||
GroupType.Single => "Single Group",
|
||||
GroupType.Multi => "Multi Group",
|
||||
_ => "Unknown",
|
||||
};
|
||||
|
||||
|
|
@ -651,16 +652,16 @@ public partial class ConfigWindow
|
|||
return;
|
||||
}
|
||||
|
||||
if( ImGui.Selectable( GroupTypeName( SelectType.Single ), group.Type == SelectType.Single ) )
|
||||
if( ImGui.Selectable( GroupTypeName( GroupType.Single ), group.Type == GroupType.Single ) )
|
||||
{
|
||||
Penumbra.ModManager.ChangeModGroupType( _mod, groupIdx, SelectType.Single );
|
||||
Penumbra.ModManager.ChangeModGroupType( _mod, groupIdx, GroupType.Single );
|
||||
}
|
||||
|
||||
var canSwitchToMulti = group.Count <= IModGroup.MaxMultiOptions;
|
||||
using var style = ImRaii.PushStyle( ImGuiStyleVar.Alpha, 0.5f, !canSwitchToMulti );
|
||||
if( ImGui.Selectable( GroupTypeName( SelectType.Multi ), group.Type == SelectType.Multi ) && canSwitchToMulti )
|
||||
if( ImGui.Selectable( GroupTypeName( GroupType.Multi ), group.Type == GroupType.Multi ) && canSwitchToMulti )
|
||||
{
|
||||
Penumbra.ModManager.ChangeModGroupType( _mod, groupIdx, SelectType.Multi );
|
||||
Penumbra.ModManager.ChangeModGroupType( _mod, groupIdx, GroupType.Multi );
|
||||
}
|
||||
|
||||
style.Pop();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using OtterGui;
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.UI.Classes;
|
||||
|
|
@ -154,7 +155,7 @@ public partial class ConfigWindow
|
|||
// If a description is provided, add a help marker besides it.
|
||||
private void DrawSingleGroup( IModGroup group, int groupIdx )
|
||||
{
|
||||
if( group.Type != SelectType.Single || !group.IsOption )
|
||||
if( group.Type != GroupType.Single || !group.IsOption )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -193,7 +194,7 @@ public partial class ConfigWindow
|
|||
// If a description is provided, add a help marker in the title.
|
||||
private void DrawMultiGroup( IModGroup group, int groupIdx )
|
||||
{
|
||||
if( group.Type != SelectType.Multi || !group.IsOption )
|
||||
if( group.Type != GroupType.Multi || !group.IsOption )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using System;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue