mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
add "Restore Default Settings" button
This commit is contained in:
parent
4f3325071e
commit
a9164e8308
@ -45,6 +45,29 @@ void __fastcall TConfigForm::LanguageImgClick(TObject *Sender)
|
|||||||
Application->Terminate();
|
Application->Terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __fastcall TConfigForm::RestoreDefaultsBtnClick(TObject *Sender)
|
||||||
|
{
|
||||||
|
if (Application->MessageBox(
|
||||||
|
(RestoreDefaultsBtn->Caption + "?").w_str(),
|
||||||
|
L"cnc-ddraw",
|
||||||
|
MB_YESNO) == IDNO) {
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteFile(".\\ddraw.ini");
|
||||||
|
|
||||||
|
ShellExecute(
|
||||||
|
NULL,
|
||||||
|
L"open",
|
||||||
|
Application->ExeName.w_str(),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
Application->Terminate();
|
||||||
|
}
|
||||||
|
|
||||||
void TConfigForm::ApplyTranslation(TIniFile *ini)
|
void TConfigForm::ApplyTranslation(TIniFile *ini)
|
||||||
{
|
{
|
||||||
auto lang = LowerCase(ini->ReadString("ddraw", "configlang", "auto"));
|
auto lang = LowerCase(ini->ReadString("ddraw", "configlang", "auto"));
|
||||||
@ -60,6 +83,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"高级设置";
|
AdvancedBtn->Caption = L"高级设置";
|
||||||
HotkeyBtn->Caption = L"热键设置";
|
HotkeyBtn->Caption = L"热键设置";
|
||||||
CompatibilityBtn->Caption = L"兼容性设置";
|
CompatibilityBtn->Caption = L"兼容性设置";
|
||||||
|
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
||||||
PresentationLbl->Caption = L"显示方式";
|
PresentationLbl->Caption = L"显示方式";
|
||||||
MaintasLbl->Caption = L"保持纵横比";
|
MaintasLbl->Caption = L"保持纵横比";
|
||||||
VsyncLbl->Caption = L"打开垂直同步";
|
VsyncLbl->Caption = L"打开垂直同步";
|
||||||
@ -118,6 +142,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Ajustes avanzados";
|
AdvancedBtn->Caption = L"Ajustes avanzados";
|
||||||
HotkeyBtn->Caption = L"Teclas de acceso rápido";
|
HotkeyBtn->Caption = L"Teclas de acceso rápido";
|
||||||
CompatibilityBtn->Caption = L"Ajustes de compatibilidad";
|
CompatibilityBtn->Caption = L"Ajustes de compatibilidad";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Restaurar la configuración predeterminada";
|
||||||
PresentationLbl->Caption = L"Presentación";
|
PresentationLbl->Caption = L"Presentación";
|
||||||
MaintasLbl->Caption = L"Mantener la relación de aspecto";
|
MaintasLbl->Caption = L"Mantener la relación de aspecto";
|
||||||
VsyncLbl->Caption = L"Activar VSync";
|
VsyncLbl->Caption = L"Activar VSync";
|
||||||
@ -176,6 +201,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Erweiterte Einstellungen";
|
AdvancedBtn->Caption = L"Erweiterte Einstellungen";
|
||||||
HotkeyBtn->Caption = L"Tastenkürzel-Einstellungen";
|
HotkeyBtn->Caption = L"Tastenkürzel-Einstellungen";
|
||||||
CompatibilityBtn->Caption = L"Kompatibilitätseinstellungen";
|
CompatibilityBtn->Caption = L"Kompatibilitätseinstellungen";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Standardeinstellungen wiederherstellen";
|
||||||
PresentationLbl->Caption = L"Darstellung";
|
PresentationLbl->Caption = L"Darstellung";
|
||||||
MaintasLbl->Caption = L"Seitenverhältnis beibehalten";
|
MaintasLbl->Caption = L"Seitenverhältnis beibehalten";
|
||||||
VsyncLbl->Caption = L"VSync aktiveren";
|
VsyncLbl->Caption = L"VSync aktiveren";
|
||||||
@ -235,6 +261,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Расширенные настройки";
|
AdvancedBtn->Caption = L"Расширенные настройки";
|
||||||
HotkeyBtn->Caption = L"Настройки горячих клавиш";
|
HotkeyBtn->Caption = L"Настройки горячих клавиш";
|
||||||
CompatibilityBtn->Caption = L"Настройки совместимости";
|
CompatibilityBtn->Caption = L"Настройки совместимости";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Восстановить настройки по умолчанию";
|
||||||
PresentationLbl->Caption = L"Отображение";
|
PresentationLbl->Caption = L"Отображение";
|
||||||
MaintasLbl->Caption = L"Сохранять соотношение сторон";
|
MaintasLbl->Caption = L"Сохранять соотношение сторон";
|
||||||
VsyncLbl->Caption = L"Включить VSync";
|
VsyncLbl->Caption = L"Включить VSync";
|
||||||
@ -293,6 +320,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Haladó Beállítások";
|
AdvancedBtn->Caption = L"Haladó Beállítások";
|
||||||
HotkeyBtn->Caption = L"Gyorsbillentyűk beállításai";
|
HotkeyBtn->Caption = L"Gyorsbillentyűk beállításai";
|
||||||
CompatibilityBtn->Caption = L"Kompatibilitás Beállítások";
|
CompatibilityBtn->Caption = L"Kompatibilitás Beállítások";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Visszaállítja az alapértelmezett beállításokat";
|
||||||
PresentationLbl->Caption = L"Bemutató";
|
PresentationLbl->Caption = L"Bemutató";
|
||||||
MaintasLbl->Caption = L"Képarány megtartása";
|
MaintasLbl->Caption = L"Képarány megtartása";
|
||||||
VsyncLbl->Caption = L"VSync bekapcsolása";
|
VsyncLbl->Caption = L"VSync bekapcsolása";
|
||||||
@ -351,6 +379,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Paramètres Avancés";
|
AdvancedBtn->Caption = L"Paramètres Avancés";
|
||||||
HotkeyBtn->Caption = L"Paramètres de raccourci";
|
HotkeyBtn->Caption = L"Paramètres de raccourci";
|
||||||
CompatibilityBtn->Caption = L"Paramètres de Compatibilité";
|
CompatibilityBtn->Caption = L"Paramètres de Compatibilité";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Restaurer les paramètres par défaut";
|
||||||
PresentationLbl->Caption = L"Présentation";
|
PresentationLbl->Caption = L"Présentation";
|
||||||
MaintasLbl->Caption = L"Conserver les proportions de l'image";
|
MaintasLbl->Caption = L"Conserver les proportions de l'image";
|
||||||
VsyncLbl->Caption = L"Activer la synchro verticale (VSync)";
|
VsyncLbl->Caption = L"Activer la synchro verticale (VSync)";
|
||||||
@ -409,6 +438,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Impostazioni avanzate";
|
AdvancedBtn->Caption = L"Impostazioni avanzate";
|
||||||
HotkeyBtn->Caption = L"Tasti di scelta rapida";
|
HotkeyBtn->Caption = L"Tasti di scelta rapida";
|
||||||
CompatibilityBtn->Caption = L"Impostazioni di compatibilità";
|
CompatibilityBtn->Caption = L"Impostazioni di compatibilità";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Ripristina le impostazioni di default";
|
||||||
PresentationLbl->Caption = L"Presentazione";
|
PresentationLbl->Caption = L"Presentazione";
|
||||||
MaintasLbl->Caption = L"Mantieni il rapporto d'aspetto";
|
MaintasLbl->Caption = L"Mantieni il rapporto d'aspetto";
|
||||||
VsyncLbl->Caption = L"Abilita la sincronizzazione verticale (VSync)";
|
VsyncLbl->Caption = L"Abilita la sincronizzazione verticale (VSync)";
|
||||||
@ -512,6 +542,7 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|||||||
AdvancedBtn->Caption = L"Advanced Settings";
|
AdvancedBtn->Caption = L"Advanced Settings";
|
||||||
HotkeyBtn->Caption = L"Hotkey Settings";
|
HotkeyBtn->Caption = L"Hotkey Settings";
|
||||||
CompatibilityBtn->Caption = L"Compatibility Settings";
|
CompatibilityBtn->Caption = L"Compatibility Settings";
|
||||||
|
RestoreDefaultsBtn->Caption = L"Restore Default Settings";
|
||||||
PresentationLbl->Caption = L"Presentation";
|
PresentationLbl->Caption = L"Presentation";
|
||||||
MaintasLbl->Caption = L"Maintain aspect ratio";
|
MaintasLbl->Caption = L"Maintain aspect ratio";
|
||||||
VsyncLbl->Caption = L"Enable VSync";
|
VsyncLbl->Caption = L"Enable VSync";
|
||||||
@ -807,6 +838,9 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|||||||
CompatibilityBtn->Visible = false;
|
CompatibilityBtn->Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RestoreDefaultsBtn->Visible =
|
||||||
|
FileExists(".\\ddraw.dll") && GetBool(ini, "allow_reset", true);
|
||||||
|
|
||||||
delete ini;
|
delete ini;
|
||||||
|
|
||||||
Initialized = true;
|
Initialized = true;
|
||||||
|
@ -3600,5 +3600,21 @@ object ConfigForm: TConfigForm
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
OnClick = HotkeyBtnClick
|
OnClick = HotkeyBtnClick
|
||||||
end
|
end
|
||||||
|
object RestoreDefaultsBtn: TSpeedButton
|
||||||
|
Left = 0
|
||||||
|
Top = 440
|
||||||
|
Width = 227
|
||||||
|
Height = 22
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
Caption = 'Restore Default Settings'
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = 'Segoe UI'
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
OnClick = RestoreDefaultsBtnClick
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -79,6 +79,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||||||
TLabel *ScreenshotLbl;
|
TLabel *ScreenshotLbl;
|
||||||
TEdit *ScreenshotEdt;
|
TEdit *ScreenshotEdt;
|
||||||
TComboBox *ShaderD3DCbx;
|
TComboBox *ShaderD3DCbx;
|
||||||
|
TSpeedButton *RestoreDefaultsBtn;
|
||||||
void __fastcall DisplayBtnClick(TObject *Sender);
|
void __fastcall DisplayBtnClick(TObject *Sender);
|
||||||
void __fastcall AdvancedBtnClick(TObject *Sender);
|
void __fastcall AdvancedBtnClick(TObject *Sender);
|
||||||
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
void __fastcall CompatibilityBtnClick(TObject *Sender);
|
||||||
@ -107,6 +108,7 @@ __published: // Von der IDE verwaltete Komponenten
|
|||||||
void __fastcall HotkeyEdtKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
|
void __fastcall HotkeyEdtKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
|
||||||
void __fastcall HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
|
void __fastcall HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
|
||||||
void __fastcall ShaderD3DCbxChange(TObject *Sender);
|
void __fastcall ShaderD3DCbxChange(TObject *Sender);
|
||||||
|
void __fastcall RestoreDefaultsBtnClick(TObject *Sender);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user