fixed config screens

This commit is contained in:
FlorianMichael 2023-10-08 09:50:46 +02:00
parent e18f886111
commit 158ba3ee93
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
8 changed files with 40 additions and 40 deletions

View File

@ -81,7 +81,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText().asString());
}
MinecraftClient.getInstance().openScreen(this);
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText().asString());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText().asString());
}

View File

@ -81,7 +81,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -91,7 +91,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText().asString());
}
MinecraftClient.getInstance().openScreen(this);
@ -103,14 +103,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText().asString());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -131,7 +131,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText().asString());
}

View File

@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText());
}
MinecraftClient.getInstance().openScreen(this);
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText());
}

View File

@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText());
}
MinecraftClient.getInstance().setScreen(this);
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText());
}

View File

@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText());
}
MinecraftClient.getInstance().setScreen(this);
@ -105,14 +105,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -133,7 +133,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText());
}

View File

@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText());
}
MinecraftClient.getInstance().setScreen(this);
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText());
}

View File

@ -87,7 +87,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -97,7 +97,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getClientSideText());
}
MinecraftClient.getInstance().setScreen(this);
@ -109,14 +109,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.setMessage(getClientSideText());
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
@Override
@ -137,7 +137,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.setMessage(getHideViaButtonText());
}

View File

@ -83,7 +83,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
ViaFabric.config.setClientSideVersion(finalNewVersion);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::saveConfig, ViaFabric.ASYNC_EXECUTOR);
latestProtocolSave = latestProtocolSave.thenRunAsync(ViaFabric.config::save, ViaFabric.ASYNC_EXECUTOR);
}
private void onClickClientSide(ButtonWidget widget) {
@ -93,7 +93,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.setClientSideVersion(-2); // AUTO
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.message = getClientSideText().asUnformattedString();
}
MinecraftClient.getInstance().setScreen(this);
@ -106,14 +106,14 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
));
} else {
ViaFabric.config.setClientSideEnabled(false);
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
widget.message = getClientSideText().asUnformattedString();
}
@Override
public void removed() {
ViaFabric.config.saveConfig();
ViaFabric.config.save();
}
private TranslatableText getClientSideText() {
@ -129,7 +129,7 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen {
private void onHideViaButton(ButtonWidget widget) {
ViaFabric.config.setHideButton(!ViaFabric.config.isHideButton());
ViaFabric.config.saveConfig();
ViaFabric.config.save();
widget.message = getHideViaButtonText().asUnformattedString();
}