Skip to content

Commit 6f1fd30

Browse files
committed
Build without forms by default
1 parent 7235c0e commit 6f1fd30

File tree

4 files changed

+114
-103
lines changed

4 files changed

+114
-103
lines changed

ECommons/Automation/WindowsKeypress.Forms.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if (DEBUG || RELEASE)
1+
#if (DEBUGFORMS || RELEASEFORMS)
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;

ECommons/ECommons.csproj

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3-
<PropertyGroup>
4-
<Authors>NightmareXIV</Authors>
5-
<Version>2.2.0.0</Version>
6-
<Configurations>Debug;Release;DebugNoForms;ReleaseNoForms</Configurations>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<Authors>NightmareXIV</Authors>
5+
<Version>2.2.0.1</Version>
6+
<Configurations>Debug;Release;DebugForms;ReleaseForms</Configurations>
7+
</PropertyGroup>
88

9-
<PropertyGroup>
10-
<TargetFramework>net8.0-windows</TargetFramework>
11-
<Platforms>x64</Platforms>
12-
<LangVersion>preview</LangVersion>
13-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
14-
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
15-
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
16-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
17-
<OutputPath>bin\$(Configuration)\</OutputPath>
18-
<NoWarn>CS1591;CA1401;CS0649;CS8632;CS0414;CS0169</NoWarn>
19-
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
20-
<Optimize>True</Optimize>
21-
<IsTrimmable>false</IsTrimmable>
22-
<Nullable>enable</Nullable>
23-
</PropertyGroup>
9+
<PropertyGroup>
10+
<TargetFramework>net8.0-windows</TargetFramework>
11+
<Platforms>x64</Platforms>
12+
<LangVersion>preview</LangVersion>
13+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
14+
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
15+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
16+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
17+
<OutputPath>bin\$(Configuration)\</OutputPath>
18+
<NoWarn>CS1591;CA1401;CS0649;CS8632;CS0414;CS0169</NoWarn>
19+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
20+
<Optimize>True</Optimize>
21+
<IsTrimmable>false</IsTrimmable>
22+
<Nullable>enable</Nullable>
23+
</PropertyGroup>
2424

25-
<PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Release'">
25+
<PropertyGroup Condition="'$(Configuration)' == 'DebugForms' or '$(Configuration)' == 'ReleaseForms'">
2626
<UseWindowsForms>true</UseWindowsForms>
2727
<EnableWindowsTargeting>true</EnableWindowsTargeting>
2828
</PropertyGroup>
2929

30-
<PropertyGroup Label="Documentation">
31-
<DocumentationFile></DocumentationFile>
32-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
33-
</PropertyGroup>
34-
35-
<PropertyGroup>
36-
<DalamudLibPath>$(appdata)\xivlauncher\Addon\Hooks\dev\</DalamudLibPath>
37-
</PropertyGroup>
38-
39-
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
40-
<DalamudLibPath>$(DALAMUD_HOME)/</DalamudLibPath>
41-
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
42-
</PropertyGroup>
30+
<PropertyGroup Label="Documentation">
31+
<DocumentationFile></DocumentationFile>
32+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
33+
</PropertyGroup>
34+
35+
<PropertyGroup>
36+
<DalamudLibPath>$(appdata)\xivlauncher\Addon\Hooks\dev\</DalamudLibPath>
37+
</PropertyGroup>
38+
39+
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
40+
<DalamudLibPath>$(DALAMUD_HOME)/</DalamudLibPath>
41+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
42+
</PropertyGroup>
4343

44-
<PropertyGroup>
45-
<LangVersion>preview</LangVersion>
46-
</PropertyGroup>
44+
<PropertyGroup>
45+
<LangVersion>preview</LangVersion>
46+
</PropertyGroup>
4747

48-
<ItemGroup>
49-
<None Include="..\..\.editorconfig" Link=".editorconfig" />
50-
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="..\..\.editorconfig" Link=".editorconfig" />
50+
</ItemGroup>
5151

52-
<ItemGroup>
53-
<Reference Include="Newtonsoft.Json">
54-
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
55-
<Private>False</Private>
56-
</Reference>
57-
<Reference Include="Dalamud">
58-
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
59-
<Private>False</Private>
60-
</Reference>
61-
<Reference Include="Dalamud.Common">
62-
<HintPath>$(DalamudLibPath)Dalamud.Common.dll</HintPath>
63-
<Private>False</Private>
64-
</Reference>
65-
<Reference Include="ImGui.NET">
66-
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
67-
<Private>False</Private>
68-
</Reference>
69-
<Reference Include="ImGuiScene">
70-
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
71-
<Private>False</Private>
72-
</Reference>
73-
<Reference Include="Lumina">
74-
<HintPath>$(DalamudLibPath)Lumina.dll</HintPath>
75-
<Private>False</Private>
76-
</Reference>
77-
<Reference Include="Lumina.Excel">
78-
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
79-
<Private>False</Private>
80-
</Reference>
81-
<Reference Include="FFXIVClientStructs">
82-
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
83-
<Private>False</Private>
84-
</Reference>
85-
<Reference Include="PInvoke.User32">
86-
<HintPath>$(DalamudLibPath)PInvoke.User32.dll</HintPath>
87-
<Private>False</Private>
88-
</Reference>
89-
<Reference Include="PInvoke.Windows.Core">
90-
<HintPath>$(DalamudLibPath)PInvoke.Windows.Core.dll</HintPath>
91-
<Private>False</Private>
92-
</Reference>
93-
<Reference Include="SharpDX.Mathematics">
94-
<HintPath>$(DalamudLibPath)SharpDX.Mathematics.dll</HintPath>
95-
<Private>False</Private>
96-
</Reference>
97-
<Reference Include="Reloaded.Hooks.Definitions">
98-
<HintPath>$(DalamudLibPath)Reloaded.Hooks.Definitions.dll</HintPath>
99-
<Private>False</Private>
100-
</Reference>
101-
<Reference Include="Serilog">
102-
<HintPath>$(DalamudLibPath)Serilog.dll</HintPath>
103-
<Private>False</Private>
104-
</Reference>
105-
</ItemGroup>
52+
<ItemGroup>
53+
<Reference Include="Newtonsoft.Json">
54+
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
55+
<Private>False</Private>
56+
</Reference>
57+
<Reference Include="Dalamud">
58+
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
59+
<Private>False</Private>
60+
</Reference>
61+
<Reference Include="Dalamud.Common">
62+
<HintPath>$(DalamudLibPath)Dalamud.Common.dll</HintPath>
63+
<Private>False</Private>
64+
</Reference>
65+
<Reference Include="ImGui.NET">
66+
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
67+
<Private>False</Private>
68+
</Reference>
69+
<Reference Include="ImGuiScene">
70+
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
71+
<Private>False</Private>
72+
</Reference>
73+
<Reference Include="Lumina">
74+
<HintPath>$(DalamudLibPath)Lumina.dll</HintPath>
75+
<Private>False</Private>
76+
</Reference>
77+
<Reference Include="Lumina.Excel">
78+
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
79+
<Private>False</Private>
80+
</Reference>
81+
<Reference Include="FFXIVClientStructs">
82+
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
83+
<Private>False</Private>
84+
</Reference>
85+
<Reference Include="PInvoke.User32">
86+
<HintPath>$(DalamudLibPath)PInvoke.User32.dll</HintPath>
87+
<Private>False</Private>
88+
</Reference>
89+
<Reference Include="PInvoke.Windows.Core">
90+
<HintPath>$(DalamudLibPath)PInvoke.Windows.Core.dll</HintPath>
91+
<Private>False</Private>
92+
</Reference>
93+
<Reference Include="SharpDX.Mathematics">
94+
<HintPath>$(DalamudLibPath)SharpDX.Mathematics.dll</HintPath>
95+
<Private>False</Private>
96+
</Reference>
97+
<Reference Include="Reloaded.Hooks.Definitions">
98+
<HintPath>$(DalamudLibPath)Reloaded.Hooks.Definitions.dll</HintPath>
99+
<Private>False</Private>
100+
</Reference>
101+
<Reference Include="Serilog">
102+
<HintPath>$(DalamudLibPath)Serilog.dll</HintPath>
103+
<Private>False</Private>
104+
</Reference>
105+
</ItemGroup>
106106
</Project>

ECommons/ECommonsMain.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@ public static void Init(DalamudPluginInterface pluginInterface, IDalamudPlugin i
3333
{
3434
Instance = instance;
3535
GenericHelpers.Safe(() => Svc.Init(pluginInterface));
36-
PluginLog.Information($"This is ECommons v{typeof(ECommonsMain).Assembly.GetName().Version} and {Svc.PluginInterface.InternalName} v{instance.GetType().Assembly.GetName().Version}. Hello!");
36+
#if DEBUG
37+
var type = "debug build without forms";
38+
#elif RELEASE
39+
var type = "release build without forms";
40+
#elif DEBUGFORMS
41+
var type = "debug build with forms";
42+
#elif RELEASEFORMS
43+
var type = "release build with forms";
44+
#else
45+
var type = "unknown build";
46+
#endif
47+
PluginLog.Information($"This is ECommons v{typeof(ECommonsMain).Assembly.GetName().Version} ({type}) and {Svc.PluginInterface.InternalName} v{instance.GetType().Assembly.GetName().Version}. Hello!");
3748
Svc.Log.MinimumLogLevel = LogEventLevel.Verbose;
3849
GenericHelpers.Safe(CmdManager.Init);
3950
if (modules.ContainsAny(Module.All, Module.ObjectFunctions))

ECommons/GenericHelpers.Forms.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Linq;
99
using System.Text;
1010
using System.Threading.Tasks;
11-
#if (DEBUG || RELEASE)
11+
#if (DEBUGFORMS || RELEASEFORMS)
1212
using System.Windows.Forms;
1313
#endif
1414

@@ -21,7 +21,7 @@ public static partial class GenericHelpers
2121
/// <param name="text">Text to copy</param>
2222
/// <param name="silent">Whether to display success/failure popup</param>
2323
/// <returns>Whether operation succeeded</returns>
24-
#if !(DEBUG || RELEASE)
24+
#if !(DEBUGFORMS || RELEASEFORMS)
2525
[Obsolete("You have selected not to use Windows Forms; copying will be done via ImGui. This has been known to cause serious issues in past. If you are working with clipboard a lot, consider enabling Windows Forms.")]
2626
#endif
2727
public static bool Copy(string text, bool silent = false)
@@ -30,7 +30,7 @@ public static bool Copy(string text, bool silent = false)
3030
{
3131
if (text.IsNullOrEmpty())
3232
{
33-
#if (DEBUG || RELEASE)
33+
#if (DEBUGFORMS || RELEASEFORMS)
3434
Clipboard.Clear();
3535
#else
3636
ImGui.SetClipboardText("");
@@ -39,7 +39,7 @@ public static bool Copy(string text, bool silent = false)
3939
}
4040
else
4141
{
42-
#if (DEBUG || RELEASE)
42+
#if (DEBUGFORMS || RELEASEFORMS)
4343
Clipboard.SetText(text);
4444
#else
4545
ImGui.SetClipboardText(text);
@@ -65,14 +65,14 @@ public static bool Copy(string text, bool silent = false)
6565
/// </summary>
6666
/// <param name="silent">Whether to display popup when error occurs.</param>
6767
/// <returns>Contents of the clipboard; null if clipboard couldn't be read.</returns>
68-
#if !(DEBUG || RELEASE)
68+
#if !(DEBUGFORMS || RELEASEFORMS)
6969
[Obsolete("You have selected not to use Windows Forms; pasting will be done via ImGui. This has been known to cause serious issues in past. If you are working with clipboard a lot, consider enabling Windows Forms.")]
7070
#endif
7171
public static string? Paste(bool silent = false)
7272
{
7373
try
7474
{
75-
#if (DEBUG || RELEASE)
75+
#if (DEBUGFORMS || RELEASEFORMS)
7676
return Clipboard.GetText();
7777
#else
7878
return ImGui.GetClipboardText();
@@ -90,7 +90,7 @@ public static bool Copy(string text, bool silent = false)
9090
}
9191
}
9292

93-
#if (DEBUG || RELEASE)
93+
#if (DEBUGFORMS || RELEASEFORMS)
9494

9595
/// <summary>
9696
/// Checks if a key is pressed via winapi.

0 commit comments

Comments
 (0)