EditBox and long strings
I have problems using EditBoxes containing large amounts of text.
For example 3,500 lines of text comprising 270,000 characters. Calling :SetText() and :Insert() with very long strings; or scrolling, resizing and typing in the editbox can freeze up the game. It's not really a Legion bug, since it's the same on Live and has always been like that as far as I can remember. Are there maybe any previous discussions about this? WeakAuras also has problems dealing with it http://eu.battle.net/wow/en/forum/topic/17611871083 Edit: I guess the EditBox was not meant for big amounts of text then. If I just wanted to see an in-game plain text list of the amount of character GUIDs I met on the Beta it's already too much to show. |
The game freeze means that the call blocks all other actions until the function is done.
Only way around this would be to make the function non-blocking using some kind of worker with a callback. Chunking can help too. Not sure if WoW can do such a thing. I doubt it. |
I've been tinkering with a modified version of LibTextDump in RealUI for good while. It utilizes a faux scroll frame where the text is a specific chunk of the current buffer based on the scroll position. The chunk is created from using two optional args for table.concat where you can specify the start and end indices for the function.
There are still some lingering scroll issues, but for the most part it works pretty well. |
Quote:
I obviously can't copy the full amount of text to clipboard, but it's fine for just viewing I guess (Instead of the original LibTextDump version, which had problems with massive amounts of text) |
Not being able to select the entire text is the main drawback to the design, but I added some bits that allow you to dump the buffer into a savedvar (passed to :New via the added 4th arg) when you click the page icon. You can then browse it at your leisure in your favorite text editor.
Probably could have documented that better, but w/e ... |
Yes this is making doing any sort of large profile import/export freeze the WoW client for several seconds in VuhDo as well. Super annoying and I haven't found a way around it that allows easy copy & paste. :(
|
Sorry I missed this topic, I solved this for weak auras a long time ago but they didn't get around to implementing it until recently.
The lag is caused by having word wrap enabled on a font string, and since this is generally only an issue for copying and pasting large amounts of text into and out of the game you can get around it by grabbing the editbox's font string and disabling "NonSpaceWrap", which is enabled by default and has no method on the edit box to turn it off. Assuming you haven't called SetMultiLine or SetIndentedWordWrap on the edit box, all you need to do is run something like editbox:GetRegions():SetNonSpaceWrap(false) to disable it on the fontstring. This will get rid of the lag but reduce you to a single line of text. If you'd like to still be able to view what's in the edit box you can create your own font string which truncates the text to whatever should be visible in the window. Also, this problem should be somewhat mitigated in legion since I talked to a dev about it and he implemented a bandaid fix (eg. 3 seconds of lag instead of 60). |
Quote:
If I don't call SetMultiLine it already seems to almost completely reduce the lag, if I just wanted to copy/paste stuff. Also tried :GetRegions():SetNonSpaceWrap(false) but not sure if it had any effect. I honestly don't have much experience with the EditBox. The used editbox for reference: https://gist.github.com/anonymous/70...ad5bbaa5cb04f2 Quote:
Is this already implemented? I didn't benchmark how long it took, otherwise will have to test it on Live as Infus did Quote:
Ow, didn't know about that yet. I'm a bit used that with most WoW libraries the documentation is in the library itself x) |
Quote:
Unfortunately, I just tried this and disabling word wrap doesn't appear to solve this problem any more. It was working about a week ago, but things change. If you need to paste large amounts of text into the game, you can call editbox:SetMaxBytes(1) to limit the length of the string, and hook the edit box's OnChar function which will fire for every character in the paste regardless of whether it's being displayed. Just insert the characters into a table OnChar and use OnUpdate to call table.concat on it on the next frame after the paste is finished to get your string. Here's a relatively long example which accepts pastes and displays a truncated portion of it, something similar is being used in weak auras for importing strings. Lua Code:
|
All times are GMT -6. The time now is 02:58 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI