示例#1
0
/**
 * @brief Use current skin for all team members onboard.
 */
static void CL_ChangeSkinForWholeTeam_f (void)
{
	/* Get selected skin and fall back to default skin if it is not valid. */
	const int newSkin = CL_FixActorSkinIDX(Cvar_GetInteger("mn_body_skin"));
	/* Apply new skin to all (shown/displayed) team-members. */
	/** @todo What happens if a model of a team member does not have the selected skin? */
	LIST_Foreach(chrDisplayList, character_t, chr) {
		/** @todo Get the skin id from the model by using the actorskin id */
		/** @todo Or remove skins from models and convert character_t->skin to string */
		chr->bodySkin = newSkin;
	}
}
示例#2
0
/**
 * @brief Change the skin of the selected actor.
 */
static void CL_ChangeSkin_f (void)
{
	const int sel = cl_selected->integer;
	character_t* chr = (character_t*)LIST_GetByIdx(chrDisplayList, sel);
	if (chr == nullptr) {
		return;
	}
	const int newSkin = CL_FixActorSkinIDX(Cvar_GetInteger("mn_body_skin"));
	Cvar_SetValue("mn_body_skin", newSkin);
	/** @todo Get the skin id from the model by using the actorskin id */
	/** @todo Or remove skins from models and convert character_t->skin to string */
	chr->bodySkin = newSkin;
}
示例#3
0
/**
 * @brief Use current skin for all team members onboard.
 */
static void CL_ChangeSkinForWholeTeam_f (void)
{
	int newSkin, i;

	/* Get selected skin and fall back to default skin if it is not valid. */
	newSkin = Cvar_GetInteger("mn_body_skin");
	newSkin = CL_FixActorSkinIDX(newSkin);

	/* Apply new skin to all (shown/displayed) team-members. */
	/** @todo What happens if a model of a team member does not have the selected skin? */
	for (i = 0; i < chrDisplayList.num; i++) {
		character_t *chr = chrDisplayList.chr[i];
		assert(chr);
		/** @todo Get the skin id from the model by using the actorskin id */
		/** @todo Or remove skins from models and convert character_t->skin to string */
		chr->bodySkin = newSkin;
	}
}
示例#4
0
/**
 * @brief Change the skin of the selected actor.
 */
static void CL_ChangeSkin_f (void)
{
	const int sel = cl_selected->integer;

	if (sel >= 0 && sel < chrDisplayList.num) {
		int newSkin = Cvar_GetInteger("mn_body_skin");
		character_t *chr = chrDisplayList.chr[sel];
		newSkin = CL_FixActorSkinIDX(newSkin);

		if (chr) {
			/** @todo Get the skin id from the model by using the actorskin id */
			/** @todo Or remove skins from models and convert character_t->skin to string */
			chr->bodySkin = newSkin;

			Cvar_SetValue("mn_body_skin", newSkin);
			Cvar_Set("mn_skinname", CL_GetTeamSkinName(newSkin));
		}
	}
}