mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 00:20:16 +00:00
Add body type selection for nonbinary characters and reduce preview rotation sensitivity
Nonbinary characters can now choose between masculine and feminine body types in character creation, with real-time preview updates and full appearance customization. Body type preference is saved to character config and persists across sessions. Also reduces character preview drag-to-rotate sensitivity from 0.5 to 0.2 for better control.
This commit is contained in:
parent
e7f8fb557c
commit
1603456120
8 changed files with 50 additions and 11 deletions
|
|
@ -5925,6 +5925,7 @@ void GameHandler::saveCharacterConfig() {
|
|||
|
||||
out << "character_guid=" << playerGuid << "\n";
|
||||
out << "gender=" << static_cast<int>(ch->gender) << "\n";
|
||||
out << "use_female_model=" << (ch->useFemaleModel ? 1 : 0) << "\n";
|
||||
for (int i = 0; i < ACTION_BAR_SLOTS; i++) {
|
||||
out << "action_bar_" << i << "_type=" << static_cast<int>(actionBar[i].type) << "\n";
|
||||
out << "action_bar_" << i << "_id=" << actionBar[i].id << "\n";
|
||||
|
|
@ -5945,6 +5946,7 @@ void GameHandler::loadCharacterConfig() {
|
|||
std::array<uint32_t, ACTION_BAR_SLOTS> ids{};
|
||||
bool hasSlots = false;
|
||||
int savedGender = -1;
|
||||
int savedUseFemaleModel = -1;
|
||||
|
||||
std::string line;
|
||||
while (std::getline(in, line)) {
|
||||
|
|
@ -5957,6 +5959,8 @@ void GameHandler::loadCharacterConfig() {
|
|||
try { savedGuid = std::stoull(val); } catch (...) {}
|
||||
} else if (key == "gender") {
|
||||
try { savedGender = std::stoi(val); } catch (...) {}
|
||||
} else if (key == "use_female_model") {
|
||||
try { savedUseFemaleModel = std::stoi(val); } catch (...) {}
|
||||
} else if (key.rfind("action_bar_", 0) == 0) {
|
||||
// Parse action_bar_N_type or action_bar_N_id
|
||||
size_t firstUnderscore = 11; // length of "action_bar_"
|
||||
|
|
@ -5984,12 +5988,16 @@ void GameHandler::loadCharacterConfig() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Apply saved gender (allows nonbinary to persist even though server only stores male/female)
|
||||
// Apply saved gender and body type (allows nonbinary to persist even though server only stores male/female)
|
||||
if (savedGender >= 0 && savedGender <= 2) {
|
||||
for (auto& character : characters) {
|
||||
if (character.guid == playerGuid) {
|
||||
character.gender = static_cast<Gender>(savedGender);
|
||||
LOG_INFO("Applied saved gender: ", getGenderName(character.gender));
|
||||
if (savedUseFemaleModel >= 0) {
|
||||
character.useFemaleModel = (savedUseFemaleModel != 0);
|
||||
}
|
||||
LOG_INFO("Applied saved gender: ", getGenderName(character.gender),
|
||||
", body type: ", (character.useFemaleModel ? "feminine" : "masculine"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue