2022-11-12 18:35:28 +00:00
|
|
|
#include "components.hpp"
|
|
|
|
#include "fiber_pool.hpp"
|
|
|
|
#include "services/script_patcher/script_patcher_service.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
bool components::script_patch_checkbox(const std::string_view text, bool* option, const std::string_view tooltip)
|
|
|
|
{
|
|
|
|
bool ret = ImGui::Checkbox(text.data(), option);
|
|
|
|
if (ret)
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-11-12 21:02:50 +00:00
|
|
|
g_script_patcher_service->update();
|
2022-11-12 18:35:28 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!tooltip.empty())
|
|
|
|
{
|
|
|
|
if (ImGui::IsItemHovered())
|
|
|
|
ImGui::SetTooltip(tooltip.data());
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|