mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Update Dalamud Services and use Dalamuds texture provider.
This commit is contained in:
parent
79ec604e89
commit
0afcc8cca8
24 changed files with 94 additions and 115 deletions
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
||||
namespace Glamourer.Customization;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ internal class CmpFile
|
|||
public bool Valid
|
||||
=> _file != null;
|
||||
|
||||
public CmpFile(DataManager gameData)
|
||||
public CmpFile(IDataManager gameData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Glamourer.Customization;
|
||||
|
|
@ -12,9 +11,9 @@ public class CustomizationManager : ICustomizationManager
|
|||
private CustomizationManager()
|
||||
{ }
|
||||
|
||||
public static ICustomizationManager Create(DalamudPluginInterface pi, DataManager gameData)
|
||||
public static ICustomizationManager Create(ITextureProvider textures, IDataManager gameData)
|
||||
{
|
||||
_options ??= new CustomizationOptions(pi, gameData);
|
||||
_options ??= new CustomizationOptions(textures, gameData);
|
||||
return new CustomizationManager();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Dalamud;
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
|
@ -36,7 +35,7 @@ public partial class CustomizationOptions
|
|||
|
||||
// Get specific icons.
|
||||
internal ImGuiScene.TextureWrap GetIcon(uint id)
|
||||
=> _icons.LoadIcon(id);
|
||||
=> _icons.LoadIcon(id)!;
|
||||
|
||||
private readonly IconStorage _icons;
|
||||
|
||||
|
|
@ -62,10 +61,10 @@ public partial class CustomizationOptions
|
|||
public string GetName(CustomName name)
|
||||
=> _names[(int)name];
|
||||
|
||||
internal CustomizationOptions(DalamudPluginInterface pi, DataManager gameData)
|
||||
internal CustomizationOptions(ITextureProvider textures, IDataManager gameData)
|
||||
{
|
||||
var tmp = new TemporaryData(gameData, this);
|
||||
_icons = new IconStorage(pi, gameData, _customizationSets.Length * 50);
|
||||
_icons = new IconStorage(textures, gameData);
|
||||
SetNames(gameData, tmp);
|
||||
foreach (var race in Clans)
|
||||
{
|
||||
|
|
@ -78,7 +77,7 @@ public partial class CustomizationOptions
|
|||
// Obtain localized names of customization options and race names from the game data.
|
||||
private readonly string[] _names = new string[Enum.GetValues<CustomName>().Length];
|
||||
|
||||
private void SetNames(DataManager gameData, TemporaryData tmp)
|
||||
private void SetNames(IDataManager gameData, TemporaryData tmp)
|
||||
{
|
||||
var subRace = gameData.GetExcelSheet<Tribe>()!;
|
||||
|
||||
|
|
@ -180,7 +179,7 @@ public partial class CustomizationOptions
|
|||
}
|
||||
|
||||
|
||||
public TemporaryData(DataManager gameData, CustomizationOptions options)
|
||||
public TemporaryData(IDataManager gameData, CustomizationOptions options)
|
||||
{
|
||||
_options = options;
|
||||
_cmpFile = new CmpFile(gameData);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud;
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Glamourer.Structs;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ public static class GameData
|
|||
private static Dictionary<byte, Job>? _jobs;
|
||||
private static Dictionary<ushort, JobGroup>? _jobGroups;
|
||||
|
||||
public static IReadOnlyDictionary<byte, Job> Jobs(DataManager dataManager)
|
||||
public static IReadOnlyDictionary<byte, Job> Jobs(IDataManager dataManager)
|
||||
{
|
||||
if (_jobs != null)
|
||||
return _jobs;
|
||||
|
|
@ -22,7 +22,7 @@ public static class GameData
|
|||
return _jobs;
|
||||
}
|
||||
|
||||
public static IReadOnlyDictionary<ushort, JobGroup> JobGroups(DataManager dataManager)
|
||||
public static IReadOnlyDictionary<ushort, JobGroup> JobGroups(IDataManager dataManager)
|
||||
{
|
||||
if (_jobGroups != null)
|
||||
return _jobGroups;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue