diff --git a/resource/common/locale/English.toml b/resource/common/locale/English.toml index 36a400c..ec58c89 100644 --- a/resource/common/locale/English.toml +++ b/resource/common/locale/English.toml @@ -192,6 +192,7 @@ Favourites = "Add to favourites" FavouritesNone = "You don't have any favourites!" FavouritesRemove = "Remove from favourites" Close = "Close" +Playtime = "Playtime: " QuickSSKey = "Quick screenshot" QuickTPKey = "Toggle quick teleport" QuickVehSpawnerCMD = "Quick vehicle spawner" @@ -227,6 +228,7 @@ ShowFPS = "Show FPS" ShowLocation = "Show location" ShowModelInfo = "Show model info" ShowPedTasks = "Show ped tasks" +ShowPlaytime = "Show playtime" ShowRAM = "Show RAM usage" ShowVehHealth = "Show veh health" ShowVehSpeed = "Show veh speed" diff --git a/src/custom/vehcustmzr.cpp b/src/custom/vehcustmzr.cpp index 72b0ee9..7f1ecb2 100644 --- a/src/custom/vehcustmzr.cpp +++ b/src/custom/vehcustmzr.cpp @@ -526,7 +526,19 @@ void VehCustmzrMgr::Draw() { pVeh->RemoveVehicleUpgrade(compID); } + } + + /* + Remove leftover comps + Nitro, wheels, hydralics + */ + int comps[] = {1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087}; + int maxSize = sizeof(comps)/sizeof(comps[0]); + for (int i = 0; i < maxSize; ++i) + { + pVeh->RemoveVehicleUpgrade(comps[i]); } + Util::SetMessage(TEXT("Vehicle.RemoveTuneMSG")); } ImGui::Spacing(); diff --git a/src/pages/menu.cpp b/src/pages/menu.cpp index 7b395ad..8fc1d19 100644 --- a/src/pages/menu.cpp +++ b/src/pages/menu.cpp @@ -166,13 +166,18 @@ void MenuPage::Draw() gConfig.Set("Overlay.ShowLocationName", Overlay::m_bLocName); } - ImGui::NextColumn(); - if (ImGui::Checkbox(TEXT("Menu.ShowModelInfo"), &Overlay::m_bModelInfo)) { gConfig.Set("Overlay.ShowModelInfo", Overlay::m_bModelInfo); } + ImGui::NextColumn(); + + if (ImGui::Checkbox(TEXT("Menu.ShowPlaytime"), &Overlay::m_bPlaytime)) + { + gConfig.Set("Overlay.ShowPlaytime", Overlay::m_bPlaytime); + } + if (ImGui::Checkbox(TEXT("Menu.ShowPedTasks"), &Overlay::m_bPedTasks)) { gConfig.Set("Overlay.ShowPedTasks", Overlay::m_bPedTasks); diff --git a/src/utils/overlay.cpp b/src/utils/overlay.cpp index dbc8866..53cca9e 100644 --- a/src/utils/overlay.cpp +++ b/src/utils/overlay.cpp @@ -15,6 +15,7 @@ void Overlay::Init() m_bFPS = gConfig.Get("Overlay.ShowFPS", false); m_bLocName = gConfig.Get("Overlay.ShowLocationName", false); m_bModelInfo = gConfig.Get("Overlay.ShowModelInfo", false); + m_bPlaytime = gConfig.Get("Overlay.ShowPlaytime", false); m_bPedTasks = gConfig.Get("Overlay.ShowPedTasks", false); m_bTransparent = gConfig.Get("Overlay.Transparent", false); m_bMemUsage = gConfig.Get("Overlay.ShowMemoryUsage", false); @@ -460,6 +461,30 @@ void Overlay::ProcessInfoBox() if (m_bLocName) { ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str()); + } + + if (m_bPlaytime) + { + int timer = CTimer::m_snTimeInMilliseconds / 1000; + int h = timer / 3600; + int m = timer / 60 - h*60; + int s = timer - m*60; + + if (h == 0) + { + if (m == 0) + { + ImGui::Text((TEXT_S("Menu.Playtime") + "%d seconds").c_str(), s); + } + else + { + ImGui::Text((TEXT_S("Menu.Playtime") + "%d min %d sec").c_str(), m, s); + } + } + else + { + ImGui::Text((TEXT_S("Menu.Playtime") + "%d hour %d min %d sec").c_str(), h, m, s); + } } if (m_bMemUsage) diff --git a/src/utils/overlay.h b/src/utils/overlay.h index e82e5fc..7ce8df6 100644 --- a/src/utils/overlay.h +++ b/src/utils/overlay.h @@ -48,6 +48,7 @@ public: static inline bool m_bLocName; static inline bool m_bMemUsage; static inline bool m_bModelInfo; + static inline bool m_bPlaytime; static inline bool m_bPedTasks; static inline bool m_bTransparent; static inline bool m_bVehHealth;