mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
Merge branch 'beta' into 'master'
BETA: Fix the likes of the `/eyes` chat command failing to properly open the expression self menu See merge request BondageProjects/Bondage-College!5543
This commit is contained in:
commit
7d6d86f897
5 changed files with 27 additions and 17 deletions
BondageClub
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -2082,9 +2082,11 @@ function DialogChangeMode(mode, reset=false) {
|
|||
DialogExpressionPreviousMode = { mode: DialogMenuMode, group: C.FocusGroup };
|
||||
}
|
||||
|
||||
DialogMenuMapping[DialogMenuMode]?.Unload();
|
||||
const modeChange = DialogMenuMode !== mode || reset;
|
||||
DialogMenuMode = mode;
|
||||
if (DialogMenuMode !== mode) {
|
||||
DialogMenuMapping[DialogMenuMode]?.Unload();
|
||||
DialogMenuMode = mode;
|
||||
}
|
||||
|
||||
switch (DialogMenuMode) {
|
||||
case "activities":
|
||||
|
@ -2374,12 +2376,12 @@ 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;
|
||||
}
|
||||
|
||||
const ids = DialogSelfMenuMapping.Expression.ids;
|
||||
const button = /** @type {null | HTMLButtonElement} */(document.querySelector(`${ids.menuLeft} > [name="${ExpressionGroup}"]`));
|
||||
const button = /** @type {null | HTMLButtonElement} */(document.querySelector(`#${ids.menuLeft} > [name="${ExpressionGroup}"]`));
|
||||
if (!button) {
|
||||
return false;
|
||||
} else if (button.getAttribute("aria-checked") === "false") {
|
||||
|
@ -4273,8 +4275,10 @@ class _DialogSelfMenu extends DialogMenu {
|
|||
|
||||
/** @type {DialogMenu<ModeType, T, { C: PlayerCharacter }>["Init"]} */
|
||||
Init(parameters, style) {
|
||||
DialogSelfMenuMapping[DialogSelfMenuSelected]?.Unload();
|
||||
DialogSelfMenuSelected = this.mode;
|
||||
if (DialogSelfMenuSelected !== this.mode) {
|
||||
DialogSelfMenuMapping[DialogSelfMenuSelected]?.Unload();
|
||||
DialogSelfMenuSelected = this.mode;
|
||||
}
|
||||
const ret = super.Init(parameters, style);
|
||||
this.Resize(true);
|
||||
return ret;
|
||||
|
@ -5473,7 +5477,7 @@ function DialogLoad() {
|
|||
}
|
||||
|
||||
if (C.IsPlayer()) {
|
||||
DialogSelfMenuMapping.Expression.Init({ C });
|
||||
DialogSelfMenuMapping[DialogSelfMenuSelected ?? "Expression"]?.Init({ C });
|
||||
}
|
||||
DialogChangeMode(DialogMenuMode ?? "dialog", true);
|
||||
}
|
||||
|
|
2
BondageClub/Scripts/Platform.d.ts
vendored
2
BondageClub/Scripts/Platform.d.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
namespace Platform {
|
||||
export namespace Platform {
|
||||
|
||||
type Perk = string;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue