Skip to content

Commit

Permalink
feat: update library dependency
Browse files Browse the repository at this point in the history
- update YYCC dependency. add MessageBox to notice user error occurs by new added feature.
- bump up version
  • Loading branch information
yyc12345 committed Jul 31, 2024
1 parent 56a1db5 commit 2138e46
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions doc/DEV_HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ For texture file path, it is done in both `ExportLayoutWeaver` and `ObjExport`.

* Dialog left-bottom corner version string (all languages, current is English and Simplified Chinese).
* About dialog string in string table (also for all languages).
* Version info in resource file (also for all languages).
* Version indentifier passed to `YYCC::ConfigManager::CoreManager` constructor in `ConfigManager.cpp` if config file structure has been changed when bumping version.
8 changes: 4 additions & 4 deletions script/build.bat
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@ECHO OFF
ECHO This script must be executed at the root of project. Press any key to continue...
PAUSE
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.0" -y "J:\YYCCommonplace\bin\install"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.0" -y "J:\YYCCommonplace\bin\msvc_install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin_vt3.0.zip" "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.5" -y "J:\YYCCommonplace\bin\install"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.5" -y "J:\YYCCommonplace\bin\msvc_install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin_vt3.5.zip" "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 4.0" -y "J:\YYCCommonplace\bin\install"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 4.0" -y "J:\YYCCommonplace\bin\msvc_install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin_vt4.0.zip" "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 5.0" -y "J:\YYCCommonplace\bin\install"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 5.0" -y "J:\YYCCommonplace\bin\msvc_install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin_vt5.0.zip" "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin.pdb"
ECHO Build Done.
2 changes: 1 addition & 1 deletion script/build_build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def main() -> None:
for ver in ('3.0', '3.5', '4.0', '5.0'):
vt_path: str = f'E:\Virtools\\Virtools Dev {ver}'
vt_interface_path: str = f'{vt_path}\InterfacePlugins'
writeline(f, f'python "script\\setup_env.py" -p "{vt_path}" -y "J:\\YYCCommonplace\\bin\\install"')
writeline(f, f'python "script\\setup_env.py" -p "{vt_path}" -y "J:\\YYCCommonplace\\bin\\msvc_install"')
writeline(f, f'MSBuild src\\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86')
writeline(f, f'python -m zipfile -c "{vt_interface_path}\\vtobjplugin_vt{ver}.zip" "{vt_interface_path}\\vtobjplugin.dll" "{vt_interface_path}\\vtobjplugin.pdb"')

Expand Down
10 changes: 10 additions & 0 deletions src/VirtoolsMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,15 @@ namespace vtobjplugin::VirtoolsMenu {
return g_Plugininterface;
}

void UnhandledExceptionCallback(const YYCC::yycc_u8string& log_path, const YYCC::yycc_u8string& coredump_path) {
const auto& string_loader = Utilities::StringLoader::GetSingleton();
MessageBoxW(
NULL,
YYCC::EncodingHelper::UTF8ToWchar(YYCC::StringHelper::Printf(string_loader.LoadStringU8(IDS_UE_BODY).c_str(), log_path.c_str(), coredump_path.c_str()).c_str()).c_str(),
string_loader.LoadStringW(IDS_UE_TITLE).c_str(),
MB_OK + MB_ICONERROR
);
}


}
2 changes: 2 additions & 0 deletions src/VirtoolsMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ namespace vtobjplugin::VirtoolsMenu {
PluginInfo* GetPluginInfo();
PluginInterface* GetPluginInterface();

void UnhandledExceptionCallback(const YYCC::yycc_u8string& log_path, const YYCC::yycc_u8string& coredump_path);

}
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CVtObjPlugin : CWinApp {
virtual BOOL InitInstance() override {
// register unhandler exception handler
#ifdef VTOBJ_RELEASE
YYCC::ExceptionHelper::Register();
YYCC::ExceptionHelper::Register(vtobjplugin::VirtoolsMenu::UnhandledExceptionCallback);
#endif

// load config from file
Expand Down
2 changes: 2 additions & 0 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#define IDS_EXPLAYOUT_NAME_CONV_FAIL 128
#define IDS_EXPALYOUT_NAME_UNAMED 129
#define IDS_EXPLAYOUT_NAME_UNAMED 129
#define IDS_UE_TITLE 130
#define IDS_UE_BODY 131
#define IDC_RADIO1 1001
#define IDC_RADIO2 1002
#define IDC_RADIO3 1003
Expand Down
2 changes: 1 addition & 1 deletion src/vtobjplugin.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ImportGroup Label="PropertySheets"/>
<PropertyGroup Label="UserMacros">
<VIRTOOLS_PATH>E:\Virtools\Virtools Dev 5.0</VIRTOOLS_PATH>
<YYCC_PATH>J:\YYCCommonplace\bin\install</YYCC_PATH>
<YYCC_PATH>J:\YYCCommonplace\bin\msvc_install</YYCC_PATH>
</PropertyGroup>
<PropertyGroup/>
<ItemDefinitionGroup/>
Expand Down
28 changes: 16 additions & 12 deletions src/vtobjplugin.rc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ LANGUAGE LANG_CHINESE, SUBLANG_NEUTRAL
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,0
PRODUCTVERSION 3,0,0,0
FILEVERSION 3,1,0,0
PRODUCTVERSION 3,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -43,12 +43,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "yyc12345"
VALUE "FileDescription", "���� Virtools �� Wavefront OBJ ��������"
VALUE "FileVersion", "3.0.0.0"
VALUE "FileVersion", "3.1.0.0"
VALUE "InternalName", "vtobjplu.dll"
VALUE "LegalCopyright", "��Ȩ���� (C) 2020-2024 yyc12345"
VALUE "OriginalFilename", "vtobjplu.dll"
VALUE "ProductName", "vtobjplugin"
VALUE "ProductVersion", "3.0.0.0"
VALUE "ProductVersion", "3.1.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down Expand Up @@ -109,7 +109,7 @@ BEGIN
EDITTEXT IDC_EDIT3,230,383,107,14,ES_AUTOHSCROLL
CONTROL "������Ͳ����ļ���ʹ�� UTF8",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,402,123,10
CONTROL "�ڽű��ļ���ʹ�� UTF8",IDC_CHECK12,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,420,99,10
LTEXT "vtobjplugin - v3.0",IDC_STATIC,6,444,58,8
LTEXT "vtobjplugin - v3.1",IDC_STATIC,6,444,58,8
PUSHBUTTON "����ΪĬ��",IDC_BUTTON2,6,462,50,14
END

Expand Down Expand Up @@ -157,7 +157,7 @@ BEGIN
IDS_VTMENU_MENU_REPORT_BUG "�㱨����"
IDS_VTMENU_MENU_ABOUT "���� vtobjplugin"
IDS_VTMENU_ABOUT_TITLE "���� vtobjplugin"
IDS_VTMENU_ABOUT_BODY "vtobjplugin v3.0 - ������ Virtools �� Wavefront OBJ ��������\n���� GPL v3 ����֤��\n��Ŀ��ҳ: https://github.com/yyc12345/vtobjplugin"
IDS_VTMENU_ABOUT_BODY "vtobjplugin v3.1 - ������ Virtools �� Wavefront OBJ ��������\n���� GPL v3 ����֤��\n��Ŀ��ҳ: https://github.com/yyc12345/vtobjplugin"
IDS_VTMENU_SUCCESS_NOTE "Wavefront OBJ ������ɡ�"
IDS_EXPSETDLG_ERR_TITLE "����"
END
Expand Down Expand Up @@ -186,6 +186,8 @@ STRINGTABLE
BEGIN
IDS_EXPLAYOUT_NAME_CONV_FAIL "�޷��Ը�������ת�������ơ����ʹ�����ɵ����������"
IDS_EXPLAYOUT_NAME_UNAMED "δ�������塣ʹ�����ɵ����ơ�"
IDS_UE_TITLE "��������"
IDS_UE_BODY "�������������󡣱��������ɡ��뱨��������ߡ�\n��־·��: %s\n����ת��·��: %s"
END

#endif // Chinese (Simplified) resources
Expand Down Expand Up @@ -241,8 +243,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,0
PRODUCTVERSION 3,0,0,0
FILEVERSION 3,1,0,0
PRODUCTVERSION 3,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -259,12 +261,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "yyc12345"
VALUE "FileDescription", "Wavefront OBJ Exporter for Virtools."
VALUE "FileVersion", "3.0.0.0"
VALUE "FileVersion", "3.1.0.0"
VALUE "InternalName", "vtobjplu.dll"
VALUE "LegalCopyright", "Copyright (C) 2020-2024 yyc12345"
VALUE "OriginalFilename", "vtobjplu.dll"
VALUE "ProductName", "vtobjplugin"
VALUE "ProductVersion", "3.0.0.0"
VALUE "ProductVersion", "3.1.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down Expand Up @@ -330,7 +332,7 @@ BEGIN
CONTROL "Use UTF8 in Object and Material File",IDC_CHECK11,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,402,131,10
CONTROL "Use UTF8 in Script File",IDC_CHECK12,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,420,87,10
LTEXT "vtobjplugin - v3.0",IDC_STATIC,6,444,58,8
LTEXT "vtobjplugin - v3.1",IDC_STATIC,6,444,58,8
PUSHBUTTON "Reset",IDC_BUTTON2,6,462,50,14
END

Expand Down Expand Up @@ -378,7 +380,7 @@ BEGIN
IDS_VTMENU_MENU_REPORT_BUG "Report Bug"
IDS_VTMENU_MENU_ABOUT "About vtobjplugin"
IDS_VTMENU_ABOUT_TITLE "About vtobjplugin"
IDS_VTMENU_ABOUT_BODY "vtobjplugin v3.0 - A Wavefront OBJ Exporter for Virtools.\nUnder GPL v3 License.\nProject Home Page: https://github.com/yyc12345/vtobjplugin"
IDS_VTMENU_ABOUT_BODY "vtobjplugin v3.1 - A Wavefront OBJ Exporter for Virtools.\nUnder GPL v3 License.\nProject Home Page: https://github.com/yyc12345/vtobjplugin"
IDS_VTMENU_SUCCESS_NOTE "Wavefront OBJ Export Done."
IDS_EXPSETDLG_ERR_TITLE "Setting Error"
END
Expand Down Expand Up @@ -410,6 +412,8 @@ BEGIN
IDS_EXPLAYOUT_NAME_CONV_FAIL
"Fail to convert its name by given encoding. Use generated name instead."
IDS_EXPLAYOUT_NAME_UNAMED "Unamed object. Use generated name."
IDS_UE_TITLE "Fatal Error"
IDS_UE_BODY "Fatal error occurs. Report is generated. Please report to developer.\nLog path: %s\nCore dump path: %s"
END

#endif // English (United States) resources
Expand Down

0 comments on commit 2138e46

Please sign in to comment.