1
0
forked from metin2/client

Compare commits

...

4 Commits

5 changed files with 92 additions and 6 deletions

View File

@ -3,7 +3,7 @@
#include <d3d9.h> #include <d3d9.h>
#include <algorithm> #include <algorithm>
#include <math.h> #include <vector>
#define APP_NAME _T("Metin2 Config") #define APP_NAME _T("Metin2 Config")
#define FILENAME_CONFIG "metin2.cfg" #define FILENAME_CONFIG "metin2.cfg"
@ -164,12 +164,24 @@ BOOL CMainDialog::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
m_comboShadow.SetCurSel(m_stConfig.iShadowLevel); m_comboShadow.SetCurSel(m_stConfig.iShadowLevel);
// Language // Language
ATL::CString language;
// Load the languages into an array
std::vector<ATL::CString> languages;
for (int i = 0; i < kLanguageMax; ++i) { for (int i = 0; i < kLanguageMax; ++i) {
ATL::CString language;
language.LoadString(kLanguageConfig[i].stringId); language.LoadString(kLanguageConfig[i].stringId);
m_comboLanguage.InsertString(i, language); languages.push_back(language);
} }
// Sort the array
std::sort(languages.begin(), languages.end(), [](const ATL::CString& a, const ATL::CString& b) {
return a.CompareNoCase(b) < 0;
});
// Add the languages to the combo
for (auto& language : languages)
m_comboLanguage.AddString(language);
m_stConfig.language = std::clamp((int) m_stConfig.language, 0, kLanguageMax - 1); m_stConfig.language = std::clamp((int) m_stConfig.language, 0, kLanguageMax - 1);
m_comboLanguage.SetCurSel(m_stConfig.language); m_comboLanguage.SetCurSel(m_stConfig.language);
@ -229,10 +241,66 @@ void CMainDialog::InitDefaultConfig()
auto lang = PRIMARYLANGID(LANGIDFROMLCID(GetUserDefaultLCID())); auto lang = PRIMARYLANGID(LANGIDFROMLCID(GetUserDefaultLCID()));
switch (lang) { switch (lang) {
case LANG_CZECH:
m_stConfig.language = kLanguageCzech;
break;
case LANG_DANISH:
m_stConfig.language = kLanguageDanish;
break;
case LANG_DUTCH:
m_stConfig.language = kLanguageDutch;
break;
case LANG_ENGLISH:
m_stConfig.language = kLanguageEnglish;
break;
case LANG_FRENCH:
m_stConfig.language = kLanguageFrench;
break;
case LANG_GERMAN: case LANG_GERMAN:
m_stConfig.language = kLanguageGerman; m_stConfig.language = kLanguageGerman;
break; break;
case LANG_GREEK:
m_stConfig.language = kLanguageGreek;
break;
case LANG_HUNGARIAN:
m_stConfig.language = kLanguageHungarian;
break;
case LANG_ITALIAN:
m_stConfig.language = kLanguageItalian;
break;
case LANG_POLISH:
m_stConfig.language = kLanguagePolish;
break;
case LANG_PORTUGUESE:
m_stConfig.language = kLanguagePortuguese;
break;
case LANG_ROMANIAN:
m_stConfig.language = kLanguageRomanian;
break;
case LANG_RUSSIAN:
m_stConfig.language = kLanguageRussian;
break;
case LANG_SPANISH:
m_stConfig.language = kLanguageSpanish;
break;
case LANG_TURKISH:
m_stConfig.language = kLanguageTurkish;
break;
default: default:
m_stConfig.language = kLanguageEnglish; m_stConfig.language = kLanguageEnglish;
break; break;

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -17,3 +17,6 @@ IDR_MAINFRAME ICON "metin2.ico"
#define METIN2_COMPONENT_TYPE VFT_APP #define METIN2_COMPONENT_TYPE VFT_APP
#include <version_info.rc> #include <version_info.rc>
// Visual Styles manifest
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "Metin2Config.exe.manifest"

View File

@ -31,18 +31,18 @@
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

Binary file not shown.