initial saving working (possibly)

This commit is contained in:
2017-09-16 08:23:47 -05:00
parent 4f2d190b6c
commit e9f1a9a3ed
4 changed files with 22 additions and 9 deletions

View File

@ -22,11 +22,12 @@ namespace SpriteLibrary
/// </summary>
public class SpriteDatabase
{
List<SpriteInfo> SpriteInfoList = new List<SpriteInfo>();
public List<SpriteInfo> SpriteInfoList = new List<SpriteInfo>();
List<ImageStruct> TheImages = new List<ImageStruct>();
ResourceManager myResourceManager = null;
string Filename = "";
Size SnapGridSize = new Size(5, 5);
int CurrentSIIndex = -1; //The information item we are editing. -1 means it is a new one.
public SpriteDatabase(ResourceManager theResourceManager, string filename)
{
@ -40,6 +41,11 @@ namespace SpriteLibrary
LoadSpriteInfo();
}
internal ResourceManager GetResourceManager()
{
return myResourceManager;
}
/// <summary>
/// Tell the database to save the sprite definitions. Use this while you are creating your game.
/// When you are done, you will usually want to take your sprite definition file and add it to the
@ -115,7 +121,7 @@ namespace SpriteLibrary
public void OpenEditWindow(int FirstItemIndex=-1)
{
SpriteEntryForm SEF = new SpriteEntryForm(myResourceManager, SpriteInfoList, SnapGridSize);
SpriteEntryForm SEF = new SpriteEntryForm(this, SpriteInfoList, SnapGridSize);
SEF.ShowDialog();
//Use the updated list returned from the form.
SpriteInfoList.Clear();