2012-04-14 15:47:44 +00:00
|
|
|
|
|
|
|
#ifndef MWGUI_TOOLTIPS_H
|
|
|
|
#define MWGUI_TOOLTIPS_H
|
|
|
|
|
|
|
|
#include <openengine/gui/layout.hpp>
|
2012-04-15 15:10:08 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2012-04-14 15:47:44 +00:00
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2012-04-15 19:14:14 +00:00
|
|
|
class WindowManager;
|
|
|
|
|
2012-04-16 17:14:05 +00:00
|
|
|
// Info about tooltip that is supplied by the MWWorld::Class object
|
|
|
|
struct ToolTipInfo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-18 14:53:56 +00:00
|
|
|
ToolTipInfo() :
|
|
|
|
effects(0)
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2012-04-16 17:14:05 +00:00
|
|
|
std::string caption;
|
|
|
|
std::string text;
|
2012-04-16 20:58:16 +00:00
|
|
|
std::string icon;
|
2012-04-16 17:14:05 +00:00
|
|
|
|
2012-04-18 14:53:56 +00:00
|
|
|
// enchantment (for cloth, armor, weapons)
|
2012-04-29 22:57:41 +00:00
|
|
|
std::string enchant;
|
2012-04-18 14:53:56 +00:00
|
|
|
|
|
|
|
// effects (for potions, ingredients)
|
|
|
|
const ESM::EffectList* effects;
|
2012-04-16 17:14:05 +00:00
|
|
|
};
|
|
|
|
|
2012-04-14 15:47:44 +00:00
|
|
|
class ToolTips : public OEngine::GUI::Layout
|
|
|
|
{
|
|
|
|
public:
|
2012-04-15 19:14:14 +00:00
|
|
|
ToolTips(WindowManager* windowManager);
|
2012-04-14 15:47:44 +00:00
|
|
|
|
|
|
|
void onFrame(float frameDuration);
|
|
|
|
|
|
|
|
void enterGameMode();
|
|
|
|
void enterGuiMode();
|
|
|
|
|
2012-04-16 13:00:44 +00:00
|
|
|
void toggleFullHelp(); ///< show extra info in item tooltips (owner, script)
|
2012-04-16 20:58:16 +00:00
|
|
|
bool getFullHelp() const;
|
2012-04-16 13:00:44 +00:00
|
|
|
|
2012-04-15 15:10:08 +00:00
|
|
|
void setFocusObject(const MWWorld::Ptr& focus);
|
|
|
|
|
2012-04-16 20:58:16 +00:00
|
|
|
static std::string getValueString(const int value, const std::string& prefix);
|
|
|
|
///< @return "prefix: value" or "" if value is 0
|
|
|
|
|
|
|
|
static std::string getMiscString(const std::string& text, const std::string& prefix);
|
|
|
|
///< @return "prefix: text" or "" if text is empty
|
|
|
|
|
|
|
|
static std::string toString(const float value);
|
|
|
|
static std::string toString(const int value);
|
|
|
|
|
2012-05-12 11:46:03 +00:00
|
|
|
static std::string getCountString(const int value);
|
|
|
|
///< @return blank string if count is 1, or else " (value)"
|
|
|
|
|
2012-04-14 15:47:44 +00:00
|
|
|
private:
|
|
|
|
MyGUI::Widget* mDynamicToolTipBox;
|
|
|
|
|
2012-04-15 19:14:14 +00:00
|
|
|
WindowManager* mWindowManager;
|
|
|
|
|
2012-04-15 15:10:08 +00:00
|
|
|
MWWorld::Ptr mFocusObject;
|
2012-04-15 19:14:14 +00:00
|
|
|
|
|
|
|
void findImageExtension(std::string& image);
|
|
|
|
|
|
|
|
MyGUI::IntSize getToolTipViaPtr ();
|
|
|
|
///< @return requested tooltip size
|
|
|
|
|
2012-04-18 14:53:56 +00:00
|
|
|
MyGUI::IntSize createToolTip(const ToolTipInfo& info);
|
2012-04-15 22:16:35 +00:00
|
|
|
///< @return requested tooltip size
|
|
|
|
|
2012-04-14 15:47:44 +00:00
|
|
|
bool mGameMode;
|
2012-04-16 13:00:44 +00:00
|
|
|
|
|
|
|
bool mFullHelp;
|
2012-04-14 15:47:44 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|