WIP: SyncScreen allows users to choose which content type to sync

This commit is contained in:
Frank 2021-08-19 16:49:43 +02:00
parent 698ecefba4
commit d46e375501
3 changed files with 28 additions and 14 deletions

View file

@ -7,11 +7,10 @@ import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import ru.bclib.gui.gridlayout.GridLayout.Alignment;
import ru.bclib.gui.gridlayout.GridRow;
import ru.bclib.gui.gridlayout.GridScreen;
@Environment(EnvType.CLIENT)
public class ConfirmRestartScreen extends GridScreen {
public class ConfirmRestartScreen extends BCLibScreen {
private final Component description;
private final ConfirmRestartScreen.Listener listener;
@ -20,9 +19,9 @@ public class ConfirmRestartScreen extends GridScreen {
}
public ConfirmRestartScreen(ConfirmRestartScreen.Listener listener, Component message) {
super(new TranslatableComponent("bclib.datafixer.confirmrestart.title"));
super(new TranslatableComponent("title.bclib.confirmrestart"));
this.description = message==null?new TranslatableComponent("bclib.datafixer.confirmrestart.message"):message;
this.description = message==null?new TranslatableComponent("message.bclib.confirmrestart"):message;
this.listener = listener;
}

View file

@ -5,18 +5,18 @@ import net.fabricmc.api.Environment;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import ru.bclib.gui.gridlayout.GridCheckboxCell;
import ru.bclib.gui.gridlayout.GridLayout.Alignment;
import ru.bclib.gui.gridlayout.GridRow;
import ru.bclib.gui.gridlayout.GridScreen;
@Environment(EnvType.CLIENT)
public class SyncFilesScreen extends GridScreen {
public class SyncFilesScreen extends BCLibScreen {
private final Component description;
private final SyncFilesScreen.Listener listener;
public SyncFilesScreen(SyncFilesScreen.Listener listener) {
super(new TranslatableComponent("bclib.datafixer.syncfiles.title"));
super(new TranslatableComponent("title.bclib.syncfiles"));
this.description = new TranslatableComponent("bclib.datafixer.syncfiles.message");
this.description = new TranslatableComponent("message.bclib.syncfiles");
this.listener = listener;
}
@ -24,11 +24,23 @@ public class SyncFilesScreen extends GridScreen {
final int BUTTON_HEIGHT = 20;
grid.addRow().addMessage(this.description, this.font, Alignment.CENTER);
//grid.addMessageRow(this.description, 25);
grid.addSpacerRow();
grid.addSpacerRow(10);
GridRow row = grid.addRow();
GridCheckboxCell mods = row.addCheckbox(new TranslatableComponent("message.bclib.syncfiles.mods"), true, BUTTON_HEIGHT, this.font);
grid.addSpacerRow();
row = grid.addRow();
GridCheckboxCell files = row.addCheckbox(new TranslatableComponent("message.bclib.syncfiles.files"), true, BUTTON_HEIGHT, this.font);
grid.addSpacerRow();
row = grid.addRow();
GridCheckboxCell folder = row.addCheckbox(new TranslatableComponent("message.bclib.syncfiles.folder"), true, BUTTON_HEIGHT, this.font);
grid.addSpacerRow(30);
row = grid.addRow();
row.addFiller();
row.addButton(CommonComponents.GUI_NO, BUTTON_HEIGHT, this.font, (button) -> {
listener.proceed(false);

View file

@ -7,8 +7,11 @@
"bclib.datafixer.backupWarning.fix": "Apply Fixes",
"bclib.datafixer.bclibmissmatch.title": "Version Mismatch",
"bclib.datafixer.bclibmissmatch.message": "The Version of BCLib on the server and this client do not match. This will cause problems when playing.\n\nDo you want to automatically download the BCLib-Version from the server. You will need to manually delete the old version from your Mods Directory.",
"bclib.datafixer.syncfiles.title": "Mismatching (Config-)Files",
"bclib.datafixer.syncfiles.message": "Some Files on the Server do not match the versions on the client.\n\nDo you want to replace the local versions with the ones from the server?",
"bclib.datafixer.confirmrestart.title": "Restart Required",
"bclib.datafixer.confirmrestart.message": "The requested files were processed. You need o restart Minecraft now."
"title.bclib.syncfiles": "Mismatching Data",
"message.bclib.syncfiles": "Some Content on the Server does not match the versions on the client.\nDo you want to replace the selected content with the data from the server?",
"message.bclib.syncfiles.mods": "Synchronize Mods",
"message.bclib.syncfiles.files": "Synchronize Configs",
"message.bclib.syncfiles.folder": "Synchronize Folders",
"title.bclib.confirmrestart": "Restart Required",
"message.bclib.confirmrestart": "The requested files were processed. You need o restart Minecraft now."
}