mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Make the ImDebugger a bit less crash prone outside of games
This commit is contained in:
1 parent
b4c476d5ed
commit
8d2c1e7a66
5 files changed
+258
-223
No files matched your search
@@ -63,4 +63,26 @@ bool CollapsingHeaderWithCount(const char *title, int count, ImGuiTreeNodeFlags
|
||||
return ImGui::CollapsingHeader(temp, flags);
|
||||
}
|
||||
|
||||
bool CheckboxInverted(const char* label, bool* v) {
|
||||
bool value = !(*v);
|
||||
if (ImGui::Checkbox(label, &value)) {
|
||||
*v = !value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MenuItemInverted(const char* label, const char* shortcut, bool* p_selected, bool enabled) {
|
||||
if (p_selected) {
|
||||
bool value = !(*p_selected);
|
||||
if (ImGui::MenuItem(label, shortcut, &value, enabled)) {
|
||||
*p_selected = !value;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return ImGui::MenuItem(label, shortcut, nullptr, enabled);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ImGui
|
||||
@@ -10,8 +10,10 @@ inline void TextUnformatted(std::string_view str) {
|
||||
}
|
||||
|
||||
bool RepeatButton(const char *title);
|
||||
int RepeatButtonShift(const char* label, float repeatRate = 0.05f);
|
||||
int RepeatButtonShift(const char *label, float repeatRate = 0.05f);
|
||||
|
||||
bool CollapsingHeaderWithCount(const char *title, int count, ImGuiTreeNodeFlags flags = 0);
|
||||
bool CheckboxInverted(const char *label, bool *v);
|
||||
bool MenuItemInverted(const char* label, const char* shortcut = nullptr, bool* p_selected = nullptr, bool enabled = true);
|
||||
|
||||
} // namespace ImGui
|
||||
Reference in new issue
Block a user