Compare commits

...

2 Commits

Author SHA1 Message Date
Green Sky c791f4c6a1
fix print formatter 2023-09-04 23:46:12 +02:00
Green Sky 7a3823db78
update ImGui to v1.89.9
and reenable obsolte bc of text editor (temp, will be replaced)
2023-09-04 20:57:00 +02:00
3 changed files with 13 additions and 12 deletions

View File

@ -41,7 +41,7 @@ target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
#target_include_directories(imgui PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/imgui") # im sad
target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1)
#target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1) # more sad
if(EMSCRIPTEN)
target_compile_options(imgui PUBLIC -sUSE_SDL=2)

@ -1 +1 @@
Subproject commit 458a1090314a965dd37b02c918d83077a0142ad5
Subproject commit c6e0284ac58b3f205c95365478888f7b53b077e2

View File

@ -4,6 +4,7 @@
#include <imgui.h>
#include <nlohmann/json.hpp>
#include <imgui/misc/cpp/imgui_stdlib.h>
#include <cinttypes>
namespace MM::ImGuiWidgets {
@ -55,16 +56,16 @@ void JsonViewerSimple(const char* name, const JsonObjectType& json) {
}
break;
case JsonObjectType::value_t::number_integer:
ImGui::TextColored(int_color, "%ld", json.template get<int64_t>());
ImGui::TextColored(int_color, "%" PRId64, json.template get<int64_t>());
break;
case JsonObjectType::value_t::number_unsigned:
ImGui::TextColored(unsigned_color, "%lu", json.template get<uint64_t>());
ImGui::TextColored(unsigned_color, "%" PRIu64, json.template get<uint64_t>());
break;
case JsonObjectType::value_t::number_float:
ImGui::TextColored(float_color, "%f", json.template get<float>());
break;
case JsonObjectType::value_t::object:
ImGui::TextDisabled("{%d}", json.size());
ImGui::TextDisabled("{%zu}", json.size());
ImGui::Indent();
for (auto& [key, value] : json.items()) {
@ -74,7 +75,7 @@ void JsonViewerSimple(const char* name, const JsonObjectType& json) {
break;
case JsonObjectType::value_t::array:
ImGui::TextDisabled("[%d]", json.size());
ImGui::TextDisabled("[%zu]", json.size());
ImGui::Indent();
for (auto& [key, value] : json.items()) {
@ -103,9 +104,9 @@ void JsonViewerTree(const char* name, const JsonObjectType& json) {
ImGui::SameLine();
if (json.is_object()) {
ImGui::TextDisabled("{%d}", json.size());
ImGui::TextDisabled("{%zu}", json.size());
} else { // is_array()
ImGui::TextDisabled("[%d]", json.size());
ImGui::TextDisabled("[%zu]", json.size());
}
if (tree_open) {
@ -143,10 +144,10 @@ void JsonViewerTree(const char* name, const JsonObjectType& json) {
}
break;
case JsonObjectType::value_t::number_integer:
ImGui::TextColored(int_color, "%ld", json.template get<int64_t>());
ImGui::TextColored(int_color, "%" PRId64, json.template get<int64_t>());
break;
case JsonObjectType::value_t::number_unsigned:
ImGui::TextColored(unsigned_color, "%lu", json.template get<uint64_t>());
ImGui::TextColored(unsigned_color, "%" PRIu64, json.template get<uint64_t>());
break;
case JsonObjectType::value_t::number_float:
ImGui::TextColored(float_color, "%f", json.template get<float>());
@ -200,9 +201,9 @@ void JsonEditor(const char* name, JsonObjectType& json) {
ImGui::SameLine();
if (json.is_object()) {
ImGui::TextDisabled("{%d}", json.size());
ImGui::TextDisabled("{%zu}", json.size());
} else { // is_array()
ImGui::TextDisabled("[%d]", json.size());
ImGui::TextDisabled("[%zu]", json.size());
}
if (tree_open) {