Got chairs properly loaded in and working when sitting and with all of the rotations. Need to find a better way to have lots of objects instead of long lines of code.

This commit is contained in:
Joshua Navarro 2019-01-08 22:15:58 -08:00
parent 000f3802df
commit e734c82df5
11 changed files with 477 additions and 22 deletions

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Revitalize.Framework.Graphics
{
public class TextureManager
{
public static Dictionary<string, TextureManager> TextureManagers = new Dictionary<string, TextureManager>();
public Dictionary<string, Texture2DExtended> textures;
public TextureManager()
{
this.textures = new Dictionary<string, Texture2DExtended>();
}
public void addTexture(string name, Texture2DExtended texture)
{
this.textures.Add(name, texture);
}
/// <summary>Returns a Texture2DExtended held by the manager.</summary>
public Texture2DExtended getTexture(string name)
{
foreach (var v in this.textures)
{
if (v.Key == name)
return v.Value.Copy();
}
throw new Exception("Error, texture name not found!!!");
}
}
}

View File

@ -206,6 +206,34 @@ namespace Revitalize.Framework.Objects
return base.placementAction(location, x, y, who); return base.placementAction(location, x, y, who);
} }
public virtual void rotate()
{
if (this.info.facingDirection == Enums.Direction.Down) this.info.facingDirection = Enums.Direction.Right;
else if (this.info.facingDirection == Enums.Direction.Right) this.info.facingDirection = Enums.Direction.Up;
else if (this.info.facingDirection == Enums.Direction.Up) this.info.facingDirection = Enums.Direction.Left;
else if (this.info.facingDirection == Enums.Direction.Left) this.info.facingDirection = Enums.Direction.Down;
if (this.info.animationManager.animations.ContainsKey(generateRotationalAnimationKey()))
{
this.info.animationManager.setAnimation(generateRotationalAnimationKey());
}
else
{
//Revitalize.ModCore.log("Animation does not exist...." + generateRotationalAnimationKey());
}
}
public string generateRotationalAnimationKey()
{
return (this.info.animationManager.currentAnimationName.Split('_')[0]) +"_"+ (int)this.info.facingDirection;
}
public string generateDefaultRotationalAnimationKey()
{
return ("Default" + "_" + (int)this.info.facingDirection);
}
/// <summary>Updates a visual draw position.</summary> /// <summary>Updates a visual draw position.</summary>
public virtual void updateDrawPosition(int x, int y) public virtual void updateDrawPosition(int x, int y)
{ {
@ -241,7 +269,10 @@ namespace Revitalize.Framework.Objects
else else
{ {
//Log.AsyncC("Animation Manager is working!"); //Log.AsyncC("Animation Manager is working!");
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(this.TileLocation.Y * Game1.tileSize) / 10000f)); int addedDepth = 0;
if (this.info.ignoreBoundingBox) addedDepth++;
if (Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this) addedDepth++;
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)( (this.TileLocation.Y+addedDepth) * Game1.tileSize) / 10000f));
try try
{ {
this.animationManager.tickAnimation(); this.animationManager.tickAnimation();

View File

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Revitalize.Framework.Objects.Furniture
{
/// <summary>
/// Todo: Make this and the big object that encapsulates it.
/// </summary>
class Chair:FurnitureTileComponent
{
}
}

View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using PyTK.CustomElementHandler;
using StardewValley;
using StardewValley.Objects;
namespace Revitalize.Framework.Objects.Furniture
{
/// <summary>
/// Object which encapsulates all of the pieces that make up a chair object in-game.
/// </summary>
public class ChairMultiTiledObject:MultiTiledObject
{
public ChairMultiTiledObject() : base()
{
}
public ChairMultiTiledObject(BasicItemInformation Info) : base(Info)
{
}
public ChairMultiTiledObject(BasicItemInformation Info, Vector2 TilePosition) : base(Info, TilePosition)
{
}
public ChairMultiTiledObject(BasicItemInformation Info,Vector2 TilePosition,Dictionary<Vector2,MultiTiledComponent> Objects) : base(Info, TilePosition, Objects) {
}
/// <summary>
/// Rotate all chair components associated with this chair object.
/// </summary>
public override void rotate()
{
Revitalize.ModCore.log("Rotate!");
foreach(KeyValuePair<Vector2,MultiTiledComponent> pair in this.objects)
{
pair.Value.rotate();
}
foreach (KeyValuePair<Vector2, MultiTiledComponent> pair in this.objects)
{
(pair.Value as ChairTileComponent).checkForSpecialUpSittingAnimation();
}
base.rotate();
}
public override Item getOne()
{
return new ChairMultiTiledObject(this.info, this.TileLocation, this.objects);
}
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
{
BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]];
return new ChairMultiTiledObject(data, (replacement as Chest).TileLocation, this.objects);
}
public override bool canBePlacedHere(GameLocation l, Vector2 tile)
{
return base.canBePlacedHere(l, tile);
}
}
}

View File

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using PyTK.CustomElementHandler;
using Revitalize.Framework.Objects.InformationFiles.Furniture;
using StardewValley;
using StardewValley.Objects;
namespace Revitalize.Framework.Objects.Furniture
{
/// <summary>
/// Chair "piece" which represents one of the objects in the game that takes up roughly one tile.
/// </summary>
public class ChairTileComponent:FurnitureTileComponent
{
/// <summary>
/// Checks if the player can sit "on" this component.
/// </summary>
public bool CanSitHere
{
get
{
return (this.furnitureInfo as InformationFiles.Furniture.ChairInformation).canSitHere;
}
}
public ChairTileComponent():base()
{
}
public ChairTileComponent(BasicItemInformation Info,ChairInformation FurnitureInfo) : base(Info,FurnitureInfo)
{
}
public ChairTileComponent(BasicItemInformation Info,Vector2 TileLocation, ChairInformation FurnitureInfo) : base(Info, TileLocation,FurnitureInfo)
{
}
/// <summary>
/// When the chair is right clicked ensure that all pieces associated with it are also rotated.
/// </summary>
/// <param name="who"></param>
/// <returns></returns>
public override bool rightClicked(Farmer who)
{
this.containerObject.rotate(); //Ensure that all of the chair pieces rotate at the same time.
checkForSpecialUpSittingAnimation();
return true;
//return base.rightClicked(who);
}
/// <summary>
/// Used for more object interactions.
/// When the chair is shift right clicked sit on that specific chair tile if you can sit there.
/// </summary>
/// <param name="who"></param>
/// <returns></returns>
public override bool shiftRightClicked(Farmer who)
{
if (this.CanSitHere)
{
Revitalize.ModCore.playerInfo.sittingInfo.sit(this.containerObject, this.TileLocation*Game1.tileSize);
foreach(KeyValuePair<Vector2,MultiTiledComponent>pair in this.containerObject.objects)
{
(pair.Value as ChairTileComponent).checkForSpecialUpSittingAnimation();
}
}
return base.shiftRightClicked(who);
}
public override Item getOne()
{
ChairTileComponent component = new ChairTileComponent(this.info, (ChairInformation)this.furnitureInfo);
component.containerObject = this.containerObject;
component.offsetKey = this.offsetKey;
return component;
}
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
{
BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]];
return new ChairTileComponent(data, (replacement as Chest).TileLocation,(ChairInformation)this.furnitureInfo)
{
containerObject = this.containerObject,
offsetKey = this.offsetKey
};
}
/// <summary>
///Used to manage graphics for chairs that need to deal with special "layering" for transparent chair backs. Otherwise the player would be hidden.
/// </summary>
public void checkForSpecialUpSittingAnimation()
{
if (this.info.facingDirection == Enums.Direction.Up && Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject)
{
string animationKey = "Sitting_" + (int)Enums.Direction.Up;
if (this.animationManager.animations.ContainsKey(animationKey))
{
this.animationManager.setAnimation(animationKey);
}
}
}
}
}

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 Microsoft.Xna.Framework;
using Revitalize.Framework.Objects.InformationFiles; using Revitalize.Framework.Objects.InformationFiles;
using Revitalize.Framework.Objects.InformationFiles.Furniture; using Revitalize.Framework.Objects.InformationFiles.Furniture;
@ -23,7 +24,10 @@ namespace Revitalize.Framework.Objects.Furniture
this.furnitureInfo = furnitureInfo; this.furnitureInfo = furnitureInfo;
} }
public FurnitureTileComponent(BasicItemInformation itemInfo,Vector2 TileLocation ,FurnitureInformation furnitureInfo) : base(itemInfo,TileLocation)
{
this.furnitureInfo = furnitureInfo;
}
} }
} }

View File

@ -12,12 +12,20 @@ namespace Revitalize.Framework.Objects
{ {
public MultiTiledObject containerObject; public MultiTiledObject containerObject;
public Vector2 offsetKey;
public MultiTiledComponent() { } public MultiTiledComponent() { }
public MultiTiledComponent(BasicItemInformation info) : base(info) { } public MultiTiledComponent(BasicItemInformation info) : base(info) { }
public MultiTiledComponent(BasicItemInformation info, Vector2 TileLocation) : base(info, TileLocation) { } public MultiTiledComponent(BasicItemInformation info, Vector2 TileLocation) : base(info, TileLocation) { }
public override bool isPassable()
{
return this.info.ignoreBoundingBox || Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject;
}
public override bool checkForAction(Farmer who, bool justCheckingForActivity = false) public override bool checkForAction(Farmer who, bool justCheckingForActivity = false)
{ {
//ModCore.log("Checking for a clicky click???"); //ModCore.log("Checking for a clicky click???");
@ -36,9 +44,9 @@ namespace Revitalize.Framework.Objects
{ {
if (this.location == null) if (this.location == null)
this.location = Game1.player.currentLocation; this.location = Game1.player.currentLocation;
this.info.lightManager.toggleLights(this.location, this); //this.info.lightManager.toggleLights(this.location, this);
ModCore.playerInfo.sittingInfo.sit(this, Vector2.Zero); //ModCore.playerInfo.sittingInfo.sit(this, Vector2.Zero);
return true; return true;
} }
@ -87,6 +95,7 @@ namespace Revitalize.Framework.Objects
{ {
MultiTiledComponent component = new MultiTiledComponent(this.info, this.TileLocation); MultiTiledComponent component = new MultiTiledComponent(this.info, this.TileLocation);
component.containerObject = this.containerObject; component.containerObject = this.containerObject;
component.offsetKey = this.offsetKey;
return component; return component;
} }
@ -95,8 +104,57 @@ namespace Revitalize.Framework.Objects
BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]]; BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]];
return new MultiTiledComponent(data, (replacement as Chest).TileLocation) return new MultiTiledComponent(data, (replacement as Chest).TileLocation)
{ {
containerObject = this.containerObject containerObject = this.containerObject,
offsetKey = this.offsetKey
}; };
} }
/// <summary>What happens when the object is drawn at a tile location.</summary>
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{
if (x <= -1)
{
spriteBatch.Draw(this.info.animationManager.getTexture(), Game1.GlobalToLocal(Game1.viewport, this.info.drawPosition), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(this.TileLocation.Y * Game1.tileSize) / 10000f));
}
else
{
//The actual planter box being drawn.
if (this.animationManager == null)
{
if (this.animationManager.getExtendedTexture() == null)
ModCore.ModMonitor.Log("Tex Extended is null???");
spriteBatch.Draw(this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(this.TileLocation.Y * Game1.tileSize) / 10000f));
// Log.AsyncG("ANIMATION IS NULL?!?!?!?!");
}
else
{
//Log.AsyncC("Animation Manager is working!");
float addedDepth = 0;
if (Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject && this.info.facingDirection == Enums.Direction.Up)
{
addedDepth += (this.containerObject.Height - 1) - ((int)(this.offsetKey.Y));
if (this.info.ignoreBoundingBox) addedDepth+=1.5f;
}
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)((this.TileLocation.Y + addedDepth) * Game1.tileSize) / 10000f));
try
{
this.animationManager.tickAnimation();
// Log.AsyncC("Tick animation");
}
catch (Exception err)
{
ModCore.ModMonitor.Log(err.ToString());
}
}
// spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)((double)tileLocation.X * (double)Game1.tileSize + (((double)tileLocation.X * 11.0 + (double)tileLocation.Y * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2), (float)((double)tileLocation.Y * (double)Game1.tileSize + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2))), new Rectangle?(new Rectangle((int)((double)tileLocation.X * 51.0 + (double)tileLocation.Y * 77.0) % 3 * 16, 128 + this.whichForageCrop * 16, 16, 16)), Color.White, 0.0f, new Vector2(8f, 8f), (float)Game1.pixelZoom, SpriteEffects.None, (float)(((double)tileLocation.Y * (double)Game1.tileSize + (double)(Game1.tileSize / 2) + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) / 10000.0));
}
}
} }
} }

View File

@ -10,33 +10,56 @@ namespace Revitalize.Framework.Objects
public class MultiTiledObject : CustomObject public class MultiTiledObject : CustomObject
{ {
public Dictionary<Vector2, MultiTiledComponent> objects; public Dictionary<Vector2, MultiTiledComponent> objects;
public Dictionary<MultiTiledComponent, Vector2> offSets;
private int width;
private int height;
public int Width
{
get
{
return this.width+1;
}
}
public int Height
{
get
{
return this.height+1;
}
}
public MultiTiledObject() public MultiTiledObject()
{ {
this.objects = new Dictionary<Vector2, MultiTiledComponent>(); this.objects = new Dictionary<Vector2, MultiTiledComponent>();
this.offSets = new Dictionary<MultiTiledComponent, Vector2>();
} }
public MultiTiledObject(BasicItemInformation info) public MultiTiledObject(BasicItemInformation info)
: base(info) : base(info)
{ {
this.objects = new Dictionary<Vector2, MultiTiledComponent>(); this.objects = new Dictionary<Vector2, MultiTiledComponent>();
this.offSets = new Dictionary<MultiTiledComponent, Vector2>();
} }
public MultiTiledObject(BasicItemInformation info, Vector2 TileLocation) public MultiTiledObject(BasicItemInformation info, Vector2 TileLocation)
: base(info, TileLocation) : base(info, TileLocation)
{ {
this.objects = new Dictionary<Vector2, MultiTiledComponent>(); this.objects = new Dictionary<Vector2, MultiTiledComponent>();
this.offSets = new Dictionary<MultiTiledComponent, Vector2>();
} }
public MultiTiledObject(BasicItemInformation info, Vector2 TileLocation, Dictionary<Vector2, MultiTiledComponent> ObjectsList) public MultiTiledObject(BasicItemInformation info, Vector2 TileLocation, Dictionary<Vector2, MultiTiledComponent> ObjectsList)
: base(info, TileLocation) : base(info, TileLocation)
{ {
this.objects = new Dictionary<Vector2, MultiTiledComponent>(); this.objects = new Dictionary<Vector2, MultiTiledComponent>();
this.offSets = new Dictionary<MultiTiledComponent, Vector2>();
foreach (var v in ObjectsList) foreach (var v in ObjectsList)
{ {
MultiTiledComponent component = (MultiTiledComponent)v.Value.getOne(); MultiTiledComponent component = (MultiTiledComponent)v.Value.getOne();
this.addComponent(v.Key, component); this.addComponent(v.Key, component);
} }
} }
public bool addComponent(Vector2 key, MultiTiledComponent obj) public bool addComponent(Vector2 key, MultiTiledComponent obj)
@ -45,7 +68,11 @@ namespace Revitalize.Framework.Objects
return false; return false;
this.objects.Add(key, obj); this.objects.Add(key, obj);
this.offSets.Add(obj, key);
if (key.X > this.width) this.width = (int)key.X;
if (key.Y > this.height) this.height = (int)key.Y;
obj.containerObject = this; obj.containerObject = this;
obj.offsetKey = key;
return true; return true;
} }
@ -170,5 +197,17 @@ namespace Revitalize.Framework.Objects
BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]]; BasicItemInformation data = (BasicItemInformation)CustomObjectData.collection[additionalSaveData["id"]];
return new MultiTiledObject(data, (replacement as Chest).TileLocation, this.objects); return new MultiTiledObject(data, (replacement as Chest).TileLocation, this.objects);
} }
public void setAllAnimationsToDefault()
{
foreach(KeyValuePair<Vector2,MultiTiledComponent> pair in this.objects)
{
string animationKey = pair.Value.generateDefaultRotationalAnimationKey();
if (pair.Value.animationManager.animations.ContainsKey(animationKey))
{
pair.Value.animationManager.setAnimation(animationKey);
}
}
}
} }
} }

View File

@ -50,6 +50,11 @@ namespace Revitalize.Framework.Player.Managers
{ {
this.isSitting = false; this.isSitting = false;
this.elapsedTime = 0; this.elapsedTime = 0;
if(this.sittingObject is MultiTiledObject)
{
(this.sittingObject as MultiTiledObject).setAllAnimationsToDefault();
}
this.sittingObject = null; this.sittingObject = null;
} }
if (this.isSitting && Game1.player.CanMove) if (this.isSitting && Game1.player.CanMove)

View File

@ -109,11 +109,21 @@ namespace Revitalize
ModHelper.Events.GameLoop.TimeChanged += this.GameLoop_TimeChanged; ModHelper.Events.GameLoop.TimeChanged += this.GameLoop_TimeChanged;
ModHelper.Events.GameLoop.UpdateTicked += this.GameLoop_UpdateTicked; ModHelper.Events.GameLoop.UpdateTicked += this.GameLoop_UpdateTicked;
playerInfo = new PlayerInfo(); playerInfo = new PlayerInfo();
Framework.Graphics.TextureManager.TextureManagers.Add("Furniture", new TextureManager());
TextureManager.TextureManagers["Furniture"].addTexture("Oak Chair", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content","Graphics","Furniture", "Chairs", "OakChair.png")));
} }
private void createDirectories() private void createDirectories()
{ {
Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Configs")); Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Configs"));
Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Content"));
Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath,"Content" ,"Graphics"));
Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Content", "Graphics","Furniture"));
Directory.CreateDirectory(Path.Combine(this.Helper.DirectoryPath, "Content", "Graphics", "Furniture","Chairs"));
} }
private void initailizeComponents() private void initailizeComponents()
@ -152,12 +162,107 @@ namespace Revitalize
}, new KeyValuePair<Item, int>(new Furniture(3, Vector2.Zero), 1),new StatCost(100,50,0,0)); }, new KeyValuePair<Item, int>(new Furniture(3, Vector2.Zero), 1),new StatCost(100,50,0,0));
Framework.Objects.Furniture.ChairTileComponent chairTop = new Framework.Objects.Furniture.ChairTileComponent(new BasicItemInformation("Oak Chair", "A basic wooden chair", "Chairs", Color.Brown, -300, 0, false, 100, Vector2.Zero, true, true, "Omegasis.Revitalize.Furniture.Basic.OakChair", "2048/0/-300/Crafting -9/Play '2048 by Platonymous' at home!/true/true/0/2048", Framework.Graphics.TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0, false, typeof(Framework.Objects.Furniture.ChairTileComponent), null, new AnimationManager(TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair"), new Animation(new Rectangle(0, 0, 16, 16)), new Dictionary<string, List<Animation>>() {
{ "Default_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
{
new Animation(new Rectangle(0,0,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
{
new Animation(new Rectangle(0,0,16,16))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Right , new List<Animation>()
{
new Animation(new Rectangle(16,0,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Right , new List<Animation>()
{
new Animation(new Rectangle(16,0,16,16))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Up , new List<Animation>()
{
new Animation(new Rectangle(32,0,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Up , new List<Animation>()
{
new Animation(new Rectangle(32,32,16,32))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Left , new List<Animation>()
{
new Animation(new Rectangle(48,0,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Left , new List<Animation>()
{
new Animation(new Rectangle(48,0,16,16))
}
}
}, "Default_" + (int)Framework.Enums.Direction.Down), Color.White, true, new Framework.Utilities.InventoryManager(), new LightManager()),new Framework.Objects.InformationFiles.Furniture.ChairInformation(false));
Framework.Objects.Furniture.ChairTileComponent chairBottom = new Framework.Objects.Furniture.ChairTileComponent(new BasicItemInformation("Oak Chair", "A basic wooden chair", "Chairs", Color.Brown, -300, 0, false, 100, Vector2.Zero, true, true, "Omegasis.Revitalize.Furniture.Basic.OakChair", "2048/0/-300/Crafting -9/Play '2048 by Platonymous' at home!/true/true/0/2048", Framework.Graphics.TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture, Color.White, 0, false, typeof(Framework.Objects.Furniture.ChairTileComponent), null, new AnimationManager(TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair"), new Animation(new Rectangle(0, 16, 16, 16)), new Dictionary<string, List<Animation>>() {
{ "Default_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
{
new Animation(new Rectangle(0,16,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Down , new List<Animation>()
{
new Animation(new Rectangle(0,16,16,16))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Right , new List<Animation>()
{
new Animation(new Rectangle(16,16,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Right , new List<Animation>()
{
new Animation(new Rectangle(16,16,16,16))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Up , new List<Animation>()
{
new Animation(new Rectangle(32,16,16,16))
}
},
{ "Sitting_" + (int)Framework.Enums.Direction.Up , new List<Animation>()
{
new Animation(new Rectangle(48,32,16,32))
}
},
{ "Default_" + (int)Framework.Enums.Direction.Left , new List<Animation>()
{
new Animation(new Rectangle(48,16,16,16))
}
},
{ "Sitting" + (int)Framework.Enums.Direction.Left , new List<Animation>()
{
new Animation(new Rectangle(48,16,16,16))
}
}
}, "Default_"+(int)Framework.Enums.Direction.Down), Color.White, false, new Framework.Utilities.InventoryManager(), new LightManager()), new Framework.Objects.InformationFiles.Furniture.ChairInformation(true));
Framework.Objects.Furniture.ChairMultiTiledObject oakChair = new Framework.Objects.Furniture.ChairMultiTiledObject(new BasicItemInformation("Oak Chair","A wood chair you can place anywhere.","Chair",Color.White,-300,0,true,100,Vector2.Zero,true,true,"Omegasis.Revitalize.Furniture.OakChair", "2048/0/-300/Crafting -9/Play '2048 by Platonymous' at home!/true/true/0/2048",TextureManager.TextureManagers["Furniture"].getTexture("Oak Chair").texture,Color.White,0,true,typeof(Revitalize.Framework.Objects.Furniture.ChairMultiTiledObject),null,new AnimationManager(),Color.White,false,new Framework.Utilities.InventoryManager(), new LightManager()));
oakChair.addComponent(new Vector2(0, 0), chairTop);
oakChair.addComponent(new Vector2(0, 1), chairBottom);
Game1.player.addItemToInventory(oakChair);
new InventoryItem(bigObject, 100, 1).addToNPCShop("Gus"); new InventoryItem(bigObject, 100, 1).addToNPCShop("Gus");
Game1.player.addItemToInventory(bigObject); Game1.player.addItemToInventory(bigObject);
if (pie.PlayerCanCraft()) if (pie.PlayerCanCraft())
{ {
pie.craft(); //pie.craft();
} }
} }

View File

@ -54,11 +54,13 @@
<Compile Include="Framework\Graphics\Animations\Animation.cs" /> <Compile Include="Framework\Graphics\Animations\Animation.cs" />
<Compile Include="Framework\Graphics\Animations\AnimationManager.cs" /> <Compile Include="Framework\Graphics\Animations\AnimationManager.cs" />
<Compile Include="Framework\Graphics\Texture2DExtended.cs" /> <Compile Include="Framework\Graphics\Texture2DExtended.cs" />
<Compile Include="Framework\Graphics\TextureManager.cs" />
<Compile Include="Framework\Illuminate\ColorExtensions.cs" /> <Compile Include="Framework\Illuminate\ColorExtensions.cs" />
<Compile Include="Framework\Illuminate\LightManager.cs" /> <Compile Include="Framework\Illuminate\LightManager.cs" />
<Compile Include="Framework\Objects\BasicItemInformation.cs" /> <Compile Include="Framework\Objects\BasicItemInformation.cs" />
<Compile Include="Framework\Objects\CustomObject.cs" /> <Compile Include="Framework\Objects\CustomObject.cs" />
<Compile Include="Framework\Objects\Furniture\Chair.cs" /> <Compile Include="Framework\Objects\Furniture\ChairMultiTiledObject.cs" />
<Compile Include="Framework\Objects\Furniture\ChairTileComponent.cs" />
<Compile Include="Framework\Objects\Furniture\FurnitureTileComponent.cs" /> <Compile Include="Framework\Objects\Furniture\FurnitureTileComponent.cs" />
<Compile Include="Framework\Objects\InformationFiles\Furniture\ChairInformation.cs" /> <Compile Include="Framework\Objects\InformationFiles\Furniture\ChairInformation.cs" />
<Compile Include="Framework\Objects\InformationFiles\Furniture\FurnitureInformation.cs" /> <Compile Include="Framework\Objects\InformationFiles\Furniture\FurnitureInformation.cs" />