HPL1: allow input unlocking through config file option

This commit is contained in:
grisenti 2022-12-28 22:14:25 +01:00
parent 28173eaed4
commit 27e06f4ef9
3 changed files with 5 additions and 4 deletions

View File

@ -107,7 +107,7 @@ static constexpr cButtonHandlerAction gvDefaultActions[] = {
#ifdef __APPLE__
{"QuitGame", "Keyboard", eKeyModifier_META | eKey_q, false},
#endif
//{"LockInput","Keyboard",eKey_k,false},
{"LockInput","Keyboard", eKey_k, false},
{"Screenshot", "Keyboard", eKey_F12, false},
//{"Hit","Keyboard",eKey_h,false},
@ -219,11 +219,9 @@ void cButtonHandler::Update(float afTimeStep) {
mpInit->mpGame->GetGraphics()->GetLowLevel()->SaveScreenToBMP(sFileName);
}
if (mpInput->BecameTriggerd("LockInput")) {
#ifndef WIN32
if (mpInit->_allowInputUnlock && mpInput->BecameTriggerd("LockInput")) {
bLockState = !bLockState;
mpInit->mpGame->GetInput()->GetLowLevel()->LockInput(bLockState);
#endif
}
///////////////////////////////////
// DEMO END TEXT

View File

@ -173,6 +173,7 @@ bool cInit::Init(tString saveToLoad) {
mbSimpleWeaponSwing = getBoolConfig("simple_weapon_swing", false);
mbDisablePersonalNotes = getBoolConfig("disable_personal_notes", false);
mbAllowQuickSave = getBoolConfig("allow_quick_save", false);
_allowInputUnlock = getBoolConfig("allow_input_unlock", false);
mbFlashItems = getBoolConfig("flash_items", true);
mbShowCrossHair = getBoolConfig("show_crosshair", false);
@ -582,6 +583,7 @@ void cInit::Exit() {
ConfMan.setBool("simple_weapon_swing", mbSimpleWeaponSwing);
ConfMan.setBool("disable_personal_notes", mbDisablePersonalNotes);
ConfMan.setBool("allow_quick_save", mbAllowQuickSave);
ConfMan.setBool("allow_input_unlock", _allowInputUnlock);
ConfMan.setBool("flash_tems", mbFlashItems);
ConfMan.setBool("show_crosshair", mbShowCrossHair);

View File

@ -138,6 +138,7 @@ public:
bool mbSimpleWeaponSwing;
bool mbDisablePersonalNotes;
bool mbAllowQuickSave;
bool _allowInputUnlock;
bool mbFlashItems;
bool mbSimpleSwingInOptions;
bool mbShowCrossHair;