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

Commit

Permalink
Merge pull request #22 from ArchiDog1998/main
Browse files Browse the repository at this point in the history
RP
  • Loading branch information
ArchiDog1998 authored Oct 4, 2023
2 parents ddb7d5e + 4dcb193 commit 17f6605
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 23 deletions.
4 changes: 2 additions & 2 deletions ActionTimelineEx/ActionTimelineEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<Authors>ArchiTed</Authors>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
<Version>1.3.4</Version>
<Version>1.3.5</Version>
<Nullable>enable</Nullable>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.11" />
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<ProjectReference Include="..\ECommons\ECommons\ECommons.csproj" />

<Reference Include="Dalamud">
Expand Down
2 changes: 1 addition & 1 deletion ActionTimelineEx/ActionTimelineEx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
punchline: Show your actions in real-time.
repo_url: https://github.com/ArchiDog1998/ActionTimelineEx
icon_url: https://xivapi.com/i/000000/000073_hr1.png
dalamud_api_level: 8
dalamud_api_level: 9
tags:
- UI
category_tags:
Expand Down
12 changes: 6 additions & 6 deletions ActionTimelineEx/Helpers/DrawHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using Dalamud.Interface.Internal;
using ECommons.DalamudServices;
using ECommons.ImGuiMethods;
using ImGuiNET;
using ImGuiScene;
Expand All @@ -12,7 +13,7 @@ internal static class DrawHelper
private static readonly Vector2 _uv1 = new Vector2(96 * 5 / 852f, 0),
_uv2 = new Vector2((96 * 5 + 144) / 852f, 0.5f);

private static TextureWrap? _roundTex;
private static IDalamudTextureWrap? _roundTex;
public static void Init()
{
var tex = Svc.Data.GetFile<TexFile>("ui/uld/icona_frame_hr1.tex");
Expand Down Expand Up @@ -42,7 +43,7 @@ public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, flo

public static void DrawActionIcon(this ImDrawListPtr drawList, uint iconId, bool isHq, Vector2 position, float size)
{
TextureWrap? texture = GetTextureFromIconId(iconId, isHq);
IDalamudTextureWrap? texture = GetTextureFromIconId(iconId, isHq);
if (texture == null) return;

var pixPerUnit = size / 82;
Expand All @@ -64,7 +65,7 @@ public static Vector4 ChangeAlpha(this Vector4 color, float alpha)
return color;
}

public static TextureWrap? GetTextureFromIconId(uint iconId, bool highQuality = false)
public static IDalamudTextureWrap? GetTextureFromIconId(uint iconId, bool highQuality = false)
=> ThreadLoadImageHandler.TryGetIconTextureWrap(iconId, highQuality, out var texture) ? texture
: ThreadLoadImageHandler.TryGetIconTextureWrap(0, highQuality, out texture) ? texture : null;

Expand All @@ -90,8 +91,7 @@ private static void CalculateColor()
{
while(calculating.TryDequeue(out var icon))
{
var tex = Svc.Data.GetIcon(icon, false);

var tex = Svc.Data.GetFile<TexFile>($"ui/icon/{icon/1000:D3}000/{icon:D6}.tex");
if(tex == null)
{
textureColorCache[icon] = uint.MaxValue;
Expand Down
3 changes: 2 additions & 1 deletion ActionTimelineEx/Timeline/StatusLineItem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ActionTimeline.Helpers;
using ActionTimelineEx.Configurations;
using Dalamud.Interface.Internal;
using ImGuiNET;
using ImGuiScene;
using System.Numerics;
Expand Down Expand Up @@ -35,7 +36,7 @@ public void DrawItemWithCenter(Vector2 centerPos, Vector2 windowPos, DrawingSett
var flag = ImDrawFlags.RoundCornersAll;
var rounding = setting.GCDRound;

TextureWrap? texture = DrawHelper.GetTextureFromIconId(Icon);
IDalamudTextureWrap? texture = DrawHelper.GetTextureFromIconId(Icon);
if (texture == null) return;

var col = DrawHelper.GetTextureAverageColor(Icon);
Expand Down
7 changes: 4 additions & 3 deletions ActionTimelineEx/Timeline/TimelineItem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ActionTimeline.Helpers;
using ActionTimelineEx.Configurations;
using Dalamud.Interface;
using Dalamud.Interface.Internal;
using ImGuiNET;
using ImGuiScene;
using RotationSolver.Basic.Data;
Expand Down Expand Up @@ -72,12 +73,12 @@ public void DrawItemWithCenter(Vector2 centerPos, TimelineLayer icon, DrawingSet
}
}

private static (TextureWrap texture, string? name)[] GetTextures(HashSet<(uint icon, string? name)> iconIds)
private static (IDalamudTextureWrap texture, string? name)[] GetTextures(HashSet<(uint icon, string? name)> iconIds)
{
var result = new List<(TextureWrap texture, string? name)>(iconIds.Count);
var result = new List<(IDalamudTextureWrap texture, string? name)>(iconIds.Count);
foreach (var item in iconIds)
{
TextureWrap? texture = DrawHelper.GetTextureFromIconId(item.icon);
IDalamudTextureWrap? texture = DrawHelper.GetTextureFromIconId(item.icon);
if (texture == null) continue;
result.Add((texture, item.name));
}
Expand Down
10 changes: 5 additions & 5 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public TimelineManager()
{
try
{
SignatureHelper.Initialise(this);
Svc.Hook.InitializeFromAttributes(this);
_onActorControlHook?.Enable();
_onCastHook?.Enable();

ActionEffect.ActionEffectEvent += ActionFromSelf;
}
catch (Exception e)
{
PluginLog.Error("Error initiating hooks: " + e.Message);
Svc.Log.Error("Error initiating hooks: " + e.Message);
}
}

Expand Down Expand Up @@ -161,7 +161,7 @@ private static TimelineItemType GetActionType(uint actionId, ActionType type)
{
switch (type)
{
case ActionType.Spell:
case ActionType.Action:
var action = Svc.Data.GetExcelSheet<Action>()?.GetRow(actionId);
if (action == null) break;

Expand Down Expand Up @@ -447,7 +447,7 @@ private async void OnActorControl(uint entityId, ActorControlCategory type, uint

catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with OnActorControl!");
Svc.Log.Warning(ex, "Something wrong with OnActorControl!");
}
}

Expand Down Expand Up @@ -477,7 +477,7 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr)
}
catch(Exception ex)
{
PluginLog.Warning(ex, "Something wrong with OnCast1");
Svc.Log.Warning(ex, "Something wrong with OnCast1");
}
}
}
1 change: 1 addition & 0 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using ActionTimelineEx.Configurations;
using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using ECommons.Commands;
Expand Down
1 change: 1 addition & 0 deletions ActionTimelineEx/Windows/TimelineWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using ActionTimelineEx.Configurations;
using ActionTimelineEx.Timeline;
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using ImGuiNET;
using System.Numerics;

Expand Down
6 changes: 3 additions & 3 deletions ActionTimelineEx/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net7.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.11, )",
"resolved": "2.1.11",
"contentHash": "9qlAWoRRTiL/geAvuwR/g6Bcbrd/bJJgVnB/RurBiyKs6srsP0bvpoo8IK+Eg8EA6jWeM6/YJWs66w4FIAzqPw=="
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
},
"ecommons": {
"type": "Project"
Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 34 files
+55 −4 ECommons/Automation/Callback.cs
+1 −1 ECommons/Automation/MacroManager.cs
+4 −1 ECommons/Automation/TaskManager.cs
+3 −1 ECommons/Automation/WindowsKeypress.cs
+1 −1 ECommons/ChatMethods/ChatPrinter.cs
+22 −0 ECommons/DalamudServices/Legacy/LegacyHelpers.cs
+16 −0 ECommons/DalamudServices/Legacy/SignatureHelper.cs
+0 −160 ECommons/DalamudServices/ServicesInternal.cs
+32 −107 ECommons/DalamudServices/Svc.cs
+7 −3 ECommons/ECommons.csproj
+2 −3 ECommons/Events/ProperOnLogin.cs
+1 −0 ECommons/GameFunctions/ObjectFunctions.cs
+26 −7 ECommons/GenericHelpers.cs
+3 −3 ECommons/Hooks/ActionEffect.cs
+2 −2 ECommons/Hooks/DirectorUpdate.cs
+1 −1 ECommons/Hooks/MapEffect.cs
+1 −1 ECommons/Hooks/SendAction.cs
+22 −7 ECommons/ImGuiMethods/ImGuiEx.cs
+3 −2 ECommons/ImGuiMethods/ImageLoadingResult.cs
+25 −4 ECommons/ImGuiMethods/KoFiButton.cs
+1 −0 ECommons/ImGuiMethods/MiddleOverlayWindow.cs
+1 −0 ECommons/ImGuiMethods/PopupWindow.cs
+8 −6 ECommons/ImGuiMethods/ThreadLoadImageHandler.cs
+3 −2 ECommons/Loader/MicroServices.cs
+2 −1 ECommons/Loader/PluginLoader.cs
+6 −6 ECommons/Logging/DuoLog.cs
+6 −6 ECommons/Logging/PluginLog.cs
+1 −1 ECommons/ObjectLifeTracker/ObjectLife.cs
+3 −2 ECommons/PartyFunctions/UniversalParty.cs
+8 −15 ECommons/Reflection/DalamudReflector.cs
+11 −1 ECommons/Reflection/ReflectionHelper.cs
+112 −0 ECommons/UIHelpers/AtkReader.cs
+24 −0 ECommons/UIHelpers/Implementations/ReaderRetainerList.cs
+21 −0 ECommons/UIHelpers/Implementations/ReaderSelectString.cs
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"CategoryTags": [
"UI"
],
"DalamudApiLevel": 8,
"DalamudApiLevel": 9,
"LoadRequiredState": 0,
"LoadSync": false,
"CanUnloadAsync": false,
Expand Down

0 comments on commit 17f6605

Please sign in to comment.