Skip to content
Open
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
68 changes: 39 additions & 29 deletions FFXIVAPP.Client/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,6 @@ namespace FFXIVAPP.Client
{
public partial class App
{
#region Logger

private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private static List<DirectSoundDeviceInfo> _availableAudioDevices;
private static IEnumerable<NetworkInterface> _availableNetworkInterfaces;

#endregion

#region Property Bindings

internal static PluginHost Plugins
{
get { return PluginHost.Instance; }
}

internal static IEnumerable<DirectSoundDeviceInfo> AvailableAudioDevices
{
get { return _availableAudioDevices ?? (_availableAudioDevices = new List<DirectSoundDeviceInfo>(DirectSoundOut.Devices.Where(d => d.Guid != Guid.Empty))); }
}

internal static IEnumerable<NetworkInterface> AvailableNetworkInterfaces
{
get { return _availableNetworkInterfaces ?? (_availableNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces()); }
}

public static string[] MArgs { get; private set; }

#endregion

private App()
{
Startup += ApplicationStartup;
Expand Down Expand Up @@ -237,6 +208,16 @@ private static void SettingsPropertyChanged(object sender, PropertyChangedEventA
Initializer.StopNetworkWorker();
}
break;
case "EnableDirectXHook":
if (Settings.Default.EnableDirectXHook)
{
Initializer.HookDirectX();
}
else
{
Initializer.UnHookDirectX();
}
break;
case "EnableHelpLabels":
Constants.EnableHelpLabels = Settings.Default.EnableHelpLabels;
break;
Expand Down Expand Up @@ -283,5 +264,34 @@ private static void SettingsSettingChanging(object sender, SettingChangingEventA
{
Logging.Log(Logger, String.Format("SettingChanging : [{0},{1}]", e.SettingKey, e.NewValue));
}

#region Logger

private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private static List<DirectSoundDeviceInfo> _availableAudioDevices;
private static IEnumerable<NetworkInterface> _availableNetworkInterfaces;

#endregion

#region Property Bindings

internal static PluginHost Plugins
{
get { return PluginHost.Instance; }
}

internal static IEnumerable<DirectSoundDeviceInfo> AvailableAudioDevices
{
get { return _availableAudioDevices ?? (_availableAudioDevices = new List<DirectSoundDeviceInfo>(DirectSoundOut.Devices.Where(d => d.Guid != Guid.Empty))); }
}

internal static IEnumerable<NetworkInterface> AvailableNetworkInterfaces
{
get { return _availableNetworkInterfaces ?? (_availableNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces()); }
}

public static string[] MArgs { get; private set; }

#endregion
}
}
30 changes: 15 additions & 15 deletions FFXIVAPP.Client/AppBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ internal class AppBootstrapper : INotifyPropertyChanged

#endregion

#region Property Bindings

private static AppBootstrapper _instance;

public static AppBootstrapper Instance
{
get { return _instance ?? (_instance = new AppBootstrapper()); }
}

#endregion

#region Declarations

#endregion

/*main entry to app
* used for:
* initializing settings
Expand Down Expand Up @@ -203,6 +188,21 @@ private void ProcessDetachCheckTimerOnElapsed(object sender, ElapsedEventArgs el
}
}

#region Property Bindings

private static AppBootstrapper _instance;

public static AppBootstrapper Instance
{
get { return _instance ?? (_instance = new AppBootstrapper()); }
}

#endregion

#region Declarations

#endregion

#region Loading Functions

#endregion
Expand Down
7 changes: 7 additions & 0 deletions FFXIVAPP.Client/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@
using FFXIVAPP.Client.Models;
using FFXIVAPP.Common.Core.Constant;
using FFXIVAPP.Common.Helpers;
using FFXIVAPP.Hooker;

namespace FFXIVAPP.Client
{
public static partial class Constants
{
#region DirectX

public static HookProcess HookProcess { get; set; }

#endregion

#region Declarations

public static readonly string[] Supported =
Expand Down
12 changes: 9 additions & 3 deletions FFXIVAPP.Client/FFXIVAPP.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
Expand Down Expand Up @@ -137,6 +139,7 @@
<Compile Include="Helpers\AppContextHelper.cs" />
<Compile Include="Helpers\MessageBoxHelper.cs" />
<Compile Include="Helpers\SettingsHelper.Application.cs" />
<Compile Include="Interop\UnsafeNativeMethods.cs" />
<Compile Include="Localization\Chinese.cs" />
<Compile Include="Localization\English.cs" />
<Compile Include="Localization\French.cs" />
Expand Down Expand Up @@ -170,7 +173,6 @@
<Compile Include="Memory\MemoryHandler.cs" />
<Compile Include="Memory\SigScanner.cs" />
<Compile Include="Memory\Signature.cs" />
<Compile Include="Memory\UnsafeNativeMethods.cs" />
<Compile Include="Memory\ChatLogWorker.cs" />
<Compile Include="Models\PluginSourceItem.cs" />
<Compile Include="Models\PluginStatus.cs" />
Expand All @@ -190,7 +192,6 @@
<Compile Include="Network\Protocol.cs" />
<Compile Include="Network\TCPHeader.cs" />
<Compile Include="Network\UDPHeader.cs" />
<Compile Include="Network\UnsafeNativeMethods.cs" />
<Compile Include="PluginHost.cs" />
<Compile Include="Models\PluginInstance.cs" />
<Compile Include="PluginInitializer.cs" />
Expand Down Expand Up @@ -403,7 +404,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\ffxivapp-hooker\FFXIVAPP.Hooker\FFXIVAPP.Hooker.csproj">
<Project>{d425cf86-abeb-44fc-9413-318b4c1617b5}</Project>
<Name>FFXIVAPP.Hooker</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
90 changes: 45 additions & 45 deletions FFXIVAPP.Client/Helpers/AppContextHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,51 @@ public class AppContextHelper

#endregion

public void RaiseNewPlayerEntity(PlayerEntity playerEntity)
{
CurrentUserStats = playerEntity;
// THIRD PARTY
PluginHost.Instance.RaiseNewPlayerEntity(playerEntity);
}

public void RaiseNewTargetEntity(TargetEntity targetEntity)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewTargetEntity(targetEntity);
}

public void RaiseNewPartyAddedEntries(List<UInt32> keys)
{
if (!keys.Any())
{
return;
}
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyAddedEntries(keys);
}

public void RaiseNewPartyEntries(ConcurrentDictionary<UInt32, PartyEntity> partyEntries)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyEntries(partyEntries);
}

public void RaiseNewPartyRemovedEntries(List<UInt32> keys)
{
if (!keys.Any())
{
return;
}
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyRemovedEntries(keys);
}

public void RaiseNewInventoryEntries(List<InventoryEntity> inventoryEntities)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewInventoryEntries(inventoryEntities);
}

#region Property Backings

private static AppContextHelper _instance;
Expand Down Expand Up @@ -199,50 +244,5 @@ public void RaiseNewPCRemovedEntries(List<UInt32> keys)
}

#endregion

public void RaiseNewPlayerEntity(PlayerEntity playerEntity)
{
CurrentUserStats = playerEntity;
// THIRD PARTY
PluginHost.Instance.RaiseNewPlayerEntity(playerEntity);
}

public void RaiseNewTargetEntity(TargetEntity targetEntity)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewTargetEntity(targetEntity);
}

public void RaiseNewPartyAddedEntries(List<UInt32> keys)
{
if (!keys.Any())
{
return;
}
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyAddedEntries(keys);
}

public void RaiseNewPartyEntries(ConcurrentDictionary<UInt32, PartyEntity> partyEntries)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyEntries(partyEntries);
}

public void RaiseNewPartyRemovedEntries(List<UInt32> keys)
{
if (!keys.Any())
{
return;
}
// THIRD PARTY
PluginHost.Instance.RaiseNewPartyRemovedEntries(keys);
}

public void RaiseNewInventoryEntries(List<InventoryEntity> inventoryEntities)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewInventoryEntries(inventoryEntities);
}
}
}
Loading