mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
MAINT: Ensure that PoseSetActive
refreshes the dialog pose menu if so required
This commit is contained in:
parent
857d304323
commit
b5f57ab851
2 changed files with 10 additions and 2 deletions
|
@ -4994,7 +4994,7 @@ class _DialogPoseMenu extends _DialogSelfMenu {
|
|||
|
||||
/** @type {DialogMenu<string, Pose>["_ClickButton"]} */
|
||||
_ClickButton(button, C, pose) {
|
||||
PoseSetActive(C, pose.Name);
|
||||
PoseSetActive(C, pose.Name, undefined, false);
|
||||
if (CurrentScreen === "ChatRoom") {
|
||||
ServerSend("ChatRoomCharacterPoseUpdate", { Pose: C.ActivePose });
|
||||
}
|
||||
|
|
|
@ -195,9 +195,10 @@ function PoseSetByItems(C, category, poseName) {
|
|||
* @param {Character} C - Character for which to set the pose
|
||||
* @param {null | AssetPoseName} poseName - Name of the pose to set as active or `null` to return to the default pose
|
||||
* @param {boolean} [ForceChange=false] - TRUE if the set pose(s) should overwrite current active pose(s)
|
||||
* @param {boolean} [RefreshDialog] - Refresh {@link DialogSelfMenuMapping.Pose} if so required
|
||||
* @returns {void} - Nothing
|
||||
*/
|
||||
function PoseSetActive(C, poseName, ForceChange = false) {
|
||||
function PoseSetActive(C, poseName, ForceChange=false, RefreshDialog=true) {
|
||||
const newPose = PoseRecord[poseName];
|
||||
if (
|
||||
poseName == null
|
||||
|
@ -206,6 +207,9 @@ function PoseSetActive(C, poseName, ForceChange = false) {
|
|||
) {
|
||||
C.ActivePoseMapping = (newPose == null) ? {} : { [newPose.Category]: newPose.Name };
|
||||
CharacterRefresh(C, false);
|
||||
if (RefreshDialog && DialogSelfMenuSelected === "Pose" && DialogSelfMenuMapping.Pose.C.ID === C.ID) {
|
||||
DialogSelfMenuMapping.Pose.Reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -229,7 +233,11 @@ function PoseSetActive(C, poseName, ForceChange = false) {
|
|||
C.PoseMapping.BodyUpper = C.PoseMapping.BodyUpper ?? "BaseUpper";
|
||||
C.PoseMapping.BodyLower = C.PoseMapping.BodyLower ?? "BaseLower";
|
||||
}
|
||||
|
||||
CharacterRefresh(C, false);
|
||||
if (RefreshDialog && DialogSelfMenuSelected === "Pose" && DialogSelfMenuMapping.Pose.C.ID === C.ID) {
|
||||
DialogSelfMenuMapping.Pose.Reload();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue