Commit 1eedc77f authored by devill.tamachan's avatar devill.tamachan

[追加] カスタムパレットフォルダを開くメニュー追加

parent 6ab4876a
......@@ -344,6 +344,7 @@ BEGIN
END
MENUITEM SEPARATOR
MENUITEM "BZ.DEFの編集(&E)", ID_TOOLS_EDITDEF
MENUITEM "カスタムパレットの編集", ID_TOOLS_EDITPALLET
END
POPUP "ヘルプ(&H)"
BEGIN
......
......@@ -182,6 +182,7 @@ BEGIN
END
MENUITEM SEPARATOR
MENUITEM "&Edit BZ.DEF", ID_TOOLS_EDITDEF
MENUITEM "Edit Custom Pallets", ID_TOOLS_EDITPALLET
END
POPUP "&Help"
BEGIN
......
......@@ -217,17 +217,22 @@ CString GetStructFilePath(UINT uID)
return retStr;
}
CString GetCustomPalletFilePath()
CString GetCustomPalletDirPath()
{
TCHAR szAppData[_MAX_PATH];
if(options.bPortableMode)return GetModulePath(_T("Pallets\\*.*"));
if(options.bPortableMode)return GetModulePath(_T("Pallets\\"));
else {
SHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, szAppData);
PathAppend(szAppData, _T("\\BzEditor\\Pallets\\*.*"));
PathAppend(szAppData, _T("\\BzEditor\\Pallets\\"));
return szAppData;
}
}
CString GetCustomPalletFilePath()
{
return GetCustomPalletDirPath()+"*.*";
}
LPVOID ReadFile(LPCTSTR pPath, DWORD *length /* = NULL */, DWORD *lengthPlusSpace /* = NULL */, DWORD spacepadding /* = 0 */, BOOL bEOF /* = FALSE */, BOOL bFailedMsgBox /* = TRUE */)
{
CAtlFile file;
......
......@@ -70,6 +70,8 @@ CString SeparateByComma(int num, BOOL bSigned = FALSE);
CString SeparateByComma64(ULONGLONG num, BOOL bSigned = FALSE);
CString GetModulePath(LPCTSTR pFileName);
CString GetStructFilePath(UINT uID);
CString GetCustomPalletDirPath();
CString GetCustomPalletFilePath();
LPVOID ReadFile(LPCTSTR pPath, DWORD *length = NULL, DWORD *lengthPlusSpace = NULL, DWORD spacepadding = 0, BOOL bEOF = FALSE, BOOL bFailedMsgBox = TRUE);
void ErrorMessageBox(HWND hWnd = NULL); // ###1.61
void ErrorResMessageBox(UINT nID, HWND hWnd = NULL);
......
......@@ -112,6 +112,7 @@ public:
COMMAND_ID_HANDLER_EX(ID_APP_ABOUT, OnAppAbout)
COMMAND_RANGE_HANDLER_EX(ID_VIEW_SPLIT_H, ID_VIEW_SPLIT_V, OnViewSplit)
COMMAND_ID_HANDLER_EX(ID_TOOLS_EDITDEF, OnToolsEditBZDef)
COMMAND_ID_HANDLER_EX(ID_TOOLS_EDITPALLET, OnToolsEditPallet)
COMMAND_ID_HANDLER_EX(ID_FILE_SAVE_DUMPLIST, OnFileSaveDumpList)
//ON_COMMAND( ID_HELP_INDEX, OnHelpIndex )
COMMAND_RANGE_HANDLER_EX(ID_LANG_JPN, ID_LANG_ENU, OnLanguage)
......@@ -365,6 +366,12 @@ public:
if(sEditorPath.IsEmpty()) ::ShellExecute(m_hWnd, _T("edit") , sPath, NULL, NULL, SW_SHOWNORMAL);
else ::ShellExecute(m_hWnd, _T("open") , sEditorPath, sPath, NULL, SW_SHOWNORMAL);
}
void OnToolsEditPallet(UINT uNotifyCode, int nID, CWindow wndCtl)
{
CString path = GetCustomPalletDirPath();
MakeSureDirectoryPathExists(CW2A(path));
::ShellExecute(m_hWnd, _T("open") , path, NULL, NULL, SW_SHOWNORMAL);
}
void OnFileSaveDumpList(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnLanguage(UINT uNotifyCode, int nID, CWindow wndCtl)
{
......
......@@ -118,6 +118,7 @@
#define ID_LANG_JPN 32831
#define ID_LANG_ENU 32832
#define ID_TOOLS_EDITDEF 32833
#define ID_TOOLS_EDITPALLET 32834
#define ID_BMPVIEW_WIDTH128 32836
#define ID_BMPVIEW_WIDTH256 32837
#define ID_BMPVIEW_ZOOM 32838
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment