コード例 #1
0
/**
 * Resets the palette and ignores the window
 * if there's only one target.
 */
void MultipleTargetsState::init()
{
	_game->setPalette(_game->getResourcePack()->getPalette("BACKPALS.DAT")->getColors(Palette::blockOffset(7)), Palette::backPos, 16);

	if (_targets.size() == 1)
	{
		popupTarget(*_targets.begin());
	}
}
コード例 #2
0
/**
 * Pick a target to display.
 * @param action Pointer to an action.
 */
void MultipleTargetsState::btnTargetClick(Action *action)
{
	for (size_t i = 0; i < _btnTargets.size(); ++i)
	{
		if (action->getSender() == _btnTargets[i])
		{
			popupTarget(_targets[i]);
			break;
		}
	}	
}
コード例 #3
0
/**
 * Resets the palette and ignores the window
 * if there's only one target.
 */
void MultipleTargetsState::init()
{
	if (_targets.size() == 1)
	{
		popupTarget(*_targets.begin());
	}
	else
	{
		State::init();
	}
}
コード例 #4
0
/**
 * Pick a target to display.
 * @param action Pointer to an action.
 */
void MultipleTargetsState::lstTargetsClick(Action *action)
{
	Target* t = _targets[_lstTargets->getSelectedRow()];
	popupTarget(t);
}