GUI style changes and key press handling

This commit is contained in:
Vortrex
2022-01-07 19:50:04 -06:00
parent b26b19ccc9
commit 83b7af4fde
10 changed files with 126 additions and 63 deletions

View File

@@ -105,6 +105,8 @@ function showTwoFactorAuthGUI() {
setChatWindowEnabled(false);
mexui.setInput(true);
twoFactorAuth.window.shown = true;
mexui.focusedControl = twoFactorAuth.codeInput;
guiSubmitKey = checkTwoFactorAuth;
}
// ===========================================================================

View File

@@ -29,16 +29,16 @@ function initCharacterSelectGUI() {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
},
title: {
textSize: 11.0,
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
},
icon: {
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
backgroundColour: toColour(0, 0, 0, 0),
}
},
});
characterSelect.window.titleBarIconSize = toVector2(0,0);
characterSelect.window.titleBarHeight = 0;
characterSelect.nameText = characterSelect.window.text(5, 40, 200, 25, 'Lastname, Firstname', {
main: {
@@ -88,7 +88,7 @@ function initCharacterSelectGUI() {
}
});
characterSelect.selectCharacterButton = characterSelect.window.button(85, 130, 260, 25, 'SELECT', {
characterSelect.selectCharacterButton = characterSelect.window.button(85, 130, 260, 25, 'PLAY', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
@@ -168,12 +168,7 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
function showNewCharacter() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing new character dialog window`);
setChatWindowEnabled(false);
mexui.setInput(true);
setHUDEnabled(false);
newCharacter.window.shown = true;
showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
showNewCharacterGUI();
}
// ===========================================================================
@@ -209,6 +204,9 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.window.shown = true;
guiSubmitKey = selectThisCharacter;
guiLeftKey = selectPreviousCharacter;
guiRightKey = selectNextCharacter;
}
// ===========================================================================

View File

@@ -46,7 +46,7 @@ function initErrorDialogGUI() {
},
});
errorDialog.okayButton = errorDialog.window.button(20, 95, 360, 30, 'OK', {
errorDialog.okayButton = errorDialog.window.button(5, 105, 395, 30, 'OK', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),

View File

@@ -45,7 +45,7 @@ function initInfoDialogGUI() {
},
});
infoDialog.okayButton = infoDialog.window.button(20, 95, 360, 30, 'OK', {
infoDialog.okayButton = infoDialog.window.button(5, 105, 395, 30, 'OK', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),

View File

@@ -96,8 +96,7 @@ function initLoginGUI() {
},
}, checkLogin);
/*
login.forgotPasswordButton = login.window.button(200, 240, 60, 15, 'FORGOT PASSWORD', {
login.forgotPasswordButton = login.window.button(200, 240, 60, 15, 'RESET PASS', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(0, 0, 0, 255),
@@ -110,7 +109,7 @@ function initLoginGUI() {
},
}, switchToPasswordResetGUI);
login.resetPasswordLabel = login.window.text(20, 140, 60, 15, 'Need to reset your password? Click here >', {
login.resetPasswordLabel = login.window.text(20, 140, 60, 15, 'Forgot your password?', {
main: {
textSize: 8.0,
textAlign: 1.0,
@@ -121,7 +120,6 @@ function initLoginGUI() {
borderColour: toColour(0, 0, 0, 0),
},
});
*/
logToConsole(LOG_DEBUG, `[VRR.GUI] Created login GUI`);
}
@@ -134,7 +132,8 @@ function showLoginGUI() {
setChatWindowEnabled(false);
mexui.setInput(true);
login.window.shown = true;
mexui.focusedControl = login.passwordInput;
guiSubmitKey = checkLogin;
showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
}
@@ -158,7 +157,15 @@ function loginFailed(errorMessage) {
function loginSuccess() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports login was successful`);
guiSubmitKey = false;
closeAllWindows();
}
// ===========================================================================
// ===========================================================================
function switchToPasswordResetGUI() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
showResetPasswordGUI();
return false;
}

View File

@@ -26,16 +26,14 @@ function initNewCharacterGUI() {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
},
title: {
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
},
icon: {
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
}
title: {
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
},
icon: {
textSize: 0.0,
textColour: toColour(0, 0, 0, 0),
},
});
newCharacter.window.titleBarIconSize = toVector2(0,0);
newCharacter.window.titleBarHeight = 0;
@@ -157,6 +155,8 @@ function showNewCharacterGUI() {
setChatWindowEnabled(false);
mexui.setInput(true);
newCharacter.window.shown = true;
mexui.focusedInput = newCharacter.firstNameInput;
guiSubmitButton = checkNewCharacter;
}
// ===========================================================================

View File

@@ -158,7 +158,8 @@ function showRegistrationGUI() {
setChatWindowEnabled(false);
mexui.setInput(true);
register.window.shown = true;
mexui.focusedControl = register.passwordInput;
guiSubmitKey = checkRegistration;
showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
}
@@ -166,6 +167,7 @@ function showRegistrationGUI() {
function registrationSuccess() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports registration was successful`);
guiSubmitKey = false;
closeAllWindows();
}

View File

@@ -48,7 +48,7 @@ function initYesNoDialogGUI() {
},
});
yesNoDialog.yesButton = yesNoDialog.window.button(20, 95, 175, 30, 'YES', {
yesNoDialog.yesButton = yesNoDialog.window.button(5, 105, 197, 30, 'YES', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
@@ -61,7 +61,7 @@ function initYesNoDialogGUI() {
},
}, yesNoDialogAnswerYes);
yesNoDialog.noButton = yesNoDialog.window.button(205, 95, 175, 30, 'NO', {
yesNoDialog.noButton = yesNoDialog.window.button(207, 105, 197, 30, 'NO', {
main: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),