本文整理汇总了C++中LocalPlayer::setSprite方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalPlayer::setSprite方法的具体用法?C++ LocalPlayer::setSprite怎么用?C++ LocalPlayer::setSprite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalPlayer
的用法示例。
在下文中一共展示了LocalPlayer::setSprite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readPlayerData
LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot)
{
LocalPlayer *tempPlayer = new LocalPlayer;
slot = msg.readInt8(); // character slot
tempPlayer->setName(msg.readString());
tempPlayer->setGender(msg.readInt8() == GENDER_MALE ? GENDER_MALE : GENDER_FEMALE);
int hs = msg.readInt8(), hc = msg.readInt8();
tempPlayer->setSprite(Player::HAIR_SPRITE, hs * -1, ColorDB::get(hc));
tempPlayer->setLevel(msg.readInt16());
tempPlayer->setCharacterPoints(msg.readInt16());
tempPlayer->setCorrectionPoints(msg.readInt16());
tempPlayer->setMoney(msg.readInt32());
for (int i = 0; i < 7; i++)
{
tempPlayer->setAttributeBase(i, msg.readInt8());
}
return tempPlayer;
}
示例2: readPlayerData
void CharServerHandler::readPlayerData(Net::MessageIn &msg, Net::Character *character)
{
const Token &token =
static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
LocalPlayer *tempPlayer = new LocalPlayer(msg.readInt32(), 0);
tempPlayer->setGender(token.sex);
character->data.mAttributes[EXP] = msg.readInt32();
character->data.mAttributes[MONEY] = msg.readInt32();
character->data.mStats[JOB].exp = msg.readInt32();
int temp = msg.readInt32();
character->data.mStats[JOB].base = temp;
character->data.mStats[JOB].mod = temp;
tempPlayer->setSprite(SPRITE_SHOE, msg.readInt16());
tempPlayer->setSprite(SPRITE_GLOVES, msg.readInt16());
tempPlayer->setSprite(SPRITE_CAPE, msg.readInt16());
tempPlayer->setSprite(SPRITE_MISC1, msg.readInt16());
msg.readInt32(); // option
msg.readInt32(); // karma
msg.readInt32(); // manner
msg.skip(2); // unknown
character->data.mAttributes[HP] = msg.readInt16();
character->data.mAttributes[MAX_HP] = msg.readInt16();
character->data.mAttributes[MP] = msg.readInt16();
character->data.mAttributes[MAX_MP] = msg.readInt16();
msg.readInt16(); // speed
tempPlayer->setSubtype(msg.readInt16()); // class (used for race)
int hairStyle = msg.readInt16();
Uint16 weapon = msg.readInt16();
tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", true);
character->data.mAttributes[LEVEL] = msg.readInt16();
msg.readInt16(); // skill point
tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, msg.readInt16()); // head bottom
tempPlayer->setSprite(SPRITE_SHIELD, msg.readInt16());
tempPlayer->setSprite(SPRITE_HAT, msg.readInt16()); // head option top
tempPlayer->setSprite(SPRITE_TOPCLOTHES, msg.readInt16()); // head option mid
tempPlayer->setSprite(SPRITE_HAIR, hairStyle * -1, ColorDB::get(msg.readInt16()));
tempPlayer->setSprite(SPRITE_MISC2, msg.readInt16());
tempPlayer->setName(msg.readString(24));
character->dummy = tempPlayer;
for (int i = 0; i < 6; i++)
character->data.mStats[i + STR].base = msg.readInt8();
character->slot = msg.readInt8(); // character slot
msg.readInt8(); // unknown
}
示例3: readPlayerData
void CharServerHandler::readPlayerData(Net::MessageIn &msg,
Net::Character *character,
bool withColors)
{
if (!character)
return;
const Token &token =
static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
LocalPlayer *tempPlayer = new LocalPlayer(msg.readInt32(), 0);
tempPlayer->setGender(token.sex);
PlayerInfoBackend &data = character->data;
data.mAttributes[EXP] = msg.readInt32();
data.mAttributes[MONEY] = msg.readInt32();
data.mStats[JOB].exp = msg.readInt32();
int temp = msg.readInt32();
data.mStats[JOB].base = temp;
data.mStats[JOB].mod = temp;
int shoes = msg.readInt16();
int gloves = msg.readInt16();
int cape = msg.readInt16();
int misc1 = msg.readInt16();
msg.readInt32(); // option
msg.readInt32(); // karma
msg.readInt32(); // manner
msg.readInt16(); // character points left
data.mAttributes[HP] = msg.readInt16();
data.mAttributes[MAX_HP] = msg.readInt16();
data.mAttributes[MP] = msg.readInt16();
data.mAttributes[MAX_MP] = msg.readInt16();
msg.readInt16(); // speed
tempPlayer->setSubtype(msg.readInt16()); // class (used for race)
int hairStyle = msg.readInt16();
uint16_t weapon = msg.readInt16(); // server not used it. may be need use?
tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
data.mAttributes[LEVEL] = msg.readInt16();
msg.readInt16(); // skill point
int bottomClothes = msg.readInt16();
int shield = msg.readInt16();
int hat = msg.readInt16(); // head option top
int topClothes = msg.readInt16();
tempPlayer->setSprite(SPRITE_HAIR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(msg.readInt16()));
int misc2 = msg.readInt16();
tempPlayer->setName(msg.readString(24));
character->dummy = tempPlayer;
for (int i = 0; i < 6; i++)
character->data.mStats[i + STR].base = msg.readInt8();
if (withColors)
{
tempPlayer->setSprite(SPRITE_SHOE, shoes, "", msg.readInt8());
tempPlayer->setSprite(SPRITE_GLOVES, gloves, "", msg.readInt8());
tempPlayer->setSprite(SPRITE_CAPE, cape, "", msg.readInt8());
tempPlayer->setSprite(SPRITE_MISC1, misc1, "", msg.readInt8());
tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, bottomClothes,
"", msg.readInt8());
//to avoid show error (error.xml) need remove this sprite
if (!config.getBoolValue("hideShield"))
tempPlayer->setSprite(SPRITE_SHIELD, shield, "", msg.readInt8());
else
msg.readInt8();
tempPlayer->setSprite(SPRITE_HAT, hat, "",
msg.readInt8()); // head option top
tempPlayer->setSprite(SPRITE_TOPCLOTHES, topClothes, "",
msg.readInt8());
tempPlayer->setSprite(SPRITE_MISC2, misc2, "", msg.readInt8());
msg.skip(5);
character->slot = msg.readInt8(); // character slot
}
else
{
tempPlayer->setSprite(SPRITE_SHOE, shoes);
tempPlayer->setSprite(SPRITE_GLOVES, gloves);
tempPlayer->setSprite(SPRITE_CAPE, cape);
tempPlayer->setSprite(SPRITE_MISC1, misc1);
tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, bottomClothes);
//to avoid show error (error.xml) need remove this sprite
if (!config.getBoolValue("hideShield"))
tempPlayer->setSprite(SPRITE_SHIELD, shield);
tempPlayer->setSprite(SPRITE_HAT, hat); // head option top
tempPlayer->setSprite(SPRITE_TOPCLOTHES, topClothes);
tempPlayer->setSprite(SPRITE_MISC2, misc2);
character->slot = msg.readInt8(); // character slot
//.........这里部分代码省略.........