Create a interface for a basic API to use the ActorRefresh and register actions to clicks on changed items (for now).

This commit is contained in:
Ottermandias 2021-07-26 15:56:09 +02:00
parent 6c26943cb7
commit 2b46397e8e
12 changed files with 225 additions and 43 deletions

View file

@ -0,0 +1,32 @@
using System;
using Dalamud.Game.ClientState.Actors.Types;
namespace Penumbra.Api
{
public interface IPenumbraApiBase
{
public int ApiVersion { get; }
public bool Valid { get; }
}
public enum MouseButton
{
None,
Left,
Right,
Middle,
}
public delegate void ChangedItemHover( object? item );
public delegate void ChangedItemClick( MouseButton button, object? item );
public interface IPenumbraApi : IPenumbraApiBase
{
public event ChangedItemHover? ChangedItemTooltip;
public event ChangedItemClick? ChangedItemClicked;
public void RedrawActor( string name, RedrawType setting );
public void RedrawActor( Actor actor, RedrawType setting );
public void RedrawAll( RedrawType setting );
}
}

View file

@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>preview</LangVersion>
<AssemblyTitle>Penumbra.Api</AssemblyTitle>
<Company>absolute gangstas</Company>
<Product>Penumbra</Product>
<Copyright>Copyright © 2020</Copyright>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup>
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB3277</MSBuildWarningsAsMessages>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dalamud">
<HintPath>$(DALAMUD_ROOT)\Dalamud.dll</HintPath>
<HintPath>..\libs\Dalamud.dll</HintPath>
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,12 @@
namespace Penumbra.Api
{
public enum RedrawType
{
WithoutSettings,
WithSettings,
OnlyWithSettings,
Unload,
RedrawWithoutSettings,
RedrawWithSettings,
}
}