Skip to content

Commit

Permalink
Merge pull request #334 from FTBTeam/feature/1.21/pointer-icon-config
Browse files Browse the repository at this point in the history
[1.21] Add config to change pointer icon type
  • Loading branch information
desht authored Nov 27, 2024
2 parents 25d42f4 + 4302771 commit 1b15c8a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,15 @@ private void mapIcons(MapIconEvent event) {
}

if (!event.getMapType().isMinimap()) {
event.add(new EntityMapIcon(mc.player, FaceIcon.getFace(mc.player.getGameProfile())));
event.add(new PointerIcon());
PointerIconMode pointerIconMode = FTBChunksClientConfig.POINTER_ICON_MODE.get();

if (pointerIconMode.showFace()) {
event.add(new EntityMapIcon(mc.player, FaceIcon.getFace(mc.player.getGameProfile())));
}

if (pointerIconMode.showPointer()) {
event.add(new PointerIcon());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public interface FTBChunksClientConfig {
StringListValue MINIMAP_INFO_HIDDEN = MINIMAP.addStringList("info_hidden", Stream.of(FPSComponent.ID, GameTimeComponent.ID, RealTimeComponent.ID, DebugComponent.ID).map(ResourceLocation::toString).toList()).excluded().comment("Info hidden under minimap");
StringMapValue MINIMAP_SETTINGS = MINIMAP.add(new MinimapComponentConfig(MINIMAP, "info_settings", Collections.emptyMap())).comment("Settings for minimap info components");
EntityTypeBoolMapValue ENTITY_ICON = MINIMAP.add(new EntityTypeBoolMapValue(MINIMAP, "entity_icon", Collections.emptyMap())).comment("Entity icons on minimap");
EnumValue<PointerIconMode> POINTER_ICON_MODE = MINIMAP.addEnum("pointer_icon_mode", PointerIconMode.NAME_MAP).comment("Mode for the pointer icon to render on full screen minimap");

SNBTConfig ADVANCED = CONFIG.addGroup("advanced", 3);
BooleanValue DEBUG_INFO = ADVANCED.addBoolean("debug_info", false).comment("Enables debug info");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.ftb.mods.ftbchunks.client;

import dev.ftb.mods.ftblibrary.config.NameMap;

public enum PointerIconMode {
FACE(true, false),
POINTER(false, true),
BOTH(true, true),
;

public static final NameMap<PointerIconMode> NAME_MAP = NameMap.of(BOTH, values()).baseNameKey("ftbchunks.minimap.pointer_icon_mode").create();

private final boolean face;
private final boolean pointer;

PointerIconMode(boolean face, boolean pointer) {
this.face = face;
this.pointer = pointer;
}

public boolean showFace() {
return face;
}

public boolean showPointer() {
return pointer;
}
}
4 changes: 4 additions & 0 deletions common/src/main/resources/assets/ftbchunks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
"ftbchunks.minimap.font_scale.tooltip": "Recommended to keep this to a multiple of 0.5",
"ftbchunks.minimap.proportional": "Proportional sizing",
"ftbchunks.minimap.proportional.tooltip": "When true, minimap size is proportional to 10%% of the screen width (modifiable by the Scale setting)\nWhen false, it is a fixed size regardless of screen resolution",
"ftbchunks.minimap.pointer_icon_mode": "Pointer Icon Mode",
"ftbchunks.minimap.pointer_icon_mode.both": "Both",
"ftbchunks.minimap.pointer_icon_mode.pointer": "Pointer",
"ftbchunks.minimap.pointer_icon_mode.face": "Face Icon",
"sidebar_button.ftbchunks.chunks": "FTB Chunks: Map",
"sidebar_button.ftbchunks.claim_chunks": "FTB Chunks: Claim Manager",
"key.categories.ftbchunks": "FTB Chunks",
Expand Down

0 comments on commit 1b15c8a

Please sign in to comment.