update for Stardew Valley 1.9 (#231)

This commit is contained in:
Jesse Plamondon-Willard 2017-02-22 19:48:25 -05:00
parent b30d93d0ff
commit 96c7010c1b
4 changed files with 33 additions and 13 deletions

View File

@ -33,7 +33,7 @@ namespace StardewModdingAPI
public static ISemanticVersion ApiVersion => new SemanticVersion(1, 8, 0, null); public static ISemanticVersion ApiVersion => new SemanticVersion(1, 8, 0, null);
/// <summary>The minimum supported version of Stardew Valley.</summary> /// <summary>The minimum supported version of Stardew Valley.</summary>
public const string MinimumGameVersion = "1.2"; public const string MinimumGameVersion = "1.2.9";
/// <summary>The directory path containing Stardew Valley's app data.</summary> /// <summary>The directory path containing Stardew Valley's app data.</summary>
public static string DataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley"); public static string DataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley");

View File

@ -923,7 +923,7 @@ namespace StardewModdingAPI.Framework
{ {
SpriteBatch spriteBatch = Game1.spriteBatch; SpriteBatch spriteBatch = Game1.spriteBatch;
SpriteFont smallFont = Game1.smallFont; SpriteFont smallFont = Game1.smallFont;
object[] objArray = new object[8]; object[] objArray = new object[10];
int index1 = 0; int index1 = 0;
string str1; string str1;
if (!Game1.panMode) if (!Game1.panMode)
@ -938,20 +938,26 @@ namespace StardewModdingAPI.Framework
float cursorTransparency = Game1.mouseCursorTransparency; float cursorTransparency = Game1.mouseCursorTransparency;
objArray[index3] = (object)cursorTransparency; objArray[index3] = (object)cursorTransparency;
int index4 = 3; int index4 = 3;
string str3 = " wasMouseVisibleThisFrame: "; string str3 = " mousePosition: ";
objArray[index4] = (object)str3; objArray[index4] = (object)str3;
int index5 = 4; int index5 = 4;
string str4 = Game1.wasMouseVisibleThisFrame.ToString(); int mouseX = Game1.getMouseX();
objArray[index5] = (object)str4; objArray[index5] = (object)mouseX;
int index6 = 5; int index6 = 5;
string newLine = Environment.NewLine; string str4 = ",";
objArray[index6] = (object)newLine; objArray[index6] = (object)str4;
int index7 = 6; int index7 = 6;
string str5 = "debugOutput: "; int mouseY = Game1.getMouseY();
objArray[index7] = (object)str5; objArray[index7] = (object)mouseY;
int index8 = 7; int index8 = 7;
string newLine = Environment.NewLine;
objArray[index8] = (object)newLine;
int index9 = 8;
string str5 = "debugOutput: ";
objArray[index9] = (object)str5;
int index10 = 9;
string debugOutput = Game1.debugOutput; string debugOutput = Game1.debugOutput;
objArray[index8] = (object)debugOutput; objArray[index10] = (object)debugOutput;
string text = string.Concat(objArray); string text = string.Concat(objArray);
Vector2 position = new Vector2((float)this.GraphicsDevice.Viewport.TitleSafeArea.X, (float)this.GraphicsDevice.Viewport.TitleSafeArea.Y); Vector2 position = new Vector2((float)this.GraphicsDevice.Viewport.TitleSafeArea.X, (float)this.GraphicsDevice.Viewport.TitleSafeArea.Y);
Color red = Color.Red; Color red = Color.Red;

View File

@ -97,6 +97,7 @@ namespace StardewModdingAPI
// initialise logging // initialise logging
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); // for consistent log formatting Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); // for consistent log formatting
this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Game1.version} on {Environment.OSVersion}", LogLevel.Info); this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Game1.version} on {Environment.OSVersion}", LogLevel.Info);
Console.Title = $"SMAPI {Constants.ApiVersion} - running Stardew Valley {Game1.version}";
// read settings // read settings
{ {
@ -252,11 +253,10 @@ namespace StardewModdingAPI
this.GameInstance = new SGame(this.Monitor); this.GameInstance = new SGame(this.Monitor);
this.GameInstance.Exiting += (sender, e) => this.IsGameRunning = false; this.GameInstance.Exiting += (sender, e) => this.IsGameRunning = false;
this.GameInstance.Window.ClientSizeChanged += (sender, e) => GraphicsEvents.InvokeResize(this.Monitor, sender, e); this.GameInstance.Window.ClientSizeChanged += (sender, e) => GraphicsEvents.InvokeResize(this.Monitor, sender, e);
this.GameInstance.Window.Title = $"Stardew Valley - Version {Game1.version}"; this.GameInstance.Window.Title = $"Stardew Valley {Game1.version}";
gameProgramType.GetField("gamePtr").SetValue(gameProgramType, this.GameInstance); gameProgramType.GetField("gamePtr").SetValue(gameProgramType, this.GameInstance);
// configure // configure
Game1.version += $" | SMAPI {Constants.ApiVersion}";
Game1.graphics.GraphicsProfile = GraphicsProfile.HiDef; Game1.graphics.GraphicsProfile = GraphicsProfile.HiDef;
} }
@ -565,7 +565,7 @@ namespace StardewModdingAPI
// print result // print result
this.Monitor.Log($"Loaded {modsLoaded} mods."); this.Monitor.Log($"Loaded {modsLoaded} mods.");
Console.Title = $"Stardew Modding API Console - Version {Constants.ApiVersion} - Mods Loaded: {modsLoaded}"; Console.Title = $"SMAPI {Constants.ApiVersion} - running Stardew Valley {Game1.version} with {modsLoaded} mods";
} }
// ReSharper disable once FunctionNeverReturns // ReSharper disable once FunctionNeverReturns

View File

@ -65,6 +65,13 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file.
"UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/518", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/518",
"Notes": "Crashes with 'Method not found: Void StardewValley.Menus.TextBox.set_Highlighted(Boolean)'." "Notes": "Crashes with 'Method not found: Void StardewValley.Menus.TextBox.set_Highlighted(Boolean)'."
}, },
{
"Name": "Chests Anywhere",
"ID": "Pathoschild.ChestsAnywhere",
"UpperVersion": "1.9-beta",
"UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/518",
"Notes": "ID changed in 1.9. Crashes with InvalidOperationException: 'The menu doesn't seem to have a player inventory'."
},
{ {
"Name": "CJB Automation", "Name": "CJB Automation",
"ID": "CJBAutomation", "ID": "CJBAutomation",
@ -184,6 +191,13 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file.
"UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/683", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/683",
"Notes": "Crashes with 'Method not found: Void StardewModdingAPI.Command.CallCommand(System.String)'." "Notes": "Crashes with 'Method not found: Void StardewModdingAPI.Command.CallCommand(System.String)'."
}, },
{
"Name": "Teleporter",
"ID": "Teleporter",
"UpperVersion": "1.0.2",
"UpdateUrl": "http://community.playstarbound.com/resources/4374",
"Notes": "Crashes with 'InvalidOperationException: The StardewValley.Menus.MapPage object doesn't have a private 'points' instance field'."
},
{ {
"Name": "Zoryn's Better RNG", "Name": "Zoryn's Better RNG",
"ID": "76b6d1e1-f7ba-4d72-8c32-5a1e6d2716f6", "ID": "76b6d1e1-f7ba-4d72-8c32-5a1e6d2716f6",