Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: patch api 9 with the normal things.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 1, 2023
1 parent 6218cf2 commit 703642b
Show file tree
Hide file tree
Showing 36 changed files with 83 additions and 79 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ internal bool CanGetTarget(BattleChara target, BattleChara subTarget)
return dis <= EffectRange && dis >= 8;
}

PluginLog.LogDebug(Name + "'s CastType is not valid! The value is " + _action.CastType.ToString());
Svc.Log.Debug(Name + "'s CastType is not valid! The value is " + _action.CastType.ToString());
return false;
}
#endregion
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PluginConfig : IPluginConfiguration
{
public static PluginConfig Create()
{
PluginLog.Warning("You created a new configuration!");
Svc.Log.Warning("You created a new configuration!");
var result = new PluginConfig();
result.SetValue(Job.WAR, JobConfigInt.HostileType, 0);
result.SetValue(Job.DRK, JobConfigInt.HostileType, 0);
Expand Down Expand Up @@ -131,7 +131,7 @@ public JobConfig GetJobConfig(Job job)
public void Save()
{
#if DEBUG
PluginLog.Information("Saved configurations.");
Svc.Log.Information("Saved configurations.");
#endif
File.WriteAllText(Svc.PluginInterface.ConfigFile.FullName,
JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings()
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Configuration/MacroInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public unsafe bool AddMacro(GameObject tar = null)
{
if (MacroIndex < 0 || MacroIndex > 99) return false;

DataCenter.Macros.Enqueue(new MacroItem(tar, IsShared ?
RaptureMacroModule.Instance->Shared[MacroIndex] :
RaptureMacroModule.Instance->Individual[MacroIndex]));
var shared = RaptureMacroModule.Instance()->SharedSpan[MacroIndex];
var individual = RaptureMacroModule.Instance()->IndividualSpan[MacroIndex];

DataCenter.Macros.Enqueue(new MacroItem(tar, IsShared ? &shared : &individual));
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/OtherConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static void InitOne<T>(ref T value, string name, bool download = true)
}
catch (Exception ex)
{
PluginLog.Warning(ex, $"Failed to load {name}.");
Svc.Log.Warning(ex, $"Failed to load {name}.");
}
}
else if(download)
Expand Down
10 changes: 0 additions & 10 deletions RotationSolver.Basic/Data/IconSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ private static byte[] SvgToPng(byte[] data)
/// <returns></returns>
public static bool GetTexture(this ITexture text, out IDalamudTextureWrap texture) => GetTexture(text?.IconID ?? 0, out texture);

/// <summary>
/// Get Texture from id.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[Obsolete]

public static TextureWrap GetTexture(uint id)
=> ThreadLoadImageHandler.TryGetIconTextureWrap(id, false, out var texture) ? texture :
ThreadLoadImageHandler.TryGetIconTextureWrap(0, false, out texture) ? texture : null;

/// <summary>
///
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Data/MacroItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public MacroItem(GameObject target, RaptureMacroModule.Macro* macro)
/// <returns></returns>
public bool StartUseMacro()
{
if (RaptureShellModule.Instance->MacroCurrentLine > -1) return false;
if (RaptureShellModule.Instance()->MacroCurrentLine > -1) return false;

_lastTarget = Svc.Targets.Target;
Svc.Targets.Target = Target;
RaptureShellModule.Instance->ExecuteMacro(_macro);
RaptureShellModule.Instance()->ExecuteMacro(_macro);

IsRunning = true;
return true;
Expand All @@ -55,7 +55,7 @@ public bool StartUseMacro()
/// <returns></returns>
public bool EndUseMacro()
{
if (RaptureShellModule.Instance->MacroCurrentLine > -1) return false;
if (RaptureShellModule.Instance()->MacroCurrentLine > -1) return false;

Svc.Targets.Target = _lastTarget;

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static unsafe ushort FateId
}
catch (Exception ex)
{
PluginLog.Error(ex.StackTrace);
Svc.Log.Error(ex.StackTrace);
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/BLU_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public bool RightType
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Failed for checking target status.");
Svc.Log.Warning(ex, "Failed for checking target status.");
}
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Plugin.Services;
using ECommons.DalamudServices;

namespace RotationSolver.Basic.Rotations;
Expand Down Expand Up @@ -49,7 +50,7 @@ public abstract partial class CustomRotation
/// <summary>
/// Condition.
/// </summary>
protected static Condition Condition => Svc.Condition;
protected static ICondition Condition => Svc.Condition;

#endregion

Expand Down
5 changes: 3 additions & 2 deletions RotationSolver.Basic/Service.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Utility.Signatures;
using Dalamud.Plugin.Services;
using Dalamud.Utility.Signatures;
using ECommons.DalamudServices;
using FFXIVClientStructs.Attributes;
using FFXIVClientStructs.FFXIV.Client.Game;
Expand Down Expand Up @@ -42,7 +43,7 @@ internal static unsafe bool CanMove

public Service()
{
SignatureHelper.Initialise(this);
Svc.Hook.InitializeFromAttributes(this);
}
public static ActionID GetAdjustedActionId(ActionID id)
=> (ActionID)GetAdjustedActionId((uint)id);
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/ActionSequencer/BaseCondition.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RotationSolver.Localization;
using Dalamud.Interface.Utility;
using RotationSolver.Localization;
using RotationSolver.UI;

namespace RotationSolver.ActionSequencer;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/ActionSequencer/ConditionHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Logging;
using Dalamud.Interface.Utility;
using Dalamud.Logging;
using ECommons.GameHelpers;
using RotationSolver.Localization;
using RotationSolver.UI;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/ActionSequencer/TargetCondition.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using Dalamud.Interface.Utility;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Localization;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static async void PulseSimulation(uint id)
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Pulse Failed!");
Svc.Log.Warning(ex, "Pulse Failed!");
}
finally { started = false; }
started = false;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Helpers/DownloadHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Logging;
using ECommons.DalamudServices;
using RotationSolver.UI;
using System.Text;

Expand Down Expand Up @@ -31,7 +32,7 @@ private static async Task<T> DownloadOneAsync<T>(string url)
}
catch (Exception ex)
{
PluginLog.Log(ex, "Failed to load downloading List.");
Svc.Log.Information(ex, "Failed to load downloading List.");
return default;
}
}
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Helpers/RotationLoadContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Runtime.Loader;
using Dalamud.Logging;
using Dalamud.Plugin;
using ECommons.DalamudServices;
using FFXIVClientStructs.Interop;
using Lumina.Excel;
using Lumina.Excel.CustomSheets;
Expand Down Expand Up @@ -65,7 +66,7 @@ internal Assembly LoadFromFile(string filePath)
var pdbPath = Path.ChangeExtension(filePath, ".pdb");
if (!File.Exists(pdbPath))
{
PluginLog.Information($"Failed to find {pdbPath}");
Svc.Log.Information($"Failed to find {pdbPath}");
return LoadFromStream(file);
}
using var pdbFile = File.Open(pdbPath, FileMode.Open, FileAccess.Read, FileShare.Read);
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Helpers/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void ShowWarning(this string message, int times = 3, DalamudLinkPa
new TextPayload("(Hide Warning)"),
RawPayload.LinkTerminator);

Svc.Chat.PrintChat(new Dalamud.Game.Text.XivChatEntry()
Svc.Chat.Print(new Dalamud.Game.Text.XivChatEntry()
{
Message = seString,
Type = Dalamud.Game.Text.XivChatType.ErrorMessage,
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Localization/LocalizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ private void OnLanguageChange(string languageCode)
{
try
{
PluginLog.Information($"Loading Localization for {languageCode}");
Svc.Log.Information($"Loading Localization for {languageCode}");
SetLanguage(languageCode);
}
catch (Exception ex)
{
PluginLog.Error(ex, "Unable to Load Localization");
Svc.Log.Error(ex, "Unable to Load Localization");
}
}
}
2 changes: 1 addition & 1 deletion RotationSolver/RotationSolver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: |-
punchline: Analyses PvE combat information every frame and finds the best action.
repo_url: https://github.com/ArchiDog1998/RotationSolver
icon_url: https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Images/Logo.png
dalamud_api_level: 8
dalamud_api_level: 9
tags:
- combat
- rotation
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
}
catch(Exception ex)
{
PluginLog.Warning(ex, "Failed to load config");
Svc.Log.Warning(ex, "Failed to load config");
Service.Config = PluginConfig.Create(); ;
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/SpeechHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal static void Speak(string text)
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with TTT.");
Svc.Log.Warning(ex, "Something wrong with TTT.");
}
}
}
3 changes: 2 additions & 1 deletion RotationSolver/UI/CollapsingHeaderGroup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Logging;
using ECommons.DalamudServices;

namespace RotationSolver.UI;

Expand Down Expand Up @@ -70,7 +71,7 @@ public void Draw()
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with header drawing.");
Svc.Log.Warning(ex, "Something wrong with header drawing.");
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Interface.Colors;
using Dalamud.Interface.Internal;
using ECommons.DalamudServices;
using ImGuiScene;
using RotationSolver.Basic.Configuration;
Expand Down Expand Up @@ -270,7 +271,7 @@ static void DrawCommandAction(uint iconId, SpecialCommandType command, Vector4 c
if (IconSet.GetTexture(iconId, out var texture)) DrawCommandAction(texture, command, color);
}

static void DrawCommandAction(TextureWrap texture, SpecialCommandType command, Vector4 color)
static void DrawCommandAction(IDalamudTextureWrap texture, SpecialCommandType command, Vector4 color)
{
var abilityW = Service.Config.GetValue(PluginConfigFloat.ControlWindow0GCDSize);
var width = abilityW + ImGui.GetStyle().ItemInnerSpacing.X * 2;
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/UI/ImguiTooltips.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility;

namespace RotationSolver.UI;

Expand Down
10 changes: 5 additions & 5 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public override void Draw()
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with sideBar");
Svc.Log.Warning(ex, "Something wrong with sideBar");
}

ImGui.TableNextColumn();
Expand All @@ -111,15 +111,15 @@ public override void Draw()
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with body");
Svc.Log.Warning(ex, "Something wrong with body");
}

ImGui.EndTable();
}
}
catch(Exception ex)
{
PluginLog.Warning(ex, "Something wrong with config window.");
Svc.Log.Warning(ex, "Something wrong with config window.");
}
}

Expand Down Expand Up @@ -245,7 +245,7 @@ private static bool GetLocalImage(string name, out IDalamudTextureWrap texture)
using var stream = typeof(RotationConfigWindow).Assembly.GetManifestResourceStream(url);
if (stream == null)
{
PluginLog.Warning($"Failed to load the pic: {url} when getting the stream from assembly.");
Svc.Log.Warning($"Failed to load the pic: {url} when getting the stream from assembly.");
_textureWrapList[url] = null;
return false;
}
Expand All @@ -255,7 +255,7 @@ private static bool GetLocalImage(string name, out IDalamudTextureWrap texture)
texture = Svc.PluginInterface.UiBuilder.LoadImage(memory.ToArray());
if(texture == null)
{
PluginLog.Warning($"Failed to load the pic: {url} when convert bytes to image.");
Svc.Log.Warning($"Failed to load the pic: {url} when convert bytes to image.");
_textureWrapList[url] = null;
return false;
}
Expand Down
6 changes: 4 additions & 2 deletions RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using ECommons.ExcelServices;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Utility;
using ECommons.ExcelServices;
using ImGuiScene;
using RotationSolver.Basic.Configuration;
using RotationSolver.Localization;
Expand Down Expand Up @@ -78,7 +80,7 @@ protected virtual void DrawChildren(Job job)
protected override void DrawMain(Job job)
{
var hasChild = Children != null && Children.Length > 0;
TextureWrap texture = null;
IDalamudTextureWrap texture = null;
var hasIcon = Action != ActionID.None && IconSet.GetTexture(Action, out texture);

var enable = GetValue(job);
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/UI/SearchableConfigs/Searchable.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using Dalamud.Interface.Utility;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Localization;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal static void UpdateNextAction()
}
catch (Exception ex)
{
PluginLog.Error(ex, "Failed to update next action.");
Svc.Log.Error(ex, "Failed to update next action.");
}

WrongAction = NextAction = NextGCDAction = null;
Expand Down
Loading

0 comments on commit 703642b

Please sign in to comment.