<?xml version="1.0" encoding="utf-8"?>
<Project>
  <!-- Common properties shared by all DSP mod projects -->
  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <LangVersion>latest</LangVersion>
    <Nullable>disable</Nullable>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <!-- CS0618: expected from the legacy Util forwarding facade; suppress so new warnings fail the build. -->
    <NoWarn>0618</NoWarn>
    <AnalysisLevel>none</AnalysisLevel>
    <EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
    <RestoreAdditionalProjectSources>https://nuget.bepinex.dev/v3/index.json</RestoreAdditionalProjectSources>
    <!-- Set to true in projects that include a CHANGELOG.md in the package -->
    <PackHasChangelog>false</PackHasChangelog>
    <!-- Set to true in projects that use the plugins/patchers layout (Dustbin, LabOpt) -->
    <PackUsePluginsLayout>false</PackUsePluginsLayout>
  </PropertyGroup>

  <!-- Common NuGet packages for all mods -->
  <ItemGroup>
    <PackageReference Include="BepInEx.Core" Version="5.*" />
    <PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
    <PackageReference Include="UnityEngine.Modules" Version="2022.3.62" IncludeAssets="compile" />
  </ItemGroup>

  <!-- Game DLL references (local copies in AssemblyFromGame/) -->
  <ItemGroup>
    <Reference Include="Assembly-CSharp">
      <HintPath>$(MSBuildThisFileDirectory)AssemblyFromGame\Assembly-CSharp.dll</HintPath>
    </Reference>
    <Reference Include="UnityEngine.UI">
      <HintPath>$(MSBuildThisFileDirectory)AssemblyFromGame\UnityEngine.UI.dll</HintPath>
    </Reference>
  </ItemGroup>

  <!-- .NET Framework reference assemblies (only needed when targeting net*) -->
  <ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
  </ItemGroup>

  <!-- All projects depend on UpdateGameDlls helper to ensure game DLLs are
       refreshed before any project resolves assembly references. -->
  <ItemGroup>
    <ProjectReference Include="$(MSBuildThisFileDirectory)UpdateGameDlls\UpdateGameDlls.csproj"
                      ReferenceOutputAssembly="false"
                      SkipGetTargetFrameworkProperties="true"
                      Private="false" />
  </ItemGroup>
</Project>
