refactor!: globals (#717)

* refactor(globals): use macro's for to_json/from_json
* refactor(globals): switch from global pointer to global instance
This commit is contained in:
Yimura
2022-12-18 23:15:52 +01:00
committed by GitHub
parent b74dd7516c
commit ddddbd4efd
146 changed files with 1279 additions and 1901 deletions

View File

@ -8,25 +8,25 @@ namespace big
{
if (ImGui::BeginTabItem("Logs"))
{
ImGui::Checkbox("Log Metrics", &g->debug.logs.metric_logs);
ImGui::Checkbox("Log Metrics", &g.debug.logs.metric_logs);
ImGui::Checkbox("Native Script Hooks", &g->debug.logs.script_hook_logs);
ImGui::Checkbox("Native Script Hooks", &g.debug.logs.script_hook_logs);
if (ImGui::TreeNode("Script Event Logging"))
{
ImGui::Checkbox("Enable Script Event Logging", &g->debug.logs.script_event.logs);
ImGui::Checkbox("Enable Script Event Logging", &g.debug.logs.script_event.logs);
ImGui::Separator();
ImGui::Checkbox("Filter by Player", &g->debug.logs.script_event.filter_player);
ImGui::Checkbox("Filter by Player", &g.debug.logs.script_event.filter_player);
if (g->debug.logs.script_event.filter_player)
if (g.debug.logs.script_event.filter_player)
{
ImGui::ListBoxHeader("##filter_player");
for (const auto& [_, player] : g_player_service->players())
{
if (components::selectable(player->get_name(), g->debug.logs.script_event.player_id == player->id()))
if (components::selectable(player->get_name(), g.debug.logs.script_event.player_id == player->id()))
{
g->debug.logs.script_event.player_id = player->id();
g.debug.logs.script_event.player_id = player->id();
}
}
ImGui::EndListBox();