Browse Source

Merge branch 'master' into working

working_subtitles
rarified 3 years ago
parent
commit
a317ae4b08
  1. 8
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  2. 4
      Sources/Plasma/FeatureLib/pfPython/cyMisc.h
  3. 8
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
  4. 8
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
  5. 14
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  6. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h

8
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2602,7 +2602,7 @@ void cyMisc::WearMaintainerSuit(pyKey& key, hsBool wear)
}
void cyMisc::WearDefaultClothing(pyKey& key)
void cyMisc::WearDefaultClothing(pyKey& key, hsBool broadcast)
{
if (key.getKey() != plNetClientMgr::GetInstance()->GetLocalPlayerKey())
return;
@ -2611,11 +2611,11 @@ void cyMisc::WearDefaultClothing(pyKey& key)
if (avMod)
{
avMod->GetClothingOutfit()->WearDefaultClothing();
avMod->GetClothingOutfit()->WearDefaultClothing(broadcast);
}
}
void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type)
void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type, hsBool broadcast)
{
if (key.getKey() != plNetClientMgr::GetInstance()->GetLocalPlayerKey())
return;
@ -2624,7 +2624,7 @@ void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type)
if (avMod)
{
avMod->GetClothingOutfit()->WearDefaultClothingType(type);
avMod->GetClothingOutfit()->WearDefaultClothingType(type, broadcast);
}
}

4
Sources/Plasma/FeatureLib/pfPython/cyMisc.h

@ -875,8 +875,8 @@ public:
//
static void WearMaintainerSuit(pyKey& key, hsBool wear);
static void WearDefaultClothing(pyKey& key);
static void WearDefaultClothingType(pyKey& key, UInt32 type);
static void WearDefaultClothing(pyKey& key, hsBool broadcast = false);
static void WearDefaultClothingType(pyKey& key, UInt32 type, hsBool broadcast = false);
//////////////////////////////////////////////////////////////////////////////
//

8
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp

@ -598,11 +598,13 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtFakeLinkAvatarToObject, args, "Params: avatar,
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothingType, args, "Params: key,type\nForces the avatar to wear the default clothing of the specified type")
PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtWearDefaultClothingType, args, kw, "Params: key,type,broadcast=false\nForces the avatar to wear the default clothing of the specified type")
{
char* kwlist[] = { "key", "type", "broadcast", NULL };
PyObject* keyObj = NULL;
unsigned long type;
if (!PyArg_ParseTuple(args, "Ol", &keyObj, &type))
bool broadcast = false;
if (!PyArg_ParseTupleAndKeywords(args, kw, "Ol|b", kwlist, &keyObj, &type, &broadcast))
{
PyErr_SetString(PyExc_TypeError, "PtWearDefaultClothingType expects a ptKey and an unsigned long");
PYTHON_RETURN_ERROR;
@ -613,7 +615,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothingType, args, "Params: key,ty
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(keyObj);
cyMisc::WearDefaultClothingType(*key, type);
cyMisc::WearDefaultClothingType(*key, type, broadcast);
PYTHON_RETURN_NONE;
}

8
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

@ -529,10 +529,12 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearMaintainerSuit, args, "Params: key,wearOrN
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothing, args, "Params: key\nForces the avatar to wear the default clothing set")
PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtWearDefaultClothing, args, kw, "Params: key, broadcast=false\nForces the avatar to wear the default clothing set")
{
char* kwlist[] = { "key", "broadcast", NULL };
PyObject* keyObj = NULL;
if (!PyArg_ParseTuple(args, "O", &keyObj))
bool broadcast = false;
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|b", kwlist, &keyObj, &broadcast))
{
PyErr_SetString(PyExc_TypeError, "PtWearDefaultClothing expects a ptKey");
PYTHON_RETURN_ERROR;
@ -543,7 +545,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothing, args, "Params: key\nForce
PYTHON_RETURN_ERROR;
}
pyKey* key = pyKey::ConvertFrom(keyObj);
cyMisc::WearDefaultClothing(*key);
cyMisc::WearDefaultClothing(*key, broadcast);
PYTHON_RETURN_NONE;
}

14
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

@ -1003,7 +1003,7 @@ void plClothingOutfit::IUpdate()
}
}
void plClothingOutfit::WearDefaultClothing()
void plClothingOutfit::WearDefaultClothing(hsBool broadcast)
{
StripAccessories();
@ -1041,9 +1041,14 @@ void plClothingOutfit::WearDefaultClothing()
}
}
}
if (broadcast) {
fSynchClients = true;
ForceUpdate(true);
}
}
void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType)
void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType, hsBool broadcast)
{
plClothingMgr *cMgr = plClothingMgr::GetClothingMgr();
hsTArray<plClothingItem *> items;
@ -1072,6 +1077,11 @@ void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType)
break;
}
}
if (broadcast) {
fSynchClients = true;
ForceUpdate(true);
}
}
void plClothingOutfit::WearMaintainerOutfit()

4
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h

@ -199,8 +199,8 @@ public:
hsBool DirtySynchState(const char* SDLStateName, UInt32 synchFlags);
void StripAccessories();
void WearDefaultClothing();
void WearDefaultClothingType(UInt32 clothingType);
void WearDefaultClothing(hsBool broadcast = false);
void WearDefaultClothingType(UInt32 clothingType, hsBool broadcast = false);
void WearMaintainerOutfit();
void WearRandomOutfit();
void RemoveMaintainerOutfit();

Loading…
Cancel
Save