From 66b57aab117d3f5c2c968cf51658a8e151e86667 Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:36:59 +0000 Subject: [PATCH 1/2] tr1/inventory: support automatic key item selection This allows the inventory to open on the correct key item based upon the receptacle Lara is currently trying to use. Resolves #1884. --- docs/tr1/CHANGELOG.md | 1 + docs/tr1/README.md | 1 + src/tr1/config.h | 1 + src/tr1/config_map.def | 1 + src/tr1/game/inventory.h | 1 + src/tr1/game/inventory/inventory.c | 14 ++++++++++ src/tr1/game/inventory/inventory_ring.c | 27 +++++++++++++++++++ src/tr1/game/inventory/inventory_ring.h | 1 + src/tr1/game/objects/general/keyhole.c | 2 +- src/tr1/game/objects/general/puzzle_hole.c | 2 +- src/tr1/game/objects/traps/midas_touch.c | 2 +- .../TR1X_ConfigTool/Resources/Lang/en.json | 4 +++ .../TR1X_ConfigTool/Resources/Lang/es.json | 4 +++ .../TR1X_ConfigTool/Resources/Lang/fr.json | 4 +++ .../TR1X_ConfigTool/Resources/Lang/it.json | 4 +++ .../Resources/specification.json | 5 ++++ 16 files changed, 71 insertions(+), 3 deletions(-) diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index cdd70fbb7..0c0d101e8 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -6,6 +6,7 @@ - added support for custom levels to enforce values for any config setting (#1846) - added support for key/puzzle/pickup descriptions, allowing players to examine said items in the inventory (#1821) - added an option to fix inventory item usage duplication (#1586) +- added optional automatic key/puzzle inventory item pre-selection (#1884) - changed OpenGL backend to use version 3.3, with fallback to 2.1 if initialization fails (#1738) - changed text backend to accept named sequences. Currently supported sequences (limited by the sprites available in OG): - `\{umlaut}` diff --git a/docs/tr1/README.md b/docs/tr1/README.md index 14432ab9e..ac8f6dc53 100644 --- a/docs/tr1/README.md +++ b/docs/tr1/README.md @@ -402,6 +402,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det - added weapons to Lara's empty holsters on pickup - added options to quiet or mute music while underwater - added a photo mode feature +- added optional automatic key/puzzle inventory item pre-selection - changed weapon pickup behavior when unarmed to set any weapon as the default weapon, not just pistols - fixed keys and items not working when drawing guns immediately after using them - fixed counting the secret in The Great Pyramid diff --git a/src/tr1/config.h b/src/tr1/config.h index c4da95985..f02adcf1c 100644 --- a/src/tr1/config.h +++ b/src/tr1/config.h @@ -100,6 +100,7 @@ typedef struct { bool enable_skybox; bool enable_ps1_crystals; bool enable_item_examining; + bool enable_auto_item_selection; struct { int32_t layout; diff --git a/src/tr1/config_map.def b/src/tr1/config_map.def index bcf35b10c..56c8bb70c 100644 --- a/src/tr1/config_map.def +++ b/src/tr1/config_map.def @@ -115,3 +115,4 @@ CFG_BOOL(g_Config, enable_ps1_crystals, true) CFG_BOOL(g_Config, ui.enable_game_ui, true) CFG_BOOL(g_Config, ui.enable_photo_mode_ui, true) CFG_BOOL(g_Config, enable_item_examining, true) +CFG_BOOL(g_Config, enable_auto_item_selection, true) diff --git a/src/tr1/game/inventory.h b/src/tr1/game/inventory.h index 890acf6c0..333d6c503 100644 --- a/src/tr1/game/inventory.h +++ b/src/tr1/game/inventory.h @@ -6,6 +6,7 @@ #include bool Inv_Display(const INV_MODE inv_mode); +bool Inv_DisplayKeys(GAME_OBJECT_ID receptacle_type_id); bool Inv_AddItem(GAME_OBJECT_ID object_id); void Inv_AddItemNTimes(GAME_OBJECT_ID object_id, int32_t qty); diff --git a/src/tr1/game/inventory/inventory.c b/src/tr1/game/inventory/inventory.c index 1d2b8e05d..ecc02088e 100644 --- a/src/tr1/game/inventory/inventory.c +++ b/src/tr1/game/inventory/inventory.c @@ -1,8 +1,11 @@ +#include "config.h" +#include "game/inventory/inventory_ring.h" #include "game/inventory/inventory_vars.h" #include "game/phase/phase.h" #include "game/phase/phase_inventory.h" #include "global/types.h" +#include #include bool Inv_Display(const INV_MODE inv_mode) @@ -16,3 +19,14 @@ bool Inv_Display(const INV_MODE inv_mode) Phase_Set(PHASE_INVENTORY, args); return true; } + +bool Inv_DisplayKeys(const GAME_OBJECT_ID receptacle_type_id) +{ + if (g_Config.enable_auto_item_selection) { + const GAME_OBJECT_ID object_id = Object_GetCognateInverse( + receptacle_type_id, g_KeyItemToReceptacleMap); + Inv_Ring_SetRequestedObjectID(object_id); + } + + return Inv_Display(INV_KEYS_MODE); +} diff --git a/src/tr1/game/inventory/inventory_ring.c b/src/tr1/game/inventory/inventory_ring.c index cf2df1ade..78bc0c318 100644 --- a/src/tr1/game/inventory/inventory_ring.c +++ b/src/tr1/game/inventory/inventory_ring.c @@ -29,8 +29,11 @@ static TEXTSTRING *m_InvUpArrow2 = NULL; static TEXTSTRING *m_ExamineItemText = NULL; static TEXTSTRING *m_UseItemText = NULL; +static GAME_OBJECT_ID m_RequestedObjectID = NO_OBJECT; + static TEXTSTRING *M_InitExamineText( int32_t x_pos, const char *role_str, const char *input_str); +static void M_HandleRequestedObject(RING_INFO *ring); static TEXTSTRING *M_InitExamineText( const int32_t x_pos, const char *const role_str, @@ -47,6 +50,28 @@ static TEXTSTRING *M_InitExamineText( return text; } +static void M_HandleRequestedObject(RING_INFO *const ring) +{ + if (m_RequestedObjectID == NO_OBJECT) { + return; + } + + for (int32_t i = 0; i < ring->number_of_objects; i++) { + const GAME_OBJECT_ID item_id = ring->list[i]->object_id; + if (item_id == m_RequestedObjectID && Inv_RequestItem(item_id) > 0) { + ring->current_object = i; + break; + } + } + + m_RequestedObjectID = NO_OBJECT; +} + +void Inv_Ring_SetRequestedObjectID(const GAME_OBJECT_ID object_id) +{ + m_RequestedObjectID = object_id; +} + void Inv_Ring_Init( RING_INFO *ring, int16_t type, INVENTORY_ITEM **list, int16_t qty, int16_t current, IMOTION_INFO *imo) @@ -58,6 +83,8 @@ void Inv_Ring_Init( ring->current_object = current; ring->angle_adder = 0x10000 / qty; + M_HandleRequestedObject(ring); + if (g_InvMode == INV_TITLE_MODE) { ring->camera_pitch = 1024; } else { diff --git a/src/tr1/game/inventory/inventory_ring.h b/src/tr1/game/inventory/inventory_ring.h index 804959b5c..38e2385f5 100644 --- a/src/tr1/game/inventory/inventory_ring.h +++ b/src/tr1/game/inventory/inventory_ring.h @@ -17,6 +17,7 @@ void Inv_Ring_ResetItem(INVENTORY_ITEM *inv_item); bool Inv_Ring_CanExamine(void); void Inv_Ring_InitExamineOverlay(void); void Inv_Ring_RemoveExamineOverlay(void); +void Inv_Ring_SetRequestedObjectID(GAME_OBJECT_ID object_id); void Inv_Ring_GetView(RING_INFO *ring, XYZ_32 *view_pos, XYZ_16 *view_rot); void Inv_Ring_Light(RING_INFO *ring); diff --git a/src/tr1/game/objects/general/keyhole.c b/src/tr1/game/objects/general/keyhole.c index 6af4aa6f9..851057077 100644 --- a/src/tr1/game/objects/general/keyhole.c +++ b/src/tr1/game/objects/general/keyhole.c @@ -55,7 +55,7 @@ static void M_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll) return; } - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); } static const OBJECT_BOUNDS *M_Bounds(void) diff --git a/src/tr1/game/objects/general/puzzle_hole.c b/src/tr1/game/objects/general/puzzle_hole.c index 41cf74087..486b6167a 100644 --- a/src/tr1/game/objects/general/puzzle_hole.c +++ b/src/tr1/game/objects/general/puzzle_hole.c @@ -115,5 +115,5 @@ void PuzzleHole_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll) return; } - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); } diff --git a/src/tr1/game/objects/traps/midas_touch.c b/src/tr1/game/objects/traps/midas_touch.c index 9178a65e5..b66494d40 100644 --- a/src/tr1/game/objects/traps/midas_touch.c +++ b/src/tr1/game/objects/traps/midas_touch.c @@ -109,5 +109,5 @@ void MidasTouch_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll) return; } - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); } diff --git a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/en.json b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/en.json index 56e657039..8a5367324 100644 --- a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/en.json +++ b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/en.json @@ -220,6 +220,10 @@ "Title": "Animated interactions", "Description": "Makes Lara walk to pickups and switches when nearby instead of teleporting to them." }, + "enable_auto_item_selection": { + "Title": "Key item pre-selection", + "Description": "When Lara presses action against a keyhole or puzzle slot, and she has the corresponding item in the inventory, that item will be pre-selected." + }, "enable_deaths_counter": { "Title": "Count number of deaths", "Description": "Enables showing a deaths counter in the compass and in the level statistics. Death count is updated in the currently loaded save as soon as Lara dies." diff --git a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/es.json b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/es.json index 01c292c59..c753232c6 100644 --- a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/es.json +++ b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/es.json @@ -431,6 +431,10 @@ "walk_to_items": { "Title": "Interacciones animadas", "Description": "Hace que Lara camine hacia los objetos recogibles y los interruptores cuando están cerca en lugar de teletransportarse hacia ellos." + }, + "enable_auto_item_selection": { + "Title": "Preselección de elementos clave", + "Description": "Cuando Lara presiona la acción contra el ojo de una cerradura o la ranura de un rompecabezas y tiene el elemento correspondiente en el inventario, ese elemento será preseleccionado." } } } diff --git a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/fr.json b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/fr.json index af82ef02c..d5a679529 100644 --- a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/fr.json +++ b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/fr.json @@ -220,6 +220,10 @@ "Title": "Interactions animées - Placement automatique", "Description": "Fait marcher Lara vers les collectibles et les interrupteurs à proximité, au lieu de se téléporter vers eux." }, + "enable_auto_item_selection": { + "Title": "Présélection des éléments clés", + "Description": "Lorsque Lara appuie sur un trou de serrure ou un emplacement de puzzle et qu'elle a l'objet correspondant dans son inventaire, cet objet sera présélectionné." + }, "enable_deaths_counter": { "Title": "Compteur du nombres de morts", "Description": "Permet d'afficher un compteur de décès dans la boussole et dans les statistiques de niveau. Le nombre de morts est mis à jour dans la sauvegarde actuellement chargée dès que Lara meurt." diff --git a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/it.json b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/it.json index 32a08e0df..525d8eb68 100644 --- a/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/it.json +++ b/tools/tr1/config/TR1X_ConfigTool/Resources/Lang/it.json @@ -220,6 +220,10 @@ "Title": "Interazioni animate", "Description": "Fa in modo che Lara si avvicini agli oggetti, alle leve e agli interruttori quando questi sono nelle vicinanze, invece di teletrasportarsi." }, + "enable_auto_item_selection": { + "Title": "Preselezione degli elementi chiave", + "Description": "Quando Lara preme l'azione contro il buco della serratura o la fessura di un puzzle e ha l'oggetto corrispondente nell'inventario, quell'oggetto verrà preselezionato." + }, "enable_deaths_counter": { "Title": "Conta il numero di morti", "Description": "Permette di mostrare il conteggio delle morti nella bussola e nelle statistiche del livello. Il conteggio delle morti viene aggiornato nel salvataggio attualmente caricato ogni volta che Lara muore." diff --git a/tools/tr1/config/TR1X_ConfigTool/Resources/specification.json b/tools/tr1/config/TR1X_ConfigTool/Resources/specification.json index 6d2292b62..44446b341 100644 --- a/tools/tr1/config/TR1X_ConfigTool/Resources/specification.json +++ b/tools/tr1/config/TR1X_ConfigTool/Resources/specification.json @@ -277,6 +277,11 @@ "DataType": "Bool", "DefaultValue": false }, + { + "Field": "enable_auto_item_selection", + "DataType": "Bool", + "DefaultValue": true + }, { "Field": "enable_deaths_counter", "DataType": "Bool", From 5018762425ad12031ea7176d15dedc87e94b16ab Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:34:40 +0000 Subject: [PATCH 2/2] tr2/inventory: support automatic key item selection This allows the inventory to open on the correct key item based upon the receptacle Lara is currently trying to use. Resolves #1884. --- docs/tr2/CHANGELOG.md | 1 + docs/tr2/README.md | 1 + src/libtrx/game/objects/vars.c | 3 ++ src/tr2/config.h | 1 + src/tr2/config_map.def | 1 + src/tr2/game/inventory/common.c | 12 ++++++++ src/tr2/game/inventory/common.h | 1 + src/tr2/game/inventory/ring.c | 29 +++++++++++++++++++ src/tr2/game/inventory/ring.h | 1 + src/tr2/game/objects/general/detonator.c | 2 +- src/tr2/game/objects/general/keyhole.c | 2 +- src/tr2/game/objects/general/puzzle_hole.c | 2 +- .../TR2X_ConfigTool/Resources/Lang/en.json | 4 +++ .../Resources/specification.json | 6 +++- 14 files changed, 62 insertions(+), 4 deletions(-) diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index 158023861..d56bc60f5 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-0.6...develop) - ××××-××-×× - added support for custom levels to enforce values for any config setting (#1846) - added an option to fix inventory item usage duplication (#1586) +- added optional automatic key/puzzle inventory item pre-selection (#1884) - fixed depth problems when drawing certain rooms (#1853, regression from 0.6) - fixed Lara getting stuck in her hit animation if she is hit while mounting the boat or skidoo (#1606) - fixed being unable to go from surface swimming to underwater swimming without first stopping (#1863, regression from 0.6) diff --git a/docs/tr2/README.md b/docs/tr2/README.md index bf451f619..3edd4b63b 100644 --- a/docs/tr2/README.md +++ b/docs/tr2/README.md @@ -22,6 +22,7 @@ decompilation process. We recognize that there is much work to be done. #### Gameplay - added an option to fix M16 accuracy while running - added optional rendering of pickups in the UI as 3D meshes +- added optional automatic key/puzzle inventory item pre-selection - changed inventory to pause the music rather than muting it - fixed killing the T-Rex with a grenade launcher crashing the game - fixed secret rewards not displaying shotgun ammo diff --git a/src/libtrx/game/objects/vars.c b/src/libtrx/game/objects/vars.c index 82b60d23f..24bb65994 100644 --- a/src/libtrx/game/objects/vars.c +++ b/src/libtrx/game/objects/vars.c @@ -12,6 +12,9 @@ const GAME_OBJECT_PAIR g_KeyItemToReceptacleMap[] = { { O_PUZZLE_OPTION_4, O_PUZZLE_HOLE_4 }, #if TR_VERSION == 1 { O_LEADBAR_OPTION, O_MIDAS_TOUCH }, + #elif TR_VERSION == 2 + { O_KEY_OPTION_2, O_DETONATOR_1 }, + { O_KEY_OPTION_2, O_DETONATOR_2 }, #endif { NO_OBJECT, NO_OBJECT }, // clang-format on diff --git a/src/tr2/config.h b/src/tr2/config.h index bdf370e1d..16473a5c5 100644 --- a/src/tr2/config.h +++ b/src/tr2/config.h @@ -21,6 +21,7 @@ typedef struct { bool fix_m16_accuracy; bool enable_cheats; bool fix_item_duplication_glitch; + bool enable_auto_item_selection; } gameplay; struct { diff --git a/src/tr2/config_map.def b/src/tr2/config_map.def index e8928ac98..cf821e666 100644 --- a/src/tr2/config_map.def +++ b/src/tr2/config_map.def @@ -1,6 +1,7 @@ CFG_BOOL(g_Config, gameplay.fix_m16_accuracy, true) CFG_BOOL(g_Config, gameplay.enable_cheats, false) CFG_BOOL(g_Config, gameplay.fix_item_duplication_glitch, false) +CFG_BOOL(g_Config, gameplay.enable_auto_item_selection, true) CFG_BOOL(g_Config, visuals.enable_3d_pickups, true) CFG_ENUM(g_Config, rendering.screenshot_format, SCREENSHOT_FORMAT_JPEG, SCREENSHOT_FORMAT) CFG_INT32(g_Config, rendering.turbo_speed, 0) diff --git a/src/tr2/game/inventory/common.c b/src/tr2/game/inventory/common.c index 0c73dc071..d839c157b 100644 --- a/src/tr2/game/inventory/common.c +++ b/src/tr2/game/inventory/common.c @@ -29,6 +29,7 @@ #include "global/vars.h" #include +#include #include @@ -819,6 +820,17 @@ int32_t __cdecl Inv_Display(int32_t inventory_mode) return 0; } +int32_t Inv_DisplayKeys(const GAME_OBJECT_ID receptacle_type_id) +{ + if (g_Config.gameplay.enable_auto_item_selection) { + const GAME_OBJECT_ID object_id = Object_GetCognateInverse( + receptacle_type_id, g_KeyItemToReceptacleMap); + Inv_Ring_SetRequestedObjectID(object_id); + } + + return Inv_Display(INV_KEYS_MODE); +} + void __cdecl Inv_SelectMeshes(INVENTORY_ITEM *const inv_item) { switch (inv_item->object_id) { diff --git a/src/tr2/game/inventory/common.h b/src/tr2/game/inventory/common.h index d86c2d93b..c1a3ee05a 100644 --- a/src/tr2/game/inventory/common.h +++ b/src/tr2/game/inventory/common.h @@ -5,6 +5,7 @@ void __cdecl Inv_InitColors(void); void __cdecl Inv_Construct(void); int32_t __cdecl Inv_Display(int32_t inventory_mode); +int32_t Inv_DisplayKeys(GAME_OBJECT_ID receptacle_type_id); void __cdecl Inv_SelectMeshes(INVENTORY_ITEM *inv_item); int32_t __cdecl Inv_AnimateInventoryItem(INVENTORY_ITEM *inv_item); void __cdecl Inv_DrawInventoryItem(INVENTORY_ITEM *inv_item); diff --git a/src/tr2/game/inventory/ring.c b/src/tr2/game/inventory/ring.c index a5136d900..3f56370b8 100644 --- a/src/tr2/game/inventory/ring.c +++ b/src/tr2/game/inventory/ring.c @@ -1,5 +1,6 @@ #include "game/inventory/ring.h" +#include "game/inventory/backpack.h" #include "game/math_misc.h" #include "game/output.h" #include "global/funcs.h" @@ -13,6 +14,32 @@ #define RING_CAMERA_HEIGHT (-256) #define RING_CAMERA_Y_OFFSET (-96) +static GAME_OBJECT_ID m_RequestedObjectID = NO_OBJECT; + +static void M_HandleRequestedObject(RING_INFO *ring); + +static void M_HandleRequestedObject(RING_INFO *const ring) +{ + if (m_RequestedObjectID == NO_OBJECT) { + return; + } + + for (int32_t i = 0; i < ring->number_of_objects; i++) { + const GAME_OBJECT_ID item_id = ring->list[i]->object_id; + if (item_id == m_RequestedObjectID && Inv_RequestItem(item_id) > 0) { + ring->current_object = i; + break; + } + } + + m_RequestedObjectID = NO_OBJECT; +} + +void Inv_Ring_SetRequestedObjectID(const GAME_OBJECT_ID object_id) +{ + m_RequestedObjectID = object_id; +} + void __cdecl Inv_Ring_Init( RING_INFO *const ring, const RING_TYPE type, INVENTORY_ITEM **const list, const int16_t qty, const int16_t current, IMOTION_INFO *const imo) @@ -24,6 +51,8 @@ void __cdecl Inv_Ring_Init( ring->radius = 0; ring->angle_adder = 0x10000 / qty; + M_HandleRequestedObject(ring); + if (g_Inv_Mode == INV_TITLE_MODE) { ring->camera_pitch = 1024; } else { diff --git a/src/tr2/game/inventory/ring.h b/src/tr2/game/inventory/ring.h index c2ba630ee..ab06661e0 100644 --- a/src/tr2/game/inventory/ring.h +++ b/src/tr2/game/inventory/ring.h @@ -2,6 +2,7 @@ #include "global/types.h" +void Inv_Ring_SetRequestedObjectID(const GAME_OBJECT_ID object_id); void __cdecl Inv_Ring_Init( RING_INFO *ring, RING_TYPE type, INVENTORY_ITEM **list, int16_t qty, int16_t current, IMOTION_INFO *imo); diff --git a/src/tr2/game/objects/general/detonator.c b/src/tr2/game/objects/general/detonator.c index 6c444949d..fce11f6af 100644 --- a/src/tr2/game/objects/general/detonator.c +++ b/src/tr2/game/objects/general/detonator.c @@ -106,7 +106,7 @@ void __cdecl Detonator_Collision( } if (g_Inv_Chosen == NO_OBJECT) { - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); } if (g_Inv_Chosen != O_KEY_OPTION_2) { diff --git a/src/tr2/game/objects/general/keyhole.c b/src/tr2/game/objects/general/keyhole.c index 4c19a1f28..e0b488d59 100644 --- a/src/tr2/game/objects/general/keyhole.c +++ b/src/tr2/game/objects/general/keyhole.c @@ -71,7 +71,7 @@ void __cdecl Keyhole_Collision( } if (g_Inv_Chosen == NO_OBJECT) { - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); if (g_Inv_Chosen == NO_OBJECT && g_Inv_KeyObjectsCount > 0) { return; } diff --git a/src/tr2/game/objects/general/puzzle_hole.c b/src/tr2/game/objects/general/puzzle_hole.c index f229bc4ea..42813df46 100644 --- a/src/tr2/game/objects/general/puzzle_hole.c +++ b/src/tr2/game/objects/general/puzzle_hole.c @@ -94,7 +94,7 @@ void __cdecl PuzzleHole_Collision( } if (g_Inv_Chosen == NO_OBJECT) { - Inv_Display(INV_KEYS_MODE); + Inv_DisplayKeys(item->object_id); if (g_Inv_Chosen == NO_OBJECT && g_Inv_KeyObjectsCount > 0) { return; } diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json index 8ec992a08..10f6cea4d 100644 --- a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json +++ b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json @@ -29,6 +29,10 @@ "Title": "Fix item duplication glitch", "Description": "Fixes the ability to duplicate usage of key items in the inventory." }, + "enable_auto_item_selection": { + "Title": "Key item pre-selection", + "Description": "When Lara presses action against a keyhole or puzzle slot, and she has the corresponding item in the inventory, that item will be pre-selected." + }, "screenshot_format": { "Title": "Screenshot format", "Description": "Screenshot file format." diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json index 7d0d9dcb2..5177c82ef 100644 --- a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json +++ b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json @@ -44,7 +44,11 @@ "ID": "gameplay_options", "Image": "Graphics/graphic4.jpg", "Properties": [ - + { + "Field": "enable_auto_item_selection", + "DataType": "Bool", + "DefaultValue": true + } ] }, {