Skip to content

Commit ff36daf

Browse files
committed
Fixed Options Menu
1 parent c7b7bcd commit ff36daf

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Seedmapper 2.22.x (MC26.1.1) - Modified by CevAPI
1+
# Seedmapper 2.22.x (MC26.1.2) - Modified by CevAPI
22

33
Original Repo: https://github.com/xpple/SeedMapper/
44

@@ -12,6 +12,13 @@ Original instructions apply.
1212

1313
## Improvements
1414

15+
### Options Menu
16+
17+
You are now able to easily access almost all functionality of SeedMapper via its options menu. There are also new keybinds you can assign and change from within.
18+
19+
![Options](https://i.imgur.com/2skv4Zu.png)
20+
![Keybinds](https://i.imgur.com/1QG9bho.png)
21+
1522
### Zoom
1623
Zoom further out on the SeedMap. Limited to approx 100,000 which is insane already.
1724

src/main/java/dev/xpple/seedmapper/SeedMapperKeybinds.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private SeedMapperKeybinds() {}
3939
private static KeyMapping TOGGLE_PLAYER_ICON;
4040
private static KeyMapping TOGGLE_DATAPACK_STRUCTURES;
4141
private static List<KeyMapping> ALL = List.of();
42+
private static boolean openOptionsAfterMapOpens;
4243

4344
private static KeyMapping register(String translationKey, int defaultKey) {
4445
return KeyMappingHelper.registerKeyMapping(new KeyMapping(translationKey, defaultKey, CATEGORY));
@@ -102,6 +103,7 @@ public static void handleClientTick(Minecraft minecraft) {
102103
while (TOGGLE_OPTIONS.consumeClick()) {
103104
if (!SeedMapScreen.toggleOptionsFromKeybind(minecraft)) {
104105
runCommand(minecraft, "sm:seedmap");
106+
openOptionsAfterMapOpens = true;
105107
}
106108
}
107109
while (OPEN_LOOT_VIEWER.consumeClick()) {
@@ -151,6 +153,11 @@ public static void handleClientTick(Minecraft minecraft) {
151153
Configs.save();
152154
SeedMapMinimapManager.refreshIfOpen();
153155
}
156+
157+
if (openOptionsAfterMapOpens && minecraft.screen instanceof SeedMapScreen) {
158+
openOptionsAfterMapOpens = false;
159+
SeedMapScreen.toggleOptionsFromKeybind(minecraft);
160+
}
154161
}
155162

156163
private static void runCommand(Minecraft minecraft, String command) {

src/main/java/dev/xpple/seedmapper/seedmap/SeedMapScreen.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,7 +4835,7 @@ private final class KeybindsScreen extends Screen {
48354835
private @Nullable net.minecraft.client.KeyMapping editingKeybind;
48364836

48374837
private KeybindsScreen(Screen previous) {
4838-
super(Component.literal("Minimap Controls"));
4838+
super(Component.literal("Keybinds"));
48394839
this.previous = previous;
48404840
}
48414841

@@ -5097,12 +5097,6 @@ protected void init() {
50975097
this.addRenderableWidget(Button.builder(Component.literal("Run Terrain ESP"), button -> SeedMapScreen.this.runTerrainEspHighlight(true))
50985098
.bounds(left, y, halfWidth, rowHeight)
50995099
.build());
5100-
this.addRenderableWidget(Button.builder(Component.literal("Clear ESP"), button -> {
5101-
RenderManager.clear();
5102-
SeedMapScreen.this.pushOptionsInfo("Cleared ESP highlights.");
5103-
}).bounds(left + halfWidth + gap, y, halfWidth, rowHeight).build());
5104-
y += rowHeight + gap;
5105-
51065100
this.addRenderableWidget(Button.builder(this.espChunksLabel(), button ->
51075101
this.minecraft.setScreen(new TextPromptScreen(this, Component.literal("ESP Chunks"), Integer.toString(SeedMapScreen.this.espChunkRange), "0 - 20", 3, value -> {
51085102
try {
@@ -5116,20 +5110,20 @@ protected void init() {
51165110
return Component.literal("Enter a value between 0 and 20.");
51175111
}
51185112
})))
5119-
.bounds(left, y, halfWidth, rowHeight)
5113+
.bounds(left + halfWidth + gap, y, halfWidth, rowHeight)
51205114
.build());
5121-
this.addRenderableWidget(Button.builder(this.espFillLabel(), button -> {
5122-
boolean enabled = !SeedMapScreen.this.selectedEspStyle().FillEnabled;
5123-
SeedMapScreen.this.updateSelectedEspStyle(style -> style.FillEnabled = enabled);
5124-
button.setMessage(this.espFillLabel());
5125-
}).bounds(left + halfWidth + gap, y, halfWidth, rowHeight).build());
51265115
y += rowHeight + gap;
51275116

51285117
this.addRenderableWidget(Button.builder(this.espProfileLabel(), button ->
51295118
this.minecraft.setScreen(new EspSettingsScreen(this)))
5130-
.bounds(left, y, panelWidth, rowHeight)
5119+
.bounds(left, y, halfWidth, rowHeight)
51315120
.build());
5121+
this.addRenderableWidget(Button.builder(Component.literal("Clear ESP"), button -> {
5122+
RenderManager.clear();
5123+
SeedMapScreen.this.pushOptionsInfo("Cleared ESP highlights.");
5124+
}).bounds(left + halfWidth + gap, y, halfWidth, rowHeight).build());
51325125
y += rowHeight + gap;
5126+
51335127
y += sectionGapLarge;
51345128

51355129
this.addRenderableWidget(Button.builder(this.datapackUrlLabel(), button ->
@@ -5149,13 +5143,13 @@ protected void init() {
51495143
this.addRenderableWidget(Button.builder(Component.literal("Import Datapack"), button -> SeedMapScreen.this.importDatapackFromOptions(true))
51505144
.bounds(left + halfWidth + gap, y, halfWidth, rowHeight)
51515145
.build());
5152-
y += rowHeight + sectionGapLarge;
5146+
y += rowHeight + gap;
51535147

51545148
this.addRenderableWidget(Button.builder(Component.literal("Datapack Settings"), button ->
51555149
this.minecraft.setScreen(new DatapackSettingsScreen(this)))
51565150
.bounds(left, y, panelWidth, rowHeight)
51575151
.build());
5158-
y += rowHeight + gap;
5152+
y += rowHeight + sectionGapLarge;
51595153

51605154
this.addRenderableWidget(Button.builder(Component.literal("Keybinds"), button ->
51615155
this.minecraft.setScreen(new KeybindsScreen(this)))

0 commit comments

Comments
 (0)