Skip to content

Commit 9a70cd0

Browse files
committed
include the patch for auto-sizing buttons in the quest dialogs
1 parent dbf24d0 commit 9a70cd0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

enhanced-ui/src/quest-dialog.ts

+18
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,22 @@ ig.module('ultimate-localized-ui.fixes.quest-dialog')
5757
);
5858
},
5959
});
60+
61+
sc.QuestStartDialogButtonBox.inject({
62+
init(...args) {
63+
this.parent(...args);
64+
let btn1 = this.acceptButton;
65+
let btn2 = this.declineButton;
66+
// left border + right border
67+
let totalBorderWidth = this.hook.size.x - btn1.hook.size.x;
68+
let prevBtnWidth = Math.max(btn1.hook.size.x, btn2.hook.size.x);
69+
// This will forcibly recompute the width of the buttons
70+
btn1.setText(btn1.text, false);
71+
btn2.setText(btn2.text, false);
72+
let newBtnWidth = Math.max(prevBtnWidth, btn1.hook.size.x, btn2.hook.size.x);
73+
btn1.setWidth(newBtnWidth);
74+
btn2.setWidth(newBtnWidth);
75+
this.hook.size.x = newBtnWidth + totalBorderWidth;
76+
},
77+
});
6078
});

0 commit comments

Comments
 (0)