Added headlight, neon light and custom tire options to LSC. (#332)

This commit is contained in:
aa15032261
2022-07-14 22:16:30 +08:00
committed by GitHub
parent 15ef1b874d
commit d852750810
19 changed files with 1101 additions and 411 deletions

View File

@ -40,21 +40,33 @@ namespace big
}
vehicle_preview_service::vehicle_preview_service() :
m_vehicle_file(g_file_manager->get_project_file("./lib/vehicles.json"))
m_vehicle_file(g_file_manager->get_project_file("./lib/vehicles.json")),
m_vehicle_file_etag(g_file_manager->get_project_file("./lib/vehicles_etag.txt"))
{
if (m_vehicle_file.exists())
this->load();
else
{
g_thread_pool->push([this]()
{
if (remote::download_binary("http://github-proxy.damon.sh/DurtyFree/gta-v-data-dumps/master/vehicles.json", m_vehicle_file.get_path()))
this->load();
else
LOG(WARNING) << "Failed to download vehicles.json data...";
});
this->load();
LOG(INFO) << "Vehicle data loaded.";
}
g_thread_pool->push([this]() {
bool ret = remote::update_binary(
"http://github-proxy.damon.sh/DurtyFree/gta-v-data-dumps/master/vehicles.json",
m_vehicle_file.get_path(),
m_vehicle_file_etag.get_path()
);
if (ret)
{
this->load();
LOG(INFO) << "Vehicle data updated.";
}
else if (!m_vehicle_file.exists())
{
LOG(WARNING) << "Failed to download vehicles.json data...";
}
});
g_vehicle_preview_service = this;
}

View File

@ -18,6 +18,7 @@ namespace big
class vehicle_preview_service
{
file m_vehicle_file;
file m_vehicle_file_etag;
std::condition_variable m_cond;
std::mutex m_mutex;