summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Inheritance/SObject.cs
diff options
context:
space:
mode:
authorZoryn Aaron <zoryn4163@gmail.com>2016-03-02 12:24:15 -0500
committerZoryn Aaron <zoryn4163@gmail.com>2016-03-02 12:24:15 -0500
commit900c804c29b6dcedef158d3b36fcebb7846e8a16 (patch)
tree84d1bab1309429dc4edf6e084abed17704c42d80 /StardewModdingAPI/Inheritance/SObject.cs
parent38bce3315841c66409e02844c86eb7a5e9295565 (diff)
downloadSMAPI-900c804c29b6dcedef158d3b36fcebb7846e8a16.tar.gz
SMAPI-900c804c29b6dcedef158d3b36fcebb7846e8a16.tar.bz2
SMAPI-900c804c29b6dcedef158d3b36fcebb7846e8a16.zip
update for new event and other crap
Diffstat (limited to 'StardewModdingAPI/Inheritance/SObject.cs')
-rw-r--r--StardewModdingAPI/Inheritance/SObject.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/StardewModdingAPI/Inheritance/SObject.cs b/StardewModdingAPI/Inheritance/SObject.cs
index 97d2fa41..5e36b5b7 100644
--- a/StardewModdingAPI/Inheritance/SObject.cs
+++ b/StardewModdingAPI/Inheritance/SObject.cs
@@ -48,13 +48,23 @@ namespace StardewModdingAPI.Inheritance
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1)
{
-
if (Texture != null)
- spriteBatch.Draw(Texture, new Vector2(x, y), new Color(255, 255, 255, 255f * alpha));
+ {
+ int targSize = Game1.tileSize;
+ int midX = (int) ((x) + 32);
+ int midY = (int) ((y) + 32);
+
+ int targX = midX - targSize / 2;
+ int targY = midY - targSize / 2;
+
+ Rectangle targ = new Rectangle(targX, targY, targSize, targSize);
+ spriteBatch.Draw(Texture, targ, null, new Color(255, 255, 255, 255f * alpha), 0, Vector2.Zero, SpriteEffects.None, 0.999f);
+ }
}
public override void draw(SpriteBatch spriteBatch, int xNonTile, int yNonTile, float layerDepth, float alpha = 1)
{
+ Program.LogInfo("DRAW ME2");
return;
try
{
@@ -183,6 +193,11 @@ namespace StardewModdingAPI.Inheritance
public override bool placementAction(GameLocation location, int x, int y, Farmer who = null)
{
+ Vector2 key = new Vector2(x, y);
+ if (!location.objects.ContainsKey(key))
+ location.objects.Add(key, this);
+ return false;
+
SGameLocation s = SGame.GetLocationFromName(location.name);
if (s.GetHashCode() != SGame.CurrentLocation.GetHashCode())