Skip to content

Commit

Permalink
No longer bundle cloth config and namespace to translations
Browse files Browse the repository at this point in the history
  • Loading branch information
TomB-134 committed Dec 27, 2021
1 parent 4d7de99 commit 2d73354
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 147 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Minimal Menu is a small client side mod that allows the user independently toggl

![Imgur Image](https://i.imgur.com/PcamapY.jpg)

*Requires [cloth config](https://www.curseforge.com/minecraft/mc-mods/cloth-config) and [mod menu](https://www.curseforge.com/minecraft/mc-mods/modmenu)

## Features
* Pause the rendering of the background panorama
Expand Down Expand Up @@ -36,4 +37,5 @@ Minimal Menu is a small client side mod that allows the user independently toggl
1. Download and install Fabric from [here](https://fabricmc.net/use)
2. Download Fabric API mod from [here](https://www.curseforge.com/minecraft/mc-mods/fabric-api) and place in your mods folder.
3. Download Modmenu from [CurseForge](https://www.curseforge.com/minecraft/mc-mods/modmenu) (Required to be able to configure mod, all settings are off by default.)
4. Download Minimal Menu from [the github page](https://github.com/TomB-134/MinimalMenu/releases) or from [CurseForge](https://www.curseforge.com/minecraft/mc-mods/minimal-menu) and place in your mods folder.
4. Download Cloth config from [CurseForge](https://www.curseforge.com/minecraft/mc-mods/cloth-config)
5. Download Minimal Menu from [the github page](https://github.com/TomB-134/MinimalMenu/releases) or from [CurseForge](https://www.curseforge.com/minecraft/mc-mods/minimal-menu) and place in your mods folder.
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ dependencies {
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
include("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}

processResources {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ org.gradle.jvmargs = -Xmx1G

#Fabric properties
minecraft_version = 1.18.1
yarn_mappings = 1.18.1+build.6
yarn_mappings = 1.18.1+build.12
loader_version = 0.12.12

#Mod properties
mod_version = 1.18.1-0.1.2
mod_version = 1.18.1-0.1.4
maven_group = minimalmenu
archives_base_name = minimalmenu

#Dependencies
fabric_api_version = 0.44.0+1.18
mod_menu_version = 3.0.0
cloth_config_version = 6.0.45
fabric_api_version = 0.45.0+1.18
mod_menu_version = 3.0.1
cloth_config_version = 6.1.48
68 changes: 34 additions & 34 deletions src/main/java/minimalmenu/config/ConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,150 +11,150 @@ public class ConfigScreen {
public static Screen getConfigScreen(Screen parentScreen) {
ConfigBuilder builder = ConfigBuilder.create()
.setParentScreen(parentScreen)
.setTitle(new TranslatableText("config.title"));
.setTitle(new TranslatableText("minimalmenu.config.title"));

builder.setSavingRunnable(ConfigHandler::write);

//Create categories
ConfigCategory generalScreen = builder.getOrCreateCategory(new TranslatableText("config.category.general"));
ConfigCategory titleScreen = builder.getOrCreateCategory(new TranslatableText("config.category.title"));
ConfigCategory optionsScreen = builder.getOrCreateCategory(new TranslatableText("config.category.options"));
ConfigCategory pauseScreen = builder.getOrCreateCategory(new TranslatableText("config.category.pause"));
ConfigCategory singePlayerScreen = builder.getOrCreateCategory(new TranslatableText("config.category.sp"));
ConfigCategory otherOptions = builder.getOrCreateCategory(new TranslatableText("config.category.other"));
ConfigCategory generalScreen = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.general"));
ConfigCategory titleScreen = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.title"));
ConfigCategory optionsScreen = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.options"));
ConfigCategory pauseScreen = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.pause"));
ConfigCategory singePlayerScreen = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.sp"));
ConfigCategory otherOptions = builder.getOrCreateCategory(new TranslatableText("minimalmenu.config.category.other"));

ConfigEntryBuilder entryBuilder = builder.entryBuilder();

//Build general screen options
generalScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.general.openFolderScreen"), ConfigHandler.OPEN_FOLDER_SCREEN)
generalScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.general.openFolderScreen"), ConfigHandler.OPEN_FOLDER_SCREEN)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.OPEN_FOLDER_SCREEN = newValue)
.setTooltip(new TranslatableText("config.option.general.openFolderScreen.tooltip"))
.setTooltip(new TranslatableText("minimalmenu.config.option.general.openFolderScreen.tooltip"))
.build());

//Build title screen options
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.splash"), ConfigHandler.REMOVE_SPLASH)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.splash"), ConfigHandler.REMOVE_SPLASH)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_SPLASH = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.edition"), ConfigHandler.REMOVE_EDITION)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.edition"), ConfigHandler.REMOVE_EDITION)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_EDITION = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.singleplayer"), ConfigHandler.REMOVE_SINGLEPLAYER)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.singleplayer"), ConfigHandler.REMOVE_SINGLEPLAYER)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_SINGLEPLAYER = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.multiplayer"), ConfigHandler.REMOVE_MULTIPLAYER)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.multiplayer"), ConfigHandler.REMOVE_MULTIPLAYER)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_MULTIPLAYER = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.realms"), ConfigHandler.REMOVE_REALMS)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.realms"), ConfigHandler.REMOVE_REALMS)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_REALMS = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.accessibility"), ConfigHandler.REMOVE_ACCESSIBILITY)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.accessibility"), ConfigHandler.REMOVE_ACCESSIBILITY)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_ACCESSIBILITY = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.language"), ConfigHandler.REMOVE_LANGUAGE)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.language"), ConfigHandler.REMOVE_LANGUAGE)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_LANGUAGE = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.copy"), ConfigHandler.REMOVE_COPYRIGHT)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.copy"), ConfigHandler.REMOVE_COPYRIGHT)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_COPYRIGHT = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.common.addFolder"), ConfigHandler.ADD_FOLDER_TS)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.common.addFolder"), ConfigHandler.ADD_FOLDER_TS)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.ADD_FOLDER_TS = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.spin"), ConfigHandler.STOP_SPIN)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.spin"), ConfigHandler.STOP_SPIN)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.STOP_SPIN = newValue)
.build());

titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.title.dirtBackground"), ConfigHandler.DIRT_BACKGROUND)
titleScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.title.dirtBackground"), ConfigHandler.DIRT_BACKGROUND)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.DIRT_BACKGROUND = newValue)
.build());

titleScreen.addEntry(entryBuilder.startIntField(new TranslatableText("config.option.title.xOffset"), ConfigHandler.X_OFFSET_TITLE)
titleScreen.addEntry(entryBuilder.startIntField(new TranslatableText("minimalmenu.config.option.title.xOffset"), ConfigHandler.X_OFFSET_TITLE)
.setDefaultValue(0)
.setSaveConsumer(newValue -> ConfigHandler.X_OFFSET_TITLE = newValue)
.build());

titleScreen.addEntry(entryBuilder.startIntField(new TranslatableText("config.option.title.yOffset"), ConfigHandler.Y_OFFSET_TITLE)
titleScreen.addEntry(entryBuilder.startIntField(new TranslatableText("minimalmenu.config.option.title.yOffset"), ConfigHandler.Y_OFFSET_TITLE)
.setDefaultValue(0)
.setSaveConsumer(newValue -> ConfigHandler.Y_OFFSET_TITLE = newValue)
.build());

//Build options screen options
optionsScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.options.online"), ConfigHandler.REMOVE_ONLINE)
optionsScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.options.online"), ConfigHandler.REMOVE_ONLINE)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_ONLINE = newValue)
.build());

//Build pause screen options
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.pause.feedback"), ConfigHandler.REMOVE_FEEDBACK)
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.pause.feedback"), ConfigHandler.REMOVE_FEEDBACK)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_FEEDBACK = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.pause.bugs"), ConfigHandler.REMOVE_BUGS)
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.pause.bugs"), ConfigHandler.REMOVE_BUGS)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_BUGS = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.pause.lanSingle"), ConfigHandler.REMOVE_LANSP)
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.pause.lanSingle"), ConfigHandler.REMOVE_LANSP)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_LANSP = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.pause.lanMulti"), ConfigHandler.REMOVE_LANMP)
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.pause.lanMulti"), ConfigHandler.REMOVE_LANMP)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.REMOVE_LANMP = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.common.addFolder"), ConfigHandler.ADD_FOLDER_PS)
pauseScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.common.addFolder"), ConfigHandler.ADD_FOLDER_PS)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.ADD_FOLDER_PS = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startIntField(new TranslatableText("config.option.pause.xOffset"), ConfigHandler.X_OFFSET_PAUSE)
pauseScreen.addEntry(entryBuilder.startIntField(new TranslatableText("minimalmenu.config.option.pause.xOffset"), ConfigHandler.X_OFFSET_PAUSE)
.setDefaultValue(0)
.setSaveConsumer(newValue -> ConfigHandler.X_OFFSET_PAUSE = newValue)
.build());

pauseScreen.addEntry(entryBuilder.startIntField(new TranslatableText("config.option.pause.yOffset"), ConfigHandler.Y_OFFSET_PAUSE)
pauseScreen.addEntry(entryBuilder.startIntField(new TranslatableText("minimalmenu.config.option.pause.yOffset"), ConfigHandler.Y_OFFSET_PAUSE)
.setDefaultValue(0)
.setSaveConsumer(newValue -> ConfigHandler.Y_OFFSET_PAUSE = newValue)
.build());

//Build singleplayer screen options
singePlayerScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.sp.addSavesFolder"), ConfigHandler.ADD_SAVES)
singePlayerScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.sp.addSavesFolder"), ConfigHandler.ADD_SAVES)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.ADD_SAVES = newValue)
.build());

singePlayerScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.sp.reloadSaves"), ConfigHandler.ADD_RELOAD_SAVES)
singePlayerScreen.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.sp.reloadSaves"), ConfigHandler.ADD_RELOAD_SAVES)
.setDefaultValue(false)
.setSaveConsumer(newValue -> ConfigHandler.ADD_RELOAD_SAVES = newValue)
.build());

//Build other options
otherOptions.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config.option.other.dev"), ConfigHandler.DEV_MODE)
otherOptions.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("minimalmenu.config.option.other.dev"), ConfigHandler.DEV_MODE)
.setDefaultValue(false)
.setTooltip(new TranslatableText("config.option.other.dev.tooltip"))
.setTooltip(new TranslatableText("minimalmenu.config.option.other.dev.tooltip"))
.setSaveConsumer(newValue -> ConfigHandler.DEV_MODE = newValue)
.build());

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minimalmenu/mixin/GameMenuScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected GameMenuScreenMixin(Text title) {
@Inject(method = "initWidgets", at = @At("HEAD"))
private void initWidgets(CallbackInfo info) {
if (ConfigHandler.ADD_FOLDER_PS) {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 104, this.height / 4 + 120 + -16, 20, 20, new TranslatableText("common..minecraft"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 104, this.height / 4 + 120 + -16, 20, 20, new TranslatableText("minimalmenu.common..minecraft"), (button) -> {
MinimalMenu.processButtonFolderClick(client);
}));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minimalmenu/mixin/ScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void afterTitleScreenInit() {
}
}

if (MinimalMenu.buttonMatchesKey(button, "common..minecraft")) {
if (MinimalMenu.buttonMatchesKey(button, "minimalmenu.common..minecraft")) {
button.y = posY;
} else {
button.y -= yOffset;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/minimalmenu/mixin/SelectWorldScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void init(CallbackInfo info) {
this.width / 2 - 232, //Create open saves folder button.
this.height - 28,
72, 20,
new TranslatableText("screen.singleplayer.saves"),
new TranslatableText("minimalmenu.screen.singleplayer.saves"),
(button -> {
assert this.client != null;
File file = client.runDirectory.toPath().resolve("saves").toFile(); //Create saves file from current running directory.
Expand All @@ -46,7 +46,7 @@ public void init(CallbackInfo info) {
this.width / 2 - 232, //Create reload button.
this.height - 52,
72, 20,
new TranslatableText("screen.singleplayer.reload"),
new TranslatableText("minimalmenu.screen.singleplayer.reload"),
button -> {
assert this.client != null;
this.client.setScreenAndRender(new SelectWorldScreen(parent)); //Refresh screen, by creating a new one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected TitleScreenButtonMixin(Text title) {
@Inject(method = "init", at = @At("HEAD"))
protected void init(CallbackInfo info) {
if (ConfigHandler.ADD_FOLDER_TS) {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 104, 0, 20, 20, new TranslatableText("common..minecraft"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 104, (this.height / 4 + 48) + 84 , 20, 20, new TranslatableText("minimalmenu.common..minecraft"), (button) -> {
MinimalMenu.processButtonFolderClick(client);
}));
}
Expand Down
Loading

0 comments on commit 2d73354

Please sign in to comment.