Tooltip::Tooltip(Type type, Graphics::Aurora::Model &parent) : _type(type), _parentWidget(0), _parentModel(&parent), _empty(true), _visible(false), _align(0.0), _bubble(0), _portrait(0), _offscreen(false), _x(0.0), _y(0.0), _z(0.0), _lineHeight(0.0), _lineSpacing(0.0), _width(0.0), _height(0.0), _needCamera(true), _detectEdge(false) { getFeedbackMode(_showBubble, _showText, _showPortrait); }
void Tooltip::redoLines() { bool needRedo = false; Common::UString fontName = getFontName(); if (fontName != _font) { needRedo = true; for (std::vector<Line>::iterator l = _lines.begin(); l != _lines.end(); ++l) { delete l->text; l->text = 0; } _font = fontName; Graphics::Aurora::FontHandle font = FontMan.get(_font); _lineHeight = font.getFont().getHeight(); _lineSpacing = font.getFont().getLineSpacing(); _width = 0.0; _height = 0.0; } bool showBubble, showText, showPortrait; getFeedbackMode(showBubble, showText, showPortrait); if ((showBubble != _showBubble ) || (showText != _showText ) || (showPortrait != _showPortrait)) { needRedo = true; _width = 0.0; _height = 0.0; _showBubble = showBubble; _showText = showText; _showPortrait = showPortrait; } if (needRedo) redoLayout(); }
void Tooltip::redoLines(bool force) { bool needRedo = force; bool showBubble, showText, showPortrait; getFeedbackMode(showBubble, showText, showPortrait); const Common::UString fontName = getFontName(); if ((fontName != _font ) || (showBubble != _showBubble ) || (showText != _showText ) || (showPortrait != _showPortrait)) { _font = fontName; _showBubble = showBubble; _showText = showText; _showPortrait = showPortrait; needRedo = true; } if (!needRedo) return; Graphics::Aurora::FontHandle font = FontMan.get(_font); _lineHeight = font.getFont().getHeight(); _lineSpacing = font.getFont().getLineSpacing(); _width = 0.0f; _height = 0.0f; if (!createTexts(100.0f, 3)) if (!createTexts(150.f, 3)) createTexts(300.0f); redoLayout(); }