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

Stat description format '$+d%' is not handled correctly #20

Closed
brather1ng opened this issue Jan 24, 2017 · 4 comments
Closed

Stat description format '$+d%' is not handled correctly #20

brather1ng opened this issue Jan 24, 2017 · 4 comments
Assignees

Comments

@brather1ng
Copy link
Contributor

Translations miss the leading '+' for the format '$+d%':

from PyPoE.poe.file import GGPKFile
from PyPoE.poe.file import TranslationFileCache
ggpk = GGPKFile()
ggpk.read('D:/Program Files (x86)/Grinding Gear Games/Path of Exile/Content.ggpk')
ggpk.directory_build()
tf = TranslationFileCache(path_or_ggpk=ggpk)['skill_stat_descriptions.txt']
tr = tf.get_translation(
    tags=['supported_active_skill_gem_quality_%'],
    values=[20]
)
print("Expected: +20% to Quality of Supported Active Skill Gems")
print("Actual:   %s" % tr[0])  # '20% to Quality of Supported Active Skill Gems'

This is correct in the wiki (see e.g. http://pathofexile.gamepedia.com/Enhance_Support), so maybe I'm doing something wrong or the bug is new.

@OmegaK2
Copy link
Owner

OmegaK2 commented Jan 24, 2017

Huh that's odd, probably broke something earlier when I fixed #18, I have a test covering the $+d case (which works) but not for the $+d%% case, which seems to be broken. Looking into it.

@OmegaK2 OmegaK2 self-assigned this Jan 24, 2017
@brather1ng
Copy link
Contributor Author

Seems like that change moved the '%' into the format for '$+d' (now '$+d%'). See my stat_translations diff. That leads to the '+' not being prepended in TranslationString.format_string().

Somewhat related: That method uses a '%d' format, so the rare cases of floating point numbers in stats are translated incorrectly:

tf.get_translation(tags=['additional_base_critical_strike_chance'], values=[110])
# 1% to Critical Strike Chance

@OmegaK2
Copy link
Owner

OmegaK2 commented Jan 24, 2017

I must have tested that wrong somewhere, I specifically overrode the $+d format to return digits, not floating points, must have messed up in between python formatting and the format GGG uses. Both of these issues will be fixed soon along with #19.

@brather1ng
Copy link
Contributor Author

All looks good now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants