mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
content-pack id validation + refactor
This commit is contained in:
parent
ba4338c4fa
commit
b7fbb8621a
10 changed files with 111 additions and 53 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue