forked from teamnwah/openmw-tes3coop
Add option to show reach and attack speed for melee weapons
This commit is contained in:
parent
1286754fb3
commit
506cc47c9d
4 changed files with 20 additions and 0 deletions
|
@ -321,6 +321,14 @@ namespace MWClass
|
||||||
+ MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
+ MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add reach and attack speed for melee weapon
|
||||||
|
if (ref->mBase->mData.mType < 9 && Settings::Manager::getBool("show melee info", "Game"))
|
||||||
|
{
|
||||||
|
text += MWGui::ToolTips::getPercentString(ref->mBase->mData.mReach, "#{sRange}");
|
||||||
|
|
||||||
|
text += MWGui::ToolTips::getPercentString(ref->mBase->mData.mSpeed, "#{sAttributeSpeed}");
|
||||||
|
}
|
||||||
|
|
||||||
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
||||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||||
|
|
||||||
|
|
|
@ -594,6 +594,14 @@ namespace MWGui
|
||||||
return "\n" + prefix + ": " + toString(weight);
|
return "\n" + prefix + ": " + toString(weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ToolTips::getPercentString(const float value, const std::string& prefix)
|
||||||
|
{
|
||||||
|
if (value == 0)
|
||||||
|
return "";
|
||||||
|
else
|
||||||
|
return "\n" + prefix + ": " + toString(value*100) +"%";
|
||||||
|
}
|
||||||
|
|
||||||
std::string ToolTips::getValueString(const int value, const std::string& prefix)
|
std::string ToolTips::getValueString(const int value, const std::string& prefix)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace MWGui
|
||||||
///< set the screen-space position of the tooltip for focused object
|
///< set the screen-space position of the tooltip for focused object
|
||||||
|
|
||||||
static std::string getWeightString(const float weight, const std::string& prefix);
|
static std::string getWeightString(const float weight, const std::string& prefix);
|
||||||
|
static std::string getPercentString(const float value, const std::string& prefix);
|
||||||
static std::string getValueString(const int value, const std::string& prefix);
|
static std::string getValueString(const int value, const std::string& prefix);
|
||||||
///< @return "prefix: value" or "" if value is 0
|
///< @return "prefix: value" or "" if value is 0
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,9 @@ show owned = 0
|
||||||
# Show damage bonus of arrow and bolts.
|
# Show damage bonus of arrow and bolts.
|
||||||
show projectile damage = false
|
show projectile damage = false
|
||||||
|
|
||||||
|
# Show additional melee weapon info: reach and attack speed
|
||||||
|
show melee info = false
|
||||||
|
|
||||||
# Always use the best mode of attack: e.g. chop, slash or thrust.
|
# Always use the best mode of attack: e.g. chop, slash or thrust.
|
||||||
best attack = false
|
best attack = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue