mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(glue): implement Script_SetCharacterCreateFacing
This commit is contained in:
parent
c494bb0041
commit
c82ac35e19
@ -239,6 +239,17 @@ void CCharacterCreation::SetCharCustomizeModel(const char* filename) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterCreation::SetFacing(float orientation) {
|
||||||
|
CCharacterCreation::s_charFacing = orientation;
|
||||||
|
|
||||||
|
auto characterModel = CCharacterCreation::s_character->m_data.model;
|
||||||
|
|
||||||
|
if (characterModel) {
|
||||||
|
C3Vector position = { 0.0f, 0.0f, 0.0f };
|
||||||
|
characterModel->SetWorldTransform(position, orientation, 1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CCharacterCreation::SetSelectedClass(int32_t classID) {
|
void CCharacterCreation::SetSelectedClass(int32_t classID) {
|
||||||
if (!CCharacterCreation::IsClassValid(classID)) {
|
if (!CCharacterCreation::IsClassValid(classID)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class CCharacterCreation {
|
|||||||
static bool IsClassValid(int32_t classID);
|
static bool IsClassValid(int32_t classID);
|
||||||
static void ResetCharCustomizeInfo();
|
static void ResetCharCustomizeInfo();
|
||||||
static void SetCharCustomizeModel(const char* filename);
|
static void SetCharCustomizeModel(const char* filename);
|
||||||
|
static void SetFacing(float orientation);
|
||||||
static void SetSelectedClass(int32_t classID);
|
static void SetSelectedClass(int32_t classID);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -273,7 +273,16 @@ int32_t Script_GetCharacterCreateFacing(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_SetCharacterCreateFacing(lua_State* L) {
|
int32_t Script_SetCharacterCreateFacing(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (!lua_isnumber(L, 1)) {
|
||||||
|
luaL_error(L, "Usage: SetCharacterCreateFacing(degrees)");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto orientation = lua_tonumber(L, 1) * 0.017453292;
|
||||||
|
|
||||||
|
CCharacterCreation::SetFacing(orientation);
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetRandomName(lua_State* L) {
|
int32_t Script_GetRandomName(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user