Request: Refactor getStatDesc to reduce duplication

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
isaacssv552
Wayist
Posts: 25
Joined: Thu Mar 12, 2015 11:12 pm

Request: Refactor getStatDesc to reduce duplication

#1 Post by isaacssv552 »

The function getStatDesc in mod/dialogs/LevelupDialog.lua currently duplicates information from the onStatChange function in mod/class/Actor.lua. For instance, multi_life is calculated separately in each function. This any addon which superloads onStatChange must also superload getStatDesc to prevent UI discrepancies. This reduces compatibility, both with other addons and with future versions of TOME. I propose moving Actor stat change information from LevelupDialog.lua into Actor.lua, perhaps into a new function such as 'getStatChange(stat, property)'.

Post Reply