muffin v7.5.0
This commit is contained in:
parent
afafd5e377
commit
a6481e7b9a
67 changed files with 4281 additions and 2372 deletions
|
|
@ -8,7 +8,8 @@ public static class LAtkValue
|
|||
{
|
||||
public unsafe static string? ReadAtkString(this AtkValue atkValue)
|
||||
{
|
||||
if (atkValue.Type == FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Undefined)
|
||||
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
||||
if ((int)atkValue.Type == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface.Windowing;
|
||||
|
||||
|
|
@ -33,39 +32,15 @@ public abstract class LWindow : Window
|
|||
}
|
||||
}
|
||||
|
||||
protected new bool IsPinned
|
||||
{
|
||||
get
|
||||
{
|
||||
return InternalIsPinned(this);
|
||||
}
|
||||
set
|
||||
{
|
||||
InternalIsPinned(this) = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected new bool IsClickthrough
|
||||
{
|
||||
get
|
||||
{
|
||||
return InternalIsClickthrough(this);
|
||||
}
|
||||
set
|
||||
{
|
||||
InternalIsClickthrough(this) = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected int? Alpha
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int?)(100000f * InternalAlpha(this));
|
||||
return (int?)(100000f * base.BgAlpha);
|
||||
}
|
||||
set
|
||||
{
|
||||
InternalAlpha(this) = (float?)value / 100000f;
|
||||
base.BgAlpha = (float?)value / 100000f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,11 +60,11 @@ public abstract class LWindow : Window
|
|||
{
|
||||
if (base.AllowPinning)
|
||||
{
|
||||
IsPinned = windowConfig.IsPinned;
|
||||
base.IsPinned = windowConfig.IsPinned;
|
||||
}
|
||||
if (base.AllowClickthrough)
|
||||
{
|
||||
IsClickthrough = windowConfig.IsClickthrough;
|
||||
base.IsClickthrough = windowConfig.IsClickthrough;
|
||||
}
|
||||
Alpha = windowConfig.Alpha;
|
||||
}
|
||||
|
|
@ -106,14 +81,14 @@ public abstract class LWindow : Window
|
|||
if (windowConfig != null)
|
||||
{
|
||||
bool flag = false;
|
||||
if (base.AllowPinning && windowConfig.IsPinned != IsPinned)
|
||||
if (base.AllowPinning && windowConfig.IsPinned != base.IsPinned)
|
||||
{
|
||||
windowConfig.IsPinned = IsPinned;
|
||||
windowConfig.IsPinned = base.IsPinned;
|
||||
flag = true;
|
||||
}
|
||||
if (base.AllowClickthrough && windowConfig.IsClickthrough != IsClickthrough)
|
||||
if (base.AllowClickthrough && windowConfig.IsClickthrough != base.IsClickthrough)
|
||||
{
|
||||
windowConfig.IsClickthrough = IsClickthrough;
|
||||
windowConfig.IsClickthrough = base.IsClickthrough;
|
||||
flag = true;
|
||||
}
|
||||
if (windowConfig.Alpha != Alpha)
|
||||
|
|
@ -176,13 +151,4 @@ public abstract class LWindow : Window
|
|||
UpdateWindowConfig();
|
||||
}
|
||||
}
|
||||
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalIsPinned")]
|
||||
private static extern ref bool InternalIsPinned(Window @this);
|
||||
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalIsClickthrough")]
|
||||
private static extern ref bool InternalIsClickthrough(Window @this);
|
||||
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalAlpha")]
|
||||
private static extern ref float? InternalAlpha(Window @this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Dalamud.Game.Addon.Lifecycle;
|
||||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
|
@ -222,10 +223,11 @@ public sealed class GrandCompanyShop : IDisposable
|
|||
|
||||
private unsafe void FireCallback(AtkUnitBase* addon, params int[] args)
|
||||
{
|
||||
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
|
||||
AtkValue* ptr = stackalloc AtkValue[args.Length];
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
{
|
||||
ptr[i].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[i].Type, (AtkValueType)3);
|
||||
ptr[i].Int = args[i];
|
||||
}
|
||||
addon->FireCallback((uint)args.Length, ptr);
|
||||
|
|
@ -233,48 +235,64 @@ public sealed class GrandCompanyShop : IDisposable
|
|||
|
||||
private unsafe void FirePurchaseCallback(AtkUnitBase* addon, GrandCompanyItem item)
|
||||
{
|
||||
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
|
||||
AtkValue* ptr = stackalloc AtkValue[9];
|
||||
ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr->Type, (AtkValueType)3);
|
||||
ptr->Int = 0;
|
||||
ptr[1].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[1].Type, (AtkValueType)3);
|
||||
ptr[1].Int = item.Index;
|
||||
ptr[2].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[2].Type, (AtkValueType)3);
|
||||
ptr[2].Int = 1;
|
||||
ptr[3].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[3].Type, (AtkValueType)3);
|
||||
ptr[3].Int = 0;
|
||||
ptr[4].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[4].Type, (AtkValueType)3);
|
||||
ptr[4].Int = 0;
|
||||
ptr[5].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr[5].Type, (AtkValueType)3);
|
||||
ptr[5].Int = 0;
|
||||
ptr[6].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt;
|
||||
Unsafe.Write(&ptr[6].Type, (AtkValueType)5);
|
||||
ptr[6].UInt = item.ItemId;
|
||||
ptr[7].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt;
|
||||
Unsafe.Write(&ptr[7].Type, (AtkValueType)5);
|
||||
ptr[7].UInt = item.IconId;
|
||||
ptr[8].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt;
|
||||
Unsafe.Write(&ptr[8].Type, (AtkValueType)5);
|
||||
ptr[8].UInt = item.SealCost;
|
||||
addon->FireCallback(9u, ptr);
|
||||
}
|
||||
|
||||
private unsafe static void ClickYes(AtkUnitBase* addon)
|
||||
{
|
||||
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||||
AtkValue* ptr = stackalloc AtkValue[1];
|
||||
ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int;
|
||||
Unsafe.Write(&ptr->Type, (AtkValueType)3);
|
||||
ptr->Int = 0;
|
||||
addon->FireCallback(1u, ptr);
|
||||
}
|
||||
|
||||
private unsafe static int GetAtkValueInt(AtkUnitBase* addon, int index)
|
||||
{
|
||||
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0053: Expected I4, but got Unknown
|
||||
if (addon == null || addon->AtkValues == null || index < 0 || index >= addon->AtkValuesCount)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
AtkValue atkValue = addon->AtkValues[index];
|
||||
return atkValue.Type switch
|
||||
AtkValueType type = atkValue.Type;
|
||||
return (type - 2) switch
|
||||
{
|
||||
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int => atkValue.Int,
|
||||
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt => (int)atkValue.UInt,
|
||||
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Bool => (atkValue.Byte != 0) ? 1 : 0,
|
||||
1 => atkValue.Int,
|
||||
3 => (int)atkValue.UInt,
|
||||
0 => (atkValue.Byte != 0) ? 1 : 0,
|
||||
_ => -1,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ public class RegularShopBase
|
|||
short num = 0;
|
||||
short num2 = 0;
|
||||
address->GetPosition(&num, &num2);
|
||||
short num3 = 0;
|
||||
short num4 = 0;
|
||||
address->GetSize(&num3, &num4, scaled: true);
|
||||
num += num3;
|
||||
ushort num3 = 0;
|
||||
ushort num4 = 0;
|
||||
address->GetSize(&num3, &num4, true);
|
||||
num += (short)num3;
|
||||
Vector2? position = _parentWindow.Position;
|
||||
if (position.HasValue)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue