diff --git a/Metin2Client.sln b/Metin2Client.sln index 0a5a4da4..acf3b98e 100644 --- a/Metin2Client.sln +++ b/Metin2Client.sln @@ -34,6 +34,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptLib", "src\ScriptLib\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EterLocale", "src\EterLocale\EterLocale.vcxproj", "{05207E97-C83A-49C6-8E08-403679963A7B}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Config", "src\Config\Metin2Config.vcxproj", "{879A444C-3A51-4B63-8888-DC0AAD578B03}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -137,6 +139,12 @@ Global {05207E97-C83A-49C6-8E08-403679963A7B}.Distribute|Win32.Build.0 = Distribute|Win32 {05207E97-C83A-49C6-8E08-403679963A7B}.Release|Win32.ActiveCfg = Release|Win32 {05207E97-C83A-49C6-8E08-403679963A7B}.Release|Win32.Build.0 = Release|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Debug|Win32.ActiveCfg = Debug|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Debug|Win32.Build.0 = Debug|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Distribute|Win32.ActiveCfg = Distribute|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Distribute|Win32.Build.0 = Distribute|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Release|Win32.ActiveCfg = Release|Win32 + {879A444C-3A51-4B63-8888-DC0AAD578B03}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin/.gitignore b/bin/.gitignore index e3d4d4f3..d8377271 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,8 +1,12 @@ # Game executable metin2client.exe +# Configuration executable +config.exe + # User configuration files channel.inf +locale.cfg metin2.cfg BGM/lastplay.inf diff --git a/bin/config.exe b/bin/config.exe deleted file mode 100644 index 24f2bc11..00000000 Binary files a/bin/config.exe and /dev/null differ diff --git a/bin/locale.cfg b/bin/locale.cfg deleted file mode 100644 index 0722646d..00000000 --- a/bin/locale.cfg +++ /dev/null @@ -1 +0,0 @@ -10002 1252 en diff --git a/bin/locale_cz.cfg b/bin/locale_cz.cfg deleted file mode 100644 index 1f3d96df..00000000 --- a/bin/locale_cz.cfg +++ /dev/null @@ -1 +0,0 @@ -10019 1250 cz diff --git a/bin/locale_de.cfg b/bin/locale_de.cfg deleted file mode 100644 index 98e0d342..00000000 --- a/bin/locale_de.cfg +++ /dev/null @@ -1 +0,0 @@ -10000 1252 de diff --git a/bin/locale_dk.cfg b/bin/locale_dk.cfg deleted file mode 100644 index d7fa2ef0..00000000 --- a/bin/locale_dk.cfg +++ /dev/null @@ -1 +0,0 @@ -10013 1252 dk diff --git a/bin/locale_en.cfg b/bin/locale_en.cfg deleted file mode 100644 index 0722646d..00000000 --- a/bin/locale_en.cfg +++ /dev/null @@ -1 +0,0 @@ -10002 1252 en diff --git a/bin/locale_es.cfg b/bin/locale_es.cfg deleted file mode 100644 index 6d511b91..00000000 --- a/bin/locale_es.cfg +++ /dev/null @@ -1 +0,0 @@ -10004 1252 es diff --git a/bin/locale_fr.cfg b/bin/locale_fr.cfg deleted file mode 100644 index 7c9c704e..00000000 --- a/bin/locale_fr.cfg +++ /dev/null @@ -1 +0,0 @@ -10000 1252 fr diff --git a/bin/locale_gr.cfg b/bin/locale_gr.cfg deleted file mode 100644 index ca636110..00000000 --- a/bin/locale_gr.cfg +++ /dev/null @@ -1 +0,0 @@ -0 1253 gr diff --git a/bin/locale_hu.cfg b/bin/locale_hu.cfg deleted file mode 100644 index c68b92a9..00000000 --- a/bin/locale_hu.cfg +++ /dev/null @@ -1 +0,0 @@ -10021 1250 hu diff --git a/bin/locale_it.cfg b/bin/locale_it.cfg deleted file mode 100644 index 8a4d09f1..00000000 --- a/bin/locale_it.cfg +++ /dev/null @@ -1 +0,0 @@ -10006 1252 it diff --git a/bin/locale_nl.cfg b/bin/locale_nl.cfg deleted file mode 100644 index e78e2f48..00000000 --- a/bin/locale_nl.cfg +++ /dev/null @@ -1 +0,0 @@ -10018 1252 nl diff --git a/bin/locale_pl.cfg b/bin/locale_pl.cfg deleted file mode 100644 index c5c3659d..00000000 --- a/bin/locale_pl.cfg +++ /dev/null @@ -1 +0,0 @@ -10012 1250 pl diff --git a/bin/locale_pt.cfg b/bin/locale_pt.cfg deleted file mode 100644 index 3949c809..00000000 --- a/bin/locale_pt.cfg +++ /dev/null @@ -1 +0,0 @@ -10010 1252 pt diff --git a/bin/locale_ro.cfg b/bin/locale_ro.cfg deleted file mode 100644 index 1033fef5..00000000 --- a/bin/locale_ro.cfg +++ /dev/null @@ -1 +0,0 @@ -10022 1250 ro diff --git a/bin/locale_ru.cfg b/bin/locale_ru.cfg deleted file mode 100644 index 09004f66..00000000 --- a/bin/locale_ru.cfg +++ /dev/null @@ -1 +0,0 @@ -10020 1251 ru diff --git a/bin/locale_tr.cfg b/bin/locale_tr.cfg deleted file mode 100644 index 1d240dd4..00000000 --- a/bin/locale_tr.cfg +++ /dev/null @@ -1 +0,0 @@ -10012 1254 tr diff --git a/build.bat b/build.bat index 080e1eec..d1f1c43b 100644 --- a/build.bat +++ b/build.bat @@ -32,6 +32,7 @@ rem Start assembling the client package RMDIR /S /Q dist MKDIR dist\ COPY /Y build\bin\Distribute\UserInterface.exe dist\metin2.exe +COPY /Y build\bin\Distribute\Config.exe dist\config.exe rem Copy over the data from the bin directory xcopy bin\ dist\ /Y /Q diff --git a/src/Config/MainDialog.cpp b/src/Config/MainDialog.cpp new file mode 100644 index 00000000..d4c4e227 --- /dev/null +++ b/src/Config/MainDialog.cpp @@ -0,0 +1,491 @@ +#include "MainDialog.h" + +#include + +#include +#include + +#define APP_NAME _T("Metin2 Config") +#define FILENAME_CONFIG "metin2.cfg" +#define LOCALE_CONFIG "locale.cfg" + +static const unsigned int kVisibilityNames[CMainDialog::VISIBILITY_MAX_NUM] = { + IDS_FOG_NEAR, IDS_FOG_MID, IDS_FOG_FAR +}; + +static const unsigned int kTilingNames[CMainDialog::TILING_MAX_NUM] = { + IDS_TILE_AUTO, IDS_TILE_CPU, IDS_TILE_GPU +}; + +static const unsigned int kShadowNames[CMainDialog::SHADOW_MAX_NUM] = { + IDS_SHADOW_NONE, IDS_SHADOW_LV1, IDS_SHADOW_LV2, IDS_SHADOW_ALL +}; + +enum Language +{ + kLanguageCzech, + kLanguageDanish, + kLanguageDutch, + kLanguageEnglish, + kLanguageFrench, + kLanguageGerman, + kLanguageGreek, + kLanguageHungarian, + kLanguageItalian, + kLanguagePolish, + kLanguagePortuguese, + kLanguageRomanian, + kLanguageRussian, + kLanguageSpanish, + kLanguageTurkish, + + kLanguageMax +}; + +struct LanguageConfig +{ + int stringId; + int charset; + const char* name; +} kLanguageConfig[] = { + {IDS_LANGUAGE_CZECH, 1250, "cz"}, + {IDS_LANGUAGE_DANISH, 1252, "dk"}, + {IDS_LANGUAGE_DUTCH, 1252, "nl"}, + {IDS_LANGUAGE_ENGLISH, 1252, "en"}, + {IDS_LANGUAGE_FRENCH, 1252, "fr"}, + {IDS_LANGUAGE_GERMAN, 1252, "de"}, + {IDS_LANGUAGE_GREEK, 1253, "gr"}, + {IDS_LANGUAGE_HUNGARIAN, 1250, "hu"}, + {IDS_LANGUAGE_ITALIAN, 1252, "it"}, + {IDS_LANGUAGE_POLISH, 1250, "pl"}, + {IDS_LANGUAGE_PORTUGUESE, 1252, "pt"}, + {IDS_LANGUAGE_ROMANIAN, 1250, "ro"}, + {IDS_LANGUAGE_RUSSIAN, 1251, "ru"}, + {IDS_LANGUAGE_SPANISH, 1252, "es"}, + {IDS_LANGUAGE_TURKISH, 1254, "tr"}, +}; + +CMainDialog::CMainDialog() +{ + InitDefaultConfig(); +} + +BOOL CMainDialog::OnInitDialog(CWindow wndFocus, LPARAM lInitParam) +{ + CenterWindow(); + + HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, + ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + + HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + + GetResolutionList(); + + LoadConfig(); + + DoDataExchange(FALSE); + + // Screen Resolution + ATL::CString strResolutionName; + for (int i=0; i < m_nResolutionCount; i++) { + strResolutionName.Format(_T("%dx%d %dbpp"), m_ResolutionList[i].width, m_ResolutionList[i].height, m_ResolutionList[i].bpp); + m_comboResolution.InsertString( i, strResolutionName ); + } + + // Resolution Selection + strResolutionName.Format(_T("%dx%d %dbpp"), m_stConfig.width, m_stConfig.height, m_stConfig.bpp); + int iResolutionSel = m_comboResolution.FindString(0, strResolutionName); + + if (iResolutionSel < 0) + m_comboResolution.SetCurSel(0); + else + m_comboResolution.SetCurSel(iResolutionSel); + + // Frequency + UpdateFrequencyComboBox(); + + ATL::CString strFrequency; + strFrequency.Format(_T("%d"), m_stConfig.frequency); + + int iFrequencySel = m_comboFrequency.FindString(0, strFrequency); + if (iFrequencySel < 0) + m_comboFrequency.SetCurSel(0); + else + m_comboFrequency.SetCurSel(iFrequencySel); + + // Gamma + ATL::CString strGammaName; + for (int i=0; i < GAMMA_MAX_NUM; i++) { + strGammaName.Format(_T("%d"), i + 1); + m_comboGamma.InsertString(i, strGammaName); + } + + // Gamma Selection + if (m_stConfig.gamma > 0 && m_stConfig.gamma <= GAMMA_MAX_NUM) + m_comboGamma.SetCurSel(m_stConfig.gamma - 1); + else + m_comboGamma.SetCurSel(0); + + // Visibility + ATL::CString strVisibility; + for (int i = 0; i < VISIBILITY_MAX_NUM; i++) { + strVisibility.LoadString(kVisibilityNames[i]); + m_comboVisibility.InsertString(i, strVisibility); + } + + if (m_stConfig.iDistance > 0 && m_stConfig.iDistance <= VISIBILITY_MAX_NUM) + m_comboVisibility.SetCurSel(m_stConfig.iDistance - 1); + else + m_comboVisibility.SetCurSel(0); + + // Tiling + ATL::CString strTiling; + for (int i=0; i < TILING_MAX_NUM; i++) { + strTiling.LoadString(kTilingNames[i]); + m_comboTiling.InsertString(i, strTiling); + } + + m_stConfig.iTiling = std::max(m_stConfig.iTiling, 0); + m_stConfig.iTiling = std::min(m_stConfig.iTiling, TILING_MAX_NUM - 1); + + m_comboTiling.SetCurSel(m_stConfig.iTiling); + + // Shadow + ATL::CString strShadow; + for (int i=0; i < SHADOW_MAX_NUM; i++) { + strShadow.LoadString(kShadowNames[i]); + m_comboShadow.InsertString(i, strShadow); + } + + m_stConfig.iShadowLevel = std::max(m_stConfig.iShadowLevel, 0); + m_stConfig.iShadowLevel = std::min(m_stConfig.iShadowLevel, SHADOW_MAX_NUM-1); + m_comboShadow.SetCurSel(m_stConfig.iShadowLevel); + + // Language + ATL::CString language; + for (int i = 0; i < kLanguageMax; ++i) { + language.LoadString(kLanguageConfig[i].stringId); + m_comboLanguage.InsertString(i, language); + } + + m_stConfig.language = std::clamp((int) m_stConfig.language, 0, kLanguageMax - 1); + + m_comboLanguage.SetCurSel(m_stConfig.language); + + // Sound + m_sliderBGMVolume.SetRange(0, 1000, true); + m_sliderSoundVolume.SetRange(0, 1000, true); + + if (m_stConfig.music_volume >= 0.0f && + m_stConfig.music_volume <= MUSIC_VOLUME_MAX_NUM) + m_sliderBGMVolume.SetPos(int(m_stConfig.music_volume * 1000.0f)); + + if (m_stConfig.voice_volume >= 0 && + m_stConfig.voice_volume <= SOUND_VOLUME_MAX_NUM) + m_sliderSoundVolume.SetPos(m_stConfig.voice_volume * 200); + + return TRUE; +} + +void CMainDialog::OnOK(UINT uNotifyCode, int nID, CWindow wndCtl) +{ + if (DoDataExchange(TRUE) == FALSE) { + //MessageBox(); + } + + ApplyConfig(); + SaveConfig(); + + EndDialog(nID); +} + +void CMainDialog::OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl) +{ + EndDialog(nID); +} + +// Utility functions +void CMainDialog::InitDefaultConfig() +{ + memset(&m_stConfig, 0, sizeof(m_stConfig)); + + m_stConfig.width = 800; + m_stConfig.height = 600; + m_stConfig.frequency = 60; + m_stConfig.bpp = 16; + + m_stConfig.bUseSoftwareCursor = false; + m_stConfig.iDistance = 3; + m_stConfig.iTiling = 0; + m_stConfig.iShadowLevel = 3; + + m_stConfig.gamma = 3; + m_stConfig.music_volume = 1.0f; + m_stConfig.voice_volume = 5; + + m_stConfig.bFullscreen = true; + + auto lang = PRIMARYLANGID(LANGIDFROMLCID(GetUserDefaultLCID())); + switch (lang) { + case LANG_GERMAN: + m_stConfig.language = kLanguageGerman; + break; + + default: + m_stConfig.language = kLanguageEnglish; + break; + } +} + +void CMainDialog::LoadConfig() +{ + char buf[256]; + char command[256]; + char value[256]; + + FILE * fp = fopen(FILENAME_CONFIG, "rt"); + if (fp == NULL) + return; + + while (fgets(buf, 256, fp)) { + if (sscanf(buf, " %s %s \n", command, value) == EOF) + break; + + if (!_stricmp(command, "WIDTH")) + m_stConfig.width = atoi(value); + else if (!_stricmp(command, "HEIGHT")) + m_stConfig.height = atoi(value); + else if (!_stricmp(command, "BPP")) + m_stConfig.bpp = atoi(value); + else if (!_stricmp(command, "FREQUENCY")) + m_stConfig.frequency = atoi(value); + else if (!_stricmp(command, "SOFTWARE_CURSOR")) + m_stConfig.bUseSoftwareCursor = atoi(value) ? true : false; + else if (!_stricmp(command, "VISIBILITY")) + m_stConfig.iDistance = atoi(value); + else if (!_stricmp(command, "SOFTWARE_TILING")) + m_stConfig.iTiling = atoi(value); + else if (!_stricmp(command, "SHADOW_LEVEL")) + m_stConfig.iShadowLevel = atoi(value); + else if (!_stricmp(command, "MUSIC_VOLUME")) + m_stConfig.music_volume = (float) atof(value); + else if (!_stricmp(command, "VOICE_VOLUME")) + m_stConfig.voice_volume = (char) atoi(value); + else if (!_stricmp(command, "GAMMA")) + m_stConfig.gamma = std::max(1, std::min(GAMMA_MAX_NUM, atoi(value))); + else if (!_stricmp(command, "WINDOWED")) + m_stConfig.bFullscreen = atoi(value) == 1 ? false : true; + } + + fclose(fp); + + int charset; + char lang[256]; + + fp = fopen(LOCALE_CONFIG, "rt"); + if (!fp) + return; + + fgets(buf, 256, fp); + sscanf(buf, "%d %s", &charset, lang); + + for (int i = 0; i < kLanguageMax; ++i) { + const auto& cfg = kLanguageConfig[i]; + if (0 == std::strcmp(lang, cfg.name)) + m_stConfig.language = i; + } + + fclose(fp); +} + +void CMainDialog::SaveConfig() +{ + FILE* fp = fopen(FILENAME_CONFIG, "wt"); + if (fp == NULL) + return; + + fprintf(fp, "WIDTH %d\n", m_stConfig.width); + fprintf(fp, "HEIGHT %d\n", m_stConfig.height); + fprintf(fp, "BPP %d\n", m_stConfig.bpp); + fprintf(fp, "FREQUENCY %d\n", m_stConfig.frequency); + fprintf(fp, "SOFTWARE_CURSOR %d\n", m_stConfig.bUseSoftwareCursor); + fprintf(fp, "VISIBILITY %d\n", m_stConfig.iDistance); + fprintf(fp, "SOFTWARE_TILING %d\n", m_stConfig.iTiling); + fprintf(fp, "SHADOW_LEVEL %d\n", m_stConfig.iShadowLevel); + fprintf(fp, "MUSIC_VOLUME %.3f\n", m_stConfig.music_volume); + fprintf(fp, "VOICE_VOLUME %d\n", m_stConfig.voice_volume); + fprintf(fp, "GAMMA %d\n", m_stConfig.gamma); + fprintf(fp, "WINDOWED %d\n", !m_stConfig.bFullscreen); + fprintf(fp, "\n"); + fclose(fp); + + fp = fopen(LOCALE_CONFIG, "wt"); + if (!fp) + return; + + fprintf(fp, "%d %s", kLanguageConfig[m_stConfig.language].charset, kLanguageConfig[m_stConfig.language].name); + fclose(fp); +} + +void CMainDialog::UpdateFrequencyComboBox() +{ + int iScreenCurrentSelection = m_comboResolution.GetCurSel(); + + m_comboFrequency.ResetContent(); + + ATL::CString strFrequencyName; + for (int i=0; i < m_ResolutionList[iScreenCurrentSelection].frequency_count; i++) { + strFrequencyName.Format(_T("%d"), m_ResolutionList[iScreenCurrentSelection].frequency[i]); + m_comboFrequency.InsertString(i, strFrequencyName); + } + + m_comboFrequency.SetCurSel(m_ResolutionList[iScreenCurrentSelection].frequency_count - 1); +} + +void CMainDialog::GetResolutionList() +{ + m_nResolutionCount = 0; + + auto lpd3d = Direct3DCreate9(D3D_SDK_VERSION); + if (!lpd3d) { + m_ResolutionList[m_nResolutionCount].width = 800; + m_ResolutionList[m_nResolutionCount].height = 600; + m_ResolutionList[m_nResolutionCount].bpp = 16; + m_ResolutionList[m_nResolutionCount].frequency[0] = 60; + m_ResolutionList[m_nResolutionCount].frequency_count = 1; + + ++m_nResolutionCount; + return; + } + + const D3DFORMAT allowedFormats[] = { + D3DFMT_X8R8G8B8, + D3DFMT_R5G6B5, + }; + + for (int i = 0; i < sizeof(allowedFormats) / sizeof(D3DFORMAT); ++i) { + // 이 어뎁터가 가지고 있는 디스플래이 모드갯수를 나열한다.. + DWORD dwNumAdapterModes = lpd3d->GetAdapterModeCount(0, allowedFormats[i]); + if (dwNumAdapterModes == 0) { + m_ResolutionList[m_nResolutionCount].width = 800; + m_ResolutionList[m_nResolutionCount].height = 600; + m_ResolutionList[m_nResolutionCount].bpp = 16; + m_ResolutionList[m_nResolutionCount].frequency[0] = 60; + m_ResolutionList[m_nResolutionCount].frequency_count = 1; + + ++m_nResolutionCount; + lpd3d->Release(); + return; + } + + for (UINT iMode = 0; iMode < dwNumAdapterModes; iMode++) { + D3DDISPLAYMODE displayMode; + lpd3d->EnumAdapterModes(0, allowedFormats[i], iMode, &displayMode); + + if (displayMode.Width < 800 || displayMode.Height < 600) + continue; + + int bpp = 0; + if (allowedFormats[i] == D3DFMT_R5G6B5) + bpp = 16; + else if (allowedFormats[i] == D3DFMT_X8R8G8B8) + bpp = 32; + + int check_res = false; + for (int i = 0; !check_res && i < m_nResolutionCount; ++i) { + if (m_ResolutionList[i].bpp != bpp || + m_ResolutionList[i].width != displayMode.Width || + m_ResolutionList[i].height != displayMode.Height) + continue; + + int check_fre = false; + + for (int j = 0; j < m_ResolutionList[i].frequency_count; ++j) { + if (m_ResolutionList[i].frequency[j] == displayMode.RefreshRate) { + check_fre = true; + break; + } + } + + if (!check_fre ) + if (m_ResolutionList[i].frequency_count < FREQUENCY_MAX_NUM) + m_ResolutionList[i].frequency[m_ResolutionList[i].frequency_count++] = displayMode.RefreshRate; + + check_res = true; + } + + if (!check_res) { + if (m_nResolutionCount < RESOLUTION_MAX_NUM) { + m_ResolutionList[m_nResolutionCount].width = displayMode.Width; + m_ResolutionList[m_nResolutionCount].height = displayMode.Height; + m_ResolutionList[m_nResolutionCount].bpp = bpp; + m_ResolutionList[m_nResolutionCount].frequency[0] = displayMode.RefreshRate; + m_ResolutionList[m_nResolutionCount].frequency_count = 1; + + ++m_nResolutionCount; + } + } + } + } + + lpd3d->Release(); +} + +void CMainDialog::ApplyConfig() +{ + int iResolutionSel = m_comboResolution.GetCurSel(); + if ((iResolutionSel >= 0) && (iResolutionSel < m_nResolutionCount)) { + m_stConfig.width = m_ResolutionList[iResolutionSel].width; + m_stConfig.height = m_ResolutionList[iResolutionSel].height; + m_stConfig.bpp = m_ResolutionList[iResolutionSel].bpp; + + int iFrequencySel = m_comboFrequency.GetCurSel(); + if ((iFrequencySel >= 0) && (iFrequencySel < m_ResolutionList[iResolutionSel].frequency_count)) + m_stConfig.frequency = m_ResolutionList[iResolutionSel].frequency[iFrequencySel]; + else + m_stConfig.frequency = 60; + } else { + m_stConfig.width = 800; + m_stConfig.height = 600; + m_stConfig.bpp = 16; + m_stConfig.frequency = 60; + } + + m_stConfig.gamma = m_comboGamma.GetCurSel() + 1; + m_stConfig.music_volume = float(m_sliderBGMVolume.GetPos()) / 1000.0f; + m_stConfig.voice_volume = m_sliderSoundVolume.GetPos() / 200; + + m_stConfig.iDistance = m_comboVisibility.GetCurSel() + 1; + m_stConfig.iTiling = m_comboTiling.GetCurSel(); + m_stConfig.iShadowLevel = m_comboShadow.GetCurSel(); + m_stConfig.language = m_comboLanguage.GetCurSel(); +} + +void CMainDialog::OnResolutionSelChange(UINT uNotifyCode, int nID, CWindow wndCtl) +{ + UpdateFrequencyComboBox(); +} + +void CMainDialog::OnTilingSelChange(UINT uNotifyCode, int nID, CWindow wndCtl) +{ + switch (m_comboTiling.GetCurSel()) { + case 0: + break; + + case 1: { + ATL::CString strCaption((LPCTSTR) IDS_NOTIFY); + ATL::CString strDescription((LPCTSTR) IDS_TILING_CPU); + MessageBox(strDescription, strCaption); + break; + } + + case 2: { + ATL::CString strCaption((LPCTSTR) IDS_NOTIFY); + ATL::CString strDescription((LPCTSTR) IDS_TILING_GPU); + MessageBox(strDescription, strCaption); + break; + } + } +} diff --git a/src/Config/MainDialog.h b/src/Config/MainDialog.h new file mode 100644 index 00000000..3dea2960 --- /dev/null +++ b/src/Config/MainDialog.h @@ -0,0 +1,134 @@ +#ifndef METIN2_CLIENT_CONFIG_MAINDIALOG_HPP +#define METIN2_CLIENT_CONFIG_MAINDIALOG_HPP + +#if VSTD_HAS_PRAGMA_ONCE +#pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "resource.h" + +#define MUSIC_VOLUME_MAX_NUM 1.0f + +class CMainDialog : public CDialogImpl, public CWinDataExchange +{ + public: + enum { IDD = IDR_MAINFRAME }; + + typedef struct SResolution + { + DWORD width; + DWORD height; + DWORD bpp; // bits per pixel (high-color = 16bpp, true-color = 32bpp) + + DWORD frequency[20]; + BYTE frequency_count; + } TResolution; + + typedef struct SConfig + { + DWORD width; + DWORD height; + DWORD bpp; + DWORD frequency; + + bool is_object_culling; + int iDistance; + int iTiling; + int iShadowLevel; + + FLOAT music_volume; + int voice_volume; + + int gamma; + + BOOL bUseSoftwareCursor; + BOOL bFullscreen; + + unsigned int language; + } TConfig; + + enum + { + FREQUENCY_MAX_NUM = 30, + RESOLUTION_MAX_NUM = 64, + + SOUND_VOLUME_MAX_NUM = 5, + + GAMMA_MAX_NUM = 5, + + VISIBILITY_MAX_NUM = 3, + TILING_MAX_NUM = 3, + SHADOW_MAX_NUM = 4, + }; + + CMainDialog(); + + BEGIN_MSG_MAP(CMainDialog) + MSG_WM_INITDIALOG(OnInitDialog) + COMMAND_HANDLER_EX(IDC_VIDEO_RESOLUTION, CBN_SELCHANGE, OnResolutionSelChange) + COMMAND_HANDLER_EX(IDC_OPTIMIZE_TILING, CBN_SELCHANGE, OnTilingSelChange) + COMMAND_ID_HANDLER_EX(IDOK, OnOK) + COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel) + END_MSG_MAP() + + BEGIN_DDX_MAP(CMainDialog) + DDX_CONTROL_HANDLE(IDC_VIDEO_RESOLUTION, m_comboResolution) + DDX_CONTROL_HANDLE(IDC_VIDEO_FREQUENCY, m_comboFrequency) + DDX_CONTROL_HANDLE(IDC_VIDEO_GAMMA, m_comboGamma) + DDX_CONTROL_HANDLE(IDC_SOUND_BGM, m_sliderBGMVolume) + DDX_CONTROL_HANDLE(IDC_SOUND_SOUND, m_sliderSoundVolume) + DDX_CONTROL_HANDLE(IDC_OPTIMIZE_VISIBILITY, m_comboVisibility) + DDX_CONTROL_HANDLE(IDC_OPTIMIZE_TILING, m_comboTiling) + DDX_CONTROL_HANDLE(IDC_OPTIMIZE_SHADOW, m_comboShadow) + DDX_CONTROL_HANDLE(IDC_LANGUAGE_COMBO, m_comboLanguage) + + DDX_RADIO(IDC_GRAPHIC_WINDOW_MODE, m_stConfig.bFullscreen) + DDX_CHECK(IDC_GRAPHIC_SOFTWARE_CURSOR, m_stConfig.bUseSoftwareCursor) + END_DDX_MAP() + + BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam); + + void OnOK(UINT uNotifyCode, int nID, CWindow wndCtl); + void OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl); + void OnResolutionSelChange(UINT uNotifyCode, int nID, CWindow wndCtl); + void OnTilingSelChange(UINT uNotifyCode, int nID, CWindow wndCtl); + + void GetResolutionList(); + void InitDefaultConfig(); + void LoadConfig(); + void SaveConfig(); + void ApplyConfig(); + void UpdateFrequencyComboBox(); + + protected: + typedef ATL::CSimpleArray TStringVector; + + WTL::CComboBox m_comboResolution; + WTL::CComboBox m_comboFrequency; + WTL::CComboBox m_comboGamma; + + WTL::CTrackBarCtrl m_sliderBGMVolume; + WTL::CTrackBarCtrl m_sliderSoundVolume; + + WTL::CComboBox m_comboVisibility; + WTL::CComboBox m_comboTiling; + WTL::CComboBox m_comboShadow; + WTL::CComboBox m_comboLanguage; + + TStringVector m_ShadowNameVector; + + protected: + TConfig m_stConfig; + TResolution m_ResolutionList[RESOLUTION_MAX_NUM]; + int m_nResolutionCount; +}; + +#endif diff --git a/src/Config/Metin2Config.cpp b/src/Config/Metin2Config.cpp new file mode 100644 index 00000000..0cc7d57b --- /dev/null +++ b/src/Config/Metin2Config.cpp @@ -0,0 +1,26 @@ +#include "MainDialog.h" +#include "resource.h" + +#include + +#include + +#pragma comment(lib, "d3d9.lib") + +CAppModule _Module; + +int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + ::InitCommonControls(); + + _Module.Init(NULL, hInstance); + + CMainDialog cDialog; + int nRet = (int) cDialog.DoModal(); + + _Module.Term(); + return nRet; +} diff --git a/src/Config/Metin2Config.rc b/src/Config/Metin2Config.rc new file mode 100644 index 00000000..62c71471 --- /dev/null +++ b/src/Config/Metin2Config.rc @@ -0,0 +1,19 @@ +#include + +#include "ui.rc" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON "metin2.ico" + +#define METIN2_COMPONENT_DESCRIPTION "Metin2 Client Configuration Utility" +#define METIN2_COMPONENT_INTERNALNAME "Config" +#define METIN2_COMPONENT_FILENAME "config.exe" +#define METIN2_COMPONENT_TYPE VFT_APP + +#include diff --git a/src/Config/Metin2Config.vcxproj b/src/Config/Metin2Config.vcxproj new file mode 100644 index 00000000..9c58713e --- /dev/null +++ b/src/Config/Metin2Config.vcxproj @@ -0,0 +1,198 @@ + + + + + Debug + Win32 + + + Distribute + Win32 + + + Release + Win32 + + + + 17.0 + Config + {879A444C-3A51-4B63-8888-DC0AAD578B03} + Metin2Config + SAK + SAK + SAK + SAK + MFCProj + 10.0 + + + + Application + v143 + false + MultiByte + + + Application + v143 + false + MultiByte + + + Application + false + MultiByte + v143 + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.32203.90 + + + $(SolutionDir)build\bin\$(Configuration)\ + $(SolutionDir)build\obj\$(ProjectName)\$(Configuration)\ + + + $(SolutionDir)build\bin\$(Configuration)\ + $(SolutionDir)build\obj\$(ProjectName)\$(Configuration)\ + + + $(SolutionDir)build\bin\$(Configuration)\ + $(SolutionDir)build\obj\$(ProjectName)\$(Configuration)\ + + + true + $(Configuration) + $(SolutionDir)build\vcpkg\ + + + true + Release + $(SolutionDir)build\vcpkg\ + + + true + $(Configuration) + $(SolutionDir)build\vcpkg\ + + + true + + + + MaxSpeed + OnlyExplicitInline + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + true + Strict + + Level3 + true + ProgramDatabase + Default + true + true + stdcpp17 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0009 + + + true + + + UseLinkTimeCodeGeneration + + + + + MaxSpeed + OnlyExplicitInline + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + true + Strict + All + + Level3 + true + ProgramDatabase + Default + true + true + stdcpp17 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0009 + + + true + + + + UseLinkTimeCodeGeneration + + + + + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Strict + + Level3 + true + EditAndContinue + Default + true + stdcpp17 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0009 + + + true + + + + false + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Config/Metin2Config.vcxproj.filters b/src/Config/Metin2Config.vcxproj.filters new file mode 100644 index 00000000..7ae2a5e0 --- /dev/null +++ b/src/Config/Metin2Config.vcxproj.filters @@ -0,0 +1,43 @@ + + + + + {62c8d2c1-c25e-4a7e-ab94-f76adb8b3c53} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {2c236430-8de1-4024-be66-ae2c7469e916} + h;hpp;hxx;hm;inl + + + {a9554394-acc3-46ba-a041-6122aabc25db} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/src/Config/metin2.ico b/src/Config/metin2.ico new file mode 100644 index 00000000..1097646e Binary files /dev/null and b/src/Config/metin2.ico differ diff --git a/src/Config/resource.h b/src/Config/resource.h new file mode 100644 index 00000000..74fe034d --- /dev/null +++ b/src/Config/resource.h @@ -0,0 +1,63 @@ +#include + +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ui.rc +// +#define IDS_NOTIFY 1 +#define IDS_MAY_SLOW 2 +#define IDS_TILING_CPU 3 +#define IDS_TILING_GPU 4 +#define IDS_FOG_NEAR 5 +#define IDS_FOG_MID 6 +#define IDS_FOG_FAR 7 +#define IDS_TILE_AUTO 8 +#define IDS_TILE_CPU 9 +#define IDS_TILE_GPU 10 +#define IDS_SHADOW_NONE 11 +#define IDS_SHADOW_LV1 12 +#define IDS_SHADOW_LV2 13 +#define IDS_SHADOW_ALL 14 +#define IDS_LANGUAGE_CZECH 15 +#define IDS_LANGUAGE_DANISH 16 +#define IDS_LANGUAGE_DUTCH 17 +#define IDS_LANGUAGE_ENGLISH 18 +#define IDS_LANGUAGE_FRENCH 19 +#define IDS_LANGUAGE_GERMAN 20 +#define IDS_LANGUAGE_GREEK 21 +#define IDS_LANGUAGE_HUNGARIAN 22 +#define IDS_LANGUAGE_ITALIAN 23 +#define IDS_LANGUAGE_POLISH 24 +#define IDS_LANGUAGE_PORTUGUESE 25 +#define IDS_LANGUAGE_ROMANIAN 26 +#define IDS_LANGUAGE_RUSSIAN 27 +#define IDS_LANGUAGE_SPANISH 28 +#define IDS_LANGUAGE_TURKISH 29 +#define IDD_CONFIG_DIALOG 102 +#define IDR_MAINFRAME 128 +#define IDC_VIDEO_RESOLUTION 1001 +#define IDC_VIDEO_FREQUENCY 1002 +#define IDC_VIDEO_GAMMA 1003 +#define IDC_GRAPHIC_SOFTWARE_CURSOR 1004 +#define IDC_SOUND_BGM 1006 +#define IDC_SOUND_SOUND 1007 +#define IDC_OPTIMIZE_SHADOW 1010 +#define IDC_OPTIMIZE_OPAQUE 1011 +#define IDC_OPTIMIZE_VISIBILITY 1012 +#define IDC_OPTIMIZE_DECOMPRESSED_TEXTURE 1013 +#define IDC_OPTIMIZE_USE_COMPRESSED_TEXTURE 1013 +#define IDC_OPTIMIZE_TILING 1013 +#define IDC_GRAPHIC_WINDOW_MODE 1014 +#define IDC_GRAPHIC_FULLSCREEN_MODE 1015 +#define IDC_LANGUAGE_COMBO 1016 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 135 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1017 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/Config/ui.rc b/src/Config/ui.rc new file mode 100644 index 00000000..a08cdd90 --- /dev/null +++ b/src/Config/ui.rc @@ -0,0 +1,283 @@ +// Microsoft Visual C++ generated resource script. +// +#include +#include "resource.h" +///////////////////////////////////////////////////////////////////////////// +// English resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDR_MAINFRAME DIALOGEX 0, 0, 286, 167 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION +EXSTYLE WS_EX_APPWINDOW +CAPTION "Configuration" +FONT 9, "Arial", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,84,150,50,14 + PUSHBUTTON "Cancel",IDCANCEL,139,150,50,14 + GROUPBOX "Display",IDC_STATIC,7,7,127,66 + LTEXT "Resolution",IDC_STATIC,15,20,36,8 + COMBOBOX IDC_VIDEO_RESOLUTION,61,20,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "Frequency",IDC_STATIC,15,38,36,8 + COMBOBOX IDC_VIDEO_FREQUENCY,61,36,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + GROUPBOX "Sound",IDC_STATIC,7,77,127,44 + CONTROL "Slider1",IDC_SOUND_BGM,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,61,88,68,12 + LTEXT "BGM",IDC_STATIC,13,90,43,8 + CONTROL "Slider1",IDC_SOUND_SOUND,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,61,104,68,12 + LTEXT "SFX",IDC_STATIC,13,106,47,8 + LTEXT "Gamma",IDC_STATIC,15,55,34,8 + COMBOBOX IDC_VIDEO_GAMMA,61,54,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "FOG",IDC_STATIC,145,88,53,8 + COMBOBOX IDC_OPTIMIZE_VISIBILITY,204,88,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + GROUPBOX "GFX",IDC_STATIC,139,77,140,66 + GROUPBOX "Window Mode",IDC_STATIC,139,7,140,30 + CONTROL "Windowed",IDC_GRAPHIC_WINDOW_MODE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,145,20,58,10 + CONTROL "Fullscreen",IDC_GRAPHIC_FULLSCREEN_MODE,"Button",BS_AUTORADIOBUTTON,204,20,66,10 + LTEXT "TNL",IDC_STATIC,145,106,55,8 + COMBOBOX IDC_OPTIMIZE_TILING,204,106,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "Shadow",IDC_STATIC,145,123,53,8 + COMBOBOX IDC_OPTIMIZE_SHADOW,204,123,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + CONTROL "Use software mouse cursor",IDC_GRAPHIC_SOFTWARE_CURSOR, + "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,13,130,110,10 + GROUPBOX "Language",IDC_STATIC,139,41,139,33 + COMBOBOX IDC_LANGUAGE_COMBO,144,55,127,91,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDR_MAINFRAME, DIALOG + BEGIN + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDR_MAINFRAME AFX_DIALOG_LAYOUT +BEGIN + 0 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_NOTIFY "Notify\n" + IDS_MAY_SLOW "This may slow the game" + IDS_TILING_CPU "CPU tilling mode accelates by low system requirements.\nPlease set to GPU mode if error occurs.\n" + IDS_TILING_GPU "GPU tilling mode slows down by low system requirements.\nPlease set to CPU if error occurs." + IDS_FOG_NEAR "Near" + IDS_FOG_MID "Mid" + IDS_FOG_FAR "Far" + IDS_TILE_AUTO "Auto" + IDS_TILE_CPU "CPU" + IDS_TILE_GPU "GPU" + IDS_SHADOW_NONE "None" + IDS_SHADOW_LV1 "Background" + IDS_SHADOW_LV2 "Background+Player" + IDS_SHADOW_ALL "All" +END + +STRINGTABLE +BEGIN + IDS_LANGUAGE_CZECH "Czech" + IDS_LANGUAGE_DANISH "Danish" + IDS_LANGUAGE_DUTCH "Dutch" + IDS_LANGUAGE_ENGLISH "English" + IDS_LANGUAGE_FRENCH "French" + IDS_LANGUAGE_GERMAN "German" + IDS_LANGUAGE_GREEK "Greek" + IDS_LANGUAGE_HUNGARIAN "Hungarian" + IDS_LANGUAGE_ITALIAN "Italian" + IDS_LANGUAGE_POLISH "Polish" + IDS_LANGUAGE_PORTUGUESE "Portuguese" + IDS_LANGUAGE_ROMANIAN "Romanian" + IDS_LANGUAGE_RUSSIAN "Russian" + IDS_LANGUAGE_SPANISH "Spanish" + IDS_LANGUAGE_TURKISH "Turkish" +END + +#endif // English resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDR_MAINFRAME DIALOGEX 0, 0, 286, 167 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION +EXSTYLE WS_EX_APPWINDOW +CAPTION "Einstellungen" +FONT 9, "Arial", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "bernehmen",1,84,150,50,14 + PUSHBUTTON "Abbrechen",2,139,150,50,14 + GROUPBOX "Display",IDC_STATIC,7,7,127,66 + LTEXT "Auflsung",IDC_STATIC,15,21,32,8 + COMBOBOX 1001,61,21,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "Frequenz",IDC_STATIC,15,39,33,8 + COMBOBOX 1002,61,36,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + GROUPBOX "Sound",IDC_STATIC,7,77,127,44 + CONTROL "Slider1",1006,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,61,88,68,12 + LTEXT "Musik",IDC_STATIC,13,90,44,8 + CONTROL "Slider1",1007,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,61,104,68,12 + LTEXT "SFX",IDC_STATIC,13,106,45,8 + LTEXT "Gamma",IDC_STATIC,15,55,38,8 + COMBOBOX 1003,61,54,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "Nebel",IDC_STATIC,145,88,51,8 + COMBOBOX IDC_OPTIMIZE_VISIBILITY,204,88,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + GROUPBOX "GFX",IDC_STATIC,139,77,140,66 + GROUPBOX "Window Mode",IDC_STATIC,139,7,140,30 + CONTROL "Fenstermodus",IDC_GRAPHIC_WINDOW_MODE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,145,20,58,10 + CONTROL "Vollbildmodus",IDC_GRAPHIC_FULLSCREEN_MODE,"Button",BS_AUTORADIOBUTTON,204,20,66,10 + LTEXT "TNL",IDC_STATIC,145,106,52,8 + COMBOBOX IDC_OPTIMIZE_TILING,204,106,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + LTEXT "Schatten",IDC_STATIC,145,123,48,8 + COMBOBOX IDC_OPTIMIZE_SHADOW,204,123,59,402,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL + CONTROL "Software-Mauszeiger",1004,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,7,130,103,10 + GROUPBOX "Sprache",IDC_STATIC,139,41,139,33 + COMBOBOX IDC_LANGUAGE_COMBO,144,55,127,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDR_MAINFRAME, DIALOG + BEGIN + LEFTMARGIN, 7 + TOPMARGIN, 7 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDR_MAINFRAME AFX_DIALOG_LAYOUT +BEGIN + 0 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_NOTIFY "ACHTUNG" + IDS_MAY_SLOW "Das |knnte| das Spiel verlangsamen" + IDS_TILING_CPU "CPU Tiling wird lediglich fr sehr alte PCs empfohlen." + IDS_TILING_GPU "GPU Tiling ist eine gute Entscheidung!" + IDS_FOG_NEAR "Nah" + IDS_FOG_MID "Mittel" + IDS_FOG_FAR "Fern" + IDS_TILE_AUTO "Auto" + IDS_TILE_CPU "CPU" + IDS_TILE_GPU "GPU" + IDS_SHADOW_NONE "Deaktiviert" + IDS_SHADOW_LV1 "Hintergrund" + IDS_SHADOW_LV2 "Hintergrund+Spieler" + IDS_SHADOW_ALL "Alles" +END + +STRINGTABLE +BEGIN + IDS_LANGUAGE_CZECH "Tschechisch" + IDS_LANGUAGE_DANISH "Dnisch" + IDS_LANGUAGE_DUTCH "Niederlndisch" + IDS_LANGUAGE_ENGLISH "Englisch" + IDS_LANGUAGE_FRENCH "Franzsisch" + IDS_LANGUAGE_GERMAN "Deutsch" + IDS_LANGUAGE_GREEK "Griechisch" + IDS_LANGUAGE_HUNGARIAN "Ungarisch" + IDS_LANGUAGE_ITALIAN "Italienisch" + IDS_LANGUAGE_POLISH "Polnisch" + IDS_LANGUAGE_PORTUGUESE "Portugiesisch" + IDS_LANGUAGE_ROMANIAN "Rumnisch" + IDS_LANGUAGE_RUSSIAN "Russisch" + IDS_LANGUAGE_SPANISH "Spanisch" + IDS_LANGUAGE_TURKISH "Trkisch" +END + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/Config/version_info.rc b/src/Config/version_info.rc new file mode 100644 index 00000000..14016f91 --- /dev/null +++ b/src/Config/version_info.rc @@ -0,0 +1,47 @@ +#include + +// +// The following macros have to be set before including this file: +// METIN2_COMPONENT_TYPE - Type of this PE (i.e. VFT_DLL or VFT_APP) +// METIN2_COMPONENT_DESCRIPTION - Description of this PE +// METIN2_COMPONENT_INTERNALNAME - Internal name of this PE +// METIN2_COMPONENT_FILENAME - Expected filename of this PE +// + +#ifndef DEBUG +#define METIN2_DEBUG 0 +#else +#define METIN2_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 0, 3, 1, 0 +PRODUCTVERSION 0, 3, 1, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS METIN2_DEBUG +FILEOS VOS__WINDOWS32 +FILETYPE METIN2_COMPONENT_TYPE // VFT_DLL +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "The Old Metin2 Project" + VALUE "FileDescription", METIN2_COMPONENT_DESCRIPTION + VALUE "FileVersion", "0.3.1.0" + VALUE "InternalName", METIN2_COMPONENT_INTERNALNAME + VALUE "LegalCopyright", "Copyright (C) 2024" + VALUE "OriginalFilename", METIN2_COMPONENT_FILENAME + VALUE "ProductName", "Metin2Config" + VALUE "ProductVersion", "0.3.1.0" + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#undef METIN2_DEBUG diff --git a/src/UserInterface/Locale.cpp b/src/UserInterface/Locale.cpp index 414f546b..aa91dc76 100644 --- a/src/UserInterface/Locale.cpp +++ b/src/UserInterface/Locale.cpp @@ -18,11 +18,10 @@ const char* LSS_GLOBAL = "GLOBAL"; static bool IS_CHEONMA = false; -char MULTI_LOCALE_SERVICE[256] = "YMIR"; -char MULTI_LOCALE_PATH[256] = "locale/ymir"; -char MULTI_LOCALE_NAME[256] = "ymir"; -int MULTI_LOCALE_CODE = 949; -int MULTI_LOCALE_REPORT_PORT = 10000; +char MULTI_LOCALE_SERVICE[256] = "EUROPE"; +char MULTI_LOCALE_PATH[256] = "locale/en"; +char MULTI_LOCALE_NAME[256] = "en"; +int MULTI_LOCALE_CODE = 1252; void LocaleService_LoadConfig(const char* fileName) { @@ -34,13 +33,11 @@ void LocaleService_LoadConfig(const char* fileName) char line[256]; char name[256]; int code; - int id; if (fgets(line, sizeof(line)-1, fp)) { line[sizeof(line)-1] = '\0'; - sscanf(line, "%d %d %s", &id, &code, name); + sscanf(line, "%d %s", &code, name); - MULTI_LOCALE_REPORT_PORT = id; MULTI_LOCALE_CODE = code; strcpy(MULTI_LOCALE_NAME, name); sprintf(MULTI_LOCALE_PATH, "locale/%s", MULTI_LOCALE_NAME); diff --git a/src/UserInterface/UserInterface.rc b/src/UserInterface/UserInterface.rc index 8d6e6623..0c13c245 100644 --- a/src/UserInterface/UserInterface.rc +++ b/src/UserInterface/UserInterface.rc @@ -126,8 +126,8 @@ IDI_METIN2 ICON "metin2.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,3,0,0 - PRODUCTVERSION 0,3,0,0 + FILEVERSION 0,3,1,0 + PRODUCTVERSION 0,3,1,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -144,12 +144,12 @@ BEGIN BEGIN VALUE "CompanyName", "The Old Metin2 Project" VALUE "FileDescription", "The Metin2 Client" - VALUE "FileVersion", "0.3.0.0" + VALUE "FileVersion", "0.3.1.0" VALUE "InternalName", "Metin2Client" VALUE "LegalCopyright", "Copyright (C) 2024" VALUE "OriginalFilename", "Metin2.exe" VALUE "ProductName", "Metin2Client" - VALUE "ProductVersion", "0.3.0.0" + VALUE "ProductVersion", "0.3.1.0" END END BLOCK "VarFileInfo" diff --git a/src/vcpkg.json b/src/vcpkg.json index 377ede68..1a21caa7 100644 --- a/src/vcpkg.json +++ b/src/vcpkg.json @@ -11,6 +11,10 @@ "name": "devil", "version>=": "1.8.0#8" }, + { + "name": "directxsdk", + "version>=": "jun10" + }, { "name": "lzo", "version>=": "2.10#7" @@ -20,8 +24,8 @@ "version>=": "2.7.18#3" }, { - "name": "directxsdk", - "version>=": "jun10" + "name": "wtl", + "version>=": "10.0.10320#2" } ] } \ No newline at end of file