예제 #1
0
CharacterGeneration::CharacterGeneration(KotORBase::Module *module,
                                         CharacterGenerationInfo *info,
                                         Engines::Console *console) :
		KotORBase::GUI(console),
		_module(module),
		_chargenInfo(info),
		_step(0) {

	load("maincg_p");

	switch (_chargenInfo->getClass()) {
		case KotORBase::kClassJediConsular:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(354));
			break;
		case KotORBase::kClassJediGuardian:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(355));
			break;
		case KotORBase::kClassJediSentinel:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(353));
			break;
		default:
			getLabel("LBL_CLASS")->setText("");
	}

	getLabel("LBL_NAME")->setText("");
	getLabel("LBL_LEVEL_VAL")->setText("");

	getLabel("PORTRAIT_LBL")->setFill(_chargenInfo->getPortrait());

	showQuickOrCustom();
}
예제 #2
0
CharacterGenerationMenu::CharacterGenerationMenu(Module *module, CharacterGenerationInfo *pc, Console *console) :
		GUI(console), _module(module), _pc(pc), _step(0), _charSubScene(new Graphics::Aurora::SubSceneQuad) {

	load("maincg");

	addBackground(kBackgroundTypeMenu);

	getLabel("VIT_ARROW_LBL")->setText("");
	getLabel("DEF_ARROW_LBL")->setText("");

	getLabel("LBL_NAME")->setText("");

	// Set the class title according to the class of the character
	switch (pc->getClass()) {
		case kClassSoldier:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(134));
			break;
		case kClassScout:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(133));
			break;
		case kClassScoundrel:
			getLabel("LBL_CLASS")->setText(TalkMan.getString(135));
			break;
		default:
			getLabel("LBL_CLASS")->setText("");
	}

	getLabel("WILL_ARROW_LBL")->setText("");
	getLabel("REFL_ARROW_LBL")->setText("");
	getLabel("FORT_ARROW_LBL")->setText("");

	getLabel("PORTRAIT_LBL")->setFill(_pc->getPortrait());

	getWidget("NEW_LBL")->setInvisible(true);
	getWidget("OLD_LBL")->setInvisible(true);

	getWidget("LBL_LEVEL_VAL")->setInvisible(true);
	getWidget("LBL_LEVEL")->setInvisible(true);

	float subSceneWidth = getLabel("MODEL_LBL")->getWidth();
	float subSceneHeight = getLabel("MODEL_LBL")->getHeight();

	glm::mat4 projection(glm::perspective(Common::deg2rad(22.72f), subSceneWidth/subSceneHeight, 0.1f, 10.0f));

	/*
	 * TODO: These values are extracted using apitrace from the original game.
	 * They should be replaced with a more straight forward matrix transformation expression.
	 */
	float modelView[] = {
			0.000900542, 0.0176735, 0.999843, 0,
			0.999999, 0.000900542, -0.00091657, 0,
			-0.00091657, 0.999843, -0.0176727, 0,
			0, 0, 0, 1
	};

	glm::mat4 transformation(glm::make_mat4(modelView));

	transformation = glm::translate(transformation, glm::vec3(-4.87251f, 0.0f, -0.776371f));

	transformation = glm::rotate(transformation,
			Common::deg2rad(-90.0f),
			glm::vec3(0.0f, 0.0f, 1.0f));

	getLabel("MODEL_LBL")->setSubScene(_charSubScene.get());
	_charSubScene->add(_pc->getModel());
	_charSubScene->setProjectionMatrix(projection);
	_charSubScene->setGlobalTransformationMatrix(transformation);

	showQuickOrCustom();
}