Refactor network usage and adapt Sail/CC to changes

This commit is contained in:
Garrett Cox
2024-10-18 11:07:22 -05:00
parent 29d7c54250
commit df6763257b
24 changed files with 539 additions and 531 deletions
+14
View File
@@ -814,4 +814,18 @@ namespace UIWidgets {
float sz = ImGui::GetFrameHeight();
return StateButtonEx(str_id, label, ImVec2(sz, sz), ImGuiButtonFlags_None);
}
// Reference: imgui-src/misc/cpp/imgui_stdlib.cpp
int InputTextResizeCallback(ImGuiInputTextCallbackData* data) {
std::string* value = (std::string*)data->UserData;
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) {
value->resize(data->BufTextLen);
data->Buf = (char*)value->c_str();
}
return 0;
}
bool InputString(const char* label, std::string* value) {
return ImGui::InputText(label, (char*)value->c_str(), value->capacity() + 1, ImGuiInputTextFlags_CallbackResize, InputTextResizeCallback, value);
}
}