From 3b17e20fb912be83a2550e6abf4910fb1d0e00bd Mon Sep 17 00:00:00 2001 From: rarified Date: Fri, 25 Feb 2022 15:28:04 -0700 Subject: [PATCH] Revert "Initial port of Mystler's code" This reverts commit b0511ea06879e24d8e46b888de6d1d5c0dea41fd. --- .../Plasma/FeatureLib/pfPython/cyAvatar.cpp | 54 ------------------- Sources/Plasma/FeatureLib/pfPython/cyAvatar.h | 3 -- .../FeatureLib/pfPython/cyAvatarGlue.cpp | 27 +--------- 3 files changed, 1 insertion(+), 83 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp index c903fe4d..2c7d61da 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp @@ -1600,60 +1600,6 @@ void cyAvatar::PlaySimpleAnimation(const char* animName) } } -///////////////////////////////////////////////////////////////////////////// -// -// Function : SaveClothingToFile -// PARAMETERS : filename - file to save to -// -// PURPOSE : Save the avatar's clothing to a file. If only a filename is -// given, it will write to UserData/Avatars. -// -bool cyAvatar::SaveClothingToFile(plFileName filename) -{ - if (fRecvr.Count() > 0) { - plArmatureMod* avatar = plAvatarMgr::FindAvatar(fRecvr[0]); - if (avatar) { - plClothingOutfit* cl = avatar->GetClothingOutfit(); - if (cl) { - // Save file in UserData/Avatars if only a filename is given - if (!filename.StripFileName().IsValid()) { - plFileName path = plFileName::Join(plFileSystem::GetUserDataPath(), "Avatars"); - plFileSystem::CreateDir(path, true); - filename = plFileName::Join(path, filename); - } - return cl->WriteToFile(filename); - } - } - } - return false; -} - -///////////////////////////////////////////////////////////////////////////// -// -// Function : LoadClothingFromFile -// PARAMETERS : filename - file to load from -// -// PURPOSE : Load the avatar's clothing from a file. If only a filename is -// given, it will read from UserData/Avatars. -// -bool cyAvatar::LoadClothingFromFile(plFileName filename) -{ - if (fRecvr.Count() > 0) { - plArmatureMod* avatar = plAvatarMgr::FindAvatar(fRecvr[0]); - if (avatar) { - plClothingOutfit* cl = avatar->GetClothingOutfit(); - if (cl) { - // Search for file in UserData/Avatars if only a filename is given - if (!filename.StripFileName().IsValid()) - filename = plFileName::Join(plFileSystem::GetUserDataPath(), "Avatars", filename); - cl->SetClothingFile(filename); - return cl->ReadClothing(); - } - } - } - return false; -} - ///////////////////////////////////////////////////////////////////////////// // // Function : ChangeAvatar diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h index f2aa1e92..168c748b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h @@ -414,9 +414,6 @@ public: virtual void PlaySimpleAnimation(const char* animName); - virtual bool SaveClothingToFile(plFileName filename); - virtual bool LoadClothingFromFile(plFileName filename); - ///////////////////////////////////////////////////////////////////////////// // // Function : ChangeAvatar diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp index f40ded3e..96b39c2c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp @@ -607,29 +607,6 @@ PYTHON_METHOD_DEFINITION(ptAvatar, setDontPanicLink, args) self->fThis->SetDontPanicLink(value); PYTHON_RETURN_NONE; - -PYTHON_METHOD_DEFINITION(ptAvatar, saveClothingToFile, args) -{ - PyObject* filename; - if (!PyArg_ParseTuple(args, "O", &filename) || !PyString_CheckEx(filename)) - { - PyErr_SetString(PyExc_TypeError, "saveClothingToFile expects a string object"); - PYTHON_RETURN_ERROR; - } - - PYTHON_RETURN_BOOL(self->fThis->SaveClothingToFile(PyString_AsStringEx(filename))); -} - -PYTHON_METHOD_DEFINITION(ptAvatar, loadClothingFromFile, args) -{ - PyObject* filename; - if (!PyArg_ParseTuple(args, "O", &filename) || !PyString_CheckEx(filename)) - { - PyErr_SetString(PyExc_TypeError, "loadClothingFromFile expects a string object"); - PYTHON_RETURN_ERROR; - } - - PYTHON_RETURN_BOOL(self->fThis->LoadClothingFromFile(PyString_AsStringEx(filename))); } PYTHON_START_METHODS_TABLE(ptAvatar) @@ -688,8 +665,6 @@ PYTHON_START_METHODS_TABLE(ptAvatar) PYTHON_METHOD(ptAvatar, playSimpleAnimation, "Params: animName\nPlay simple animation on avatar"), PYTHON_METHOD(ptAvatar, setDontPanicLink, "Params: value\nDisables panic linking to Personal Age (warps the avatar back to the start instead)"), - PYTHON_METHOD(ptAvatar, saveClothingToFile, "Params: filename\nSave avatar clothing to a file"), - PYTHON_METHOD(ptAvatar, loadClothingFromFile, "Params: filename\nLoad avatar clothing from a file"), PYTHON_END_METHODS_TABLE; PYTHON_GLOBAL_METHOD_DEFINITION(PtSetBehaviorLoopCount, args, "Params: behaviorKey,stage,loopCount,netForce\nThis will set the loop count for a particular stage in a multistage behavior") @@ -938,4 +913,4 @@ void cyAvatar::AddPlasmaConstantsClasses(PyObject *m) PYTHON_ENUM_ELEMENT(PtBehaviorTypes, kBehaviorTypeLinkIn, plHBehavior::kBehaviorTypeLinkIn); PYTHON_ENUM_ELEMENT(PtBehaviorTypes, kBehaviorTypeLinkOut, plHBehavior::kBehaviorTypeLinkOut); PYTHON_ENUM_END(m, PtBehaviorTypes); -} +} \ No newline at end of file