2024-08-30 14:23:51 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text.Json.Serialization;
|
2023-09-21 23:17:46 +02:00
|
|
|
|
using Dalamud.Configuration;
|
2024-06-06 22:03:42 +02:00
|
|
|
|
using Dalamud.Game.ClientState.Keys;
|
2024-01-28 08:15:51 +01:00
|
|
|
|
using Dalamud.Game.Text;
|
2023-09-28 10:12:26 +02:00
|
|
|
|
using Deliveroo.GameData;
|
2024-05-11 00:27:33 +02:00
|
|
|
|
using LLib.ImGui;
|
2023-09-21 23:17:46 +02:00
|
|
|
|
|
|
|
|
|
namespace Deliveroo;
|
|
|
|
|
|
|
|
|
|
internal sealed class Configuration : IPluginConfiguration
|
|
|
|
|
{
|
2024-08-30 18:21:33 +02:00
|
|
|
|
public int Version { get; set; } = 2;
|
2023-09-21 23:17:46 +02:00
|
|
|
|
|
2024-08-30 18:21:33 +02:00
|
|
|
|
[Obsolete]
|
|
|
|
|
public List<uint> ItemsAvailableForPurchase { get; set; } = [];
|
|
|
|
|
|
|
|
|
|
public List<PurchaseOption> ItemsAvailableToPurchase { get; set; } = [];
|
|
|
|
|
public List<PurchasePriority> ItemsToPurchase { get; set; } = [];
|
2023-09-22 08:59:31 +02:00
|
|
|
|
|
2023-10-18 10:12:27 +02:00
|
|
|
|
public int ReservedSealCount { get; set; }
|
|
|
|
|
public bool ReserveDifferentSealCountAtMaxRank { get; set; }
|
|
|
|
|
public int ReservedSealCountAtMaxRank { get; set; }
|
2024-05-09 01:08:01 +02:00
|
|
|
|
public XivChatType ChatType { get; set; } = XivChatType.Debug;
|
2023-10-21 12:49:47 +02:00
|
|
|
|
public int PauseAtRank { get; set; }
|
2023-12-02 13:52:55 +01:00
|
|
|
|
public EBehaviorOnOtherWorld BehaviorOnOtherWorld { get; set; } = EBehaviorOnOtherWorld.Warning;
|
2024-04-30 19:35:56 +02:00
|
|
|
|
public bool DisableFrameLimiter { get; set; } = true;
|
2024-05-02 11:40:34 +02:00
|
|
|
|
public bool UncapFrameRate { get; set; }
|
2024-06-06 22:03:42 +02:00
|
|
|
|
public VirtualKey QuickTurnInKey { get; set; } = VirtualKey.SHIFT;
|
2023-09-28 10:51:17 +02:00
|
|
|
|
|
2024-05-11 00:27:33 +02:00
|
|
|
|
public WindowConfig TurnInWindowConfig { get; } = new();
|
|
|
|
|
public WindowConfig ConfigWindowConfig { get; } = new();
|
|
|
|
|
|
2024-08-30 18:21:33 +02:00
|
|
|
|
internal sealed class PurchaseOption
|
|
|
|
|
{
|
|
|
|
|
public uint ItemId { get; set; }
|
|
|
|
|
public bool SameQuantityForAllLists { get; set; }
|
|
|
|
|
public int GlobalLimit { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-24 12:14:43 +02:00
|
|
|
|
internal sealed class PurchasePriority
|
|
|
|
|
{
|
2024-08-30 14:23:51 +02:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public Guid InternalId { get; } = Guid.NewGuid();
|
|
|
|
|
|
2023-09-24 12:14:43 +02:00
|
|
|
|
public uint ItemId { get; set; }
|
|
|
|
|
public int Limit { get; set; }
|
2023-10-15 14:31:49 +02:00
|
|
|
|
public bool Enabled { get; set; } = true;
|
2024-01-28 08:15:51 +01:00
|
|
|
|
public PurchaseType Type { get; set; } = PurchaseType.KeepStocked;
|
2024-01-28 13:37:38 +01:00
|
|
|
|
public bool CheckRetainerInventory { get; set; }
|
2024-01-28 08:15:51 +01:00
|
|
|
|
|
|
|
|
|
public string GetIcon()
|
|
|
|
|
{
|
|
|
|
|
return Type switch
|
|
|
|
|
{
|
|
|
|
|
PurchaseType.PurchaseOneTime => SeIconChar.BoxedNumber1.ToIconString(),
|
|
|
|
|
PurchaseType.KeepStocked => SeIconChar.Circle.ToIconString(),
|
|
|
|
|
_ => SeIconChar.BoxedQuestionMark.ToIconString(),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum PurchaseType
|
|
|
|
|
{
|
|
|
|
|
PurchaseOneTime,
|
|
|
|
|
KeepStocked,
|
2023-09-24 12:14:43 +02:00
|
|
|
|
}
|
2023-09-22 22:42:18 +02:00
|
|
|
|
|
2023-09-28 10:12:26 +02:00
|
|
|
|
public bool AddVentureIfNoItemToPurchaseSelected()
|
|
|
|
|
{
|
2024-08-30 18:21:33 +02:00
|
|
|
|
if (ItemsAvailableToPurchase.Count == 0)
|
2023-09-28 10:12:26 +02:00
|
|
|
|
{
|
2024-08-30 18:21:33 +02:00
|
|
|
|
ItemsAvailableToPurchase.Add(new PurchaseOption { ItemId = ItemIds.Venture });
|
2023-09-28 10:12:26 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2023-12-02 13:52:55 +01:00
|
|
|
|
|
|
|
|
|
public enum EBehaviorOnOtherWorld
|
|
|
|
|
{
|
|
|
|
|
None,
|
|
|
|
|
Warning,
|
|
|
|
|
DisableTurnIn,
|
|
|
|
|
}
|
2023-09-21 23:17:46 +02:00
|
|
|
|
}
|