2016-10-20 02:33:13 +08:00
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2016-10-22 07:42:09 +08:00
<!--######
## select target OS
#######-->
<PropertyGroup>
<!-- from override -->
<GamePlatform Condition="$(GamePlatform) != 'Linux' AND $(GamePlatform) != 'Mac' AND $(GamePlatform) != 'Windows'"></GamePlatform>
<GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_LINUX'))">Linux</GamePlatform>
<GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_MAC'))">Mac</GamePlatform>
<GamePlatform Condition="$(DefineConstants.Contains('GAME_PLATFORM_WINDOWS'))">Windows</GamePlatform>
<!-- from OS -->
<GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'Unix'">Linux</GamePlatform>
<GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'OSX'">Mac</GamePlatform>
<GamePlatform Condition="$(GamePlatform) == '' AND $(OS) == 'Windows_NT'">Windows</GamePlatform>
</PropertyGroup>
<!--######
## select game path
#######-->
2016-10-20 02:33:13 +08:00
<PropertyGroup>
2016-10-20 08:43:35 +08:00
<!-- injected by Silverplum -->
<GamePath Condition="!Exists('$(GamePath)')">$(STARDEWVALLEY_DIR)</GamePath>
<!-- Linux -->
2016-10-21 13:25:21 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
2016-10-20 10:53:49 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
2016-10-20 08:43:35 +08:00
<!-- Mac -->
2016-10-20 10:53:49 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
2016-10-20 08:43:35 +08:00
<!-- Windows -->
2016-12-07 04:04:50 +08:00
<GamePath Condition="!Exists('$(GamePath)' )">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
<GamePath Condition="!Exists('$(GamePath)') AND '$(GamePlatform)' == 'Windows'">$([" >$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1453375253}', 'PATH', null,RegistryView.Registry64, RegistryView.Registry32))</GamePath>
<GamePath Condition="!Exists('$(GamePath)' )">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
<GamePath Condition="!Exists('$(GamePath)') AND '$(GamePlatform)' == 'Windows'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null,RegistryView.Registry64, RegistryView.Registry32))</GamePath>
</PropertyGroup>
2016-10-20 02:33:13 +08:00
2016-10-22 07:42:09 +08:00
<!--######
## set up configuration
#######-->
2016-10-20 07:26:33 +08:00
<Choose>
2016-10-22 07:42:09 +08:00
<When Condition="$(GamePlatform) == 'Windows'">
2016-10-20 07:26:33 +08:00
<!-- references -->
<ItemGroup>
2016-10-24 22:51:54 +08:00
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>false</Private>
</Reference>
2016-10-20 07:26:33 +08:00
<Reference Include="Stardew Valley">
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
2016-10-20 07:26:33 +08:00
</Reference>
<Reference Include="StardewModdingAPI">
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
2016-10-20 07:26:33 +08:00
</Reference>
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
<HintPath>$(GamePath)\xTile.dll</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
<SpecificVersion>False</SpecificVersion>
2016-10-20 07:26:33 +08:00
</Reference>
</ItemGroup>
2016-10-20 02:33:13 +08:00
2016-10-20 07:26:33 +08:00
<!-- launch game for debugging -->
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>$(GamePath)\StardewModdingAPI.exe</StartProgram>
<StartWorkingDirectory>$(GamePath)</StartWorkingDirectory>
</PropertyGroup>
</When>
<Otherwise>
<!-- references -->
<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
<SpecificVersion>False</SpecificVersion>
2016-10-20 07:26:33 +08:00
</Reference>
<Reference Include="StardewValley">
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
2016-10-20 07:26:33 +08:00
</Reference>
<Reference Include="StardewModdingAPI">
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
2016-10-20 07:26:33 +08:00
</Reference>
<Reference Include="xTile">
<HintPath>$(GamePath)\xTile.dll</HintPath>
2016-10-24 22:51:54 +08:00
<Private>false</Private>
2016-10-20 07:26:33 +08:00
</Reference>
</ItemGroup>
</Otherwise>
</Choose>
2016-10-20 02:33:13 +08:00
2016-10-22 07:42:09 +08:00
<!--######
## validate
#######-->
2016-10-20 02:33:13 +08:00
<Target Name="BeforeBuild">
2016-10-22 07:42:09 +08:00
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
2016-10-20 08:16:06 +08:00
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a <GamePath> setting with the full directory path containing the Stardew Valley executable." />
2016-10-20 02:33:13 +08:00
</Target>
</Project>