WeakAuras2
WeakAuras2 copied to clipboard
Feature: Aura data cleaner
I'd like to have a way to clean unused data.
Like if i copy an aura, uncheck custom custom text, uncheck animation, uncheck load condition, change custom trigger for something else, etc.. it's still there in the data. All this unused data adds up, it's really not a big deal, but i don't like to upload something on wago and find later that the data is full or garbage.
I’ve toyed with this idea myself. It’s a nice idea but I’m just afraid of inadvertently destroying data that is necessary to work properly.
Perhaps, we could implement something where each region type, trigger type, etc, lists all of the fields which it cares about, and then have WeakAuras.TrimData which unsets any field which isn't interesting to any system that the aura employs.
I don't think that it's necessarily a good idea to make this happen automatically, though. Perhaps on import, there can be an option to trim unnecessary data, and also add it to the context menu of the aura.
Yeah, that could work, but we don't have a very good view of how writes/reads which data and where.
And thus I feel that's a huge effort for little gain, it's hard to even make that not accidentally remove some data.
That's certainly why I think it should not be something which happens on e.g. PreAdd, but would require the user to opt in.
This probably isn't a usable solution, but I've had some success in using the in-game editor to determine which data was relevant. I added an instrumented copy of the aura to weakauras, opened this copy in the in-game editor, and kept only data that had been read. This didn't seem to remove anything important, and successfully removed quite a few bits of data that were not used. The script I used to try this.
In-game editor? Do you mean the stringifier that shows a readonly printout of the aura data?
In any case, deleting anything which wasn't read from since the last time that the aura was loaded would in principle work. The pattern that we use to build the regions, animations, trigger funcs, etc. should be sufficient to ensure that any value which is needed is actually read from pretty much immediately.
...but I don't know for sure, so I can't in good conscience ship something to do this automagically without doing a lot of testing first.
I mean the one that pops up when you type /wa
.
EDIT: Took another look and whether I opened it in the editor or not doesn't seem to change the which data is removed. Looks like WeakAuras.Add
reads all the relevant info on its own.
EDIT2: Nevermind, it looks like parts of author options aren't read by WeakAuras.Add
, those require the aura to be opened in the editor and the little >
arrows to be clicked.
You’re talking about WeakAurasOptions. But anyways, the point about custom options is a good one, and is exactly the kind of thing which makes me hesitant to do any real work on this.
If/when we ever implement history (undo/redo changes to the database), then we have an option to improve this by creating a fresh table with minimal fields each time certain options are changed. e.g. when the user switches from a buff trigger to a status trigger, almost none of the fields are shared between the two systems. So we can start fresh. This would at least minimize the amount of bloat which is unlikely to ever be useful, and would not introduce the hazards that actively removing fields would.
Well, we could implement it today without undo/redo. But people have expressed a desire to keep the ability to “undo” the change. So it would probably be best to not remove that until we have a replacement.
For a patient with severe obsessive-compulsive disorder, this function is too much needed (obsessive-compulsive disorder is so severe that it needs long-term drug control) I want to remove the redundant code in "weakauras.lua" in WTF. (I'm a Lua rookie) I delete "weakauras.lua" line by line, and then re-enter the game to see the transformation, and then delete, re-enter the game to see if it will break... Infinite cycle Because the "weakauras.lua" file will be automatically generated every time I restart the game, I will replace the newly generated "weakauras.lua" file with the one I am deleting, and then continue to do "delete redundant work" on the basis of this file It will take 10-16 hours to do this every day At present, more than 3.9 million lines of code have been screened It will take more than two years (I have been doing this since 2020) In order to clarify the function of each row and the consistency when deleting redundant rows (some empty assignment fields will also appear in "weakauras.lua"). I wrote comments for each line of code The pain is that my mother tongue is not English. I have to look up every word in a dictionary, and some of them may not understand Then after annotating each line in my mother tongue, every time I re-enter the game and exit the game, the file will be overwritten by the automatically generated "weakauras.lua", so every time I enter and exit the game, I will back up the "weakauras.lua" file I am writing comments on, and paste it back after the test. Then I found that for each group or content, the order of the code lines of "weakauras.lua" was inconsistent I spent a lot of time and energy again to sort all the contents. The order of sorting is exactly the same as the top-down fields in the game setting interface After finishing these, I found that because it took too long to do, some descriptions of the notes I wrote for the same fields were not the same (my interpretation of them changed two years ago and now) Then, I exposed them all, compared them, and tried to modify them into the same ... another round of collapsing workload Then, the game version has changed, and many new skill monitoring and copy monitoring are needed. Many previous skills have also changed Then I write the new one and spend a lot of time (I add an aura, which is written line by line from the "weakauras.lua" file, not from the interface in the game, because there are many redundant lines of code added from the interface in the game) In the process of writing, because of obsessive-compulsive disorder, I have doubts about all the contents I have done before Then they will recheck one by one line... Unable to control themselves Today, when I visited GitHub for the first time, I saw this problem. Because my English is poor, I'm not sure if it's the problem I described But I've burned my life on this matter. I look at "weakauras.lua" in the editor every day I've been doing this for nearly 10000 hours without exaggeration I know it's meaningless
@1575819749 Then please for you own sanity, deinstall WeakAuras or seek professional help.
The extra code is just meaningless clutter that has no impact at all on anything, except a small one for importing/exporting.
Is this function started now? Or is there a plan? If I want to pay for customized development of this function, is it possible?
Because I'm not studying code, I'm just an ordinary player So I will look at it painfully, line by line, word by word Or is there any batch operation method that can solve this kind of problem Now I find that there is no end. I can't bear to give up when I'm half done. I'm desperately looking for a solution T.T~
No there's nothing planned. It's not a priortiy at all.
As I said, you need professional help. Or stop using WeakAuras.