fixed GetPath when opening Cheats

This commit is contained in:
ansstuff 2012-12-29 16:32:21 +00:00
parent 3cb74f7780
commit 07a21643d6
4 changed files with 32 additions and 8 deletions

View File

@ -500,8 +500,8 @@ BEGIN
BEGIN BEGIN
MENUITEM "Toggle selected Cheats\tDbl-Clk", CHEAT_CONTEXT_TOGGLECHEAT MENUITEM "Toggle selected Cheats\tDbl-Clk", CHEAT_CONTEXT_TOGGLECHEAT
MENUITEM "Poke Cheat Value", CHEAT_CONTEXT_POKECHEATVALUE MENUITEM "Poke Cheat Value", CHEAT_CONTEXT_POKECHEATVALUE
MENUITEM "Goto In Hex Editor", CHEAT_CONTEXT_GOTOINHEXEDITOR MENUITEM "Goto in Hex Editor", CHEAT_CONTEXT_GOTOINHEXEDITOR
MENUITEM "Delete Selected Cheats", ID_CHEATLISTPOPUP_DELETESELECTEDCHEATS MENUITEM "Delete selected Cheats", ID_CHEATLISTPOPUP_DELETESELECTEDCHEATS
END END
END END

View File

@ -1098,7 +1098,7 @@ void LoadNewGamey(HWND hParent, const char *initialdir)
ofn.lpstrFile=nameo; ofn.lpstrFile=nameo;
ofn.nMaxFile=256; ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK;
string stdinitdir =FCEU_GetPath(FCEUMKF_ROMS); string stdinitdir = FCEU_GetPath(FCEUMKF_ROMS);
if (initialdir) //adelikat: If a directory is specified in the function parameter, it should take priority if (initialdir) //adelikat: If a directory is specified in the function parameter, it should take priority
ofn.lpstrInitialDir = initialdir; ofn.lpstrInitialDir = initialdir;

View File

@ -477,66 +477,90 @@ void FCEUI_SetDirOverride(int which, char *n)
std::string FCEU_GetPath(int type) std::string FCEU_GetPath(int type)
{ {
char ret[FILENAME_MAX]; switch (type)
switch(type)
{ {
case FCEUMKF_STATE: case FCEUMKF_STATE:
{
if(odirs[FCEUIOD_STATES]) if(odirs[FCEUIOD_STATES])
return (odirs[FCEUIOD_STATES]); return (odirs[FCEUIOD_STATES]);
else else
return BaseDirectory + PSS + "fcs"; return BaseDirectory + PSS + "fcs";
break; break;
}
case FCEUMKF_CHEAT:
{
if(odirs[FCEUIOD_CHEATS])
return (odirs[FCEUIOD_CHEATS]);
else
return BaseDirectory + PSS + "cheats";
break;
}
case FCEUMKF_MOVIE: case FCEUMKF_MOVIE:
{
if(odirs[FCEUIOD_MOVIES]) if(odirs[FCEUIOD_MOVIES])
return (odirs[FCEUIOD_MOVIES]); return (odirs[FCEUIOD_MOVIES]);
else else
return BaseDirectory + PSS + "movies"; return BaseDirectory + PSS + "movies";
break; break;
}
case FCEUMKF_MEMW: case FCEUMKF_MEMW:
{
if(odirs[FCEUIOD_MEMW]) if(odirs[FCEUIOD_MEMW])
return (odirs[FCEUIOD_MEMW]); return (odirs[FCEUIOD_MEMW]);
else else
return ""; //adelikat: 03/02/09 - return null so it defaults to last directory used return ""; //adelikat: 03/02/09 - return null so it defaults to last directory used
//return BaseDirectory + PSS + "tools"; //return BaseDirectory + PSS + "tools";
break; break;
}
//adelikat: TODO: this no longer exist and could be removed (but that would require changing a lot of other directory arrays //adelikat: TODO: this no longer exist and could be removed (but that would require changing a lot of other directory arrays
case FCEUMKF_BBOT: case FCEUMKF_BBOT:
{
if(odirs[FCEUIOD_BBOT]) if(odirs[FCEUIOD_BBOT])
return (odirs[FCEUIOD_BBOT]); return (odirs[FCEUIOD_BBOT]);
else else
return BaseDirectory + PSS + "tools"; return BaseDirectory + PSS + "tools";
break; break;
}
case FCEUMKF_ROMS: case FCEUMKF_ROMS:
{
if(odirs[FCEUIOD_ROMS]) if(odirs[FCEUIOD_ROMS])
return (odirs[FCEUIOD_ROMS]); return (odirs[FCEUIOD_ROMS]);
else else
return ""; //adelikat: removing base directory return, should return null it goes to last used directory return ""; //adelikat: removing base directory return, should return null it goes to last used directory
break; break;
}
case FCEUMKF_INPUT: case FCEUMKF_INPUT:
{
if(odirs[FCEUIOD_INPUT]) if(odirs[FCEUIOD_INPUT])
return (odirs[FCEUIOD_INPUT]); return (odirs[FCEUIOD_INPUT]);
else else
return BaseDirectory + PSS + "tools"; return BaseDirectory + PSS + "tools";
break; break;
}
case FCEUMKF_LUA: case FCEUMKF_LUA:
{
if(odirs[FCEUIOD_LUA]) if(odirs[FCEUIOD_LUA])
return (odirs[FCEUIOD_LUA]); return (odirs[FCEUIOD_LUA]);
else else
return ""; //adelikat: 03/02/09 - return null so it defaults to last directory used //return BaseDirectory + PSS + "tools"; return ""; //adelikat: 03/02/09 - return null so it defaults to last directory used //return BaseDirectory + PSS + "tools";
break; break;
}
case FCEUMKF_AVI: case FCEUMKF_AVI:
{
if(odirs[FCEUIOD_AVI]) if(odirs[FCEUIOD_AVI])
return (odirs[FCEUIOD_AVI]); return (odirs[FCEUIOD_AVI]);
else else
return ""; //adelikat - 03/02/09 - if no override, should return null and allow the last directory to be used intead return ""; //adelikat - 03/02/09 - if no override, should return null and allow the last directory to be used intead
//return BaseDirectory + PSS + "tools"; //return BaseDirectory + PSS + "tools";
break; break;
}
case FCEUMKF_TASEDITOR: case FCEUMKF_TASEDITOR:
{
return BaseDirectory + PSS + "tools"; return BaseDirectory + PSS + "tools";
break;
}
} }
return "";
return ret;
} }
std::string FCEU_MakePath(int type, const char* filebase) std::string FCEU_MakePath(int type, const char* filebase)

Binary file not shown.