Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,12 @@ namespace TFE_FrontEndUI
gameSettings->df_autoEndMission = autoEndMission;
}

bool showKeysUsed = gameSettings->df_showKeyUsed;
if (ImGui::Checkbox("Show Key Used messages when opening doors", &showKeysUsed))
{
gameSettings->df_showKeyUsed = showKeysUsed;
}

ImGui::Separator();

ImGui::PushFont(s_versionFont);
Expand Down
54 changes: 39 additions & 15 deletions TheForceEngine/TFE_Jedi/InfSystem/infSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2786,26 +2786,50 @@ namespace TFE_Jedi

// Does the player have the key?
KeyItem key = elev->key;
if (key == KEY_RED && !s_playerInfo.itemRedKey)
if (key == KEY_RED)
{
// "You need the red key."
hud_sendTextMessage(6);
sound_play(s_needKeySoundId);
return;
if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemRedKey)
{
string msg = "Using the Red Key";
TFE_DarkForces::hud_sendTextMessage(msg.c_str(), 1, false);
}
else if (!s_playerInfo.itemRedKey)
{
// "You need the red key."
hud_sendTextMessage(6);
sound_play(s_needKeySoundId);
return;
}
}
else if (key == KEY_YELLOW && !s_playerInfo.itemYellowKey)
else if (key == KEY_YELLOW)
{
// "You need the yellow key."
hud_sendTextMessage(7);
sound_play(s_needKeySoundId);
return;
if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemYellowKey)
{
string msg = "Using the Yellow Key";
TFE_DarkForces::hud_sendTextMessage(msg.c_str(), 1, false);
}
else if (!s_playerInfo.itemYellowKey)
{
// "You need the yellow key."
hud_sendTextMessage(7);
sound_play(s_needKeySoundId);
return;
}
}
else if (key == KEY_BLUE && !s_playerInfo.itemBlueKey)
else if (key == KEY_BLUE)
{
// "You need the blue key."
hud_sendTextMessage(8);
sound_play(s_needKeySoundId);
return;
if (TFE_Settings::getGameSettings()->df_showKeyUsed && s_playerInfo.itemBlueKey)
{
string msg = "Using the Blue Key";
TFE_DarkForces::hud_sendTextMessage(msg.c_str(), 1, false);
}
else if (!s_playerInfo.itemBlueKey)
{
// "You need the blue key."
hud_sendTextMessage(8);
sound_play(s_needKeySoundId);
return;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions TheForceEngine/TFE_Settings/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ namespace TFE_Settings
writeKeyValue_Bool(settings, "df_enableRecordingAll", s_gameSettings.df_enableRecordingAll);
writeKeyValue_Bool(settings, "df_demologging", s_gameSettings.df_demologging);
writeKeyValue_Bool(settings, "df_autoNextMission", s_gameSettings.df_autoEndMission);
writeKeyValue_Bool(settings, "df_showKeyUsed", s_gameSettings.df_showKeyUsed);
}

void writePerGameSettings(FileStream& settings)
Expand Down
3 changes: 2 additions & 1 deletion TheForceEngine/TFE_Settings/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ struct TFE_Settings_Game
bool df_enableReplay = false; // Enable replay of gameplay.
bool df_showReplayCounter = false; // Show the replay counter on the HUD.
bool df_demologging = false; // Log the record/playback logging
bool df_autoEndMission = false; // Automatically skip to the next mission
bool df_autoEndMission = false; // Automatically skip to the next mission
s32 df_recordFrameRate = 4; // Recording Framerate value
s32 df_playbackFrameRate = 2; // Playback Framerate value
bool df_showKeyUsed = false; // Show a message when a key is used.
PitchLimit df_pitchLimit = PITCH_VANILLA_PLUS;
};

Expand Down