Add pos offset for locale chooser

This commit is contained in:
Vortrex
2022-05-17 08:55:17 -05:00
parent c93dcff420
commit 8841958a8d

View File

@@ -52,7 +52,13 @@ function closeLocaleChooserGUI() {
// ===========================================================================
function showLocaleChooserGUI() {
function showLocaleChooserGUI(position = toVector2(0, 0)) {
if(position.x != 0 && position.y != 0) {
localeChooser.window.position = position;
} else {
localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
}
//closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing locale chooser window`);
mexui.setInput(true);
@@ -61,6 +67,16 @@ function showLocaleChooserGUI() {
// ===========================================================================
function toggleLocaleChooserGUI() {
if(localeChooser.window.shown) {
closeLocaleChooserGUI();
} else {
showLocaleChooserGUI();
}
}
// ===========================================================================
function localeChooserSetLocale(localeId) {
logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Asking server to change locale to ${localeId}`);
sendLocaleSelectToServer(localeId);