Updated to Risa's changes
This commit is contained in:
@@ -81,6 +81,7 @@ internal static class Constants
|
||||
|
||||
/// <summary>
|
||||
/// Movement hook address, used for position offset and other changes which cannot be done in main hook
|
||||
/// Client::Game::Object::GameObject_UpdateVisualPosition
|
||||
/// </summary>
|
||||
public const string MovementHookAddress = "E8 ?? ?? ?? ?? 84 DB 74 3A";
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Utility;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using System.Text;
|
||||
|
||||
namespace CustomizePlus.Core.Helpers;
|
||||
|
||||
@@ -67,21 +66,15 @@ public static class CtrlHelper
|
||||
}
|
||||
|
||||
public static bool ArrowToggle(string label, ref bool value)
|
||||
{//ImGuiNative.ArrowButton(label, value ? ImGuiDir.Down : ImGuiDir.Right);
|
||||
unsafe // temporary fix
|
||||
{
|
||||
var toggled = ImGui.ArrowButton(label, value ? ImGuiDir.Down : ImGuiDir.Right);
|
||||
|
||||
if (toggled)
|
||||
{
|
||||
var utf8Label = Encoding.UTF8.GetBytes(label + "\0");
|
||||
|
||||
fixed (byte* labelPtr = utf8Label)
|
||||
{
|
||||
bool toggled = ImGuiNative.ArrowButton(labelPtr, value ? ImGuiDir.Down : ImGuiDir.Right) != 0;
|
||||
|
||||
if (toggled)
|
||||
value = !value;
|
||||
|
||||
return value;
|
||||
}
|
||||
value = !value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void AddHoverText(string text)
|
||||
|
||||
@@ -25,7 +25,6 @@ using CustomizePlus.UI.Windows.MainWindow.Tabs.Debug;
|
||||
using CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles;
|
||||
using CustomizePlus.UI.Windows.MainWindow.Tabs.Templates;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Log;
|
||||
@@ -59,10 +58,10 @@ public static class ServiceManagerBuilder
|
||||
.AddApi();
|
||||
|
||||
DalamudServices.AddServices(services, pi);
|
||||
services.AddDalamudService<ISeStringEvaluator>(pi);
|
||||
|
||||
services.AddIServices(typeof(EquipItem).Assembly);
|
||||
services.AddIServices(typeof(Plugin).Assembly);
|
||||
services.AddIServices(typeof(CutsceneService).Assembly);
|
||||
services.AddIServices(typeof(CutsceneService).Assembly);
|
||||
services.AddIServices(typeof(ImRaii).Assembly);
|
||||
|
||||
services.CreateProvider();
|
||||
|
||||
@@ -8,6 +8,8 @@ using OtterGui.Services;
|
||||
|
||||
namespace CustomizePlus.Core.Services.Dalamud;
|
||||
|
||||
#pragma warning disable SeStringEvaluator
|
||||
|
||||
public class DalamudServices
|
||||
{
|
||||
public static void AddServices(ServiceManager services, IDalamudPluginInterface pi)
|
||||
@@ -27,6 +29,7 @@ public class DalamudServices
|
||||
.AddDalamudService<IPluginLog>(pi)
|
||||
.AddDalamudService<ITargetManager>(pi)
|
||||
.AddDalamudService<INotificationManager>(pi)
|
||||
.AddDalamudService<IContextMenu>(pi);
|
||||
.AddDalamudService<IContextMenu>(pi)
|
||||
.AddDalamudService<ISeStringEvaluator>(pi);
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ public class HookingService : IDisposable
|
||||
private readonly ProfileManager _profileManager;
|
||||
private readonly ArmatureManager _armatureManager;
|
||||
private readonly GameStateService _gameStateService;
|
||||
private readonly DalamudBranchService _dalamudBranchService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
private Hook<RenderDelegate>? _renderManagerHook;
|
||||
@@ -46,7 +45,6 @@ public class HookingService : IDisposable
|
||||
ProfileManager profileManager,
|
||||
ArmatureManager armatureManager,
|
||||
GameStateService gameStateService,
|
||||
DalamudBranchService dalamudBranchService,
|
||||
Logger logger)
|
||||
{
|
||||
_configuration = configuration;
|
||||
@@ -55,7 +53,6 @@ public class HookingService : IDisposable
|
||||
_profileManager = profileManager;
|
||||
_armatureManager = armatureManager;
|
||||
_gameStateService = gameStateService;
|
||||
_dalamudBranchService = dalamudBranchService;
|
||||
_logger = logger;
|
||||
|
||||
ReloadHooks();
|
||||
@@ -75,12 +72,6 @@ public class HookingService : IDisposable
|
||||
RenderHookFailed = false;
|
||||
MovementHookFailed = false;
|
||||
|
||||
if(!_dalamudBranchService.AllowPluginToRun)
|
||||
{
|
||||
_logger.Error("Not reloading hooks because the plugin is not allowed to run. (Branch Service)");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (_configuration.PluginEnabled)
|
||||
|
||||
@@ -21,22 +21,18 @@ public class SupportLogBuilderService
|
||||
private readonly ProfileManager _profileManager;
|
||||
private readonly ArmatureManager _armatureManager;
|
||||
private readonly IDalamudPluginInterface _dalamudPluginInterface;
|
||||
private readonly DalamudBranchService _dalamudBranchService;
|
||||
|
||||
public SupportLogBuilderService(
|
||||
PluginConfiguration configuration,
|
||||
TemplateManager templateManager,
|
||||
ProfileManager profileManager,
|
||||
ArmatureManager armatureManager,
|
||||
IDalamudPluginInterface dalamudPluginInterface,
|
||||
DalamudBranchService dalamudBranchService)
|
||||
IDalamudPluginInterface dalamudPluginInterface)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_templateManager = templateManager;
|
||||
_profileManager = profileManager;
|
||||
_armatureManager = armatureManager;
|
||||
_dalamudPluginInterface = dalamudPluginInterface;
|
||||
_dalamudBranchService = dalamudBranchService;
|
||||
}
|
||||
|
||||
public string BuildSupportLog()
|
||||
@@ -45,7 +41,6 @@ public class SupportLogBuilderService
|
||||
sb.AppendLine("**Settings**");
|
||||
sb.Append($"> **`Plugin Version: `** {VersionHelper.Version}\n");
|
||||
sb.Append($"> **`Commit Hash: `** {ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha}\n");
|
||||
sb.Append($"> **`Dalamud Branch: `** {_dalamudBranchService.CurrentBranchName} ({_dalamudBranchService.CurrentBranch})\n");
|
||||
sb.Append($"> **`Plugin enabled: `** {_configuration.PluginEnabled}\n");
|
||||
sb.AppendLine("**Settings -> Editor Settings**");
|
||||
sb.Append($"> **`Preview character (editor): `** {_configuration.EditorConfiguration.PreviewCharacter.Incognito(null)}\n");
|
||||
|
||||
@@ -12,18 +12,15 @@ public class UserNotifierService : IDisposable
|
||||
{
|
||||
private readonly IClientState _clientState;
|
||||
private readonly ChatService _chatService;
|
||||
private readonly DalamudBranchService _dalamudBranchService;
|
||||
private readonly PopupSystem _popupSystem;
|
||||
|
||||
public UserNotifierService(
|
||||
IClientState clientState,
|
||||
ChatService chatService,
|
||||
DalamudBranchService dalamudBranchService,
|
||||
PopupSystem popupSystem)
|
||||
{
|
||||
_clientState = clientState;
|
||||
_chatService = chatService;
|
||||
_dalamudBranchService = dalamudBranchService;
|
||||
_popupSystem = popupSystem;
|
||||
|
||||
NotifyUser(true);
|
||||
@@ -46,17 +43,5 @@ public class UserNotifierService : IDisposable
|
||||
if (VersionHelper.IsTesting)
|
||||
_chatService.PrintInChat($"You are running testing version of Customize+! Some features like integration with other plugins might not function correctly.",
|
||||
ChatService.ChatMessageColor.Warning);
|
||||
|
||||
if (!_dalamudBranchService.AllowPluginToRun)
|
||||
{
|
||||
_chatService.PrintInChat(DalamudBranchService.PluginDisabledMessage,
|
||||
ChatService.ChatMessageColor.Error);
|
||||
|
||||
if (displayOptionalMessages)
|
||||
{
|
||||
if(_popupSystem.ShowPopup(PopupSystem.Messages.PluginDisabledNonReleaseDalamud))
|
||||
UIGlobals.PlayChatSoundEffect(11);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user