mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Add character creation screen with race/class/appearance customization
Implements a full character creation UI integrated into the existing flow. In single-player mode, auth screen now goes to character creation before entering the world. In online mode, a "Create Character" button on the character selection screen sends CMSG_CHAR_CREATE to the server. Includes WoW 3.3.5a race/class combo validation and appearance range limits.
This commit is contained in:
parent
129bbac9b3
commit
0605d1522d
16 changed files with 611 additions and 30 deletions
42
include/ui/character_create_screen.hpp
Normal file
42
include/ui/character_create_screen.hpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
|
||||
#include "game/character.hpp"
|
||||
#include "game/world_packets.hpp"
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
namespace wowee {
|
||||
namespace game { class GameHandler; }
|
||||
|
||||
namespace ui {
|
||||
|
||||
class CharacterCreateScreen {
|
||||
public:
|
||||
CharacterCreateScreen();
|
||||
|
||||
void render(game::GameHandler& gameHandler);
|
||||
void setOnCreate(std::function<void(const game::CharCreateData&)> cb) { onCreate = std::move(cb); }
|
||||
void setOnCancel(std::function<void()> cb) { onCancel = std::move(cb); }
|
||||
void setStatus(const std::string& msg, bool isError = false);
|
||||
void reset();
|
||||
|
||||
private:
|
||||
char nameBuffer[13] = {}; // WoW max name = 12 chars + null
|
||||
int raceIndex = 0;
|
||||
int classIndex = 0;
|
||||
int genderIndex = 0;
|
||||
int skin = 0, face = 0, hairStyle = 0, hairColor = 0, facialHair = 0;
|
||||
std::string statusMessage;
|
||||
bool statusIsError = false;
|
||||
|
||||
std::vector<game::Class> availableClasses;
|
||||
void updateAvailableClasses();
|
||||
|
||||
std::function<void(const game::CharCreateData&)> onCreate;
|
||||
std::function<void()> onCancel;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue