we can have more than 2 args in a command, c'mon brain

This commit is contained in:
Zoryn Aaron 2016-03-02 23:38:51 -05:00
parent 47fecbd81e
commit 250559d227
9 changed files with 28 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -30,7 +30,7 @@ namespace StardewModdingAPI
{ {
args = input.Split(new[] {" "}, 2, StringSplitOptions.RemoveEmptyEntries); args = input.Split(new[] {" "}, 2, StringSplitOptions.RemoveEmptyEntries);
fnd = FindCommand(args[0]); fnd = FindCommand(args[0]);
args = args[1].Split(new[] { " " }, 2, StringSplitOptions.RemoveEmptyEntries); args = args[1].Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
} }
else else
{ {

View File

@ -49,6 +49,14 @@ namespace StardewModdingAPI.Inheritance
public Farmer PreviousFarmer { get; private set; } public Farmer PreviousFarmer { get; private set; }
public SGame()
{
if (Program.debug)
{
//SaveGame.serializer.
}
}
protected override void Initialize() protected override void Initialize()
{ {
Program.Log("XNA Initialize"); Program.Log("XNA Initialize");

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using StardewValley; using StardewValley;
@ -66,8 +67,6 @@ namespace StardewModdingAPI.Inheritance
if (Texture != null) if (Texture != null)
{ {
int targSize = Game1.tileSize; int targSize = Game1.tileSize;
int midX = (int) ((x) + 32);
int midY = (int) ((y) + 32);
Vector2 local = Game1.GlobalToLocal(Game1.viewport, new Vector2(x,y)); Vector2 local = Game1.GlobalToLocal(Game1.viewport, new Vector2(x,y));
Rectangle targ = new Rectangle((int)local.X, (int)local.Y, targSize, targSize); 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) public override void actionWhenBeingHeld(Farmer who)
{ {
Point p = Game1.getMousePosition(); 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); base.actionWhenBeingHeld(who);
} }
public override bool canBePlacedHere(GameLocation l, Vector2 tile) public override bool canBePlacedHere(GameLocation l, Vector2 tile)
{ {
Program.LogInfo(CurrentMouse.ToString().Replace("{", "").Replace("}", ""));
if (!l.objects.ContainsKey(tile)) if (!l.objects.ContainsKey(tile))
return true; return true;
@ -221,6 +222,9 @@ namespace StardewModdingAPI.Inheritance
public override bool placementAction(GameLocation location, int x, int y, Farmer who = null) public override bool placementAction(GameLocation location, int x, int y, Farmer who = null)
{ {
if (Game1.didPlayerJustRightClick())
return false;
x = (x / Game1.tileSize) * Game1.tileSize; x = (x / Game1.tileSize) * Game1.tileSize;
y = (y / 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) public override void drawPlacementBounds(SpriteBatch spriteBatch, GameLocation location)
{ {
if (canBePlacedHere(location, CurrentMouse)) 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);
}
} }
} }
} }

View File

@ -49,8 +49,8 @@ namespace StardewModdingAPI
public static Thread gameThread; public static Thread gameThread;
public static Thread consoleInputThread; public static Thread consoleInputThread;
public const string Version = "0.35 Alpha"; public const string Version = "0.36 Alpha";
public const bool debug = false; public const bool debug = true;
public static bool disableLogging { get; private set; } public static bool disableLogging { get; private set; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -63,7 +63,7 @@ namespace StardewModdingAPI
Console.Title += " - Version " + Version; Console.Title += " - Version " + Version;
if (debug) 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 //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); ExecutionPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
@ -84,6 +84,7 @@ namespace StardewModdingAPI
} }
catch (Exception ex) catch (Exception ex)
{ {
LogError("Could not create a missing ModPath: " + ModPath + "\n\n" + ex); LogError("Could not create a missing ModPath: " + ModPath + "\n\n" + ex);
} }
} }

View File

@ -602,6 +602,7 @@ namespace TrainerMod
int quality = 0; int quality = 0;
if (cmd.CalledArgs.Length > 1) if (cmd.CalledArgs.Length > 1)
{ {
Console.WriteLine(cmd.CalledArgs[1]);
if (cmd.CalledArgs[1].IsInt32()) if (cmd.CalledArgs[1].IsInt32())
{ {
count = cmd.CalledArgs[1].AsInt32(); count = cmd.CalledArgs[1].AsInt32();

Binary file not shown.

Binary file not shown.