diff --git a/.gitignore b/.gitignore index 53d8a225b..db4bf8fc6 100644 --- a/.gitignore +++ b/.gitignore @@ -84,4 +84,7 @@ TheForceEngine/tfelnx # Ignore dumps *.dmp + +# ignore recipe +*.recipe .DS_Store diff --git a/TheForceEngine/TFE_DarkForces/GameUI/pda.cpp b/TheForceEngine/TFE_DarkForces/GameUI/pda.cpp index c17baf288..7a546aa61 100644 --- a/TheForceEngine/TFE_DarkForces/GameUI/pda.cpp +++ b/TheForceEngine/TFE_DarkForces/GameUI/pda.cpp @@ -835,7 +835,15 @@ namespace TFE_DarkForces char secretStr[32]; LRect rect; - sprintf(secretStr, "%2d%%", secretPercentage); + bool showCount = TFE_Settings::getGameSettings()->df_showSecretCount; + if (showCount) + { + sprintf(secretStr, "%d/%d", s_secretsFound, s_levelState.secretCount); + } + else + { + sprintf(secretStr, "%2d%%", secretPercentage); + } lactor_setState(s_pdaArt, 31, 0); lactorAnim_getFrame(s_pdaArt, &rect); diff --git a/TheForceEngine/TFE_DarkForces/hud.cpp b/TheForceEngine/TFE_DarkForces/hud.cpp index 773cc2a39..628063957 100644 --- a/TheForceEngine/TFE_DarkForces/hud.cpp +++ b/TheForceEngine/TFE_DarkForces/hud.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -549,7 +550,22 @@ namespace TFE_DarkForces s32 xOffset = floor16(div16(intToFixed16(vfb_getWidescreenOffset()), vfb_getXScale())); u8 dataStr[64]; - sprintf((char*)dataStr, "X:%04d Y:%.1f Z:%04d H:%.1f S:%d%%", floor16(x), -fixed16ToFloat(s_playerEye->posWS.y), floor16(z), fixed16ToFloat(s_playerEye->worldHeight), s_secretsPercent); + char secretStr[8]; + + bool showCount = TFE_Settings::getGameSettings()->df_showSecretCount; + if (showCount) + { + sprintf(secretStr, "%d/%d ", s_secretsFound, TFE_Jedi::s_levelState.secretCount); + + // Offset text for large # of secrets. + if (TFE_Jedi::s_levelState.secretCount > 10) xOffset -= 12; + } + else + { + sprintf(secretStr, "%2d%%", s_secretsPercent); + } + + sprintf((char*)dataStr, "X:%04d Y:%.1f Z:%04d H:%.1f S:%s", floor16(x), -fixed16ToFloat(s_playerEye->posWS.y), floor16(z), fixed16ToFloat(s_playerEye->worldHeight), secretStr); displayHudMessage(s_hudFont, (DrawRect*)vfb_getScreenRect(VFB_RECT_UI), 164 + xOffset, 10, dataStr, framebuffer); } } @@ -1284,10 +1300,14 @@ namespace TFE_DarkForces fixed16_16 xScale = vfb_getXScale(); fixed16_16 yScale = vfb_getYScale(); + bool centerText = TFE_Settings::getGameSettings()->df_centerHudPosition; + + // Center X Offset otherwise use the font centered scaling + fixed16_16 xf = mul16(intToFixed16(x), centerText ? xScale / 2 : xScale); + xScale /= fntScale; yScale /= fntScale; - fixed16_16 xf = mul16(intToFixed16(x), xScale); fixed16_16 yf = mul16(intToFixed16(y), yScale); fixed16_16 x0 = xf; diff --git a/TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp b/TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp index 3bf7c9b25..31a447e5d 100644 --- a/TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp +++ b/TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp @@ -1201,18 +1201,6 @@ namespace TFE_FrontEndUI gameSettings->df_enableAutoaim = enableAutoaim; } - bool showSecretMsg = gameSettings->df_showSecretFoundMsg; - if (ImGui::Checkbox("Show Secret Found Message", &showSecretMsg)) - { - 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)) { @@ -1243,12 +1231,42 @@ namespace TFE_FrontEndUI gameSettings->df_autoEndMission = autoEndMission; } + ImGui::Separator(); + + ImGui::PushFont(s_versionFont); + ImGui::LabelText("##ConfigLabel", "UI Settings"); + ImGui::PopFont(); + bool showKeyColors = gameSettings->df_showKeyColors; if (ImGui::Checkbox("Show the key color of the door on the map", &showKeyColors)) { gameSettings->df_showKeyColors = showKeyColors; } + bool centerDataPos = gameSettings->df_centerHudPosition; + if (ImGui::Checkbox("Center the hud LADATA overlay", ¢erDataPos)) + { + gameSettings->df_centerHudPosition = centerDataPos; + } + + bool showSecretMsg = gameSettings->df_showSecretFoundMsg; + if (ImGui::Checkbox("Show Secret Found Message", &showSecretMsg)) + { + gameSettings->df_showSecretFoundMsg = showSecretMsg; + } + + bool showSecretCount = gameSettings->df_showSecretCount; + if (ImGui::Checkbox("Show the Total Number of Secrets Found", &showSecretCount)) + { + gameSettings->df_showSecretCount = showSecretCount; + } + + bool showKeysUsed = gameSettings->df_showKeyUsed; + if (ImGui::Checkbox("Show Key Used messages", &showKeysUsed)) + { + gameSettings->df_showKeyUsed = showKeysUsed; + } + bool showMapSecrets = gameSettings->df_showMapSecrets; if (ImGui::Checkbox("Show Secrets on the AutoMap", &showMapSecrets)) { diff --git a/TheForceEngine/TFE_Settings/settings.cpp b/TheForceEngine/TFE_Settings/settings.cpp index b6c7a0e09..3c65d6178 100644 --- a/TheForceEngine/TFE_Settings/settings.cpp +++ b/TheForceEngine/TFE_Settings/settings.cpp @@ -554,29 +554,31 @@ namespace TFE_Settings void writeDarkForcesGameSettings(FileStream& settings) { - writeKeyValue_Int(settings, "airControl", s_gameSettings.df_airControl); + writeKeyValue_Int(settings, "airControl", s_gameSettings.df_airControl); writeKeyValue_Bool(settings, "bobaFettFacePlayer", s_gameSettings.df_bobaFettFacePlayer); writeKeyValue_Bool(settings, "smoothVUEs", s_gameSettings.df_smoothVUEs); writeKeyValue_Bool(settings, "disableFightMusic", s_gameSettings.df_disableFightMusic); writeKeyValue_Bool(settings, "enableAutoaim", s_gameSettings.df_enableAutoaim); writeKeyValue_Bool(settings, "showSecretFoundMsg", s_gameSettings.df_showSecretFoundMsg); + writeKeyValue_Bool(settings, "showSecretCount", s_gameSettings.df_showSecretCount); writeKeyValue_Bool(settings, "autorun", s_gameSettings.df_autorun); writeKeyValue_Bool(settings, "crouchToggle", s_gameSettings.df_crouchToggle); writeKeyValue_Bool(settings, "ignoreInfLimit", s_gameSettings.df_ignoreInfLimit); writeKeyValue_Bool(settings, "stepSecondAlt", s_gameSettings.df_stepSecondAlt); - writeKeyValue_Int(settings, "pitchLimit", s_gameSettings.df_pitchLimit); + writeKeyValue_Int(settings, "pitchLimit", s_gameSettings.df_pitchLimit); writeKeyValue_Bool(settings, "solidWallFlagFix", s_gameSettings.df_solidWallFlagFix); writeKeyValue_Bool(settings, "enableUnusedItem", s_gameSettings.df_enableUnusedItem); writeKeyValue_Bool(settings, "jsonAiLogics", s_gameSettings.df_jsonAiLogics); - writeKeyValue_Bool(settings, "df_showReplayCounter", s_gameSettings.df_showReplayCounter); - writeKeyValue_Int(settings, "df_recordFrameRate", s_gameSettings.df_recordFrameRate); - writeKeyValue_Int(settings, "df_playbackFrameRate", s_gameSettings.df_playbackFrameRate); - writeKeyValue_Bool(settings, "df_enableRecording", s_gameSettings.df_enableRecording); - 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); - writeKeyValue_Bool(settings, "df_showKeyColors", s_gameSettings.df_showKeyColors); + writeKeyValue_Bool(settings, "showReplayCounter", s_gameSettings.df_showReplayCounter); + writeKeyValue_Int(settings, "recordFrameRate", s_gameSettings.df_recordFrameRate); + writeKeyValue_Int(settings, "playbackFrameRate", s_gameSettings.df_playbackFrameRate); + writeKeyValue_Bool(settings, "enableRecording", s_gameSettings.df_enableRecording); + writeKeyValue_Bool(settings, "enableRecordingAll", s_gameSettings.df_enableRecordingAll); + writeKeyValue_Bool(settings, "demologging", s_gameSettings.df_demologging); + writeKeyValue_Bool(settings, "autoNextMission", s_gameSettings.df_autoEndMission); + writeKeyValue_Bool(settings, "showKeyUsed", s_gameSettings.df_showKeyUsed); + writeKeyValue_Bool(settings, "showKeyColors", s_gameSettings.df_showKeyColors); + writeKeyValue_Bool(settings, "centerHudPos", s_gameSettings.df_centerHudPosition); writeKeyValue_Bool(settings, "df_showMapSecrets", s_gameSettings.df_showMapSecrets); writeKeyValue_Bool(settings, "df_showMapObjects", s_gameSettings.df_showMapObjects); } @@ -1180,6 +1182,10 @@ namespace TFE_Settings { s_gameSettings.df_showSecretFoundMsg = parseBool(value); } + else if (strcasecmp("showSecretCount", key) == 0) + { + s_gameSettings.df_showSecretCount = parseBool(value); + } else if (strcasecmp("autorun", key) == 0) { s_gameSettings.df_autorun = parseBool(value); @@ -1212,37 +1218,45 @@ namespace TFE_Settings { s_gameSettings.df_jsonAiLogics = parseBool(value); } - else if (strcasecmp("df_showReplayCounter", key) == 0) + else if (strcasecmp("showReplayCounter", key) == 0) { s_gameSettings.df_showReplayCounter = parseBool(value); } - else if (strcasecmp("df_recordFrameRate", key) == 0) + else if (strcasecmp("recordFrameRate", key) == 0) { s_gameSettings.df_recordFrameRate = parseInt(value); } - else if (strcasecmp("df_playbackFrameRate", key) == 0) + else if (strcasecmp("playbackFrameRate", key) == 0) { s_gameSettings.df_playbackFrameRate = parseInt(value); } - else if (strcasecmp("df_enableRecording", key) == 0) + else if (strcasecmp("enableRecording", key) == 0) { s_gameSettings.df_enableRecording = parseBool(value); } - else if (strcasecmp("df_enableRecordingAll", key) == 0) + else if (strcasecmp("enableRecordingAll", key) == 0) { s_gameSettings.df_enableRecordingAll = parseBool(value); } - else if (strcasecmp("df_demologging", key) == 0) + else if (strcasecmp("demologging", key) == 0) { s_gameSettings.df_demologging = parseBool(value); } - else if (strcasecmp("df_autoNextMission", key) == 0) + else if (strcasecmp("autoNextMission", key) == 0) { s_gameSettings.df_autoEndMission = parseBool(value); } - else if (strcasecmp("df_showKeyUsed", key) == 0) + else if (strcasecmp("showKeyUsed", key) == 0) { s_gameSettings.df_showKeyUsed = parseBool(value); + } + else if (strcasecmp("showKeyColors", key) == 0) + { + s_gameSettings.df_showKeyColors = parseBool(value); + } + else if (strcasecmp("centerHudPos", key) == 0) + { + s_gameSettings.df_centerHudPosition = parseBool(value); } else if (strcasecmp("df_showKeyColors", key) == 0) { diff --git a/TheForceEngine/TFE_Settings/settings.h b/TheForceEngine/TFE_Settings/settings.h index 2542db228..a2e2bb788 100644 --- a/TheForceEngine/TFE_Settings/settings.h +++ b/TheForceEngine/TFE_Settings/settings.h @@ -215,7 +215,9 @@ struct TFE_Settings_Game bool df_smoothVUEs = false; // Smooths VUE animations (e.g. the Moldy Crow entering and exiting levels) bool df_disableFightMusic = false; // Set to true to disable fight music and music transitions during gameplay. bool df_enableAutoaim = true; // Set to true to enable autoaim, false to disable. - bool df_showSecretFoundMsg = true; // Show a message when the player finds a secret. + bool df_showSecretFoundMsg = false; // Show a message when the player finds a secret. + bool df_showSecretCount = true; // Show secret counts instead of percentage. + bool df_centerHudPosition = false; // Center LADATA position instead of top-right (Default). bool df_autorun = false; // Run by default instead of walk. bool df_crouchToggle = false; // Use toggle instead of hold for crouch. bool df_ignoreInfLimit = true; // Ignore the vanilla INF limit. @@ -229,7 +231,7 @@ struct TFE_Settings_Game 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_showKeyColors = false; // Shows the door key color on the minimap + bool df_showKeyColors = false; // Shows the door key color on the minimap bool df_showMapSecrets = true; // Show secrets on the automap. bool df_showMapObjects = true; // Show objects on the automap. s32 df_recordFrameRate = 4; // Recording Framerate value