Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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 @@ -1200,6 +1200,12 @@ namespace TFE_FrontEndUI
gameSettings->df_showSecretFoundMsg = showSecretMsg;
}

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

bool autorun = gameSettings->df_autorun;
if (ImGui::Checkbox("Autorun", &autorun))
{
Expand Down
61 changes: 46 additions & 15 deletions TheForceEngine/TFE_Jedi/InfSystem/infSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <TFE_System/system.h>
#include <TFE_System/memoryPool.h>
#include <TFE_System/math.h>
#include <TFE_System/tfeMessage.h>
#include <TFE_Jedi/Level/rtexture.h>
#include <TFE_Jedi/Task/task.h>
// TODO: This will make adding Outlaws harder, fix the abstraction.
Expand Down Expand Up @@ -2741,6 +2742,11 @@ namespace TFE_Jedi
}
}

void showDoorUsedMessage(KeyItem key)
{

}

void infElevatorMessageInternal(MessageType msgType)
{
u32 event = s_msgEvent;
Expand Down Expand Up @@ -2786,26 +2792,51 @@ namespace TFE_Jedi

// Does the player have the key?
KeyItem key = elev->key;
if (key == KEY_RED && !s_playerInfo.itemRedKey)
char keyBuffer[100];
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)
{
sprintf(keyBuffer, "Using the %s Key", TFE_System::getMessage(TFE_MSG_RED));
TFE_DarkForces::hud_sendTextMessage(keyBuffer, 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)
{
sprintf(keyBuffer, "Using the %s Key", TFE_System::getMessage(TFE_MSG_YELLOW));
TFE_DarkForces::hud_sendTextMessage(keyBuffer, 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)
{
sprintf(keyBuffer, "Using the %s Key", TFE_System::getMessage(TFE_MSG_BLUE));
TFE_DarkForces::hud_sendTextMessage(keyBuffer, 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 = true; // Show a message when a key is used.
PitchLimit df_pitchLimit = PITCH_VANILLA_PLUS;
};

Expand Down
3 changes: 3 additions & 0 deletions TheForceEngine/TFE_System/tfeMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ enum TFE_Message
TFE_MSG_HARDCORE,
TFE_MSG_FULLBRIGHT,
TFE_MSG_HD,
TFE_MSG_RED,
TFE_MSG_BLUE,
TFE_MSG_YELLOW,
TFE_MSG_COUNT
};

Expand Down
5 changes: 4 additions & 1 deletion TheForceEngine/UI_Text/TfeMessages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
"One-Hit Kill Toggle." // TFE_MSG_ONEHITKILL
"Hardcore Mode Toggle." // TFE_MSG_HARDCORE
"Full-Bright Toggle." // TFE_MSG_FULLBRIGHT
"HD Assets Toggle." // TFE_MSG_HD
"HD Assets Toggle." // TFE_MSG_HD
"Red" //TFE_MSG_RED
"Blue" //TFE_MSG_BLUE
"Yellow" //TFE_MSG_YELLOW