Toukibi / ToSAddon

Add-ons for Tree of Savior
GNU General Public License v3.0
11 stars 9 forks source link

Tooltip helper - remove an item from it #28

Open bsides opened 4 years ago

bsides commented 4 years ago

Hi Toukibi,

Right now some items like Nucle Powder ou Sierra Powder do too many things in the game making hovering these lags quite a bit to show the list of the items in the tooltip. Would it be possible to have the option to remove the item from the addon? Like, /command-line remove ITEM_ID. It would be great. Thank you!

Toukibi commented 4 years ago

Hi bsides,

I've tried the Tooltip Helper delay issue.Certainly this cannot be overlooked. So, I took a closer look at the program to see what caused the heavy processing.

As a result, I found that the function to check if it is a recipe item and the function to get the number of items that I have are heavy processing. When I rewrote that part to an alternative process, I confirmed that the lag almost disappeared and I was able to operate it comfortably.

I'm hoping to search if there are any more improvements, so I think the release of the modified version will be a little later. Thank you for posting the Issue.

Toukibi commented 4 years ago

Hello. Today I have released ToolTip Helper ver.1.0.6. Probably I think that it can be displayed with almost no lag.

The implementation was different from the initial request, but I hope you can try it.

bsides commented 4 years ago

Hi Toukibi, I just tested with said items and it's working great. Out of curiosity, as I'm a developer myself (not Lua though), what did you do to optimize it?

Y6JeYyDOCD

Thanks again!

Toukibi commented 4 years ago

Hi bsides,

The things that I did for optimization, first I used a timer to find out which process was heavy. As a result, I found that the part to check the number of items used in the recipe was heavy, so I tried commenting out that part. Then, I was surprised myself that the processing was dramatically faster.

So I decided to switch the policy from excluding items to modifying the process. In previous versions, it was obtained using a function provided by IMC Games. However, because the function was heavy, I read the contents of the function and created my own process that uses only the necessary parts. (The contents of each function are also described in each ipf file.)

Therefore, there is a problem that a bug may occur each time the usage count acquisition function of the item is changed. There is no such thing at the moment, but if items with the same name but different ranks are implemented, it is likely that the current method can not be used.

That's about it. Since there is no official specification, I look for the syntax written in each ipf file to find out how to use it, so I sometimes say "I found a better way by reading in detail" like this time.

Thank you.

bsides commented 4 years ago

Very nice development. I looked at your commit for it https://github.com/Toukibi/ToSAddon/commit/2f7f1217a7812914c4df104d0988ed8381457b54 and it's nicely done. Thanks for the throughout explanation!