BUG: Fix the likes of the /eyes chat command failing to properly open the expression self menu

Update Dialog.js
This commit is contained in:
bananarama92 2025-04-13 17:52:37 +02:00
parent f6f963a87a
commit e1c72a4f68
No known key found for this signature in database
GPG key ID: E83C7D3B5DA36248
4 changed files with 17 additions and 11 deletions
BondageClub
Screens/Online/ChatRoom
Scripts

View file

@ -1566,9 +1566,10 @@ function ChatRoomDrawCharacterStatusIcons(C, CharX, CharY, Zoom)
/**
* Select the character (open dialog) and clear other chatroom displays.
* @param {Character} C - The character to focus on. Does nothing if null.
* @param {null | { mode?: DialogMenuMode, selfMode?: DialogSelfMenuName }} options - The type of dialog- and dialog-self subscreen te open
* @returns {void} - Nothing
*/
function ChatRoomFocusCharacter(C) {
function ChatRoomFocusCharacter(C, options=null) {
if (ChatRoomOwnerPresenceRule("BlockAccessSelf", C)) return;
if (ChatRoomOwnerPresenceRule("BlockAccessOther", C)) return;
if (C == null) return;
@ -1579,7 +1580,7 @@ function ChatRoomFocusCharacter(C) {
ChatRoomLovershipOption = "";
if (!C.IsPlayer()) ServerSend("ChatRoomAllowItem", { MemberNumber: C.MemberNumber });
if (C.IsOwnedByPlayer() || C.IsLoverOfPlayer()) ServerSend("ChatRoomChat", { Content: "RuleInfoGet", Type: "Hidden", Target: C.MemberNumber });
CharacterSetCurrent(C);
CharacterSetCurrent(C, options);
}
/**

View file

@ -855,8 +855,7 @@ const CommonCommands = [
Tag: 'expr',
Action: args => {
if (args.trim() == "") {
ChatRoomFocusCharacter(Player);
DialogFindSubMenu("SavedExpressions");
ChatRoomFocusCharacter(Player, { selfMode: "SavedExpressions" });
} else if (/^[0-5]$/.test(args)) {
let ExprNum = parseInt(args);
if (ExprNum == 0) {
@ -871,8 +870,7 @@ const CommonCommands = [
Tag: 'blush',
Action: args => {
if (args.trim() == "") {
ChatRoomFocusCharacter(Player);
DialogFindSubMenu("Expression");
ChatRoomFocusCharacter(Player, { selfMode: "Expression" });
DialogFindFacialExpressionMenuGroup("Blush");
return;
}
@ -921,8 +919,7 @@ const CommonCommands = [
Tag: 'eyes',
Action: args => {
if (args.trim() == "") {
ChatRoomFocusCharacter(Player);
DialogFindSubMenu("Expression");
ChatRoomFocusCharacter(Player, { selfMode: "Expression" });
DialogFindFacialExpressionMenuGroup("Eyes");
return;
}

View file

@ -1431,10 +1431,18 @@ function CharacterLoadCanvasAll() {
* Sets the current character to have a dialog with.
*
* @param {Character} C - Character to have a conversation with
* @param {null | { mode?: DialogMenuMode, selfMode?: DialogSelfMenuName }} options - The type of dialog- and dialog-self subscreen te open
* @returns {void} - Nothing
*/
function CharacterSetCurrent(C) {
function CharacterSetCurrent(C, options=null) {
options ??= {};
CurrentCharacter = C;
if (options.mode) {
DialogMenuMode = options.mode;
}
if (options.selfMode) {
DialogSelfMenuSelected = options.selfMode;
}
DialogLoad();
}

View file

@ -2374,7 +2374,7 @@ function DialogFindSubMenu(MenuName, force=false) {
* @returns {boolean} True, when the expression group was found and opened. False otherwise and nothing happens.
*/
function DialogFindFacialExpressionMenuGroup(ExpressionGroup) {
if (DialogSelfMenuSelected !== "Expression" && !DialogSelfMenuMapping.Expression.Init({ C: Player })) {
if (DialogSelfMenuSelected !== "Expression") {
return false;
}
@ -5473,7 +5473,7 @@ function DialogLoad() {
}
if (C.IsPlayer()) {
DialogSelfMenuMapping.Expression.Init({ C });
DialogSelfMenuMapping[DialogSelfMenuSelected ?? "Expression"]?.Init({ C });
}
DialogChangeMode(DialogMenuMode ?? "dialog", true);
}