refactor: remove rename profile button

This commit is contained in:
trafficlunar 2025-10-15 22:30:09 +01:00
parent 2c90b0af37
commit 5ead7649af

View file

@ -62,18 +62,6 @@ public class EditProfileScreen extends Screen {
.build(), .build(),
LayoutSettings::alignHorizontallyCenter LayoutSettings::alignHorizontallyCenter
); );
linearLayoutButtons.addChild(
Button.builder(
Component.translatable("gui.optionsprofiles.rename-profile"),
(button) -> {
Profiles.renameProfile(profileName.getString(), this.profileNameEdit.getValue());
this.minecraft.setScreen(new EditProfileScreen(profilesScreen, Component.literal(this.profileNameEdit.getValue())));
})
.size(150, 20)
.pos(this.width / 2 - 75, 166)
.build(),
LayoutSettings::alignHorizontallyCenter
);
linearLayoutButtons.addChild( linearLayoutButtons.addChild(
Button.builder( Button.builder(
Component.translatable("gui.optionsprofiles.options-toggle").append("..."), Component.translatable("gui.optionsprofiles.options-toggle").append("..."),
@ -140,6 +128,8 @@ public class EditProfileScreen extends Screen {
if (!deleted) { if (!deleted) {
this.profileConfiguration.setServers(this.serversEdit.getValue()); this.profileConfiguration.setServers(this.serversEdit.getValue());
this.profileConfiguration.save(); this.profileConfiguration.save();
Profiles.renameProfile(profileName.getString(), this.profileNameEdit.getValue());
} }
this.minecraft.setScreen(this.profilesScreen); this.minecraft.setScreen(this.profilesScreen);
this.profilesScreen.profilesList.refreshEntries(); this.profilesScreen.profilesList.refreshEntries();