Ejemplo n.º 1
0
CharSpells::CharSpells(CharGenChoices &choices, Console *console) : CharGenBase(console) {
	_choices = &choices;
	load("cg_spells");

	_currentSpellLevel = SIZE_MAX;
	_abilityLimit = 0;

	_spellHelp = new CharHelp("cg_spellinfo", console);

	// TODO: Recommend button in the spell selection for the character generator.
	getWidget("RecommendButton", true)->setDisabled(true);
	// TODO: Reset button in the spell selection for the character generator.
	getWidget("ResetButton", true)->setDisabled(true);

	_availListBox = getListBox("AvailBox", true);
	_availListBox->setMode(WidgetListBox::kModeSelectable);
	_knownListBox = getListBox("KnownBox", true);
	_knownListBox->setMode(WidgetListBox::kModeSelectable);

	for (uint32 lvl = 0; lvl < 10; ++lvl) {
		WidgetButton *spellLvlButton = getButton("SpellLevel" + Common::composeString<uint32>(lvl), true);
		spellLvlButton->setTooltip(TalkMan.getString(68674 + lvl));
		spellLvlButton->setTooltipPosition(20.f, -40.f, -100.f);

		// TODO: The button should be render properly when pressed.
		spellLvlButton->setMode(WidgetButton::kModeUnchanged);
		spellLvlButton->setPressed(false);
	}

	makeSpellsList();
}
Ejemplo n.º 2
0
PartyLeader::PartyLeader(Module &module) : _module(&module),
	_currentHP(1), _maxHP(1) {

	// The panel

	WidgetPanel *playerPanel = new WidgetPanel(*this, "LeaderPanel", "pnl_party_bar");

	playerPanel->setPosition(- playerPanel->getWidth(), 0.0, 0.0);

	addWidget(playerPanel);


	// Buttons

	float buttonsX = - playerPanel->getWidth () +  4.0;
	float buttonsY = - playerPanel->getHeight() + 57.0;

	for (int i = 0; i < 8; i++) {
		WidgetButton *button = new WidgetButton(*this, kButtonTags[i], kButtonModels[i]);

		button->setTooltip(TalkMan.getString(kButtonTooltips[i]));
		button->setTooltipPosition(0.0, -10.0, -1.0);

		const float x = buttonsX + ((i / 4) * 36.0);
		const float y = buttonsY - ((i % 4) * 18.0);
		const float z = -100.0;

		button->setPosition(x, y, z);

		addWidget(button);
	}

	getWidget("ButtonPlayers", true)->setDisabled(true);


	// Portrait

	_portrait =
		new PortraitWidget(*this, "LeaderPortrait", "gui_po_nwnlogo_", Portrait::kSizeMedium);

	_portrait->setPosition(-67.0, -103.0, -100.0);
	_portrait->setTooltipPosition(-50.0, 50.0, -1.0);

	addWidget(_portrait);


	// Health bar

	_health = new QuadWidget(*this, "LeaderHealthbar", "", 0.0, 0.0, 6.0, 100.0);

	_health->setColor(1.0, 0.0, 0.0, 1.0);
	_health->setPosition(-76.0, -103.0, -100.0);

	addWidget(_health);


	updatePortraitTooltip();
	notifyResized(0, 0, GfxMan.getScreenWidth(), GfxMan.getScreenHeight());
}