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 4041370763
commit f6c00f113d
147 changed files with 1280 additions and 1902 deletions

View File

@ -30,7 +30,7 @@ namespace big
// calculate icons width
const auto window = ImGui::GetCurrentWindow();
ImGui::PushFont(g->window.font_icon);
ImGui::PushFont(g.window.font_icon);
const auto icons_size = ImGui::CalcTextSize(player_iconsc, player_icons_end);
const ImVec2 icons_pos(window->DC.CursorPos.x + 300.0f - 32.0f - icons_size.x, window->DC.CursorPos.y + 2.0f);
const ImRect icons_box(icons_pos, icons_pos + icons_size);
@ -48,7 +48,7 @@ namespace big
{
g_player_service->set_selected(plyr);
g_gui_service->set_selected(tabs::PLAYER);
g->window.switched_view = true;
g.window.switched_view = true;
}
ImGui::PopID();
ImGui::PopStyleVar();
@ -60,7 +60,7 @@ namespace big
ImGui::PopStyleColor();
// render icons on top of the player button
ImGui::PushFont(g->window.font_icon);
ImGui::PushFont(g.window.font_icon);
ImGui::RenderTextWrapped(icons_box.Min, player_iconsc, player_icons_end, icons_size.x);
ImGui::PopFont();
}