mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 12:06:43 +00:00
Display school in the spell tooltip
This commit is contained in:
parent
fc789265e2
commit
df262e53ae
2 changed files with 11 additions and 9 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
#include "../mwmechanics/spellcasting.hpp"
|
||||||
|
|
||||||
#include "mapwindow.hpp"
|
#include "mapwindow.hpp"
|
||||||
#include "inventorywindow.hpp"
|
#include "inventorywindow.hpp"
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
std::string ToolTips::sSchoolNames[] = {"#{sSchoolAlteration}", "#{sSchoolConjuration}", "#{sSchoolDestruction}", "#{sSchoolIllusion}", "#{sSchoolMysticism}", "#{sSchoolRestoration}"};
|
||||||
|
|
||||||
ToolTips::ToolTips() :
|
ToolTips::ToolTips() :
|
||||||
Layout("openmw_tooltips.layout")
|
Layout("openmw_tooltips.layout")
|
||||||
|
@ -220,6 +222,12 @@ namespace MWGui
|
||||||
params.mNoTarget = false;
|
params.mNoTarget = false;
|
||||||
effects.push_back(params);
|
effects.push_back(params);
|
||||||
}
|
}
|
||||||
|
if (MWMechanics::spellIncreasesSkill(spell)) // display school of spells that contribute to skill progress
|
||||||
|
{
|
||||||
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
int school = MWMechanics::getSpellSchool(spell, player);
|
||||||
|
info.text = "#{sSchool}: " + sSchoolNames[school];
|
||||||
|
}
|
||||||
info.effects = effects;
|
info.effects = effects;
|
||||||
tooltipSize = createToolTip(info);
|
tooltipSize = createToolTip(info);
|
||||||
}
|
}
|
||||||
|
@ -739,19 +747,11 @@ namespace MWGui
|
||||||
icon.insert(slashPos+1, "b_");
|
icon.insert(slashPos+1, "b_");
|
||||||
icon = Misc::ResourceHelpers::correctIconPath(icon);
|
icon = Misc::ResourceHelpers::correctIconPath(icon);
|
||||||
|
|
||||||
std::vector<std::string> schools;
|
|
||||||
schools.push_back ("#{sSchoolAlteration}");
|
|
||||||
schools.push_back ("#{sSchoolConjuration}");
|
|
||||||
schools.push_back ("#{sSchoolDestruction}");
|
|
||||||
schools.push_back ("#{sSchoolIllusion}");
|
|
||||||
schools.push_back ("#{sSchoolMysticism}");
|
|
||||||
schools.push_back ("#{sSchoolRestoration}");
|
|
||||||
|
|
||||||
widget->setUserString("ToolTipType", "Layout");
|
widget->setUserString("ToolTipType", "Layout");
|
||||||
widget->setUserString("ToolTipLayout", "MagicEffectToolTip");
|
widget->setUserString("ToolTipLayout", "MagicEffectToolTip");
|
||||||
widget->setUserString("Caption_MagicEffectName", "#{" + name + "}");
|
widget->setUserString("Caption_MagicEffectName", "#{" + name + "}");
|
||||||
widget->setUserString("Caption_MagicEffectDescription", effect->mDescription);
|
widget->setUserString("Caption_MagicEffectDescription", effect->mDescription);
|
||||||
widget->setUserString("Caption_MagicEffectSchool", "#{sSchool}: " + schools[effect->mData.mSchool]);
|
widget->setUserString("Caption_MagicEffectSchool", "#{sSchool}: " + sSchoolNames[effect->mData.mSchool]);
|
||||||
widget->setUserString("ImageTexture_MagicEffectImage", icon);
|
widget->setUserString("ImageTexture_MagicEffectImage", icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,8 @@ namespace MWGui
|
||||||
/// Adjust position for a tooltip so that it doesn't leave the screen and does not obscure the mouse cursor
|
/// Adjust position for a tooltip so that it doesn't leave the screen and does not obscure the mouse cursor
|
||||||
void position(MyGUI::IntPoint& position, MyGUI::IntSize size, MyGUI::IntSize viewportSize);
|
void position(MyGUI::IntPoint& position, MyGUI::IntSize size, MyGUI::IntSize viewportSize);
|
||||||
|
|
||||||
|
static std::string sSchoolNames[6];
|
||||||
|
|
||||||
int mHorizontalScrollIndex;
|
int mHorizontalScrollIndex;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue