content-pack id validation + refactor

This commit is contained in:
MihailRis
2024-01-25 03:40:08 +03:00
parent ba4338c4fa
commit b7fbb8621a
10 changed files with 111 additions and 53 deletions
+4
View File
@@ -37,6 +37,10 @@ void guiutil::alert(GUI* gui, const std::wstring& text, gui::runnable on_hidden)
size_t offset = 0;
int extra;
while ((extra = text.length() - offset) > 0) {
size_t endline = text.find(L'\n', offset);
if (endline != std::string::npos) {
extra = std::min(extra, int(endline-offset)+1);
}
extra = std::min(extra, wrap_length);
std::wstring part = text.substr(offset, extra);
panel->add(new Label(part));