mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
fix: Fixed manager not respecting autoconnectwhentrue and srsport settings
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="input-group autoconnect">
|
||||
<span onclick="signal('onEnableAutoconnectClicked')">
|
||||
<div class="checkbox <%= activeInstance['installationType'] === 'multiplayer'? '': 'checked' %>"></div> Autoconnect when local
|
||||
<div class="checkbox <%= activeInstance['autoconnectWhenLocal'] ? 'checked': '' %>"></div> Autoconnect when local
|
||||
<img src="./icons/circle-info-solid.svg"
|
||||
title="Autoconnect as Game Master when running Olympus on the same computer as DCS.">
|
||||
</span>
|
||||
|
||||
@@ -192,7 +192,7 @@ class DCSInstance {
|
||||
/* Read the new configurations added in v2.0.0 */
|
||||
if (config["frontend"]["autoconnectWhenLocal"] !== undefined)
|
||||
this.autoconnectWhenLocal = config["frontend"]["autoconnectWhenLocal"];
|
||||
if (config["frontend"]["audio"] !== undefined && config["frontend"]["audio"]["SRSPort"] !== undefined)
|
||||
if (config["audio"] !== undefined && config["audio"]["SRSPort"] !== undefined)
|
||||
this.SRSPort = config["audio"]["SRSPort"];
|
||||
|
||||
this.gameMasterPasswordEdited = false;
|
||||
|
||||
@@ -175,8 +175,10 @@ class Manager {
|
||||
|
||||
/* Reset default radio buttons */
|
||||
this.typePage.options.onShow = () => {
|
||||
if (this.getActiveInstance())
|
||||
if (this.getActiveInstance()) {
|
||||
this.getActiveInstance().installationType = 'singleplayer';
|
||||
this.getActiveInstance().autoconnectWhenLocal = true;
|
||||
}
|
||||
else {
|
||||
showErrorPopup(`<div class='main-message'>A critical error occurred! </div><div class='sub-message'> Check ${this.getLogLocation()} for more info. </div>`);
|
||||
}
|
||||
@@ -335,7 +337,7 @@ class Manager {
|
||||
this.typePage.getElement().querySelector(`.multiplayer`).classList.toggle("selected", type === 'multiplayer');
|
||||
if (this.getActiveInstance()) {
|
||||
this.getActiveInstance().installationType = type;
|
||||
this.getActiveInstance().autoconnectWhenLocal = type === 'singleplayer';
|
||||
this.getActiveInstance().autoconnectWhenLocal = (type === 'singleplayer');
|
||||
}
|
||||
else {
|
||||
showErrorPopup(`<div class='main-message'>A critical error occurred! </div><div class='sub-message'> Check ${this.getLogLocation()} for more info. </div>`);
|
||||
@@ -570,7 +572,11 @@ class Manager {
|
||||
} else {
|
||||
this.getActiveInstance().autoconnectWhenLocal = true;
|
||||
}
|
||||
this.expertSettingsPage.getElement().querySelector(".autoconnect .checkbox").classList.toggle("checked", this.getActiveInstance().autoconnectWhenLocal)
|
||||
if (this.getMode() === 'basic') {
|
||||
this.passwordsPage.getElement().querySelector(".autoconnect .checkbox").classList.toggle("checked", this.getActiveInstance().autoconnectWhenLocal);
|
||||
} else {
|
||||
this.expertSettingsPage.getElement().querySelector(".autoconnect .checkbox").classList.toggle("checked", this.getActiveInstance().autoconnectWhenLocal);
|
||||
}
|
||||
} else {
|
||||
showErrorPopup(`<div class='main-message'>A critical error occurred! </div><div class='sub-message'> Check ${this.getLogLocation()} for more info. </div>`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user