Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: .NET Build

on:
push:
branches-ignore: main
tags-ignore: '*'
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Prepare Environment
uses: Aether-Tools/Deployment/.github/actions/prepare-environment@master
with:
project: CustomizePlus
- name: Build and Upload Artifact
uses: Aether-Tools/Deployment/.github/actions/build-with-artifact@master
with:
project: CustomizePlus
89 changes: 18 additions & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,81 +9,28 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v5
- name: Prepare Environment
uses: Aether-Tools/Deployment/.github/actions/prepare-environment@master
with:
dotnet-version: |
10.x.x
9.x.x
- name: Restore dependencies
run: dotnet restore
- name: Download Dalamud
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
- name: Build
run: |
$ver = '${{ github.ref_name }}'
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
- name: write version into jsons
run: |
$ver = '${{ github.ref_name }}'
$path = './CustomizePlus/bin/Release/CustomizePlus.json'
$json = Get-Content -Raw $path | ConvertFrom-Json
$json.AssemblyVersion = $ver
$content = $json | ConvertTo-Json
set-content -Path $path -Value $content
- name: Archive
run: Compress-Archive -Path CustomizePlus/bin/Release/* -DestinationPath CustomizePlus.zip
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
project: CustomizePlus
- name: Build and Upload Artifact
uses: Aether-Tools/Deployment/.github/actions/build-with-artifact@master
with:
path: |
./CustomizePlus/bin/Release/*
project: CustomizePlus
version: ${{ github.ref_name }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: Aether-Tools/Deployment/.github/actions/create-release@master
with:
tag_name: ${{ github.ref }}
release_name: CustomizePlus ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
project: CustomizePlus
version: ${{ github.ref_name }}
- name: Update repo.json
uses: Aether-Tools/Deployment/.github/actions/update-repo@master
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./CustomizePlus.zip
asset_name: CustomizePlus.zip
asset_content_type: application/zip

- name: Write out repo.json
run: |
$ver = '${{ github.ref_name }}'
$path = './repo.json'
$json = Get-Content -Raw $path | ConvertFrom-Json
$json[0].AssemblyVersion = $ver
$json[0].TestingAssemblyVersion = $ver
$json[0].DownloadLinkInstall = $json.DownloadLinkInstall -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
$json[0].DownloadLinkUpdate = $json.DownloadLinkUpdate -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
$content = $json | ConvertTo-Json -AsArray
set-content -Path $path -Value $content

- name: Commit repo.json
run: |
git config --global user.name "Actions User"
git config --global user.email "actions@github.com"
git fetch origin main
git branch -f main ${{ github.sha }}
git checkout main
git add repo.json
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
git push origin main
token: ${{ secrets.GITHUB_TOKEN }}
project: CustomizePlus
version: ${{ github.ref_name }}
branch: main
92 changes: 22 additions & 70 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Test Release
name: Create Release

on:
push:
Expand All @@ -9,79 +9,31 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v5
- name: Prepare Environment
uses: Aether-Tools/Deployment/.github/actions/prepare-environment@master
with:
dotnet-version: |
10.x.x
9.x.x
- name: Restore dependencies
run: dotnet restore
- name: Download Dalamud
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
- name: Build
run: |
$ver = '${{ github.ref_name }}' -replace 'testing_'
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
- name: write version into json
run: |
$ver = '${{ github.ref_name }}' -replace 'testing_'
$path = './CustomizePlus/bin/Release/CustomizePlus.json'
$json = Get-Content -Raw $path | ConvertFrom-Json
$json.AssemblyVersion = $ver
$content = $json | ConvertTo-Json
set-content -Path $path -Value $content
- name: Archive
run: Compress-Archive -Path CustomizePlus/bin/Release/* -DestinationPath CustomizePlus.zip
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
dalamud-distrib: stg/
project: CustomizePlus
- name: Build and Upload Artifact
uses: Aether-Tools/Deployment/.github/actions/build-with-artifact@master
with:
path: |
./CustomizePlus/bin/Release/*
configuration: Debug
project: CustomizePlus
version: ${{ github.ref_name }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: Aether-Tools/Deployment/.github/actions/create-release@master
with:
tag_name: ${{ github.ref }}
release_name: CustomizePlus ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
project: CustomizePlus
version: ${{ github.ref_name }}
- name: Update repo.json
uses: Aether-Tools/Deployment/.github/actions/update-repo@master
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./CustomizePlus.zip
asset_name: CustomizePlus.zip
asset_content_type: application/zip

- name: Write out repo.json
run: |
$verT = '${{ github.ref_name }}'
$ver = $verT -replace 'testing_'
$path = './repo.json'
$json = Get-Content -Raw $path | ConvertFrom-Json
$json[0].TestingAssemblyVersion = $ver
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/CustomizePlus.zip',"$verT/CustomizePlus.zip"
$content = $json | ConvertTo-Json -AsArray
set-content -Path $path -Value $content

- name: Commit repo.json
run: |
git config --global user.name "Actions User"
git config --global user.email "actions@github.com"
git fetch origin main
git branch -f main ${{ github.sha }}
git checkout main
git add repo.json
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
git push origin main
token: ${{ secrets.GITHUB_TOKEN }}
project: CustomizePlus
version: ${{ github.ref_name }}
branch: main
testing: true
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "submodules/OtterGui"]
path = submodules/OtterGui
url = https://github.com/Ottermandias/OtterGui.git
branch = main
[submodule "submodules/Penumbra.GameData"]
path = submodules/Penumbra.GameData
url = https://github.com/Ottermandias/Penumbra.GameData
Expand All @@ -17,4 +13,8 @@
[submodule "submodules/ECommonsLite"]
path = submodules/ECommonsLite
url = https://github.com/Aether-Tools/ECommonsLite.git
branch = api15
[submodule "submodules/Luna"]
path = submodules/Luna
url = https://github.com/Ottermandias/Luna.git
branch = main
3 changes: 2 additions & 1 deletion CustomizePlus.GameData/CustomizePlus.GameData.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Dalamud.NET.Sdk/14.0.2">
<Project Sdk="Dalamud.NET.Sdk/15.0.0">

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\submodules\Luna\Luna\Luna.csproj" />
<ProjectReference Include="..\submodules\Penumbra.GameData\Penumbra.GameData.csproj" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions CustomizePlus.GameData/Data/ReverseNameDicts.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CustomizePlus.GameData.ReverseSearchDictionaries;
using Dalamud.Game.ClientState.Objects.Enums;
using OtterGui.Services;
using Luna;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;

Expand Down Expand Up @@ -52,7 +52,7 @@ public bool TryGetID(ObjectKind kind, string name, [NotNullWhen(true)] out uint
npcId = default;
return kind switch
{
ObjectKind.MountType => Mounts.TryGetValue(name, out npcId),
ObjectKind.Mount => Mounts.TryGetValue(name, out npcId),
ObjectKind.Companion => Companions.TryGetValue(name, out npcId),
ObjectKind.BattleNpc => BNpcs.TryGetValue(name, out npcId),
ObjectKind.EventNpc => ENpcs.TryGetValue(name, out npcId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
return identifier.Incognito(null);
#endif
}
catch (Exception e)

Check warning on line 82 in CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used

Check warning on line 82 in CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used

Check warning on line 82 in CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used
{
#if DEBUG
throw;
Expand All @@ -101,7 +101,7 @@
_ => " (Retainer)",
}}",
IdentifierType.Owned => $" ({identifier.Kind switch {
ObjectKind.MountType => "Mount",
ObjectKind.Mount => "Mount",
ObjectKind.Companion => "Companion",
ObjectKind.Ornament => "Accessory",
_ => $"Owned {identifier.Kind}",
Expand Down Expand Up @@ -130,7 +130,7 @@
case IdentifierType.Owned:
return
identifier.Kind == ObjectKind.BattleNpc ||
//identifier.Kind == ObjectKind.MountType ||
//identifier.Kind == ObjectKind.Mount ||
identifier.Kind == ObjectKind.Companion ||
identifier.Kind == ObjectKind.Ornament;
default:
Expand Down
1 change: 1 addition & 0 deletions CustomizePlus.GameData/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Logger = Luna.MainLogger;
35 changes: 18 additions & 17 deletions CustomizePlus.GameData/Hooks/Objects/CharacterDestructor.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
using Dalamud.Hooking;
using Dalamud.Hooking;
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using OtterGui.Classes;
using OtterGui.Services;
using Luna;
using Penumbra.GameData;
using Penumbra.GameData.Interop;

namespace CustomizePlus.GameData.Hooks.Objects;
public sealed unsafe class CharacterDestructor : EventWrapperPtr<Character, CharacterDestructor.Priority>, IHookService

public sealed unsafe class CharacterDestructor : EventBase<CharacterDestructor.Arguments, CharacterDestructor.Priority>, IHookService
{
public enum Priority
{
/// <seealso cref="PathResolving.CutsceneService"/>
CutsceneService = 0,

/// <seealso cref="PathResolving.IdentifiedCollectionCache"/>
IdentifiedCollectionCache = 0,
}

public CharacterDestructor(HookManager hooks)
: base("Character Destructor")
public CharacterDestructor(LunaLogger log, HookManager hooks)
: base("Character Destructor", log)
=> _task = hooks.CreateHook<Delegate>(Name, Sigs.CharacterDestructor, Detour, true);

private readonly Task<Hook<Delegate>> _task;
private readonly Task<Hook<Delegate>?> _task;

public nint Address
=> _task.Result.Address;
=> _task.Result?.Address ?? nint.Zero;

public void Enable()
=> _task.Result.Enable();
=> _task.Result?.Enable();

public void Disable()
=> _task.Result.Disable();
=> _task.Result?.Disable();

public Task Awaiter
=> _task;
Expand All @@ -41,8 +38,12 @@ public bool Finished

private void Detour(Character* character)
{
//Penumbra.Log.Verbose($"[{Name}] Triggered with 0x{(nint)character:X}.");
Invoke(character);
_task.Result.Original(character);
MainLogger.GlobalPluginLogger.Verbose($"[{Name}] Triggered with 0x{(nint)character:X}.");
Invoke(new Arguments(character));
_task.Result!.Original(character);
}

/// <summary> The arguments for a character destructor event. </summary>
/// <param name="Character"> The game object that is being destroyed. </param>
public readonly record struct Arguments(Actor Character);
}
Loading
Loading