2021-07-06 16:26:15 +02:00
|
|
|
|
//---------------------------------------------------------------------------
|
2021-07-01 18:02:16 +02:00
|
|
|
|
|
|
|
|
|
#include <vcl.h>
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
#include <IniFiles.hpp>
|
|
|
|
|
#include <StrUtils.hpp>
|
|
|
|
|
#include <IOUtils.hpp>
|
2021-07-06 02:23:48 +02:00
|
|
|
|
#include <SysUtils.hpp>
|
2023-08-04 17:38:31 +02:00
|
|
|
|
#include <Registry.hpp>
|
2023-08-15 15:38:50 +02:00
|
|
|
|
#include <System.Hash.hpp>
|
2021-07-01 18:02:16 +02:00
|
|
|
|
#include "ConfigFormUnit.h"
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
#pragma package(smart_init)
|
|
|
|
|
#pragma resource "*.dfm"
|
|
|
|
|
TConfigForm *ConfigForm;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
bool Initialized;
|
2021-07-24 07:27:55 +02:00
|
|
|
|
bool IsEnglish;
|
2023-09-25 02:30:35 +02:00
|
|
|
|
System::UnicodeString KeyNames[256];
|
2021-07-02 01:19:12 +02:00
|
|
|
|
|
|
|
|
|
/* Save previous settings so we don't override custom settings */
|
|
|
|
|
int Maxfps;
|
|
|
|
|
int Savesettings;
|
2023-08-11 18:33:08 +02:00
|
|
|
|
int Resolutions;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
int Minfps;
|
|
|
|
|
|
2021-07-01 18:02:16 +02:00
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
__fastcall TConfigForm::TConfigForm(TComponent* Owner)
|
|
|
|
|
: TForm(Owner)
|
|
|
|
|
{
|
2021-07-24 07:27:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-08-15 15:38:50 +02:00
|
|
|
|
void __fastcall TConfigForm::CreateParams(TCreateParams & Params)
|
|
|
|
|
{
|
|
|
|
|
TForm::CreateParams(Params);
|
|
|
|
|
|
|
|
|
|
StrCopy(
|
|
|
|
|
Params.WinClassName,
|
|
|
|
|
THashSHA1::GetHashString(Application->ExeName).w_str());
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-01 15:10:56 +02:00
|
|
|
|
void __fastcall TConfigForm::LanguageImgClick(TObject *Sender)
|
2021-07-24 07:27:55 +02:00
|
|
|
|
{
|
|
|
|
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
2021-07-24 07:40:51 +02:00
|
|
|
|
ini->WriteString("ddraw", "configlang", IsEnglish ? "auto" : "english");
|
2021-07-24 07:27:55 +02:00
|
|
|
|
delete ini;
|
|
|
|
|
|
|
|
|
|
ShellExecute(
|
|
|
|
|
NULL,
|
|
|
|
|
L"open",
|
|
|
|
|
Application->ExeName.w_str(),
|
2023-08-15 16:16:49 +02:00
|
|
|
|
L"-restart",
|
2021-07-24 07:27:55 +02:00
|
|
|
|
NULL,
|
|
|
|
|
SW_SHOWNORMAL);
|
|
|
|
|
|
|
|
|
|
Application->Terminate();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 17:15:59 +02:00
|
|
|
|
void __fastcall TConfigForm::ThemePnlClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
|
|
|
|
auto theme =
|
|
|
|
|
ThemePnl->Color == (TColor)RGB(31, 31, 31) ? "Cobalt XEMedia" : "Windows10";
|
|
|
|
|
|
|
|
|
|
ini->WriteString("ddraw", "configtheme", theme);
|
|
|
|
|
|
|
|
|
|
delete ini;
|
|
|
|
|
|
|
|
|
|
ShellExecute(
|
|
|
|
|
NULL,
|
|
|
|
|
L"open",
|
|
|
|
|
Application->ExeName.w_str(),
|
2023-08-15 16:16:49 +02:00
|
|
|
|
L"-restart",
|
2023-08-13 17:15:59 +02:00
|
|
|
|
NULL,
|
|
|
|
|
SW_SHOWNORMAL);
|
|
|
|
|
|
|
|
|
|
Application->Terminate();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 14:40:29 +02:00
|
|
|
|
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(),
|
2023-08-15 16:16:49 +02:00
|
|
|
|
L"-restart",
|
2023-08-13 14:40:29 +02:00
|
|
|
|
NULL,
|
|
|
|
|
SW_SHOWNORMAL);
|
|
|
|
|
|
|
|
|
|
Application->Terminate();
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-24 07:27:55 +02:00
|
|
|
|
void TConfigForm::ApplyTranslation(TIniFile *ini)
|
|
|
|
|
{
|
|
|
|
|
auto lang = LowerCase(ini->ReadString("ddraw", "configlang", "auto"));
|
|
|
|
|
int priID = SysLocale.PriLangID;
|
|
|
|
|
|
|
|
|
|
if (lang == "chinese" || (lang == "auto" && priID == LANG_CHINESE)) {
|
2021-08-01 15:10:56 +02:00
|
|
|
|
LanguageImg->Visible = true;
|
2021-07-24 07:27:55 +02:00
|
|
|
|
|
2021-07-06 20:01:25 +02:00
|
|
|
|
/* -Chinese Simplified- made by universal963 @ github */
|
2021-07-06 16:26:15 +02:00
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"cnc-ddraw 配置";
|
|
|
|
|
DisplayBtn->Caption = L"显示设置";
|
|
|
|
|
AdvancedBtn->Caption = L"高级设置";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"热键设置";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"兼容性设置";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"恢复默认设置";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
PresentationLbl->Caption = L"显示方式";
|
|
|
|
|
MaintasLbl->Caption = L"保持纵横比";
|
|
|
|
|
VsyncLbl->Caption = L"打开垂直同步";
|
|
|
|
|
AdjmouseLbl->Caption = L"调整鼠标灵敏度";
|
|
|
|
|
DevmodeLbl->Caption = L"锁定光标到窗口/屏幕";
|
|
|
|
|
RendererLbl->Caption = L"渲染器";
|
|
|
|
|
BorderLbl->Caption = L"在窗口模式下显示窗口边框";
|
|
|
|
|
SavesettingsLbl->Caption = L"记住窗口位置和大小";
|
|
|
|
|
ShaderLbl->Caption = L"OpenGL着色器";
|
|
|
|
|
MaxfpsLbl->Caption = L"限制帧率";
|
|
|
|
|
BoxingLbl->Caption = L"打开窗盒显示/整数缩放";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"切换窗口模式";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"最大化窗口";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"解锁光标 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"解锁光标 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"截屏";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"限制游戏速率";
|
|
|
|
|
NoactivateappLbl->Caption = L"修复损坏的Alt+Tab功能";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"解锁其他屏幕分辨率";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MinfpsLbl->Caption = L"强制高FPS / 修复使用Freesync/G-Sync的卡顿问题";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"修复性能不佳和声音问题";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"修复不显示的视频/UI元素";
|
2021-07-06 02:23:48 +02:00
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
2021-07-06 16:26:15 +02:00
|
|
|
|
RendererCbx->AddItem(L"自动", NULL);
|
2021-08-10 01:29:53 +02:00
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
2021-07-06 16:26:15 +02:00
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
2021-07-06 02:23:48 +02:00
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
2021-07-06 16:26:15 +02:00
|
|
|
|
PresentationCbx->AddItem(L"全屏", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"拉伸至全屏", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"无边框", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"窗口化", NULL);
|
2021-07-06 02:23:48 +02:00
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"无限制", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"与显示器刷新率同步", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"模拟60hz刷新率显示器", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000tick每秒", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500tick每秒", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250tick每秒", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125tick每秒", NULL);
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60tick每秒", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30tick每秒", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25tick每秒", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15tick每秒", NULL);
|
2021-07-06 02:23:48 +02:00
|
|
|
|
}
|
2021-07-24 07:27:55 +02:00
|
|
|
|
else if (lang == "spanish" || (lang == "auto" && priID == LANG_SPANISH)) {
|
2021-08-01 15:10:56 +02:00
|
|
|
|
LanguageImg->Visible = true;
|
2021-07-24 07:27:55 +02:00
|
|
|
|
|
2021-07-06 20:01:25 +02:00
|
|
|
|
/* -Spanish- made by c-sanchez @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"Ajustes de cnc-ddraw";
|
|
|
|
|
DisplayBtn->Caption = L"Ajustes de pantalla";
|
|
|
|
|
AdvancedBtn->Caption = L"Ajustes avanzados";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Teclas de acceso rápido";
|
2021-07-06 20:01:25 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Ajustes de compatibilidad";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Restaurar la configuración predeterminada";
|
2021-07-06 20:01:25 +02:00
|
|
|
|
PresentationLbl->Caption = L"Presentación";
|
|
|
|
|
MaintasLbl->Caption = L"Mantener la relación de aspecto";
|
|
|
|
|
VsyncLbl->Caption = L"Activar VSync";
|
|
|
|
|
AdjmouseLbl->Caption = L"Ajustar sensibilidad de ratón";
|
|
|
|
|
DevmodeLbl->Caption = L"Bloquear cursor a la ventana / pantalla";
|
|
|
|
|
RendererLbl->Caption = L"Renderizador";
|
|
|
|
|
BorderLbl->Caption = L"Mostrar bordes en modo ventana";
|
|
|
|
|
SavesettingsLbl->Caption = L"Recordar posición y tamaño de ventana";
|
|
|
|
|
ShaderLbl->Caption = L"Sombreador OpenGL";
|
|
|
|
|
MaxfpsLbl->Caption = L"Limitar velocidad de fotogramas";
|
|
|
|
|
BoxingLbl->Caption = L"Activar encajado de ventanas / escalado de enteros";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Alternar modo de ventana";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Maximizar ventana";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Desbloquear cursor 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Desbloquear cursor 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Captura de pantalla";
|
2021-07-06 20:01:25 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Limitar velocidad de juego";
|
|
|
|
|
NoactivateappLbl->Caption = L"Corregir Alt+Tab roto";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Desbloquear resoluciones de pantalla adicionales";
|
2021-07-06 20:01:25 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Forzar un alto FPS / Corregir retrasos en Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Solucione el mal rendimiento y los problemas de sonido";
|
2021-07-06 20:01:25 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Corregir vídeos / elementos de interfaz invisibles";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automático", NULL);
|
2021-08-10 01:29:53 +02:00
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
2021-07-06 20:01:25 +02:00
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Pantalla completa", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Pantalla completa ampliada", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Sin bordes", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Ventana", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Sin límite", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Sincronizar con tasa de refresco de monitor", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Emular monitor con tasa de refresco de 60hz", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 tics por segundo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 tics por segundo", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 tics por segundo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 tics por segundo", NULL);
|
2021-07-06 20:01:25 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 tics por segundo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 tics por segundo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 tics por segundo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 tics por segundo", NULL);
|
2021-07-23 14:29:10 +02:00
|
|
|
|
}
|
2021-07-24 07:27:55 +02:00
|
|
|
|
else if (lang == "german" || (lang == "auto" && priID == LANG_GERMAN)) {
|
2021-08-01 15:10:56 +02:00
|
|
|
|
LanguageImg->Visible = true;
|
2021-07-24 07:27:55 +02:00
|
|
|
|
|
2021-07-23 14:29:10 +02:00
|
|
|
|
/* -German- made by helgo1506 @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"cnc-ddraw Konfiguration";
|
|
|
|
|
DisplayBtn->Caption = L"Anzeigeeinstellungen";
|
|
|
|
|
AdvancedBtn->Caption = L"Erweiterte Einstellungen";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Tastenkürzel-Einstellungen";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Kompatibilitätseinstellungen";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Standardeinstellungen wiederherstellen";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
PresentationLbl->Caption = L"Darstellung";
|
|
|
|
|
MaintasLbl->Caption = L"Seitenverhältnis beibehalten";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
VsyncLbl->Caption = L"VSync aktiveren";
|
|
|
|
|
AdjmouseLbl->Caption = L"Mausempfindlichkeit anpassen";
|
|
|
|
|
DevmodeLbl->Caption = L"Sperre Cursor zu Fenster / Bildschirm"; //Not 100% sure, if not a better translation exists
|
|
|
|
|
RendererLbl->Caption = L"Renderer";
|
|
|
|
|
BorderLbl->Caption = L"Zeige Fensterränder in Fenstermodus";
|
|
|
|
|
SavesettingsLbl->Caption = L"Fensterposition und Größe merken";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
ShaderLbl->Caption = L"OpenGL Shader";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
MaxfpsLbl->Caption = L"Limitiere Aktualisierungsrate";
|
|
|
|
|
BoxingLbl->Caption = L"Fensterboxing / Integer Skalierung aktivieren"; //Not 100% sure if "windowboxing" can be translated better.
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Fenstermodus umschalten";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Fenster maximieren";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Cursor entsperren 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Cursor entsperren 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Bildschirmfoto";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Spielgeschwindigkeit limitieren";
|
|
|
|
|
NoactivateappLbl->Caption = L"Fehlerhaftes Alt+Tab reparieren"; //The first word can be ignored if its to long (eng word "Fix"
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Zusätzliche Bildschirmauflösungen freischalten";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Erzwinge Hohe FPS / Repariere Stottern bei Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Schlechte Leistung und Soundprobleme reparieren";
|
2021-07-23 14:29:10 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Unsichtbare Videos / UI Elemente reparieren";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automatisch", NULL);
|
2021-08-10 01:29:53 +02:00
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
2021-07-23 14:29:10 +02:00
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Vollbild", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Hochskaliertes Vollbild", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Ränderfreies Fenster", NULL);
|
2023-08-13 01:43:03 +02:00
|
|
|
|
PresentationCbx->AddItem(L"Fenstermodus", NULL);
|
2021-07-23 14:29:10 +02:00
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Unlimitiert", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Sync mit Bildschirmaktualisierungsrate", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Emuliere 60hz Bildschirmaktualisierungsrate", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 Ticks pro Sekunde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 Ticks pro Sekunde", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 Ticks pro Sekunde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 Ticks pro Sekunde", NULL);
|
2021-07-23 14:29:10 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 Ticks pro Sekunde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 Ticks pro Sekunde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 Ticks pro Sekunde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 Ticks pro Sekunde", NULL);
|
|
|
|
|
}
|
2021-08-10 01:29:53 +02:00
|
|
|
|
else if (lang == "russian" || (lang == "auto" && priID == LANG_RUSSIAN)) {
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
ClientWidth *= 1.13;
|
|
|
|
|
|
|
|
|
|
/* -Russian- made by shikulja @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"Настройки cnc-ddraw";
|
|
|
|
|
DisplayBtn->Caption = L"Настройки отображения";
|
|
|
|
|
AdvancedBtn->Caption = L"Расширенные настройки";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Настройки горячих клавиш";
|
2021-08-10 01:29:53 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Настройки совместимости";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Восстановить настройки по умолчанию";
|
2021-08-10 01:29:53 +02:00
|
|
|
|
PresentationLbl->Caption = L"Отображение";
|
|
|
|
|
MaintasLbl->Caption = L"Сохранять соотношение сторон";
|
|
|
|
|
VsyncLbl->Caption = L"Включить VSync";
|
|
|
|
|
AdjmouseLbl->Caption = L"Регулировка чувствительности мыши";
|
|
|
|
|
DevmodeLbl->Caption = L"Зафиксировать курсор на окне / экране";
|
|
|
|
|
RendererLbl->Caption = L"Рендер";
|
|
|
|
|
BorderLbl->Caption = L"Отображение границ окна в оконном режиме";
|
|
|
|
|
SavesettingsLbl->Caption = L"Запомнить положение и размер окна";
|
|
|
|
|
ShaderLbl->Caption = L"Шейдер OpenGL";
|
|
|
|
|
MaxfpsLbl->Caption = L"Ограничить частоту кадров";
|
|
|
|
|
BoxingLbl->Caption = L"Включить windowboxing / целочисленное масштабирование";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Переключить оконный режим";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Развернуть окно";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Разблокировать курсор 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Разблокировать курсор 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Скриншот";
|
2021-08-10 01:29:53 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Ограничить скорость игры";
|
|
|
|
|
NoactivateappLbl->Caption = L"Исправить сломанный Alt+Tab";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Разблокировать дополнительные разрешения экрана";
|
2021-08-10 01:29:53 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Принудительно высокий FPS / Исправить заикание при Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Исправление проблем с производительностью и звуком";
|
2021-08-10 01:29:53 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Исправить невидимые видео / элементы пользовательского интерфейса";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Автоматический", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Полноэкранный", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Полноэкранный масштабированный", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Без границ", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Оконный", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Без ограничений", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Синхронизация с частотой обновления монитора", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Эмуляция частоты обновления монитора 60 Гц", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 тиков в секунду", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 тиков в секунду", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 тиков в секунду", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 тиков в секунду", NULL);
|
2021-08-10 01:29:53 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 тиков в секунду", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 тиков в секунду", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 тиков в секунду", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 тиков в секунду", NULL);
|
|
|
|
|
}
|
2021-09-29 13:48:12 +02:00
|
|
|
|
else if (lang == "hungarian" || (lang == "auto" && priID == LANG_HUNGARIAN)) {
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
|
|
|
|
|
/* -Hungarian - made by cyberdyne-sys @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"cnc-ddraw Beállító";
|
|
|
|
|
DisplayBtn->Caption = L"Képbeállítások";
|
|
|
|
|
AdvancedBtn->Caption = L"Haladó Beállítások";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Gyorsbillentyűk beállításai";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Kompatibilitás Beállítások";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Visszaállítja az alapértelmezett beállításokat";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
PresentationLbl->Caption = L"Bemutató";
|
|
|
|
|
MaintasLbl->Caption = L"Képarány megtartása";
|
|
|
|
|
VsyncLbl->Caption = L"VSync bekapcsolása";
|
|
|
|
|
AdjmouseLbl->Caption = L"Egérérzékenység beállítás";
|
|
|
|
|
DevmodeLbl->Caption = L"Kurzor bezárása az ablakba / képbe";
|
|
|
|
|
RendererLbl->Caption = L"Renderelő";
|
|
|
|
|
BorderLbl->Caption = L"Szegélyek megjelenítése ablakos módban";
|
|
|
|
|
SavesettingsLbl->Caption = L"Ablakhelyzet és méret megjegyzése";
|
|
|
|
|
ShaderLbl->Caption = L"OpenGL árnyaló";
|
|
|
|
|
MaxfpsLbl->Caption = L"Képkockaszám korlátozás";
|
|
|
|
|
BoxingLbl->Caption = L"Ablakos mód / felskálázás bekapcsolása";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Az ablakos mód váltása";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Az ablak maximalizálása";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"A kurzor feloldása 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"A kurzor feloldása 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Képernyőkép";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Játéksebesség korlátozás";
|
|
|
|
|
NoactivateappLbl->Caption = L"Alt+Tab hiba kiküszöbölése";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"További képernyőfelbontások feloldása";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Magas FPS kényszerítés / Akadozásjavítás Freesync/G-Sync esetén";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Javítsa ki a rossz teljesítmény- és hangproblémákat";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Láthatatlan videók / kezelőfelületi elemek javítása";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automatikus", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Teljes képernyő", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Teljes képernyő felskálázva", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Keret nélkül", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Ablakban", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Korlátlan", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Hangolás a kijelző képfrissítéséhez", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"60hz képfrissítésű kijelző emulálása", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 tick másodpercenként", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 tick másodpercenként", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 tick másodpercenként", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 tick másodpercenként", NULL);
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 tick másodpercenként", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 tick másodpercenként", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 tick másodpercenként", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 tick másodpercenként", NULL);
|
|
|
|
|
}
|
|
|
|
|
else if (lang == "french" || (lang == "auto" && priID == LANG_FRENCH)) {
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
|
|
|
|
|
/* -French - made by Toshiba-3 @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"Configuration cnc-ddraw";
|
|
|
|
|
DisplayBtn->Caption = L"Paramètres d'Affichage";
|
|
|
|
|
AdvancedBtn->Caption = L"Paramètres Avancés";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Paramètres de raccourci";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Paramètres de Compatibilité";
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Restaurer les paramètres par défaut";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
PresentationLbl->Caption = L"Présentation";
|
|
|
|
|
MaintasLbl->Caption = L"Conserver les proportions de l'image";
|
|
|
|
|
VsyncLbl->Caption = L"Activer la synchro verticale (VSync)";
|
|
|
|
|
AdjmouseLbl->Caption = L"Ajuster la sensibilité souris";
|
|
|
|
|
DevmodeLbl->Caption = L"Capturer le curseur dans la fenêtre / l'écran";
|
|
|
|
|
RendererLbl->Caption = L"Moteur de rendu";
|
|
|
|
|
BorderLbl->Caption = L"Afficher les bordures en mode fenêtré";
|
|
|
|
|
SavesettingsLbl->Caption = L"Retenir position/dimensions de la fenêtre";
|
|
|
|
|
ShaderLbl->Caption = L"Shader OpenGL";
|
|
|
|
|
MaxfpsLbl->Caption = L"Limiter les images par seconde (FPS)";
|
|
|
|
|
BoxingLbl->Caption = L"Activer windowboxing / mise à l'échelle par nombres entiers";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Basculer en mode fenêtré";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Agrandir la fenêtre";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Déverrouiller le curseur 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Déverrouiller le curseur 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Capture d'écran";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Limiter la vitesse du jeu";
|
|
|
|
|
NoactivateappLbl->Caption = L"Corriger Alt+Tab défaillant";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Déverrouiller des résolutions d'écran supplémentaires";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Forcer FPS élevé / Corriger saccades en Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Résoudre les problèmes de mauvaise performance et de son";
|
2021-09-29 13:48:12 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Corriger vidéos et éléments d'interface invisibles";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automatique", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Plein Écran", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Plein Écran Mis à l'Échelle", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Sans Bordure", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Fenêtré", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Pas de limite", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Sync avec la fréquence de l'écran", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Émuler un écran à 60Hz", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 tics par seconde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 tics par seconde", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 tics par seconde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 tics par seconde", NULL);
|
2021-09-29 13:48:12 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 tics par seconde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 tics par seconde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 tics par seconde", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 tics par seconde", NULL);
|
|
|
|
|
}
|
2023-03-01 15:06:12 +01:00
|
|
|
|
else if (lang == "italian" || (lang == "auto" && priID == LANG_ITALIAN)) {
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
|
|
|
|
|
/* -Italian - made by Kappa971 @ github */
|
|
|
|
|
|
|
|
|
|
ConfigForm->Caption = L"Configurazione di cnc-ddraw";
|
|
|
|
|
DisplayBtn->Caption = L"Impostazioni dello schermo";
|
|
|
|
|
AdvancedBtn->Caption = L"Impostazioni avanzate";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Tasti di scelta rapida";
|
2023-03-01 15:06:12 +01:00
|
|
|
|
CompatibilityBtn->Caption = L"Impostazioni di compatibilità";
|
2023-08-28 18:51:57 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Ripristina le impostazioni predefinite";
|
2023-03-01 15:06:12 +01:00
|
|
|
|
PresentationLbl->Caption = L"Presentazione";
|
|
|
|
|
MaintasLbl->Caption = L"Mantieni il rapporto d'aspetto";
|
2023-03-01 16:19:17 +01:00
|
|
|
|
VsyncLbl->Caption = L"Abilita la sincronizzazione verticale (VSync)";
|
2023-03-01 15:06:12 +01:00
|
|
|
|
AdjmouseLbl->Caption = L"Regola la sensibilità del mouse";
|
|
|
|
|
DevmodeLbl->Caption = L"Cattura il cursore nella finestra / schermo";
|
|
|
|
|
RendererLbl->Caption = L"Renderer";
|
|
|
|
|
BorderLbl->Caption = L"Mostra i bordi della finestra in modalità finestra";
|
|
|
|
|
SavesettingsLbl->Caption = L"Ricorda la posizione e le dimensioni della finestra";
|
|
|
|
|
ShaderLbl->Caption = L"Shader OpenGL";
|
|
|
|
|
MaxfpsLbl->Caption = L"Limita la frequenza dei fotogrammi (FPS)";
|
2023-03-01 16:19:17 +01:00
|
|
|
|
BoxingLbl->Caption = L"Abilita il ridimensionamento dei numeri interi";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Attiva/disattiva la modalità finestra";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Ingrandisci finestra";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Sblocca cursore 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Sblocca cursore 2";
|
2023-08-28 18:51:57 +02:00
|
|
|
|
ScreenshotLbl->Caption = L"Istantanea dello schermo";
|
2023-03-01 15:06:12 +01:00
|
|
|
|
MaxgameticksLbl->Caption = L"Limita la velocità di gioco";
|
2023-03-01 16:19:17 +01:00
|
|
|
|
NoactivateappLbl->Caption = L"Correggi il funzionamento di Alt+Tab";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Sblocca ulteriori risoluzioni dello schermo";
|
2023-03-01 16:19:17 +01:00
|
|
|
|
MinfpsLbl->Caption = L"Forza FPS elevati / Correggi balbuzie su Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Risolvi problemi di prestazioni e audio scadenti";
|
2023-03-01 15:06:12 +01:00
|
|
|
|
NonexclusiveLbl->Caption = L"Correggi video / elementi dell'interfaccia utente invisibili";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automatico", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Schermo Intero", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Schermo Intero Ridimensionato", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Senza Bordi", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"In Finestra", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Senza Limiti", NULL);
|
2023-03-01 16:19:17 +01:00
|
|
|
|
MaxgameticksCbx->AddItem(L"Sincronizza con la frequenza dello schermo", NULL);
|
2023-03-01 15:06:12 +01:00
|
|
|
|
MaxgameticksCbx->AddItem(L"Emula uno schermo a 60Hz", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 tick al secondo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 tick al secondo", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 tick al secondo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 tick al secondo", NULL);
|
2023-03-01 15:06:12 +01:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 tick al secondo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 tick al secondo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 tick al secondo", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 tick al secondo", NULL);
|
|
|
|
|
}
|
2021-07-06 16:26:15 +02:00
|
|
|
|
else {
|
2021-07-24 07:27:55 +02:00
|
|
|
|
IsEnglish = true;
|
|
|
|
|
|
|
|
|
|
try {
|
2021-08-01 15:10:56 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
2021-08-10 01:29:53 +02:00
|
|
|
|
else if (priID == LANG_RUSSIAN) {
|
|
|
|
|
TPngImage *png = new TPngImage();
|
|
|
|
|
png->LoadFromResourceName((int)HInstance, "PngImage_RU");
|
|
|
|
|
LanguageImg->Picture->Graphic = png;
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
}
|
2021-09-29 13:48:12 +02:00
|
|
|
|
else if (priID == LANG_HUNGARIAN) {
|
|
|
|
|
TPngImage *png = new TPngImage();
|
|
|
|
|
png->LoadFromResourceName((int)HInstance, "PngImage_HU");
|
|
|
|
|
LanguageImg->Picture->Graphic = png;
|
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
}
|
|
|
|
|
else if (priID == LANG_FRENCH) {
|
|
|
|
|
TPngImage *png = new TPngImage();
|
|
|
|
|
png->LoadFromResourceName((int)HInstance, "PngImage_FR");
|
|
|
|
|
LanguageImg->Picture->Graphic = png;
|
2023-03-01 15:06:12 +01:00
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
}
|
|
|
|
|
else if (priID == LANG_ITALIAN) {
|
|
|
|
|
TPngImage *png = new TPngImage();
|
|
|
|
|
png->LoadFromResourceName((int)HInstance, "PngImage_IT");
|
|
|
|
|
LanguageImg->Picture->Graphic = png;
|
2021-09-29 13:48:12 +02:00
|
|
|
|
LanguageImg->Visible = true;
|
|
|
|
|
}
|
2021-07-24 07:27:55 +02:00
|
|
|
|
} catch (...) {
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-06 16:26:15 +02:00
|
|
|
|
/*
|
|
|
|
|
ConfigForm->Caption = L"cnc-ddraw config";
|
|
|
|
|
DisplayBtn->Caption = L"Display Settings";
|
|
|
|
|
AdvancedBtn->Caption = L"Advanced Settings";
|
2023-08-13 01:43:03 +02:00
|
|
|
|
HotkeyBtn->Caption = L"Hotkey Settings";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
CompatibilityBtn->Caption = L"Compatibility Settings";
|
2023-08-13 15:03:25 +02:00
|
|
|
|
RestoreDefaultsBtn->Caption = L"Restore default settings";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
PresentationLbl->Caption = L"Presentation";
|
|
|
|
|
MaintasLbl->Caption = L"Maintain aspect ratio";
|
|
|
|
|
VsyncLbl->Caption = L"Enable VSync";
|
|
|
|
|
AdjmouseLbl->Caption = L"Adjust mouse sensitivity";
|
|
|
|
|
DevmodeLbl->Caption = L"Lock cursor to window / screen";
|
|
|
|
|
RendererLbl->Caption = L"Renderer";
|
|
|
|
|
BorderLbl->Caption = L"Show window borders in windowed mode";
|
|
|
|
|
SavesettingsLbl->Caption = L"Remember window position and size";
|
|
|
|
|
ShaderLbl->Caption = L"OpenGL shader";
|
|
|
|
|
MaxfpsLbl->Caption = L"Limit frame rate";
|
|
|
|
|
BoxingLbl->Caption = L"Enable windowboxing / integer scaling";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
ToggleWindowedLbl->Caption = L"Toggle windowed mode";
|
|
|
|
|
MaximizeWindowLbl->Caption = L"Maximize window";
|
|
|
|
|
UnlockCursor1Lbl->Caption = L"Unlock cursor 1";
|
|
|
|
|
UnlockCursor2Lbl->Caption = L"Unlock cursor 2";
|
|
|
|
|
ScreenshotLbl->Caption = L"Screenshot";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MaxgameticksLbl->Caption = L"Limit game speed";
|
|
|
|
|
NoactivateappLbl->Caption = L"Fix broken Alt+Tab";
|
2023-08-11 18:33:08 +02:00
|
|
|
|
ResolutionsLbl->Caption = L"Unlock additional screen resolutions";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MinfpsLbl->Caption = L"Force high FPS / Fix stuttering on Freesync/G-Sync";
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuLbl->Caption = L"Fix bad performance and sound issues";
|
2021-07-06 16:26:15 +02:00
|
|
|
|
NonexclusiveLbl->Caption = L"Fix invisible videos / UI elements";
|
|
|
|
|
|
|
|
|
|
RendererCbx->Items->Clear();
|
|
|
|
|
RendererCbx->AddItem(L"Automatic", NULL);
|
2021-08-10 01:29:53 +02:00
|
|
|
|
RendererCbx->AddItem(L"Direct3D 9", NULL);
|
2021-07-06 16:26:15 +02:00
|
|
|
|
RendererCbx->AddItem(L"OpenGL", NULL);
|
|
|
|
|
RendererCbx->AddItem(L"GDI", NULL);
|
|
|
|
|
|
|
|
|
|
PresentationCbx->Items->Clear();
|
|
|
|
|
PresentationCbx->AddItem(L"Fullscreen", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Fullscreen Upscaled", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Borderless", NULL);
|
|
|
|
|
PresentationCbx->AddItem(L"Windowed", NULL);
|
|
|
|
|
|
|
|
|
|
MaxgameticksCbx->Items->Clear();
|
|
|
|
|
MaxgameticksCbx->AddItem(L"No limit", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Sync with monitor refresh rate", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"Emulate 60hz refresh rate monitor", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"1000 ticks per second", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"500 ticks per second", NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"250 ticks per second", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"125 ticks per second", NULL);
|
2021-07-06 16:26:15 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(L"60 ticks per second", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"30 ticks per second", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"25 ticks per second", NULL);
|
|
|
|
|
MaxgameticksCbx->AddItem(L"15 ticks per second", NULL);
|
|
|
|
|
*/
|
2021-07-23 14:29:10 +02:00
|
|
|
|
}
|
2023-08-13 00:58:48 +02:00
|
|
|
|
|
|
|
|
|
ToggleWindowedKeyLbl->Caption = GetKeyText(VK_MENU) + L" +";
|
|
|
|
|
MaximizeWindowKeyLbl->Caption = GetKeyText(VK_MENU) + L" +";
|
|
|
|
|
UnlockCursor1KeyLbl->Caption = GetKeyText(VK_CONTROL) + L" +";
|
2023-08-13 10:10:35 +02:00
|
|
|
|
UnlockCursor2KeyLbl->Caption = "R " + GetKeyText(VK_MENU) + L" +";
|
2023-08-15 15:46:05 +02:00
|
|
|
|
|
|
|
|
|
ConfigForm->Caption +=
|
|
|
|
|
" (" + TPath::GetFileName(
|
|
|
|
|
TPath::GetDirectoryName(Application->ExeName)) + ")";
|
2021-07-01 18:02:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::DisplayBtnClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
DisplayPnl->Visible = true;
|
2021-07-03 03:42:23 +02:00
|
|
|
|
AdvancedPnl->Visible = false;
|
2023-08-13 00:58:48 +02:00
|
|
|
|
HotkeyPnl->Visible = false;
|
2021-07-01 18:02:16 +02:00
|
|
|
|
CompatibilityPnl->Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-03 03:42:23 +02:00
|
|
|
|
void __fastcall TConfigForm::AdvancedBtnClick(TObject *Sender)
|
2021-07-01 18:02:16 +02:00
|
|
|
|
{
|
2021-07-03 03:42:23 +02:00
|
|
|
|
AdvancedPnl->Visible = true;
|
2021-07-01 18:02:16 +02:00
|
|
|
|
DisplayPnl->Visible = false;
|
2023-08-13 00:58:48 +02:00
|
|
|
|
HotkeyPnl->Visible = false;
|
|
|
|
|
CompatibilityPnl->Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::HotkeyBtnClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
HotkeyPnl->Visible = true;
|
|
|
|
|
AdvancedPnl->Visible = false;
|
|
|
|
|
DisplayPnl->Visible = false;
|
2021-07-01 18:02:16 +02:00
|
|
|
|
CompatibilityPnl->Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 18:04:34 +02:00
|
|
|
|
void __fastcall TConfigForm::CompatibilityBtnClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
CompatibilityPnl->Visible = true;
|
2021-07-03 03:42:23 +02:00
|
|
|
|
AdvancedPnl->Visible = false;
|
2021-07-01 18:04:34 +02:00
|
|
|
|
DisplayPnl->Visible = false;
|
2023-08-13 00:58:48 +02:00
|
|
|
|
HotkeyPnl->Visible = false;
|
2021-07-01 18:04:34 +02:00
|
|
|
|
}
|
2021-07-01 18:02:16 +02:00
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
void __fastcall TConfigForm::FormCreate(TObject *Sender)
|
|
|
|
|
{
|
2023-08-05 04:50:02 +02:00
|
|
|
|
/* Let cnc-ddraw create a new ddraw.ini if it doesn't exist */
|
2023-08-13 02:36:40 +02:00
|
|
|
|
if (FileExists(".\\ddraw.dll") && !FileExists(".\\ddraw.ini")) {
|
2023-08-05 04:50:02 +02:00
|
|
|
|
|
|
|
|
|
SetEnvironmentVariableW(L"cnc_ddraw_config_init", L"1");
|
|
|
|
|
|
|
|
|
|
HMODULE ddraw = LoadLibraryW(L".\\ddraw.dll");
|
|
|
|
|
|
|
|
|
|
if (ddraw) {
|
|
|
|
|
|
|
|
|
|
void (WINAPI* dd_create)(void*, void**, void*);
|
|
|
|
|
|
|
|
|
|
dd_create =
|
|
|
|
|
(void (WINAPI*)(void*, void**, void*))
|
|
|
|
|
GetProcAddress(ddraw, "DirectDrawCreate");
|
|
|
|
|
|
2023-08-13 02:51:16 +02:00
|
|
|
|
if (dd_create && GetProcAddress(ddraw, "GameHandlesClose")) {
|
2023-08-05 04:50:02 +02:00
|
|
|
|
|
|
|
|
|
void *buf;
|
|
|
|
|
dd_create(NULL, &buf, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FreeLibrary(ddraw);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
|
|
|
|
|
2023-08-13 17:15:59 +02:00
|
|
|
|
if (ini->ReadString("ddraw", "configtheme", "Windows10") == "Cobalt XEMedia") {
|
|
|
|
|
|
|
|
|
|
ThemePnl->Color = (TColor)RGB(243, 243, 243);
|
|
|
|
|
DisplayPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
|
|
|
|
AdvancedPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
|
|
|
|
HotkeyPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
|
|
|
|
CompatibilityPnl->StyleElements = TStyleElements(seFont + seClient + seBorder);
|
|
|
|
|
|
|
|
|
|
MenuPnl->StyleElements = TStyleElements(seFont);
|
|
|
|
|
MenuPnl->Color = (TColor)RGB(31, 31, 31);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-24 07:27:55 +02:00
|
|
|
|
ApplyTranslation(ini);
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
/* Display Settings */
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
bool windowed = GetBool(ini, "windowed", false);
|
|
|
|
|
bool fullscreen = GetBool(ini, "fullscreen", false);
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
|
|
|
|
if (windowed && fullscreen) {
|
2021-07-03 03:23:04 +02:00
|
|
|
|
PresentationCbx->ItemIndex = 2;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
}
|
|
|
|
|
else if (windowed) {
|
2021-07-03 03:23:04 +02:00
|
|
|
|
PresentationCbx->ItemIndex = 3;
|
|
|
|
|
}
|
|
|
|
|
else if (fullscreen) {
|
|
|
|
|
PresentationCbx->ItemIndex = 1;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PresentationCbx->ItemIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
MaintasChk->State = GetBool(ini, "maintas", false) ? tssOn : tssOff;
|
|
|
|
|
VsyncChk->State = GetBool(ini, "vsync", false) ? tssOn : tssOff;
|
2021-07-02 02:42:57 +02:00
|
|
|
|
AdjmouseChk->State = GetBool(ini, "adjmouse", true) ? tssOn : tssOff;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
DevmodeChk->State = GetBool(ini, "devmode", false) ? tssOff : tssOn;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2021-07-06 02:23:48 +02:00
|
|
|
|
/* Advanced Settings */
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
|
|
|
|
auto renderer = LowerCase(ini->ReadString("ddraw", "renderer", "auto"));
|
|
|
|
|
|
2023-08-08 17:45:19 +02:00
|
|
|
|
if (renderer == "direct3d9on12") {
|
|
|
|
|
RendererCbx->AddItem(L"Direct3D 12 (9On12)", NULL);
|
|
|
|
|
RendererCbx->ItemIndex = 4;
|
2023-08-13 12:49:54 +02:00
|
|
|
|
|
|
|
|
|
ShaderLbl->Caption =
|
|
|
|
|
ReplaceStr(ShaderLbl->Caption, "OpenGL", "Direct3D");
|
|
|
|
|
|
|
|
|
|
ShaderD3DCbx->Visible = true;
|
|
|
|
|
ShaderCbx->Visible = false;
|
2023-08-08 17:45:19 +02:00
|
|
|
|
}
|
|
|
|
|
else if (renderer == "openglcore") {
|
|
|
|
|
RendererCbx->AddItem(L"OpenGL Core", NULL);
|
|
|
|
|
RendererCbx->ItemIndex = 4;
|
|
|
|
|
}
|
|
|
|
|
else if (StartsStr("d", renderer)) {
|
2021-07-01 20:56:25 +02:00
|
|
|
|
RendererCbx->ItemIndex = 1;
|
2023-08-13 12:49:54 +02:00
|
|
|
|
|
2023-08-13 12:51:38 +02:00
|
|
|
|
ShaderLbl->Caption =
|
2023-08-13 12:49:54 +02:00
|
|
|
|
ReplaceStr(ShaderLbl->Caption, "OpenGL", "Direct3D");
|
|
|
|
|
|
|
|
|
|
ShaderD3DCbx->Visible = true;
|
|
|
|
|
ShaderCbx->Visible = false;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
}
|
|
|
|
|
else if (StartsStr("o", renderer)) {
|
|
|
|
|
RendererCbx->ItemIndex = 2;
|
|
|
|
|
}
|
|
|
|
|
else if (StartsStr("s", renderer) || StartsStr("g", renderer)) {
|
|
|
|
|
RendererCbx->ItemIndex = 3;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
RendererCbx->ItemIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
TStringDynArray list = TDirectory::GetFiles(
|
|
|
|
|
"Shaders",
|
|
|
|
|
"*.glsl",
|
|
|
|
|
TSearchOption::soAllDirectories);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < list.Length; i++)
|
|
|
|
|
ShaderCbx->AddItem(list[i], NULL);
|
|
|
|
|
}
|
|
|
|
|
catch (...)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-26 21:28:53 +02:00
|
|
|
|
if (ShaderCbx->Items->Count == 0) {
|
|
|
|
|
ShaderCbx->AddItem("Nearest neighbor", NULL);
|
|
|
|
|
ShaderCbx->AddItem("Bilinear", NULL);
|
|
|
|
|
ShaderCbx->AddItem("Bicubic", NULL);
|
2023-08-26 22:10:21 +02:00
|
|
|
|
ShaderCbx->AddItem("Lanczos", NULL);
|
2023-08-29 18:24:32 +02:00
|
|
|
|
ShaderCbx->AddItem("xBR-lv2", NULL);
|
2023-08-26 21:28:53 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto shader = ini->ReadString("ddraw", "shader", "Bicubic");
|
|
|
|
|
ShaderCbx->ItemIndex = ShaderCbx->Items->IndexOf(shader);
|
|
|
|
|
|
|
|
|
|
if (ShaderCbx->ItemIndex == -1) {
|
|
|
|
|
ShaderCbx->AddItem(shader, NULL);
|
|
|
|
|
ShaderCbx->ItemIndex = ShaderCbx->Items->Count - 1;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 12:49:54 +02:00
|
|
|
|
int d3d9_filter = ini->ReadInteger("ddraw", "d3d9_filter", 2);
|
|
|
|
|
|
|
|
|
|
switch (d3d9_filter) {
|
|
|
|
|
case 0:
|
|
|
|
|
ShaderD3DCbx->ItemIndex = 0;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
ShaderD3DCbx->ItemIndex = 1;
|
|
|
|
|
break;
|
2023-08-23 17:04:15 +02:00
|
|
|
|
case 2:
|
2023-08-13 12:49:54 +02:00
|
|
|
|
default:
|
|
|
|
|
ShaderD3DCbx->ItemIndex = 2;
|
|
|
|
|
break;
|
2023-08-23 17:04:15 +02:00
|
|
|
|
case 3:
|
|
|
|
|
ShaderD3DCbx->ItemIndex = 3;
|
|
|
|
|
break;
|
2023-08-13 12:49:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-07-02 01:19:12 +02:00
|
|
|
|
Maxfps = ini->ReadInteger("ddraw", "maxfps", -1);
|
|
|
|
|
MaxfpsChk->State = Maxfps != 0 ? tssOn : tssOff;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
BoxingChk->State = GetBool(ini, "boxing", false) ? tssOn : tssOff;
|
2021-07-02 02:42:57 +02:00
|
|
|
|
BorderChk->State = GetBool(ini, "border", true) ? tssOn : tssOff;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2021-07-02 01:19:12 +02:00
|
|
|
|
Savesettings = ini->ReadInteger("ddraw", "savesettings", 1);
|
|
|
|
|
SavesettingsChk->State = Savesettings != 0 ? tssOn : tssOff;
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2023-08-13 00:58:48 +02:00
|
|
|
|
/* Hotkey Settings */
|
|
|
|
|
|
|
|
|
|
ToggleWindowedEdt->Text =
|
|
|
|
|
GetKeyText(Byte(ini->ReadInteger("ddraw", "keytogglefullscreen", 0x0D)));
|
|
|
|
|
|
|
|
|
|
MaximizeWindowEdt->Text =
|
|
|
|
|
GetKeyText(Byte(ini->ReadInteger("ddraw", "keytogglemaximize", 0x22)));
|
|
|
|
|
|
|
|
|
|
UnlockCursor1Edt->Text =
|
|
|
|
|
GetKeyText(Byte(ini->ReadInteger("ddraw", "keyunlockcursor1", 0x09)));
|
|
|
|
|
|
|
|
|
|
UnlockCursor2Edt->Text =
|
|
|
|
|
GetKeyText(Byte(ini->ReadInteger("ddraw", "keyunlockcursor2", 0xA3)));
|
|
|
|
|
|
|
|
|
|
ScreenshotEdt->Text =
|
|
|
|
|
GetKeyText(Byte(ini->ReadInteger("ddraw", "keyscreenshot", 0x2C)));
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
/* Compatibility Settings */
|
|
|
|
|
|
|
|
|
|
int maxgameticks = ini->ReadInteger("ddraw", "maxgameticks", 0);
|
|
|
|
|
|
|
|
|
|
switch (maxgameticks) {
|
|
|
|
|
case -1:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 0;
|
|
|
|
|
break;
|
|
|
|
|
case -2:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 1;
|
|
|
|
|
break;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
case 0:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 2;
|
|
|
|
|
break;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
case 1000:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 3;
|
|
|
|
|
break;
|
|
|
|
|
case 500:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 4;
|
|
|
|
|
break;
|
2023-08-04 13:51:57 +02:00
|
|
|
|
case 250:
|
2021-07-02 00:22:01 +02:00
|
|
|
|
MaxgameticksCbx->ItemIndex = 5;
|
|
|
|
|
break;
|
2023-08-04 13:51:57 +02:00
|
|
|
|
case 125:
|
2021-07-02 00:22:01 +02:00
|
|
|
|
MaxgameticksCbx->ItemIndex = 6;
|
|
|
|
|
break;
|
2023-08-04 13:51:57 +02:00
|
|
|
|
case 60:
|
2021-07-02 00:22:01 +02:00
|
|
|
|
MaxgameticksCbx->ItemIndex = 7;
|
|
|
|
|
break;
|
2023-08-04 13:51:57 +02:00
|
|
|
|
case 30:
|
2021-07-02 00:22:01 +02:00
|
|
|
|
MaxgameticksCbx->ItemIndex = 8;
|
|
|
|
|
break;
|
2023-08-04 13:51:57 +02:00
|
|
|
|
case 25:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 9;
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
MaxgameticksCbx->ItemIndex = 10;
|
|
|
|
|
break;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
default:
|
2021-07-02 01:19:12 +02:00
|
|
|
|
MaxgameticksCbx->AddItem(IntToStr(maxgameticks), NULL);
|
2023-08-04 13:51:57 +02:00
|
|
|
|
MaxgameticksCbx->ItemIndex = 11;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NoactivateappChk->State = GetBool(ini, "noactivateapp", false) ? tssOn : tssOff;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
|
2023-08-11 18:33:08 +02:00
|
|
|
|
Resolutions = ini->ReadInteger("ddraw", "resolutions", 0);
|
|
|
|
|
ResolutionsChk->State = Resolutions == 2 ? tssOn : tssOff;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
|
|
|
|
|
Minfps = ini->ReadInteger("ddraw", "minfps", 0);
|
|
|
|
|
MinfpsChk->State = Minfps != 0 ? tssOn : tssOff;
|
|
|
|
|
|
2023-08-04 13:38:49 +02:00
|
|
|
|
SinglecpuChk->State = GetBool(ini, "singlecpu", true) ? tssOff : tssOn;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
NonexclusiveChk->State = GetBool(ini, "nonexclusive", false) ? tssOn : tssOff;
|
|
|
|
|
|
2023-08-13 15:19:45 +02:00
|
|
|
|
CompatibilityBtn->Visible = !GetBool(ini, "hide_compat_tab", false);
|
2023-08-04 15:06:23 +02:00
|
|
|
|
|
2023-08-13 14:40:29 +02:00
|
|
|
|
RestoreDefaultsBtn->Visible =
|
2023-08-13 14:54:52 +02:00
|
|
|
|
FileExists(".\\ddraw.dll") &&
|
|
|
|
|
FileExists(".\\ddraw.ini") &&
|
|
|
|
|
GetBool(ini, "allow_reset", true);
|
2023-08-13 14:40:29 +02:00
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
delete ini;
|
|
|
|
|
|
|
|
|
|
Initialized = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TConfigForm::SaveSettings()
|
|
|
|
|
{
|
|
|
|
|
if (!Initialized)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
auto *ini = new TIniFile(".\\ddraw.ini");
|
|
|
|
|
|
|
|
|
|
/* Display Settings */
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
switch(PresentationCbx->ItemIndex) {
|
2021-07-01 20:56:25 +02:00
|
|
|
|
case 0:
|
|
|
|
|
ini->WriteString("ddraw", "windowed", "false");
|
|
|
|
|
ini->WriteString("ddraw", "fullscreen", "false");
|
2023-08-04 14:31:46 +02:00
|
|
|
|
ini->WriteString("ddraw", "toggle_borderless", "false");
|
2021-07-01 20:56:25 +02:00
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2021-07-03 03:23:04 +02:00
|
|
|
|
ini->WriteString("ddraw", "windowed", "false");
|
2021-07-01 20:56:25 +02:00
|
|
|
|
ini->WriteString("ddraw", "fullscreen", "true");
|
|
|
|
|
break;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
case 2:
|
2021-07-03 03:23:04 +02:00
|
|
|
|
ini->WriteString("ddraw", "windowed", "true");
|
|
|
|
|
ini->WriteString("ddraw", "fullscreen", "true");
|
2023-08-04 14:31:46 +02:00
|
|
|
|
ini->WriteString("ddraw", "toggle_borderless", "true");
|
2021-07-03 03:23:04 +02:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2021-07-01 20:56:25 +02:00
|
|
|
|
ini->WriteString("ddraw", "windowed", "true");
|
|
|
|
|
ini->WriteString("ddraw", "fullscreen", "false");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"maintas",
|
|
|
|
|
MaintasChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"vsync",
|
|
|
|
|
VsyncChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"adjmouse",
|
|
|
|
|
AdjmouseChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"devmode",
|
2021-07-01 21:09:26 +02:00
|
|
|
|
DevmodeChk->State == tssOn ? "false" : "true");
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2021-07-06 02:23:48 +02:00
|
|
|
|
/* Advanced Settings */
|
|
|
|
|
|
|
|
|
|
switch(RendererCbx->ItemIndex) {
|
|
|
|
|
case 0:
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "auto");
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "direct3d9");
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "opengl");
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "gdi");
|
|
|
|
|
break;
|
2023-08-08 17:45:19 +02:00
|
|
|
|
case 4:
|
|
|
|
|
if (RendererCbx->Text == "OpenGL Core") {
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "openglcore");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ini->WriteString("ddraw", "renderer", "direct3d9on12");
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-07-06 02:23:48 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
|
|
|
|
ini->WriteString("ddraw", "shader", ShaderCbx->Text);
|
|
|
|
|
|
2023-08-13 12:49:54 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "d3d9_filter", ShaderD3DCbx->ItemIndex);
|
|
|
|
|
|
2021-07-02 01:19:12 +02:00
|
|
|
|
int maxfps = Maxfps == 0 ? -1 : Maxfps;
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
ini->WriteInteger(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"maxfps",
|
2021-07-02 01:19:12 +02:00
|
|
|
|
MaxfpsChk->State == tssOn ? maxfps : 0);
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"boxing",
|
|
|
|
|
BoxingChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"border",
|
|
|
|
|
BorderChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
2021-07-02 01:19:12 +02:00
|
|
|
|
int savesettings = Savesettings == 0 ? 1 : Savesettings;
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
ini->WriteInteger(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"savesettings",
|
2021-07-02 01:19:12 +02:00
|
|
|
|
SavesettingsChk->State == tssOn ? savesettings : 0);
|
|
|
|
|
|
|
|
|
|
if (Savesettings != 0 && SavesettingsChk->State == tssOff) {
|
|
|
|
|
ini->WriteInteger("ddraw", "width", 0);
|
|
|
|
|
ini->WriteInteger("ddraw", "height", 0);
|
|
|
|
|
ini->WriteInteger("ddraw", "posX", -32000);
|
|
|
|
|
ini->WriteInteger("ddraw", "posY", -32000);
|
|
|
|
|
}
|
2021-07-01 20:56:25 +02:00
|
|
|
|
|
2023-08-13 00:58:48 +02:00
|
|
|
|
/* Hotkey Settings */
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"keytogglefullscreen",
|
|
|
|
|
"0x" + IntToHex(Byte(GetKeyCode(ToggleWindowedEdt->Text))));
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"keytogglemaximize",
|
|
|
|
|
"0x" + IntToHex(Byte(GetKeyCode(MaximizeWindowEdt->Text))));
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"keyunlockcursor1",
|
|
|
|
|
"0x" + IntToHex(Byte(GetKeyCode(UnlockCursor1Edt->Text))));
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"keyunlockcursor2",
|
|
|
|
|
"0x" + IntToHex(Byte(GetKeyCode(UnlockCursor2Edt->Text))));
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"keyscreenshot",
|
|
|
|
|
"0x" + IntToHex(Byte(GetKeyCode(ScreenshotEdt->Text))));
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
/* Compatibility Settings */
|
|
|
|
|
|
|
|
|
|
switch(MaxgameticksCbx->ItemIndex) {
|
|
|
|
|
case 0:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", -1);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", -2);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 0);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 1000);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 500);
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
2023-08-04 13:51:57 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 250);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
break;
|
|
|
|
|
case 6:
|
2023-08-04 13:51:57 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 125);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2023-08-04 13:51:57 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 60);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
break;
|
|
|
|
|
case 8:
|
2023-08-04 13:51:57 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 30);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
break;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
case 9:
|
2023-08-04 13:51:57 +02:00
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 25);
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
ini->WriteInteger("ddraw", "maxgameticks", 15);
|
|
|
|
|
break;
|
|
|
|
|
case 11:
|
2021-07-02 01:19:12 +02:00
|
|
|
|
ini->WriteString("ddraw", "maxgameticks", MaxgameticksCbx->Text);
|
|
|
|
|
break;
|
2021-07-02 00:22:01 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"noactivateapp",
|
|
|
|
|
NoactivateappChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
2023-08-11 18:33:08 +02:00
|
|
|
|
int resolutions = Resolutions != 2 ? Resolutions : 0;
|
2021-07-02 01:19:12 +02:00
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
ini->WriteInteger(
|
|
|
|
|
"ddraw",
|
2023-08-11 18:33:08 +02:00
|
|
|
|
"resolutions",
|
|
|
|
|
ResolutionsChk->State == tssOn ? 2 : resolutions);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
|
2021-07-02 01:19:12 +02:00
|
|
|
|
int minfps = Minfps == 0 ? -1 : Minfps;
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
ini->WriteInteger(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"minfps",
|
2021-07-02 01:19:12 +02:00
|
|
|
|
MinfpsChk->State == tssOn ? minfps : 0);
|
2021-07-02 00:22:01 +02:00
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
2023-08-04 13:38:49 +02:00
|
|
|
|
"singlecpu",
|
|
|
|
|
SinglecpuChk->State == tssOn ? "false" : "true");
|
2021-07-02 00:22:01 +02:00
|
|
|
|
|
|
|
|
|
ini->WriteString(
|
|
|
|
|
"ddraw",
|
|
|
|
|
"nonexclusive",
|
|
|
|
|
NonexclusiveChk->State == tssOn ? "true" : "false");
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
delete ini;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-04 17:38:31 +02:00
|
|
|
|
void __fastcall TConfigForm::FormActivate(TObject *Sender)
|
2023-09-07 19:54:19 +02:00
|
|
|
|
{
|
|
|
|
|
DisableGameUX();
|
|
|
|
|
AddDllOverride();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TConfigForm::AddDllOverride()
|
2023-08-04 17:38:31 +02:00
|
|
|
|
{
|
2023-08-05 04:50:02 +02:00
|
|
|
|
/* Detect wine (Linux/macOS) and create the needed dll override */
|
2023-08-05 05:20:11 +02:00
|
|
|
|
if (!GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "wine_get_version"))
|
2023-08-04 17:38:31 +02:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TRegistry* reg = new TRegistry(KEY_READ);
|
|
|
|
|
reg->RootKey = HKEY_CURRENT_USER;
|
|
|
|
|
|
2023-08-08 18:09:17 +02:00
|
|
|
|
if (reg->OpenKey("Software\\Wine\\DllOverrides\\", true)) {
|
2023-08-04 17:38:31 +02:00
|
|
|
|
|
|
|
|
|
if (!reg->ValueExists("ddraw")) {
|
|
|
|
|
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
|
|
|
|
|
if (Application->MessageBox(
|
|
|
|
|
L"cnc-ddraw requires a dll override in winecfg, "
|
|
|
|
|
"would you like to add it now?",
|
|
|
|
|
L"cnc-ddraw",
|
|
|
|
|
MB_YESNO) == IDNO) {
|
|
|
|
|
|
|
|
|
|
reg->Free();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reg->Access = KEY_WRITE;
|
|
|
|
|
|
|
|
|
|
if (reg->OpenKey("Software\\Wine\\DllOverrides\\", true)) {
|
|
|
|
|
|
|
|
|
|
reg->WriteString("ddraw", "native,builtin");
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reg->Free();
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-07 19:54:19 +02:00
|
|
|
|
void TConfigForm::DisableGameUX()
|
|
|
|
|
{
|
|
|
|
|
/* Prevent bug where some games don't start properly and run in the background */
|
|
|
|
|
if (!(TOSVersion::Major == 6 && TOSVersion::Minor == 1))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TRegistry* reg = new TRegistry(KEY_READ);
|
|
|
|
|
reg->RootKey = HKEY_CLASSES_ROOT;
|
|
|
|
|
|
|
|
|
|
if (reg->OpenKey(
|
|
|
|
|
"Local Settings\\Software\\Microsoft\\Windows\\GameUX\\ServiceLocation\\",
|
|
|
|
|
false)) {
|
|
|
|
|
|
|
|
|
|
if (reg->ValueExists("Games") &&
|
|
|
|
|
reg->ReadString("Games") != "127.0.0.1" &&
|
|
|
|
|
LowerCase(reg->ReadString("Games")) != "localhost") {
|
|
|
|
|
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
|
|
|
|
|
reg->Access = KEY_WRITE;
|
|
|
|
|
|
|
|
|
|
if (reg->OpenKey(
|
|
|
|
|
"Local Settings\\Software\\Microsoft\\Windows\\GameUX\\ServiceLocation\\",
|
|
|
|
|
false)) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reg->WriteString("Games", "127.0.0.1");
|
|
|
|
|
} catch (...) {
|
|
|
|
|
/* maybe restart with admin rights here? */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
reg->CloseKey();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reg->Free();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 00:58:48 +02:00
|
|
|
|
void __fastcall TConfigForm::HotkeyEdtKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
|
|
|
|
|
{
|
|
|
|
|
TEdit *edit = static_cast<TEdit*>(Sender);
|
|
|
|
|
|
|
|
|
|
if (Key == VK_DELETE || Key == VK_BACK) {
|
|
|
|
|
edit->Text = L"";
|
|
|
|
|
}
|
|
|
|
|
else if (GetAsyncKeyState(VK_RCONTROL) & 0x8000) {
|
|
|
|
|
edit->Text = GetKeyText(VK_RCONTROL);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
edit->Text = GetKeyText(Key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)
|
|
|
|
|
{
|
|
|
|
|
TEdit *edit = static_cast<TEdit*>(Sender);
|
|
|
|
|
|
|
|
|
|
if (Key == VK_SNAPSHOT || Key == VK_TAB) {
|
|
|
|
|
edit->Text = GetKeyText(Key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:57:59 +02:00
|
|
|
|
WORD TConfigForm::GetKeyCode(System::UnicodeString text)
|
2023-08-13 00:58:48 +02:00
|
|
|
|
{
|
2023-09-25 02:57:59 +02:00
|
|
|
|
if (text == L"PrtScn") {
|
2023-08-13 00:58:48 +02:00
|
|
|
|
return VK_SNAPSHOT;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:57:59 +02:00
|
|
|
|
if (text == L"Pause_") {
|
2023-08-13 02:03:17 +02:00
|
|
|
|
return VK_PAUSE;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:57:59 +02:00
|
|
|
|
if (text == L"R " + KeyToText(VK_CONTROL)) {
|
2023-08-13 00:58:48 +02:00
|
|
|
|
return VK_RCONTROL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:57:59 +02:00
|
|
|
|
for (WORD i = 0; i < 256; i++) {
|
|
|
|
|
if (KeyNames[i] == text) {
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2023-08-13 00:58:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System::UnicodeString TConfigForm::GetKeyText(WORD key)
|
|
|
|
|
{
|
|
|
|
|
if (key == VK_SNAPSHOT) {
|
2023-08-13 01:23:19 +02:00
|
|
|
|
return L"PrtScn";
|
2023-08-13 00:58:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 02:03:17 +02:00
|
|
|
|
if (key == VK_PAUSE) {
|
|
|
|
|
return L"Pause_";
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 00:58:48 +02:00
|
|
|
|
if (key == VK_RCONTROL) {
|
2023-09-25 02:30:35 +02:00
|
|
|
|
return L"R " + KeyToText(VK_CONTROL);
|
2023-08-13 00:58:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (key == VK_RSHIFT) {
|
2023-09-25 02:30:35 +02:00
|
|
|
|
return KeyToText(VK_SHIFT);
|
2023-08-13 00:58:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:30:35 +02:00
|
|
|
|
return KeyToText(key);
|
2023-09-25 00:42:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:30:35 +02:00
|
|
|
|
System::UnicodeString TConfigForm::KeyToText(WORD key)
|
|
|
|
|
{
|
|
|
|
|
UINT scanCode = MapVirtualKeyW(key, MAPVK_VK_TO_VSC);
|
|
|
|
|
|
|
|
|
|
switch (key) {
|
|
|
|
|
case VK_LEFT:
|
|
|
|
|
case VK_UP:
|
|
|
|
|
case VK_RIGHT:
|
|
|
|
|
case VK_DOWN:
|
|
|
|
|
case VK_PRIOR:
|
|
|
|
|
case VK_NEXT:
|
|
|
|
|
case VK_END:
|
|
|
|
|
case VK_HOME:
|
|
|
|
|
case VK_INSERT:
|
|
|
|
|
case VK_DELETE:
|
|
|
|
|
case VK_DIVIDE:
|
|
|
|
|
case VK_NUMLOCK:
|
|
|
|
|
{
|
|
|
|
|
scanCode |= 0x100;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-25 02:57:59 +02:00
|
|
|
|
WCHAR keyName[256] = {};
|
2023-09-25 02:30:35 +02:00
|
|
|
|
GetKeyNameTextW(scanCode << 16, keyName, sizeof(keyName) / sizeof(WCHAR));
|
|
|
|
|
|
|
|
|
|
KeyNames[(BYTE)key] = keyName;
|
|
|
|
|
|
|
|
|
|
return KeyNames[(BYTE)key];
|
2023-08-13 00:58:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
bool TConfigForm::GetBool(TIniFile *ini, System::UnicodeString key, bool defValue)
|
|
|
|
|
{
|
|
|
|
|
auto s = LowerCase(ini->ReadString("ddraw", key, defValue ? "true" : "false"));
|
|
|
|
|
return s == "true" || s == "yes" || s == "1";
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
void __fastcall TConfigForm::PresentationCbxChange(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::MaintasChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::VsyncChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::AdjmouseChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::DevmodeChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::RendererCbxChange(TObject *Sender)
|
|
|
|
|
{
|
2023-08-13 12:49:54 +02:00
|
|
|
|
if (ContainsStr(RendererCbx->Text, "Direct3D")) {
|
|
|
|
|
|
|
|
|
|
ShaderLbl->Caption =
|
|
|
|
|
ReplaceStr(ShaderLbl->Caption, "OpenGL", "Direct3D");
|
|
|
|
|
|
|
|
|
|
ShaderD3DCbx->Visible = true;
|
|
|
|
|
ShaderCbx->Visible = false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2023-08-13 12:53:12 +02:00
|
|
|
|
ShaderLbl->Caption =
|
2023-08-13 12:49:54 +02:00
|
|
|
|
ReplaceStr(ShaderLbl->Caption, "Direct3D", "OpenGL");
|
|
|
|
|
|
|
|
|
|
ShaderCbx->Visible = true;
|
|
|
|
|
ShaderD3DCbx->Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::ShaderCbxChange(TObject *Sender)
|
|
|
|
|
{
|
2023-08-08 18:09:17 +02:00
|
|
|
|
if (RendererCbx->Text != "OpenGL Core") {
|
|
|
|
|
RendererCbx->ItemIndex = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-13 12:49:54 +02:00
|
|
|
|
void __fastcall TConfigForm::ShaderD3DCbxChange(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 20:56:25 +02:00
|
|
|
|
void __fastcall TConfigForm::MaxfpsChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::BoxingChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::BorderChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::SavesettingsChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-02 00:22:01 +02:00
|
|
|
|
void __fastcall TConfigForm::MaxgameticksCbxChange(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::NoactivateappChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-11 18:33:08 +02:00
|
|
|
|
void __fastcall TConfigForm::ResolutionsChkClick(TObject *Sender)
|
2021-07-02 00:22:01 +02:00
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::MinfpsChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-04 13:38:49 +02:00
|
|
|
|
void __fastcall TConfigForm::SinglecpuChkClick(TObject *Sender)
|
2021-07-02 00:22:01 +02:00
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __fastcall TConfigForm::NonexclusiveChkClick(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-02 18:20:47 +02:00
|
|
|
|
void __fastcall TConfigForm::PboxPaint(TObject *Sender)
|
|
|
|
|
{
|
|
|
|
|
TPaintBox *pbox = static_cast<TPaintBox*>(Sender);
|
2023-08-04 11:54:46 +02:00
|
|
|
|
//pbox->Canvas->Rectangle(pbox->ClientRect);
|
2021-07-02 18:20:47 +02:00
|
|
|
|
}
|
|
|
|
|
|