add country flags
This commit is contained in:
parent
35ac6194ff
commit
e5985d2c39
9 changed files with 117 additions and 36 deletions
|
@ -27,7 +27,7 @@ __fastcall TConfigForm::TConfigForm(TComponent* Owner)
|
|||
{
|
||||
}
|
||||
|
||||
void __fastcall TConfigForm::LanguageLblClick(TObject *Sender)
|
||||
void __fastcall TConfigForm::LanguageImgClick(TObject *Sender)
|
||||
{
|
||||
auto *ini = new TIniFile(".\\ddraw.ini");
|
||||
ini->WriteString("ddraw", "configlang", IsEnglish ? "auto" : "english");
|
||||
|
@ -50,7 +50,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||
int priID = SysLocale.PriLangID;
|
||||
|
||||
if (lang == "chinese" || (lang == "auto" && priID == LANG_CHINESE)) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageImg->Visible = true;
|
||||
|
||||
/* -Chinese Simplified- made by universal963 @ github */
|
||||
|
||||
|
@ -100,7 +100,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||
MaxgameticksCbx->AddItem(L"15tick每秒", NULL);
|
||||
}
|
||||
else if (lang == "spanish" || (lang == "auto" && priID == LANG_SPANISH)) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageImg->Visible = true;
|
||||
|
||||
/* -Spanish- made by c-sanchez @ github */
|
||||
|
||||
|
@ -150,7 +150,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||
MaxgameticksCbx->AddItem(L"15 tics por segundo", NULL);
|
||||
}
|
||||
else if (lang == "german" || (lang == "auto" && priID == LANG_GERMAN)) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageImg->Visible = true;
|
||||
|
||||
/* -German- made by helgo1506 @ github */
|
||||
|
||||
|
@ -201,27 +201,29 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||
}
|
||||
else {
|
||||
IsEnglish = true;
|
||||
UnicodeString name = "";
|
||||
|
||||
try {
|
||||
int lcid = Languages()->IndexOf(SysLocale.DefaultLCID);
|
||||
name = SplitString(Languages()->Name[lcid].w_str(), L" (")[0];
|
||||
if (priID == LANG_CHINESE) {
|
||||
TPngImage *png = new TPngImage();
|
||||
png->LoadFromResourceName((int)HInstance, "PngImage_CN");
|
||||
LanguageImg->Picture->Graphic = png;
|
||||
LanguageImg->Visible = true;
|
||||
}
|
||||
else if (priID == LANG_SPANISH) {
|
||||
TPngImage *png = new TPngImage();
|
||||
png->LoadFromResourceName((int)HInstance, "PngImage_ES");
|
||||
LanguageImg->Picture->Graphic = png;
|
||||
LanguageImg->Visible = true;
|
||||
}
|
||||
else if (priID == LANG_GERMAN) {
|
||||
TPngImage *png = new TPngImage();
|
||||
png->LoadFromResourceName((int)HInstance, "PngImage_DE");
|
||||
LanguageImg->Picture->Graphic = png;
|
||||
LanguageImg->Visible = true;
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
if (priID == LANG_CHINESE) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageLbl->Caption = name == "" ? "Chinese" : name;
|
||||
}
|
||||
else if (priID == LANG_SPANISH) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageLbl->Caption = name == "" ? "Spanish" : name;
|
||||
}
|
||||
else if (priID == LANG_GERMAN) {
|
||||
LanguageLbl->Visible = true;
|
||||
LanguageLbl->Caption = name == "" ? "German" : name;
|
||||
}
|
||||
|
||||
/*
|
||||
ConfigForm->Caption = L"cnc-ddraw config";
|
||||
DisplayBtn->Caption = L"Display Settings";
|
||||
|
|
|
@ -3151,22 +3151,56 @@ object ConfigForm: TConfigForm
|
|||
Height = 31
|
||||
OnPaint = PboxPaint
|
||||
end
|
||||
object LanguageLbl: TLabel
|
||||
Left = 453
|
||||
object LanguageImg: TImage
|
||||
Left = 433
|
||||
Top = 8
|
||||
Width = 38
|
||||
Height = 13
|
||||
Alignment = taRightJustify
|
||||
Caption = 'English'
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Segoe UI'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
Width = 57
|
||||
Height = 30
|
||||
Picture.Data = {
|
||||
0954506E67496D61676589504E470D0A1A0A0000000D49484452000000390000
|
||||
001E080600000096B1B60B00000006624B474400FF00FF00FFA0BDA793000000
|
||||
097048597300000DD700000DD70142289B780000000774494D4507E508010B3B
|
||||
338DA66DFA0000048B4944415478DAE5976B4C9B6514C7FFE556EED79612284E
|
||||
A1328DA2832173832186C9069A30B3E10C6E91B54B4CBC2CFA6126029B71AC68
|
||||
E6078D533FAD1DC974D9350EA3C0D850D8BA3191010E2F1BEB5006452AF77B0B
|
||||
B4F539C7748DFA711FDAB4E7CBF33EEDFB9CBCBFF739E7FF7F5E496ECE6E4750
|
||||
5020161797E08C7B993BAF154BB37879F43A3C21240459BE73136EDE1C40DB95
|
||||
5FE0E7E7878ACA32D41E69C4E0E0284243A5A8DABB0307AA8F627EDE0AA55206
|
||||
BABF467B0C76BB1D6BD73D82952B93F97E0A67AEBED61F3C0B323232942EA148
|
||||
88C1C09DBF045830ACD6452426C9D0FF87193259244647A7B1E27E05864CA390
|
||||
4A8304B005C9F7C5C33C3C21D63A780D05FDEE7000B2F0201C7CA5C0DD7C2E48
|
||||
8944221ECC819DEA4DB8D6D18B9E9EDFC58E4AF04E45193E3D7416535373888A
|
||||
0AC3EB6F6CC6FB35B4830EA4A73F80D5596938A26F04AD2F2CCCE2844D4D1D9C
|
||||
2B2D4D099D7E8FBBF95C905B4B9F82F19609DDDD46F8FBFB41A329467DFD552E
|
||||
D7F0F01094976F446DED39CCCE2E70B916173F099DAE1E369B1DAB56A9A07A30
|
||||
09A74FB5724267AE499319DAB26C77F3B920535313B1B0606588E9E9796464A8
|
||||
60340E891D026666169093FB282E1B7E4644440897A24A9588AE2E23A8CCE925
|
||||
848448C50B19E1844AA59C73D9FAFB3DAB279D9337DFDA8AE60B9DA25CFB1010
|
||||
E08F9A1A0DB4DA2FEF966B65E54BA8A8D06179D926CA3505051B32F1F147A779
|
||||
6D49490E8F757597794CB02F6097B5CFDD7C2EC8356B1E8649088AD93CCEEABA
|
||||
4E286677F76DCCCD59842504203BFB21B4B7DF10D6B08CB0B06051A2A9B82294
|
||||
98D455A188459210A8CECE5E4E989999C6B948953DAA277345398E8DCFA05748
|
||||
3FF5D9962DEBD1D2F2132627675964D49A22E8750D2C46D1D1E1C8CF7F1C67CE
|
||||
5CE2FE4D13F611171BC1D014F48228974DECB64741F28568C0575F2BC185F3D7
|
||||
D8E7C8D4F7BCBD0D9F7F5687898919C4C444F0FF1F1E3CC1664FDEB8E199D5FC
|
||||
3FA96951D13F22D3D0D0CE6362A00DBBE51677F3B920E5F1D1181F9B865C1ECD
|
||||
A24142323C3C8E1421480377CC888B8BC2D8D894F04505FA6E0F212121F6EE7D
|
||||
232393888D8B845D5400859FD85DCA25B34C7B96F0A8D54518348DA0E95C0797
|
||||
6065D5769C38FE3DEF28A9A756AB16A2A367F5A51DDCF6E2D3D01EF8824BBB70
|
||||
6316944972E8F50D9CD099EBC6D51E54E525BB9BCF05E99C6C7E3E173F0A8121
|
||||
E120752D7D211FDF7ED3C6B64276F1EC736B71EA640BAB2B89CD134290CE7E65
|
||||
E0B5244E142450141E7718A0B2A3F2237F2440F2469A171464E0E2C5EB023840
|
||||
802D232FEF31343777719992671228F925CDE99A82D6D35AD58A781CAADEEE6E
|
||||
3E17241DAA8D46130C977A5841F7EEDB01DDE106367802786F7F39DEDD57CB0F
|
||||
4F66AFD95584EAFD47597973D7A78BC341D2BF0EE894EBD6776D9ED593C1C141
|
||||
3CB1581679248FA37EB35A975875E9204007025251A93490FB96BE4828FEBBD6
|
||||
398F9A19F71CC8DF0C5D8E7B4FF3FF080CF487427CBD7842481CB43D5E1E925F
|
||||
3FF8C4FB21BF4EC9F27E4843A9C6FB217DA2277D02B231B3C0FB217D4278FA4F
|
||||
D6793FA44FF4E49FE75BBD1FD2277AD21720FF069A073A277FD5E8B800000000
|
||||
49454E44AE426082}
|
||||
Stretch = True
|
||||
Visible = False
|
||||
StyleElements = [seClient, seBorder]
|
||||
OnClick = LanguageLblClick
|
||||
OnClick = LanguageImgClick
|
||||
end
|
||||
object PresentationCbx: TComboBox
|
||||
Left = 41
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <Vcl.WinXCtrls.hpp>
|
||||
#include <Vcl.Buttons.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
class TConfigForm : public TForm
|
||||
{
|
||||
|
@ -60,7 +61,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||
TPaintBox *RendererPbox;
|
||||
TPaintBox *ShaderPbox;
|
||||
TPaintBox *MaxgameticksPbox;
|
||||
TLabel *LanguageLbl;
|
||||
TImage *LanguageImg;
|
||||
void __fastcall DisplayBtnClick(TObject *Sender);
|
||||
void __fastcall AdvancedBtnClick(TObject *Sender);
|
||||
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
||||
|
@ -83,7 +84,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||
void __fastcall FixpitchChkClick(TObject *Sender);
|
||||
void __fastcall NonexclusiveChkClick(TObject *Sender);
|
||||
void __fastcall PboxPaint(TObject *Sender);
|
||||
void __fastcall LanguageLblClick(TObject *Sender);
|
||||
void __fastcall LanguageImgClick(TObject *Sender);
|
||||
private: // Benutzer-Deklarationen
|
||||
void SaveSettings();
|
||||
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
|
||||
|
|
BIN
config/Resources/CN.png
Normal file
BIN
config/Resources/CN.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 531 B |
BIN
config/Resources/DE.png
Normal file
BIN
config/Resources/DE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 B |
BIN
config/Resources/ES.png
Normal file
BIN
config/Resources/ES.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 682 B |
BIN
config/Resources/US.png
Normal file
BIN
config/Resources/US.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -131,6 +131,22 @@
|
|||
<DependentOn>ConfigFormUnit.h</DependentOn>
|
||||
<BuildOrder>2</BuildOrder>
|
||||
</CppCompile>
|
||||
<RcItem Include="Resources\CN.png">
|
||||
<ResourceType>RCDATA</ResourceType>
|
||||
<ResourceId>PngImage_CN</ResourceId>
|
||||
</RcItem>
|
||||
<RcItem Include="Resources\DE.png">
|
||||
<ResourceType>RCDATA</ResourceType>
|
||||
<ResourceId>PngImage_DE</ResourceId>
|
||||
</RcItem>
|
||||
<RcItem Include="Resources\ES.png">
|
||||
<ResourceType>RCDATA</ResourceType>
|
||||
<ResourceId>PngImage_ES</ResourceId>
|
||||
</RcItem>
|
||||
<RcItem Include="Resources\US.png">
|
||||
<ResourceType>RCDATA</ResourceType>
|
||||
<ResourceId>PngImage_US</ResourceId>
|
||||
</RcItem>
|
||||
<FormResources Include="ConfigFormUnit.dfm"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
|
@ -215,12 +231,36 @@
|
|||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="Resources\DE.png" Configuration="Release" Class="ProjectFile">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>.\</RemoteDir>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="Resources\ES.png" Configuration="Release" Class="ProjectFile">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>.\</RemoteDir>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="Resources\US.png" Configuration="Release" Class="ProjectFile">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>.\</RemoteDir>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput">
|
||||
<Platform Name="Win32">
|
||||
<RemoteName>cnc-ddraw_config.exe</RemoteName>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="Resources\CN.png" Configuration="Release" Class="ProjectFile">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>.\</RemoteDir>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile Condition="'$(DynamicRTL)'=='true' And '$(Multithreaded)'!='true'" LocalName="$(BDS)\bin64\cc64260.dll" Class="DependencyModule">
|
||||
<Platform Name="Win64">
|
||||
<Overwrite>true</Overwrite>
|
||||
|
|
4
config/cnc-ddraw config_resources.rc
Normal file
4
config/cnc-ddraw config_resources.rc
Normal file
|
@ -0,0 +1,4 @@
|
|||
PngImage_CN RCDATA "Resources\\CN.png"
|
||||
PngImage_DE RCDATA "Resources\\DE.png"
|
||||
PngImage_ES RCDATA "Resources\\ES.png"
|
||||
PngImage_US RCDATA "Resources\\US.png"
|
Loading…
Reference in a new issue