2018-02-06 18:13:21 +08:00
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
2018-03-06 12:46:45 +08:00
|
|
|
|
using StardewModdingAPI;
|
2018-02-06 18:13:21 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace StardustCore.UIUtilities
|
|
|
|
|
{
|
|
|
|
|
public class Texture2DExtended
|
|
|
|
|
{
|
|
|
|
|
public string Name;
|
|
|
|
|
public Texture2D texture;
|
|
|
|
|
public string path;
|
|
|
|
|
|
2018-03-06 12:46:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Constructor.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">The relative path to file on disk. See StardustCore.Utilities.getRelativePath(modname,path);
|
|
|
|
|
public Texture2DExtended(IModHelper helper,string path)
|
2018-02-06 18:13:21 +08:00
|
|
|
|
{
|
|
|
|
|
this.Name = Path.GetFileName(path);
|
|
|
|
|
this.path = path;
|
2018-03-06 12:46:45 +08:00
|
|
|
|
this.texture = helper.Content.Load<Texture2D>(path);
|
2018-02-06 18:13:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-06 12:46:45 +08:00
|
|
|
|
public Texture2DExtended Copy(IModHelper helper)
|
2018-02-06 18:13:21 +08:00
|
|
|
|
{
|
2018-03-06 12:46:45 +08:00
|
|
|
|
return new Texture2DExtended(helper,this.path);
|
2018-02-06 18:13:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|