|
23 | 23 | #include <TFE_System/system.h>
|
24 | 24 | #include <TFE_System/memoryPool.h>
|
25 | 25 | #include <TFE_System/math.h>
|
| 26 | +#include <TFE_System/tfeMessage.h> |
26 | 27 | #include <TFE_Jedi/Level/rtexture.h>
|
27 | 28 | #include <TFE_Jedi/Task/task.h>
|
28 | 29 | // TODO: This will make adding Outlaws harder, fix the abstraction.
|
@@ -2791,26 +2792,54 @@ namespace TFE_Jedi
|
2791 | 2792 |
|
2792 | 2793 | // Does the player have the key?
|
2793 | 2794 | KeyItem key = elev->key;
|
2794 |
| - if (key == KEY_RED && !s_playerInfo.itemRedKey) |
| 2795 | + char keyBuffer[50]; |
| 2796 | + char keyBufferWrapper[50]; |
| 2797 | + snprintf(keyBufferWrapper, 50, "%s", TFE_System::getMessage(TFE_MSG_KEY)); |
| 2798 | + |
| 2799 | + if (key == KEY_RED) |
2795 | 2800 | {
|
2796 |
| - // "You need the red key." |
2797 |
| - hud_sendTextMessage(6); |
2798 |
| - sound_play(s_needKeySoundId); |
2799 |
| - return; |
| 2801 | + if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemRedKey) |
| 2802 | + { |
| 2803 | + sprintf(keyBuffer, keyBufferWrapper, TFE_System::getMessage(TFE_MSG_RED)); |
| 2804 | + TFE_DarkForces::hud_sendTextMessage(keyBuffer, 1, false); |
| 2805 | + } |
| 2806 | + else if (!s_playerInfo.itemRedKey) |
| 2807 | + { |
| 2808 | + // "You need the red key." |
| 2809 | + hud_sendTextMessage(6); |
| 2810 | + sound_play(s_needKeySoundId); |
| 2811 | + return; |
| 2812 | + } |
2800 | 2813 | }
|
2801 |
| - else if (key == KEY_YELLOW && !s_playerInfo.itemYellowKey) |
| 2814 | + else if (key == KEY_YELLOW) |
2802 | 2815 | {
|
2803 |
| - // "You need the yellow key." |
2804 |
| - hud_sendTextMessage(7); |
2805 |
| - sound_play(s_needKeySoundId); |
2806 |
| - return; |
| 2816 | + if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemYellowKey) |
| 2817 | + { |
| 2818 | + sprintf(keyBuffer, keyBufferWrapper, TFE_System::getMessage(TFE_MSG_YELLOW)); |
| 2819 | + TFE_DarkForces::hud_sendTextMessage(keyBuffer, 1, false); |
| 2820 | + } |
| 2821 | + else if (!s_playerInfo.itemYellowKey) |
| 2822 | + { |
| 2823 | + // "You need the yellow key." |
| 2824 | + hud_sendTextMessage(7); |
| 2825 | + sound_play(s_needKeySoundId); |
| 2826 | + return; |
| 2827 | + } |
2807 | 2828 | }
|
2808 |
| - else if (key == KEY_BLUE && !s_playerInfo.itemBlueKey) |
| 2829 | + else if (key == KEY_BLUE) |
2809 | 2830 | {
|
2810 |
| - // "You need the blue key." |
2811 |
| - hud_sendTextMessage(8); |
2812 |
| - sound_play(s_needKeySoundId); |
2813 |
| - return; |
| 2831 | + if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemBlueKey) |
| 2832 | + { |
| 2833 | + sprintf(keyBuffer, keyBufferWrapper, TFE_System::getMessage(TFE_MSG_BLUE)); |
| 2834 | + TFE_DarkForces::hud_sendTextMessage(keyBuffer, 1, false); |
| 2835 | + } |
| 2836 | + else if (!s_playerInfo.itemBlueKey) |
| 2837 | + { |
| 2838 | + // "You need the blue key." |
| 2839 | + hud_sendTextMessage(8); |
| 2840 | + sound_play(s_needKeySoundId); |
| 2841 | + return; |
| 2842 | + } |
2814 | 2843 | }
|
2815 | 2844 | }
|
2816 | 2845 |
|
|
0 commit comments