| 1107 | } |
| 1108 | |
| 1109 | void DrawFlagArray8(const std::string& name, uint8_t& flags, Colors color) { |
| 1110 | ImGui::PushID(name.c_str()); |
| 1111 | for (int8_t flagIndex = 0; flagIndex < 8; flagIndex++) { |
| 1112 | if ((flagIndex % 8) != 0) { |
| 1113 | ImGui::SameLine(); |
| 1114 | } |
| 1115 | ImGui::PushID(flagIndex); |
| 1116 | uint8_t bitMask = 1 << flagIndex; |
| 1117 | bool flag = (flags & bitMask) != 0; |
| 1118 | PushStyleCheckbox(color); |
| 1119 | ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 3.0f)); |
| 1120 | std::string id = fmt::format("##{}{}", name, flagIndex); |
| 1121 | if (ImGui::Checkbox(id.c_str(), &flag)) { |
| 1122 | if (flag) { |
| 1123 | flags |= bitMask; |
| 1124 | } else { |
| 1125 | flags &= ~bitMask; |
| 1126 | } |
| 1127 | } |
| 1128 | ImGui::PopStyleVar(); |
| 1129 | PopStyleCheckbox(); |
| 1130 | ImGui::PopID(); |
| 1131 | } |
| 1132 | ImGui::PopID(); |
| 1133 | } |
| 1134 | |
| 1135 | void DrawFlagArray8Mask(const std::string& name, uint8_t& flags, Colors color) { |
| 1136 | ImGui::PushID(name.c_str()); |
nothing calls this directly
no test coverage detected