Example #1
0
WidgetListItemButton::WidgetListItemButton(::Engines::GUI &gui, const Common::UString &button,
                                           const Common::UString &text, const Common::UString &icon,
                                           uint32 otherButtons, const Common::UString &soundClick) :
                                           WidgetListItemBaseButton(gui, button, 1.0f, soundClick),
                                           _isRight(true) {

	_text = new Graphics::Aurora::Text(FontMan.get("fnt_galahad14"), text);

	if (icon == "") {
		_icon = 0;
	} else {
		_icon = new Portrait(icon, Portrait::kSizeIcon);
	}

	if (otherButtons & kHelpButton) {
		_helpButton = loadModelGUI("ctl_cg_btn_help");
	} else {
		_helpButton = 0;
	}

	if (otherButtons & kMoveButton) {
		_isMovable = true;
		_moveButtonRight = new WidgetButton(gui, "Item#" + text + "#MoveButtonRight", "ctl_cg_btn_right");
		_moveButtonLeft  = new WidgetButton(gui, "Item#" + text + "#MoveButtonLeft", "ctl_cg_btn_left");

		addSub(*_moveButtonRight);
		addSub(*_moveButtonLeft);

	} else {
		_isMovable = false;
		_moveButtonLeft = 0;
		_moveButtonRight = 0;
	}
}
Example #2
0
void Tooltip::redoBubble() {
	delete _bubble;
	_bubble = 0;

	if (!_showBubble || (_height <= 0.0))
		return;

	float  height = _height - _lineHeight;
	uint32 lines  = 1;

	while (height > _lineSpacing) {
		height -= (_lineSpacing + _lineHeight);
		lines++;
	}

	Common::UString bubbleModel = getBubbleModel(lines, _width);

	_bubble = loadModelGUI(bubbleModel);
	if (!_bubble) {
		warning("Tooltip::redoBubble(): Failed loading model \"%s\"", bubbleModel.c_str());
		return;
	}

	_bubble->setTag("Tooltip#Bubble");
}
Example #3
0
ModelWidget::ModelWidget(::Engines::GUI &gui, const Common::UString &tag,
                         const Common::UString &model) : NWNWidget(gui, tag) {

	if (!(_model = loadModelGUI(model)))
		throw Common::Exception("Can't load model \"%s\" for widget \"%s\"",
				model.c_str(), tag.c_str());

	_model->setTag(tag);
}
Example #4
0
WidgetListItemBaseButton::WidgetListItemBaseButton(::Engines::GUI &gui,
                                                   const Common::UString &button, float spacing,
                                                   const Common::UString &soundClick) :
                                                   WidgetListItem(gui), _spacing(spacing),
                                                   _sound(soundClick) {

	_button = loadModelGUI(button);
	assert(_button);

	_button->setClickable(true);
	_channelHandle = Sound::ChannelHandle();
}