This commit is contained in:
chris220 2009-06-14 17:07:57 +00:00
parent 610a809b29
commit 4c6762ef52
2 changed files with 56 additions and 2 deletions

View File

@ -12,6 +12,7 @@
#include "keyboard.h" #include "keyboard.h"
#include "joystick.h" #include "joystick.h"
#include "help.h" #include "help.h"
#include "main.h" //So we can use the GetRomName() function!
using namespace std; using namespace std;
@ -36,6 +37,37 @@ static TSelectionFrames selectionFrames;
//add a new fceud_ function?? blehhh maybe //add a new fceud_ function?? blehhh maybe
extern EMOVIEMODE movieMode; extern EMOVIEMODE movieMode;
//The project file struct
struct TASEDIT_PROJECT
{
std::string mainFilename; //The main fm2's file name and location
std::string getFilename();
std::string setFilename();
std::string projectFilename; //Name of the actual project's file
};
TASEDIT_PROJECT project; //Create an instance of the project
std::string getFilename() //Get fm2 file name
{
return project.mainFilename; //Speaks for itself really!
}
void setFilename(std::string e) //Guess what? Sets the project's fm2 file name!
{
project.mainFilename = e; //Yep
}
std::string getProjectname() //Get TASEedit project's name
{
return project.projectFilename; //Speaks for itself really!
}
void setProjectname(std::string e) //Guess what? Sets the project's name!
{
project.projectFilename = e; //Yep
}
static void GetDispInfo(NMLVDISPINFO* nmlvDispInfo) static void GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
{ {
LVITEM& item = nmlvDispInfo->item; LVITEM& item = nmlvDispInfo->item;
@ -528,6 +560,28 @@ static void NewProject()
//if so, ask to save changes //if so, ask to save changes
//close current project //close current project
//create new project //create new project
const char TPfilter[]="TASEdit Project (*.tas)\0*.tas\0";
OPENFILENAME ofn;
memset(&ofn,0,sizeof(ofn));
ofn.lStructSize=sizeof(ofn);
ofn.hInstance=fceu_hInstance;
ofn.lpstrTitle="Save TASEdit Project As...";
ofn.lpstrFilter=TPfilter;
char nameo[2048];
strcpy(nameo, GetRomName());
ofn.lpstrFile=nameo;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT;
string initdir = FCEU_GetPath(FCEUMKF_MOVIE);
ofn.lpstrInitialDir=initdir.c_str();
if(GetSaveFileName(&ofn))
{
//TODO: Save project and reinitialise TASEdit
}
} }
//Opens a new Project file //Opens a new Project file
@ -685,7 +739,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
{ {
case ACCEL_CTRL_N: case ACCEL_CTRL_N:
case ID_FILE_NEWPROJECT: case ID_FILE_NEWPROJECT:
NewProject(); NewProject();
break; break;
case ACCEL_CTRL_O: case ACCEL_CTRL_O:

View File

@ -1,2 +1,2 @@
void DoTasEdit(); void DoTasEdit();
void UpdateTasEdit(); void UpdateTasEdit();