Show locale chooser below window
This commit is contained in:
@@ -133,16 +133,17 @@ function checkChangePassword() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showChangePasswordGUI() {
|
function showChangePasswordGUI(errorMessage) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing change password window`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing change password window`);
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
passwordChange.window.shown = true;
|
passwordChange.window.shown = true;
|
||||||
|
passwordChange.messageLabel = errorMessage;
|
||||||
mexui.focusedControl = passwordChange.passwordInput;
|
mexui.focusedControl = passwordChange.passwordInput;
|
||||||
guiSubmitKey = checkChangePassword;
|
guiSubmitKey = checkChangePassword;
|
||||||
|
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), passwordChange.window.position.y+passwordChange.window.size.y+20));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
|
|||||||
guiLeftKey = selectPreviousCharacter;
|
guiLeftKey = selectPreviousCharacter;
|
||||||
guiRightKey = selectNextCharacter;
|
guiRightKey = selectNextCharacter;
|
||||||
|
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), characterSelect.window.position.y+characterSelect.window.size.y+20));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ function closeLocaleChooserGUI() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showLocaleChooserGUI(position = toVector2(0, 0)) {
|
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
||||||
if(position.x != 0 && position.y != 0) {
|
if(position.x != 0.0 && position.y != 0.0) {
|
||||||
localeChooser.window.position = position;
|
localeChooser.window.position = position;
|
||||||
} else {
|
} else {
|
||||||
localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
|
localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ let loginHTML =
|
|||||||
|
|
||||||
function initLoginGUI() {
|
function initLoginGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
||||||
login.window = mexui.window(game.width/2-150, game.height/2-135, 300, 275, 'LOGIN', {
|
login.window = mexui.window(getScreenWidth()/2-150, getScreenHeight()/2-135, 300, 275, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -118,7 +118,7 @@ function initLoginGUI() {
|
|||||||
},
|
},
|
||||||
}, checkLogin);
|
}, checkLogin);
|
||||||
|
|
||||||
login.forgotPasswordButton = login.window.button(200, 240, 80, 15, 'RESET PASS', {
|
login.forgotPasswordButton = login.window.button(180, 240, 100, 15, 'RESET PASS', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(0, 0, 0, 255),
|
textColour: toColour(0, 0, 0, 255),
|
||||||
@@ -131,7 +131,7 @@ function initLoginGUI() {
|
|||||||
},
|
},
|
||||||
}, switchToPasswordResetGUI);
|
}, switchToPasswordResetGUI);
|
||||||
|
|
||||||
login.resetPasswordLabel = login.window.text(125, 240, 60, 15, 'Forgot your password?', {
|
login.resetPasswordLabel = login.window.text(110, 240, 60, 15, 'Forgot your password?', {
|
||||||
main: {
|
main: {
|
||||||
textSize: 8.0,
|
textSize: 8.0,
|
||||||
textAlign: 1.0,
|
textAlign: 1.0,
|
||||||
@@ -157,7 +157,7 @@ function showLoginGUI() {
|
|||||||
mexui.focusedControl = login.passwordInput;
|
mexui.focusedControl = login.passwordInput;
|
||||||
guiSubmitKey = checkLogin;
|
guiSubmitKey = checkLogin;
|
||||||
|
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), login.window.position.y+login.window.size.y+20));
|
||||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ let newCharacter = {
|
|||||||
|
|
||||||
function initNewCharacterGUI() {
|
function initNewCharacterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
||||||
newCharacter.window = mexui.window(game.width/2-130, game.height/2-115, 300, 230, 'NEW CHARACTER', {
|
newCharacter.window = mexui.window(getScreenWidth()/2-130, getScreenHeight()/2-115, 300, 230, 'NEW CHARACTER', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -158,9 +158,9 @@ function showNewCharacterGUI() {
|
|||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
newCharacter.window.shown = true;
|
newCharacter.window.shown = true;
|
||||||
mexui.focusedInput = newCharacter.firstNameInput;
|
mexui.focusedInput = newCharacter.firstNameInput;
|
||||||
guiSubmitButton = checkNewCharacter;
|
guiSubmitKey = checkNewCharacter;
|
||||||
|
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), newCharacter.window.position.y+newCharacter.window.size.y+20));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -21,7 +21,7 @@ let register = {
|
|||||||
|
|
||||||
function initRegisterGUI() {
|
function initRegisterGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
||||||
register.window = mexui.window(game.width/2-150, game.height/2-150, 300, 300, 'Register', {
|
register.window = mexui.window(getScreenWidth()/2-150, getScreenHeight()/2-150, 300, 300, 'Register', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -162,7 +162,7 @@ function showRegistrationGUI() {
|
|||||||
mexui.focusedControl = register.passwordInput;
|
mexui.focusedControl = register.passwordInput;
|
||||||
guiSubmitKey = checkRegistration;
|
guiSubmitKey = checkRegistration;
|
||||||
|
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), register.window.position.y+register.window.size.y+20));
|
||||||
|
|
||||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ let passwordReset = {
|
|||||||
|
|
||||||
function initResetPasswordGUI() {
|
function initResetPasswordGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating password reset GUI ...`);
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
@@ -42,7 +42,7 @@ function initResetPasswordGUI() {
|
|||||||
passwordReset.window.titleBarHeight = 0;
|
passwordReset.window.titleBarHeight = 0;
|
||||||
passwordReset.window.titleBarShown = false;
|
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: {
|
focused: {
|
||||||
borderColour: toColour(0, 0, 0, 0),
|
borderColour: toColour(0, 0, 0, 0),
|
||||||
},
|
},
|
||||||
@@ -82,7 +82,7 @@ function initResetPasswordGUI() {
|
|||||||
});
|
});
|
||||||
passwordReset.emailInput.placeholder = "Email";
|
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: {
|
main: {
|
||||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
|
||||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||||
@@ -108,7 +108,7 @@ function initResetPasswordGUI() {
|
|||||||
},
|
},
|
||||||
}, switchToLoginGUI);
|
}, 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: {
|
main: {
|
||||||
textSize: 8.0,
|
textSize: 8.0,
|
||||||
textAlign: 1.0,
|
textAlign: 1.0,
|
||||||
@@ -132,9 +132,9 @@ function showResetPasswordGUI() {
|
|||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
passwordReset.window.shown = true;
|
passwordReset.window.shown = true;
|
||||||
mexui.focusedControl = passwordReset.emailInput;
|
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);
|
//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() {
|
function resetPasswordCodeInputGUI() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password reset was successful`);
|
logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Server reports password reset email confirmation was successful. Asking for code ...`);
|
||||||
|
|
||||||
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;
|
|
||||||
closeAllWindows();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user