Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New addon: Debuffed #1630

Merged
merged 12 commits into from Jun 11, 2018
Merged

New addon: Debuffed #1630

merged 12 commits into from Jun 11, 2018

Conversation

aukon
Copy link
Contributor

@aukon aukon commented Mar 24, 2018

No description provided.

Copy link
Member

@z16 z16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks pretty good, you just need to fix the copyright notice. Aside from that all the things I commented on are minor suggestions, although I would like to see the debuff file committed to the RE repository. But even if you decide to do that, it wouldn't have to be now, can do it at any other point in time.

So once you fix the copyright notice let me know if you want me to merge it as is, or if you want to implement any of the other suggestions.

@@ -0,0 +1,250 @@
--[[
Copyright (c) 2018, Auk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the proper copyright sign ©.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of <addon name> nor the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add your addon name here.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And your name again here.

@@ -0,0 +1,54 @@
return {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, I think this would be a useful addition to Windower resources. Feel free to add this to the ResourceExtractor repository (in the fixes.xml file). That way you could access that then.

I would also leave out the name field (both if you go the ResourceExtractor route or if you leave it here). You can use the ID to access the name from the buff resources, and then you can use the .name property to localize it based on client language (so it shows the japanese name on the japanese client). You can still use the english name in a comment at the end of the line for easier maintenance (both here and in the fixes.xml file).

end
end
end
box.current_string = count > 0 and current_string or ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is minor suggestion, but repeated expanding string concatenation can be "very" expensive (for certain definitions of "very"). I would probably use a list to append lines to and later join them all by \n.

Has the even minorer additional benefit, that you won't need the count variable - at the end of the function you could just check if the table is empty. If so - return. If not, update the box.current_string with Debuffed [' .. target.name ..']\n' .. list:concat('\n'), where lines is the table used to hold all the lines.

That makes it a tad more efficient, but I doubt it would make much of a difference unless it's on the lowest of low boxes.

end

function handle_overwrites(target, new, t)
if debuffed_mobs[target] then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can invert the condition to reduce nesting:

    if not debuffed_mobs[target] then
        return true
    end

end

function inc_action(act)
if act.category == 4 then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, can invert the condition:

    if act.category ~= 4 then
        return
    end

print(' \\cs(255,255,255)interval <value>\\cr - Allows you to change the refresh interval (default: 0.1)')
print(' \\cs(255,255,255)blacklist|whitelist add|remove <name>\\cr - Adds or removes the spell <name> to the specified list')
end
end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new line at the end of the file. This is critical.

@aukon
Copy link
Contributor Author

aukon commented Mar 24, 2018

Implemented all of those suggestions. I'll definitely look into the resources but I still need to add a few other spells like songs yet.

@aukon
Copy link
Contributor Author

aukon commented Mar 28, 2018

Switched to using resources now and I've made a pull request with an updated fixes.xml. Windower/ResourceExtractor@39b324a

@z16
Copy link
Member

z16 commented Apr 18, 2018

Just so you know, I want to refactor RE first to handle tables within the fixes file and interpret it as an array. As it is now we end up with the string '{123,456,789}' instead of an actual table in Lua. After that you'll need to adjust your code as well at the appropriate place. Since I'm currently on vacation this is taking a bit, sorry for the delay...

@aukon
Copy link
Contributor Author

aukon commented Apr 18, 2018

No worries, I did take a look at RE myself but it's a bit out of my expertise. Should be a lot cleaner than the hacky workaround I used for the string issue.

@aukon aukon changed the title Debuff Tracking Addon New addon: Debuffed May 17, 2018
@z16
Copy link
Member

z16 commented Jun 9, 2018

Sorry this took so long, we went over a few things and resources were adjusted again. Now the overwrites should be an actual table instead of a string containing a table definition.

Also adjusted some duration values, but not many. Some seem to be off still, but it should be usable. Let me know when you've upgraded the addon to handle the new resources.

@aukon
Copy link
Contributor Author

aukon commented Jun 11, 2018

Fixed for the new resources now but I also added a check for Light Shot to upgrade Dia. I've made two more pull requests to add the spell attributes for Dia IV so overwrites work properly for it.

Windower/ResourceExtractor#54
Windower/Resources#28

I'll look into fixing the durations if I ever get chance, haven't been actively playing recently.

@z16 z16 merged commit d4ece04 into Windower:dev Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants