Show locale chooser below window

This commit is contained in:
Vortrex
2022-05-22 13:28:55 -05:00
parent 7897414aa1
commit 7e2b9b12e6
7 changed files with 45 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ let passwordReset = {
function initResetPasswordGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating password reset GUI ...`);
passwordReset.window = mexui.window(game.width/2-150, game.height/2-130, 300, 260, 'RESET PASSWORD', {
passwordReset.window = mexui.window(getScreenWidth()/2-150, getScreenHeight()/2-135, 300, 275, 'RESET PASSWORD', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -42,7 +42,7 @@ function initResetPasswordGUI() {
passwordReset.window.titleBarHeight = 0;
passwordReset.window.titleBarShown = false;
passwordReset.logoImage = passwordReset.window.image(5, 20, 290, 80, mainLogoPath, {
passwordReset.logoImage = passwordReset.window.image(100, 20, 100, 100, mainLogoPath, {
focused: {
borderColour: toColour(0, 0, 0, 0),
},
@@ -82,7 +82,7 @@ function initResetPasswordGUI() {
});
passwordReset.emailInput.placeholder = "Email";
passwordReset.resetPasswordButton = passwordReset.window.button(20, 205, 260, 30, 'RESET PASSWORD', {
passwordReset.resetPasswordButton = passwordReset.window.button(180, 240, 100, 15, 'RESET PASSWORD', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
@@ -108,7 +108,7 @@ function initResetPasswordGUI() {
},
}, switchToLoginGUI);
passwordReset.backToLoginLabel = passwordReset.window.text(125, 240, 60, 15, 'Remember your password?', {
passwordReset.backToLoginLabel = passwordReset.window.text(110, 240, 60, 15, 'Remember your password?', {
main: {
textSize: 8.0,
textAlign: 1.0,
@@ -132,9 +132,9 @@ function showResetPasswordGUI() {
mexui.setInput(true);
passwordReset.window.shown = true;
mexui.focusedControl = passwordReset.emailInput;
guiSubmitButton = checkResetPassword;
guiSubmitKey = checkResetPassword;
showLocaleChooserGUI();
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), passwordReset.window.position.y+passwordReset.window.size.y+20));
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
}
@@ -157,15 +157,31 @@ function resetPasswordFailed(errorMessage) {
// ===========================================================================
function resetPasswordCodeInputGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password reset was successful`);
passwordReset.messageLabel.text = "Check your email for a verification code";
passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordReset.emailInput.text = "";
passwordReset.emailInput.placeholder = "Verification Code";
guiSubmitButton = checkResetPassword;
logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
closeAllWindows();
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordCodeInputLabel");
//passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordReset.emailInput.text = "";
passwordReset.emailInput.placeholder = getLocaleString("GUIResetPasswordCodePlaceholder");
guiSubmitKey = checkResetPassword;
showResetPasswordGUI();
}
// ===========================================================================
function resetPasswordEmailInputGUI() {
logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Server reports password reset request was approved. Asking for email ...`);
closeAllWindows();
passwordReset.messageLabel.text = getLocaleString("GUIResetPasswordConfirmEmailLabel");
//passwordReset.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordReset.emailInput.text = "";
passwordReset.emailInput.placeholder = getLocaleString("GUIResetPasswordEmailPlaceholder");
guiSubmitKey = checkResetPassword;
showResetPasswordGUI();
}
// ===========================================================================