Skip to content

Commit

Permalink
Add mods folder keybind
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoDistant committed Jan 5, 2024
1 parent bdb4fbf commit f2a184c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.15.3

# Mod Properties
mod_version = 1.2.0
mod_version = 1.2.1
maven_group = io.github.minifabric
archives_base_name = minifabric-modmenu

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
import minicraft.gfx.Font;
import minicraft.gfx.Screen;
import minicraft.screen.*;
import minicraft.screen.Menu;
import minicraft.screen.entry.SelectEntry;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.Person;

import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;
Expand Down Expand Up @@ -99,7 +103,13 @@ public void tick(InputHandler input) {
super.tick(input);
if (input.getMappedKey("exit").isClicked()) {
Game.setDisplay(parent);
}
} else if (input.getMappedKey("info").isClicked()) {
try {
Desktop.getDesktop().open(new File("mods/"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

@Override
Expand Down Expand Up @@ -143,8 +153,9 @@ public void render(Screen screen) {
Font.drawCentered(Localization.getLocalized("Authors:") + " " + author, screen, Font.textHeight() * 5, col);
}

Font.drawCentered(Game.input.getMapping("select") + Localization.getLocalized(" to confirm"), screen, Screen.h - 40, Color.GRAY);
Font.drawCentered(Game.input.getMapping("exit") + Localization.getLocalized(" to return"), screen, Screen.h - 20, Color.GRAY);
Font.drawCentered(Game.input.getMapping("info") + Localization.getLocalized(" to open mods folder"), screen, Screen.h - 30, Color.GRAY);
Font.drawCentered(Game.input.getMapping("select") + Localization.getLocalized(" to confirm"), screen, Screen.h - 20, Color.GRAY);
Font.drawCentered(Game.input.getMapping("exit") + Localization.getLocalized(" to return"), screen, Screen.h - 10, Color.GRAY);

String title = Localization.getLocalized("Fabric Mod Menu");
int color = Color.WHITE;
Expand Down

0 comments on commit f2a184c

Please sign in to comment.