pu to work from another location
This commit is contained in:
parent
250559d227
commit
659825ea78
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,11 +2,16 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Serialization;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using StardewValley;
|
||||
using StardewValley.Characters;
|
||||
using StardewValley.Menus;
|
||||
using StardewValley.Monsters;
|
||||
using StardewValley.Quests;
|
||||
using StardewValley.TerrainFeatures;
|
||||
|
||||
namespace StardewModdingAPI.Inheritance
|
||||
{
|
||||
|
@ -53,7 +58,37 @@ namespace StardewModdingAPI.Inheritance
|
|||
{
|
||||
if (Program.debug)
|
||||
{
|
||||
//SaveGame.serializer.
|
||||
SaveGame.serializer = new XmlSerializer(typeof (SaveGame), new Type[28]
|
||||
{
|
||||
typeof (Tool),
|
||||
typeof (GameLocation),
|
||||
typeof (Crow),
|
||||
typeof (Duggy),
|
||||
typeof (Bug),
|
||||
typeof (BigSlime),
|
||||
typeof (Fireball),
|
||||
typeof (Ghost),
|
||||
typeof (Child),
|
||||
typeof (Pet),
|
||||
typeof (Dog),
|
||||
typeof (StardewValley.Characters.Cat),
|
||||
typeof (Horse),
|
||||
typeof (GreenSlime),
|
||||
typeof (LavaCrab),
|
||||
typeof (RockCrab),
|
||||
typeof (ShadowGuy),
|
||||
typeof (SkeletonMage),
|
||||
typeof (SquidKid),
|
||||
typeof (Grub),
|
||||
typeof (Fly),
|
||||
typeof (DustSpirit),
|
||||
typeof (Quest),
|
||||
typeof (MetalHead),
|
||||
typeof (ShadowGirl),
|
||||
typeof (Monster),
|
||||
typeof (TerrainFeature),
|
||||
typeof (SObject)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ namespace StardewModdingAPI.Inheritance
|
|||
|
||||
public Boolean FlaggedForPickup { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public Vector2 CurrentMouse { get; protected set; }
|
||||
[XmlIgnore]
|
||||
public Vector2 PlacedAt { get; protected set; }
|
||||
|
||||
public override int Stack
|
||||
|
@ -205,15 +207,20 @@ namespace StardewModdingAPI.Inheritance
|
|||
|
||||
public override void actionWhenBeingHeld(Farmer who)
|
||||
{
|
||||
Point p = Game1.getMousePosition();
|
||||
CurrentMouse = new Vector2((p.X / Game1.tileSize), (p.Y / Game1.tileSize));
|
||||
Program.LogInfo(canBePlacedHere(Game1.currentLocation, CurrentMouse));
|
||||
int x = Game1.oldMouseState.X + Game1.viewport.X;
|
||||
int y = Game1.oldMouseState.Y + Game1.viewport.Y;
|
||||
|
||||
x = x / Game1.tileSize;
|
||||
y = y / Game1.tileSize;
|
||||
|
||||
CurrentMouse = new Vector2(x, y);
|
||||
//Program.LogDebug(canBePlacedHere(Game1.currentLocation, CurrentMouse));
|
||||
base.actionWhenBeingHeld(who);
|
||||
}
|
||||
|
||||
public override bool canBePlacedHere(GameLocation l, Vector2 tile)
|
||||
{
|
||||
Program.LogInfo(CurrentMouse.ToString().Replace("{", "").Replace("}", ""));
|
||||
//Program.LogDebug(CurrentMouse.ToString().Replace("{", "").Replace("}", ""));
|
||||
if (!l.objects.ContainsKey(tile))
|
||||
return true;
|
||||
|
||||
|
@ -225,8 +232,11 @@ namespace StardewModdingAPI.Inheritance
|
|||
if (Game1.didPlayerJustRightClick())
|
||||
return false;
|
||||
|
||||
x = (x / Game1.tileSize) * Game1.tileSize;
|
||||
y = (y / Game1.tileSize) * Game1.tileSize;
|
||||
x = (x / Game1.tileSize);
|
||||
y = (y / Game1.tileSize);
|
||||
|
||||
//Program.LogDebug(x + " - " + y);
|
||||
//Console.ReadKey();
|
||||
|
||||
Vector2 key = new Vector2(x, y);
|
||||
|
||||
|
|
|
@ -761,7 +761,10 @@ namespace TrainerMod
|
|||
static void RegisterNewItem(Command cmd)
|
||||
{
|
||||
if (!Program.debug)
|
||||
{
|
||||
Program.LogError("Experimental code cannot be run in user mode.");
|
||||
return;
|
||||
}
|
||||
SObject s = SGame.PullModItemFromDict(0, true);
|
||||
s.Stack = 999;
|
||||
Game1.player.addItemToInventory(s);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue