1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 01:57:47 +01:00

add hotkey editor

This commit is contained in:
FunkyFr3sh 2023-08-13 00:58:48 +02:00
parent 62e147f27d
commit 5b82ffbb96
3 changed files with 463 additions and 14 deletions

View File

@ -70,6 +70,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"OpenGL着色器"; ShaderLbl->Caption = L"OpenGL着色器";
MaxfpsLbl->Caption = L"限制帧率"; MaxfpsLbl->Caption = L"限制帧率";
BoxingLbl->Caption = L"打开窗盒显示/整数缩放"; BoxingLbl->Caption = L"打开窗盒显示/整数缩放";
ToggleWindowedLbl->Caption = L"切换窗口模式";
MaximizeWindowLbl->Caption = L"最大化窗口";
UnlockCursor1Lbl->Caption = L"解锁光标 1";
UnlockCursor2Lbl->Caption = L"解锁光标 2";
ScreenshotLbl->Caption = L"截屏";
MaxgameticksLbl->Caption = L"限制游戏速率"; MaxgameticksLbl->Caption = L"限制游戏速率";
NoactivateappLbl->Caption = L"修复损坏的Alt+Tab功能"; NoactivateappLbl->Caption = L"修复损坏的Alt+Tab功能";
ResolutionsLbl->Caption = L"解锁其他屏幕分辨率"; ResolutionsLbl->Caption = L"解锁其他屏幕分辨率";
@ -122,6 +127,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"Sombreador OpenGL"; ShaderLbl->Caption = L"Sombreador OpenGL";
MaxfpsLbl->Caption = L"Limitar velocidad de fotogramas"; MaxfpsLbl->Caption = L"Limitar velocidad de fotogramas";
BoxingLbl->Caption = L"Activar encajado de ventanas / escalado de enteros"; BoxingLbl->Caption = L"Activar encajado de ventanas / escalado de enteros";
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";
MaxgameticksLbl->Caption = L"Limitar velocidad de juego"; MaxgameticksLbl->Caption = L"Limitar velocidad de juego";
NoactivateappLbl->Caption = L"Corregir Alt+Tab roto"; NoactivateappLbl->Caption = L"Corregir Alt+Tab roto";
ResolutionsLbl->Caption = L"Desbloquear resoluciones de pantalla adicionales"; ResolutionsLbl->Caption = L"Desbloquear resoluciones de pantalla adicionales";
@ -174,6 +184,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"OpenGL shader"; ShaderLbl->Caption = L"OpenGL shader";
MaxfpsLbl->Caption = L"Limitiere Aktualisierungsrate"; MaxfpsLbl->Caption = L"Limitiere Aktualisierungsrate";
BoxingLbl->Caption = L"Fensterboxing / Integer Skalierung aktivieren"; //Not 100% sure if "windowboxing" can be translated better. BoxingLbl->Caption = L"Fensterboxing / Integer Skalierung aktivieren"; //Not 100% sure if "windowboxing" can be translated better.
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";
MaxgameticksLbl->Caption = L"Spielgeschwindigkeit limitieren"; 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" NoactivateappLbl->Caption = L"Fehlerhaftes Alt+Tab reparieren"; //The first word can be ignored if its to long (eng word "Fix"
ResolutionsLbl->Caption = L"Zusätzliche Bildschirmauflösungen freischalten"; ResolutionsLbl->Caption = L"Zusätzliche Bildschirmauflösungen freischalten";
@ -227,6 +242,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"Шейдер OpenGL"; ShaderLbl->Caption = L"Шейдер OpenGL";
MaxfpsLbl->Caption = L"Ограничить частоту кадров"; MaxfpsLbl->Caption = L"Ограничить частоту кадров";
BoxingLbl->Caption = L"Включить windowboxing / целочисленное масштабирование"; BoxingLbl->Caption = L"Включить windowboxing / целочисленное масштабирование";
ToggleWindowedLbl->Caption = L"Переключить оконный режим";
MaximizeWindowLbl->Caption = L"Развернуть окно";
UnlockCursor1Lbl->Caption = L"Разблокировать курсор 1";
UnlockCursor2Lbl->Caption = L"Разблокировать курсор 2";
ScreenshotLbl->Caption = L"Скриншот";
MaxgameticksLbl->Caption = L"Ограничить скорость игры"; MaxgameticksLbl->Caption = L"Ограничить скорость игры";
NoactivateappLbl->Caption = L"Исправить сломанный Alt+Tab"; NoactivateappLbl->Caption = L"Исправить сломанный Alt+Tab";
ResolutionsLbl->Caption = L"Разблокировать дополнительные разрешения экрана"; ResolutionsLbl->Caption = L"Разблокировать дополнительные разрешения экрана";
@ -279,6 +299,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"OpenGL árnyaló"; ShaderLbl->Caption = L"OpenGL árnyaló";
MaxfpsLbl->Caption = L"Képkockaszám korlátozás"; MaxfpsLbl->Caption = L"Képkockaszám korlátozás";
BoxingLbl->Caption = L"Ablakos mód / felskálázás bekapcsolása"; BoxingLbl->Caption = L"Ablakos mód / felskálázás bekapcsolása";
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";
MaxgameticksLbl->Caption = L"Játéksebesség korlátozás"; MaxgameticksLbl->Caption = L"Játéksebesség korlátozás";
NoactivateappLbl->Caption = L"Alt+Tab hiba kiküszöbölése"; NoactivateappLbl->Caption = L"Alt+Tab hiba kiküszöbölése";
ResolutionsLbl->Caption = L"További képernyőfelbontások feloldása"; ResolutionsLbl->Caption = L"További képernyőfelbontások feloldása";
@ -331,6 +356,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"Shader OpenGL"; ShaderLbl->Caption = L"Shader OpenGL";
MaxfpsLbl->Caption = L"Limiter les images par seconde (FPS)"; MaxfpsLbl->Caption = L"Limiter les images par seconde (FPS)";
BoxingLbl->Caption = L"Activer windowboxing / mise à l'échelle par nombres entiers"; BoxingLbl->Caption = L"Activer windowboxing / mise à l'échelle par nombres entiers";
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";
MaxgameticksLbl->Caption = L"Limiter la vitesse du jeu"; MaxgameticksLbl->Caption = L"Limiter la vitesse du jeu";
NoactivateappLbl->Caption = L"Corriger Alt+Tab défaillant"; NoactivateappLbl->Caption = L"Corriger Alt+Tab défaillant";
ResolutionsLbl->Caption = L"Déverrouiller des résolutions d'écran supplémentaires"; ResolutionsLbl->Caption = L"Déverrouiller des résolutions d'écran supplémentaires";
@ -383,6 +413,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"Shader OpenGL"; ShaderLbl->Caption = L"Shader OpenGL";
MaxfpsLbl->Caption = L"Limita la frequenza dei fotogrammi (FPS)"; MaxfpsLbl->Caption = L"Limita la frequenza dei fotogrammi (FPS)";
BoxingLbl->Caption = L"Abilita il ridimensionamento dei numeri interi"; BoxingLbl->Caption = L"Abilita il ridimensionamento dei numeri interi";
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";
ScreenshotLbl->Caption = L"Immagine dello schermo";
MaxgameticksLbl->Caption = L"Limita la velocità di gioco"; MaxgameticksLbl->Caption = L"Limita la velocità di gioco";
NoactivateappLbl->Caption = L"Correggi il funzionamento di Alt+Tab"; NoactivateappLbl->Caption = L"Correggi il funzionamento di Alt+Tab";
ResolutionsLbl->Caption = L"Sblocca ulteriori risoluzioni dello schermo"; ResolutionsLbl->Caption = L"Sblocca ulteriori risoluzioni dello schermo";
@ -480,6 +515,11 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
ShaderLbl->Caption = L"OpenGL shader"; ShaderLbl->Caption = L"OpenGL shader";
MaxfpsLbl->Caption = L"Limit frame rate"; MaxfpsLbl->Caption = L"Limit frame rate";
BoxingLbl->Caption = L"Enable windowboxing / integer scaling"; BoxingLbl->Caption = L"Enable windowboxing / integer scaling";
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";
MaxgameticksLbl->Caption = L"Limit game speed"; MaxgameticksLbl->Caption = L"Limit game speed";
NoactivateappLbl->Caption = L"Fix broken Alt+Tab"; NoactivateappLbl->Caption = L"Fix broken Alt+Tab";
ResolutionsLbl->Caption = L"Unlock additional screen resolutions"; ResolutionsLbl->Caption = L"Unlock additional screen resolutions";
@ -513,12 +553,18 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
MaxgameticksCbx->AddItem(L"15 ticks per second", NULL); MaxgameticksCbx->AddItem(L"15 ticks per second", NULL);
*/ */
} }
ToggleWindowedKeyLbl->Caption = GetKeyText(VK_MENU) + L" +";
MaximizeWindowKeyLbl->Caption = GetKeyText(VK_MENU) + L" +";
UnlockCursor1KeyLbl->Caption = GetKeyText(VK_CONTROL) + L" +";
UnlockCursor2KeyLbl->Caption = GetKeyText(VK_RMENU) + L" +";
} }
void __fastcall TConfigForm::DisplayBtnClick(TObject *Sender) void __fastcall TConfigForm::DisplayBtnClick(TObject *Sender)
{ {
DisplayPnl->Visible = true; DisplayPnl->Visible = true;
AdvancedPnl->Visible = false; AdvancedPnl->Visible = false;
HotkeyPnl->Visible = false;
CompatibilityPnl->Visible = false; CompatibilityPnl->Visible = false;
} }
@ -526,6 +572,16 @@ void __fastcall TConfigForm::AdvancedBtnClick(TObject *Sender)
{ {
AdvancedPnl->Visible = true; AdvancedPnl->Visible = true;
DisplayPnl->Visible = false; DisplayPnl->Visible = false;
HotkeyPnl->Visible = false;
CompatibilityPnl->Visible = false;
}
void __fastcall TConfigForm::HotkeyBtnClick(TObject *Sender)
{
HotkeyPnl->Visible = true;
AdvancedPnl->Visible = false;
DisplayPnl->Visible = false;
CompatibilityPnl->Visible = false; CompatibilityPnl->Visible = false;
} }
@ -534,6 +590,7 @@ void __fastcall TConfigForm::CompatibilityBtnClick(TObject *Sender)
CompatibilityPnl->Visible = true; CompatibilityPnl->Visible = true;
AdvancedPnl->Visible = false; AdvancedPnl->Visible = false;
DisplayPnl->Visible = false; DisplayPnl->Visible = false;
HotkeyPnl->Visible = false;
} }
void __fastcall TConfigForm::FormCreate(TObject *Sender) void __fastcall TConfigForm::FormCreate(TObject *Sender)
@ -641,6 +698,23 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
Savesettings = ini->ReadInteger("ddraw", "savesettings", 1); Savesettings = ini->ReadInteger("ddraw", "savesettings", 1);
SavesettingsChk->State = Savesettings != 0 ? tssOn : tssOff; SavesettingsChk->State = Savesettings != 0 ? tssOn : tssOff;
/* 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)));
/* Compatibility Settings */ /* Compatibility Settings */
int maxgameticks = ini->ReadInteger("ddraw", "maxgameticks", 0); int maxgameticks = ini->ReadInteger("ddraw", "maxgameticks", 0);
@ -817,6 +891,33 @@ void TConfigForm::SaveSettings()
ini->WriteInteger("ddraw", "posY", -32000); ini->WriteInteger("ddraw", "posY", -32000);
} }
/* 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))));
/* Compatibility Settings */ /* Compatibility Settings */
switch(MaxgameticksCbx->ItemIndex) { switch(MaxgameticksCbx->ItemIndex) {
@ -933,6 +1034,80 @@ void __fastcall TConfigForm::FormActivate(TObject *Sender)
reg->Free(); reg->Free();
} }
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_RMENU) & 0x8000) {
edit->Text = GetKeyText(VK_RMENU);
}
else if (GetAsyncKeyState(VK_RCONTROL) & 0x8000) {
edit->Text = GetKeyText(VK_RCONTROL);
}
else if (GetAsyncKeyState(VK_RSHIFT) & 0x8000) {
edit->Text = GetKeyText(VK_RSHIFT);
}
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();
}
WORD TConfigForm::GetKeyCode(System::UnicodeString key)
{
if (key == L"Print Screen") {
return VK_SNAPSHOT;
}
if (key == L"R " + ShortCutToText(VK_MENU)) {
return VK_RMENU;
}
if (key == L"R " + ShortCutToText(VK_CONTROL)) {
return VK_RCONTROL;
}
if (key == L"R " + ShortCutToText(VK_SHIFT)) {
return VK_RSHIFT;
}
return TextToShortCut(key);
}
System::UnicodeString TConfigForm::GetKeyText(WORD key)
{
if (key == VK_SNAPSHOT) {
return L"Print Screen";
}
if (key == VK_RMENU) {
return L"R " + ShortCutToText(VK_MENU);
}
if (key == VK_RCONTROL) {
return L"R " + ShortCutToText(VK_CONTROL);
}
if (key == VK_RSHIFT) {
return L"R " + ShortCutToText(VK_SHIFT);
}
return ShortCutToText(key);
}
bool TConfigForm::GetBool(TIniFile *ini, System::UnicodeString key, bool defValue) bool TConfigForm::GetBool(TIniFile *ini, System::UnicodeString key, bool defValue)
{ {
auto s = LowerCase(ini->ReadString("ddraw", key, defValue ? "true" : "false")); auto s = LowerCase(ini->ReadString("ddraw", key, defValue ? "true" : "false"));
@ -1034,5 +1209,3 @@ void __fastcall TConfigForm::PboxPaint(TObject *Sender)
//pbox->Canvas->Rectangle(pbox->ClientRect); //pbox->Canvas->Rectangle(pbox->ClientRect);
} }
//---------------------------------------------------------------------------

View File

@ -3257,10 +3257,249 @@ object ConfigForm: TConfigForm
OnClick = BoxingChkClick OnClick = BoxingChkClick
end end
end end
object HotkeyPnl: TPanel
Left = 234
Top = 8
Width = 499
Height = 465
Anchors = [akLeft, akTop, akRight, akBottom]
BevelOuter = bvNone
Color = clWhite
ParentBackground = False
ShowCaption = False
TabOrder = 4
Visible = False
StyleElements = [seFont, seBorder]
object ToggleWindowedLbl: TLabel
Left = 40
Top = 27
Width = 165
Height = 21
Margins.Top = 18
Caption = 'Toggle windowed mode'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object ToggleWindowedKeyLbl: TLabel
Left = 41
Top = 60
Width = 34
Height = 21
Margins.Top = 8
Caption = 'Alt +'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object MaximizeWindowLbl: TLabel
Left = 39
Top = 107
Width = 125
Height = 21
Margins.Top = 18
Caption = 'Maximize window'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object MaximizeWindowKeyLbl: TLabel
Left = 40
Top = 139
Width = 34
Height = 21
Margins.Top = 8
Caption = 'Alt +'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object UnlockCursor1Lbl: TLabel
Left = 40
Top = 186
Width = 109
Height = 21
Margins.Top = 18
Caption = 'Unlock cursor 1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object UnlockCursor1KeyLbl: TLabel
Left = 41
Top = 218
Width = 40
Height = 21
Margins.Top = 8
Caption = 'Ctrl +'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object UnlockCursor2Lbl: TLabel
Left = 41
Top = 265
Width = 109
Height = 21
Margins.Top = 18
Caption = 'Unlock cursor 2'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object UnlockCursor2KeyLbl: TLabel
Left = 41
Top = 297
Width = 48
Height = 21
Margins.Top = 8
Caption = 'R Alt +'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object ScreenshotLbl: TLabel
Left = 41
Top = 344
Width = 77
Height = 21
Margins.Top = 18
Caption = 'Screenshot'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
StyleElements = [seClient, seBorder]
end
object ToggleWindowedEdt: TEdit
Left = 137
Top = 57
Width = 217
Height = 29
Margins.Top = 5
TabStop = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 0
OnKeyDown = HotkeyEdtKeyDown
OnKeyUp = HotkeyEdtKeyUp
end
object MaximizeWindowEdt: TEdit
Left = 137
Top = 136
Width = 217
Height = 29
Margins.Top = 5
TabStop = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 1
OnKeyDown = HotkeyEdtKeyDown
OnKeyUp = HotkeyEdtKeyUp
end
object UnlockCursor1Edt: TEdit
Left = 137
Top = 215
Width = 217
Height = 29
Margins.Top = 5
TabStop = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 2
OnKeyDown = HotkeyEdtKeyDown
OnKeyUp = HotkeyEdtKeyUp
end
object UnlockCursor2Edt: TEdit
Left = 137
Top = 294
Width = 217
Height = 29
Margins.Top = 5
TabStop = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 3
OnKeyDown = HotkeyEdtKeyDown
OnKeyUp = HotkeyEdtKeyUp
end
object ScreenshotEdt: TEdit
Left = 137
Top = 373
Width = 217
Height = 29
Margins.Top = 5
TabStop = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 4
OnKeyDown = HotkeyEdtKeyDown
OnKeyUp = HotkeyEdtKeyUp
end
end
object MenuPnl: TPanel object MenuPnl: TPanel
Left = 0 Left = 0
Top = 8 Top = 8
Width = 227 Width = 233
Height = 465 Height = 465
Anchors = [akLeft, akTop, akBottom] Anchors = [akLeft, akTop, akBottom]
BevelOuter = bvNone BevelOuter = bvNone
@ -3269,12 +3508,12 @@ object ConfigForm: TConfigForm
TabOrder = 0 TabOrder = 0
ExplicitHeight = 464 ExplicitHeight = 464
DesignSize = ( DesignSize = (
227 233
465) 465)
object DisplayBtn: TSpeedButton object DisplayBtn: TSpeedButton
Left = 5 Left = 0
Top = 8 Top = 8
Width = 216 Width = 227
Height = 41 Height = 41
Anchors = [akLeft, akTop, akRight] Anchors = [akLeft, akTop, akRight]
Caption = 'Display Settings' Caption = 'Display Settings'
@ -3286,12 +3525,11 @@ object ConfigForm: TConfigForm
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnClick = DisplayBtnClick OnClick = DisplayBtnClick
ExplicitWidth = 190
end end
object AdvancedBtn: TSpeedButton object AdvancedBtn: TSpeedButton
Left = 5 Left = 0
Top = 55 Top = 55
Width = 216 Width = 227
Height = 41 Height = 41
Anchors = [akLeft, akTop, akRight] Anchors = [akLeft, akTop, akRight]
Caption = 'Advanced Settings' Caption = 'Advanced Settings'
@ -3303,12 +3541,11 @@ object ConfigForm: TConfigForm
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnClick = AdvancedBtnClick OnClick = AdvancedBtnClick
ExplicitWidth = 190
end end
object CompatibilityBtn: TSpeedButton object CompatibilityBtn: TSpeedButton
Left = 5 Left = 0
Top = 102 Top = 149
Width = 216 Width = 227
Height = 41 Height = 41
Anchors = [akLeft, akTop, akRight] Anchors = [akLeft, akTop, akRight]
Caption = 'Compatibility Settings' Caption = 'Compatibility Settings'
@ -3320,7 +3557,22 @@ object ConfigForm: TConfigForm
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnClick = CompatibilityBtnClick OnClick = CompatibilityBtnClick
ExplicitWidth = 190 end
object HotkeyBtn: TSpeedButton
Left = 0
Top = 102
Width = 227
Height = 41
Anchors = [akLeft, akTop, akRight]
Caption = 'Hotkey Settings'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = []
ParentFont = False
OnClick = HotkeyBtnClick
end end
end end
end end

View File

@ -62,6 +62,22 @@ __published: // Von der IDE verwaltete Komponenten
TPaintBox *ShaderPbox; TPaintBox *ShaderPbox;
TPaintBox *MaxgameticksPbox; TPaintBox *MaxgameticksPbox;
TImage *LanguageImg; TImage *LanguageImg;
TPanel *HotkeyPnl;
TLabel *ToggleWindowedLbl;
TSpeedButton *HotkeyBtn;
TEdit *ToggleWindowedEdt;
TLabel *ToggleWindowedKeyLbl;
TLabel *MaximizeWindowLbl;
TEdit *MaximizeWindowEdt;
TLabel *MaximizeWindowKeyLbl;
TLabel *UnlockCursor1Lbl;
TEdit *UnlockCursor1Edt;
TLabel *UnlockCursor1KeyLbl;
TLabel *UnlockCursor2Lbl;
TEdit *UnlockCursor2Edt;
TLabel *UnlockCursor2KeyLbl;
TLabel *ScreenshotLbl;
TEdit *ScreenshotEdt;
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);
@ -86,10 +102,18 @@ __published: // Von der IDE verwaltete Komponenten
void __fastcall PboxPaint(TObject *Sender); void __fastcall PboxPaint(TObject *Sender);
void __fastcall LanguageImgClick(TObject *Sender); void __fastcall LanguageImgClick(TObject *Sender);
void __fastcall FormActivate(TObject *Sender); void __fastcall FormActivate(TObject *Sender);
void __fastcall HotkeyBtnClick(TObject *Sender);
void __fastcall HotkeyEdtKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
private: // Benutzer-Deklarationen private: // Benutzer-Deklarationen
void SaveSettings(); void SaveSettings();
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue); bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
void ApplyTranslation(TIniFile *ini); void ApplyTranslation(TIniFile *ini);
System::UnicodeString GetKeyText(WORD key);
WORD GetKeyCode(System::UnicodeString key);
public: // Benutzer-Deklarationen public: // Benutzer-Deklarationen
__fastcall TConfigForm(TComponent* Owner); __fastcall TConfigForm(TComponent* Owner);
}; };