diff options
-rw-r--r-- | Release/Mods/TrainerMod.dll | bin | 23040 -> 23552 bytes | |||
-rw-r--r-- | Release/StardewModdingAPI.exe | bin | 64512 -> 66560 bytes | |||
-rw-r--r-- | StardewModdingAPI/Command.cs | 2 | ||||
-rw-r--r-- | StardewModdingAPI/Inheritance/SGame.cs | 8 | ||||
-rw-r--r-- | StardewModdingAPI/Inheritance/SObject.cs | 18 | ||||
-rw-r--r-- | StardewModdingAPI/Program.cs | 7 | ||||
-rw-r--r-- | TrainerMod/TrainerMod.cs | 1 | ||||
-rw-r--r-- | TrainerMod/bin/Debug/TrainerMod.dll | bin | 23040 -> 23552 bytes | |||
-rw-r--r-- | TrainerMod/obj/Debug/TrainerMod.dll | bin | 23040 -> 23552 bytes |
9 files changed, 28 insertions, 8 deletions
diff --git a/Release/Mods/TrainerMod.dll b/Release/Mods/TrainerMod.dll Binary files differindex 2ca9ad54..9fc10782 100644 --- a/Release/Mods/TrainerMod.dll +++ b/Release/Mods/TrainerMod.dll diff --git a/Release/StardewModdingAPI.exe b/Release/StardewModdingAPI.exe Binary files differindex f47bb06e..aa593708 100644 --- a/Release/StardewModdingAPI.exe +++ b/Release/StardewModdingAPI.exe diff --git a/StardewModdingAPI/Command.cs b/StardewModdingAPI/Command.cs index 1659b1e9..c65e8122 100644 --- a/StardewModdingAPI/Command.cs +++ b/StardewModdingAPI/Command.cs @@ -30,7 +30,7 @@ namespace StardewModdingAPI { args = input.Split(new[] {" "}, 2, StringSplitOptions.RemoveEmptyEntries); fnd = FindCommand(args[0]); - args = args[1].Split(new[] { " " }, 2, StringSplitOptions.RemoveEmptyEntries); + args = args[1].Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries); } else { diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs index 27eb3c4b..99db73d9 100644 --- a/StardewModdingAPI/Inheritance/SGame.cs +++ b/StardewModdingAPI/Inheritance/SGame.cs @@ -49,6 +49,14 @@ namespace StardewModdingAPI.Inheritance public Farmer PreviousFarmer { get; private set; } + public SGame() + { + if (Program.debug) + { + //SaveGame.serializer. + } + } + protected override void Initialize() { Program.Log("XNA Initialize"); diff --git a/StardewModdingAPI/Inheritance/SObject.cs b/StardewModdingAPI/Inheritance/SObject.cs index 9d112859..5c80cd52 100644 --- a/StardewModdingAPI/Inheritance/SObject.cs +++ b/StardewModdingAPI/Inheritance/SObject.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Xml.Serialization; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using StardewValley; @@ -66,8 +67,6 @@ namespace StardewModdingAPI.Inheritance if (Texture != null) { int targSize = Game1.tileSize; - int midX = (int) ((x) + 32); - int midY = (int) ((y) + 32); Vector2 local = Game1.GlobalToLocal(Game1.viewport, new Vector2(x,y)); Rectangle targ = new Rectangle((int)local.X, (int)local.Y, targSize, targSize); @@ -207,12 +206,14 @@ namespace StardewModdingAPI.Inheritance public override void actionWhenBeingHeld(Farmer who) { Point p = Game1.getMousePosition(); - CurrentMouse = new Vector2(p.X, p.Y); + CurrentMouse = new Vector2((p.X / Game1.tileSize), (p.Y / Game1.tileSize)); + Program.LogInfo(canBePlacedHere(Game1.currentLocation, CurrentMouse)); base.actionWhenBeingHeld(who); } public override bool canBePlacedHere(GameLocation l, Vector2 tile) { + Program.LogInfo(CurrentMouse.ToString().Replace("{", "").Replace("}", "")); if (!l.objects.ContainsKey(tile)) return true; @@ -221,6 +222,9 @@ namespace StardewModdingAPI.Inheritance public override bool placementAction(GameLocation location, int x, int y, Farmer who = null) { + if (Game1.didPlayerJustRightClick()) + return false; + x = (x / Game1.tileSize) * Game1.tileSize; y = (y / Game1.tileSize) * Game1.tileSize; @@ -248,7 +252,13 @@ namespace StardewModdingAPI.Inheritance public override void drawPlacementBounds(SpriteBatch spriteBatch, GameLocation location) { if (canBePlacedHere(location, CurrentMouse)) - base.drawPlacementBounds(spriteBatch, location); + { + int targSize = Game1.tileSize; + + int x = Game1.oldMouseState.X + Game1.viewport.X; + int y = Game1.oldMouseState.Y + Game1.viewport.Y; + spriteBatch.Draw(Game1.mouseCursors, new Vector2((float)(x / Game1.tileSize * Game1.tileSize - Game1.viewport.X), (float)(y / Game1.tileSize * Game1.tileSize - Game1.viewport.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Utility.playerCanPlaceItemHere(location, (Item)this, x, y, Game1.player) ? 194 : 210, 388, 16, 16)), Color.White, 0.0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.01f); + } } } }
\ No newline at end of file diff --git a/StardewModdingAPI/Program.cs b/StardewModdingAPI/Program.cs index a58a5f9b..313fcbe5 100644 --- a/StardewModdingAPI/Program.cs +++ b/StardewModdingAPI/Program.cs @@ -49,8 +49,8 @@ namespace StardewModdingAPI public static Thread gameThread; public static Thread consoleInputThread; - public const string Version = "0.35 Alpha"; - public const bool debug = false; + public const string Version = "0.36 Alpha"; + public const bool debug = true; public static bool disableLogging { get; private set; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -63,7 +63,7 @@ namespace StardewModdingAPI Console.Title += " - Version " + Version; if (debug) - Console.Title += " - DEBUG IS NOT FALSE, AUTHOUR FORGOT TO INCREMENT VERSION VARS"; + Console.Title += " - DEBUG IS NOT FALSE, AUTHOUR NEEDS TO REUPLOAD THIS VERSION"; //TODO: Have an app.config and put the paths inside it so users can define locations to load mods from ExecutionPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -84,6 +84,7 @@ namespace StardewModdingAPI } catch (Exception ex) { + LogError("Could not create a missing ModPath: " + ModPath + "\n\n" + ex); } } diff --git a/TrainerMod/TrainerMod.cs b/TrainerMod/TrainerMod.cs index a9896aac..86b03673 100644 --- a/TrainerMod/TrainerMod.cs +++ b/TrainerMod/TrainerMod.cs @@ -602,6 +602,7 @@ namespace TrainerMod int quality = 0; if (cmd.CalledArgs.Length > 1) { + Console.WriteLine(cmd.CalledArgs[1]); if (cmd.CalledArgs[1].IsInt32()) { count = cmd.CalledArgs[1].AsInt32(); diff --git a/TrainerMod/bin/Debug/TrainerMod.dll b/TrainerMod/bin/Debug/TrainerMod.dll Binary files differindex 2ca9ad54..9fc10782 100644 --- a/TrainerMod/bin/Debug/TrainerMod.dll +++ b/TrainerMod/bin/Debug/TrainerMod.dll diff --git a/TrainerMod/obj/Debug/TrainerMod.dll b/TrainerMod/obj/Debug/TrainerMod.dll Binary files differindex 2ca9ad54..9fc10782 100644 --- a/TrainerMod/obj/Debug/TrainerMod.dll +++ b/TrainerMod/obj/Debug/TrainerMod.dll |