Merge branch 'Development' of https://github.com/janavarro95/Stardew_Valley_Mods into Development
This commit is contained in:
commit
03d230c4af
|
@ -1,6 +1,7 @@
|
|||
using System.IO;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using StardewModdingAPI;
|
||||
using StardewValley;
|
||||
|
||||
namespace Revitalize.Framework.Graphics
|
||||
{
|
||||
|
@ -24,14 +25,6 @@ namespace Revitalize.Framework.Graphics
|
|||
this.modID = "";
|
||||
}
|
||||
|
||||
public Texture2DExtended(Texture2D Texture)
|
||||
{
|
||||
this.Name = "";
|
||||
this.texture = Texture;
|
||||
this.path = "";
|
||||
this.helper = null;
|
||||
this.modID = "";
|
||||
}
|
||||
|
||||
/// <summary>Construct an instance.</summary>
|
||||
/// <param name="path">The relative path to file on disk. See StardustCore.Utilities.getRelativePath(modname,path);
|
||||
|
@ -55,6 +48,25 @@ namespace Revitalize.Framework.Graphics
|
|||
this.source = contentSource;
|
||||
}
|
||||
|
||||
public Texture2DExtended(IContentPack ContentPack, IManifest manifest, string path)
|
||||
{
|
||||
this.Name = Path.GetFileNameWithoutExtension(path);
|
||||
this.path = path;
|
||||
this.texture = ContentPack.LoadAsset<Texture2D>(path);
|
||||
this.helper = null;
|
||||
this.modID = manifest.UniqueID;
|
||||
this.source = ContentSource.ModFolder;
|
||||
}
|
||||
public Texture2DExtended(IContentPack ContentPack, string modID, string path)
|
||||
{
|
||||
this.Name = Path.GetFileNameWithoutExtension(path);
|
||||
this.path = path;
|
||||
this.texture = ContentPack.LoadAsset<Texture2D>(path);
|
||||
this.helper = null;
|
||||
this.modID = modID;
|
||||
this.source = ContentSource.ModFolder;
|
||||
}
|
||||
|
||||
public Texture2DExtended(IContentPack content, string path)
|
||||
{
|
||||
this.Name = Path.GetFileNameWithoutExtension(path);
|
||||
|
|
|
@ -24,6 +24,19 @@ namespace Revitalize.Framework.Graphics
|
|||
{
|
||||
this.name = Name;
|
||||
this.textures = new Dictionary<string, Texture2DExtended>();
|
||||
this.searchForTextures();
|
||||
}
|
||||
|
||||
public TextureManager(bool doNothing=false)
|
||||
{
|
||||
this.textures = new Dictionary<string, Texture2DExtended>();
|
||||
//
|
||||
}
|
||||
|
||||
public TextureManager(IContentPack ContentPack)
|
||||
{
|
||||
this.textures = new Dictionary<string, Texture2DExtended>();
|
||||
this.searchForTextures(ContentPack);
|
||||
}
|
||||
|
||||
public void addTexture(string name, Texture2DExtended texture)
|
||||
|
@ -166,5 +179,7 @@ namespace Revitalize.Framework.Graphics
|
|||
return TextureManagers[Manifest.UniqueID][Name];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ namespace Revitalize.Framework.Objects
|
|||
|
||||
public BasicItemInformation(string name, string description, string categoryName, Color categoryColor,int edibility, int fragility, bool isLamp, int price, Vector2 TileLocation, bool canBeSetOutdoors, bool canBeSetIndoors, string id, string data, Texture2D texture, Color color, int tileIndex, bool bigCraftable, Type type, CraftingData craftingData, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights) : base(id, data, texture, color, tileIndex, bigCraftable, type, craftingData)
|
||||
{
|
||||
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.categoryName = categoryName;
|
||||
|
@ -79,10 +78,10 @@ namespace Revitalize.Framework.Objects
|
|||
if (this.animationManager.IsNull)
|
||||
{
|
||||
this.animationManager = new AnimationManager(new Graphics.Texture2DExtended(), new Animation(new Rectangle(0, 0, 16, 16)), false);
|
||||
this.animationManager.getExtendedTexture().texture = this.texture;
|
||||
this.animationManager.getExtendedTexture().texture = texture;
|
||||
}
|
||||
else
|
||||
this.texture = this.animationManager.getTexture();
|
||||
this.texture = texture;
|
||||
|
||||
this.drawPosition = Vector2.Zero;
|
||||
this.drawColor = drawColor;
|
||||
|
|
|
@ -140,10 +140,19 @@ namespace Revitalize
|
|||
ModHelper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;
|
||||
playerInfo = new PlayerInfo();
|
||||
|
||||
<<<<<<< HEAD
|
||||
Framework.Graphics.TextureManager.AddTextureManager(Manifest,"Furniture");
|
||||
TextureManager.GetTextureManager(Manifest,"Furniture").searchForTextures();
|
||||
|
||||
//TextureManager.addTexture("Furniture","Oak Chair", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content","Graphics","Furniture", "Chairs", "Oak Chair.png")));
|
||||
=======
|
||||
//Framework.Graphics.TextureManager.TextureManagers.Add("Furniture", new TextureManager(this.Helper.DirectoryPath, Path.Combine("Content", "Graphics", "Furniture")));
|
||||
Framework.Graphics.TextureManager.TextureManagers.Add("Furniture", new TextureManager());
|
||||
//Rename graphic files tohave spaces and comment out below lines
|
||||
|
||||
//TextureManager.addTexture("Furniture","Oak Chair", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content","Graphics","Furniture", "Chairs", "Oak Chair.png")));
|
||||
//
|
||||
>>>>>>> 596aedac77fc182f58bd38415ed86de0b1a6483e
|
||||
//TextureManager.addTexture("Furniture", "Oak Table", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content", "Graphics", "Furniture", "Tables", "Oak Table.png")));
|
||||
//TextureManager.addTexture("Furniture", "Oak Lamp", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content", "Graphics", "Furniture", "Lamps", "Oak Lamp.png")));
|
||||
customObjects = new Dictionary<string, CustomObject>();
|
||||
|
|
Loading…
Reference in New Issue