summaryrefslogtreecommitdiff
path: root/StardewModdingAPI
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI')
-rw-r--r--StardewModdingAPI/Inheritance/SGame.cs13
-rw-r--r--StardewModdingAPI/StardewModdingAPI.csproj37
2 files changed, 40 insertions, 10 deletions
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs
index 36f905f7..69439209 100644
--- a/StardewModdingAPI/Inheritance/SGame.cs
+++ b/StardewModdingAPI/Inheritance/SGame.cs
@@ -66,8 +66,15 @@ namespace StardewModdingAPI.Inheritance
public Farmer PreviousFarmer { get; private set; }
+ private static SGame instance;
+ public static SGame Instance { get { return instance; } }
+
+ public Farmer CurrentFarmer { get { return player; } }
+
public SGame()
{
+ instance = this;
+
if (Program.debug)
{
SaveGame.serializer = new XmlSerializer(typeof (SaveGame), new Type[28]
@@ -195,11 +202,7 @@ namespace StardewModdingAPI.Inheritance
public static SGameLocation GetLocationFromName(String name)
{
- if (ModLocations.Any(x => x.name == name))
- {
- return ModLocations[ModLocations.IndexOf(ModLocations.First(x => x.name == name))];
- }
- return null;
+ return ModLocations.FirstOrDefault(n => n.name == name);
}
public static SGameLocation LoadOrCreateSGameLocationFromName(String name)
diff --git a/StardewModdingAPI/StardewModdingAPI.csproj b/StardewModdingAPI/StardewModdingAPI.csproj
index a223f6c2..d6a3d01c 100644
--- a/StardewModdingAPI/StardewModdingAPI.csproj
+++ b/StardewModdingAPI/StardewModdingAPI.csproj
@@ -19,9 +19,24 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
+ <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@@ -57,9 +72,9 @@
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Stardew Valley, Version=1.0.5900.38427, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
- <HintPath>D:\Games\steamapps\common\Stardew Valley\Stardew Valley.exe</HintPath>
+ <HintPath>..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
- <Private>False</Private>
+ <Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -72,8 +87,8 @@
<Reference Include="System.Xml" />
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
- <HintPath>D:\Games\steamapps\common\Stardew Valley\xTile.dll</HintPath>
- <Private>False</Private>
+ <HintPath>..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\xTile.dll</HintPath>
+ <Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -108,6 +123,18 @@
<Content Include="icon.ico" />
<Content Include="steam_appid.txt" />
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.5">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>