Skip to content

Commit

Permalink
style -> shape
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Feb 23, 2024
1 parent 23576a1 commit feb81d2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void render(@NotNull DrawContext context, @NotNull MinecraftClient client
.style(Flat.Rectangle.Outlined.OutliningStyle.EDGE_FADED)
);

switch (Knowledges.CONFIG.components.crosshair.ringStyle) {
switch (Knowledges.CONFIG.components.crosshair.ringShape) {
case OVAL -> {
// Oval
box.render(context, flat -> flat.new Oval()
Expand Down Expand Up @@ -147,12 +147,12 @@ public boolean requestsConfigPage() {
return true;
}

public enum RingStyle implements EnumLocalizable.WithName, EnumLocalizable.WithTooltip {
public enum RingShape implements EnumLocalizable.WithName, EnumLocalizable.WithTooltip {
OVAL("oval"), DIAMOND("diamond");

private final String path;

RingStyle(String path) {
RingShape(String path) {
this.path = path;
}

Expand All @@ -163,30 +163,30 @@ public String path() {

@Override
public MutableText localization() {
return Knowledges.localize("ring_style", path());
return Knowledges.localize("ring_shape", path());
}

@Override
public MutableText toolip() {
return Knowledges.localize("ring_style", path(), "tooltip");
return Knowledges.localize("ring_shape", path(), "tooltip");
}
}

@Override
public Function<ConfigEntryBuilder, List<AbstractFieldBuilder<?, ?, ?>>> buildConfigEntries() {
return entryBuilder -> List.of(
entryBuilder.startEnumSelector(
localize("config", "ring_style"),
RingStyle.class,
Knowledges.CONFIG.components.crosshair.ringStyle
localize("config", "ring_shape"),
RingShape.class,
Knowledges.CONFIG.components.crosshair.ringShape
)
.setDefaultValue(Knowledges.DEFAULT_CONFIG.components.crosshair.ringStyle)
.setTooltip(localize("config", "ring_style", "tooltip"))
.setDefaultValue(Knowledges.DEFAULT_CONFIG.components.crosshair.ringShape)
.setTooltip(localize("config", "ring_shape", "tooltip"))
.setEnumNameProvider(e -> ((EnumLocalizable.WithName) e).localization())
.setTooltipSupplier(ringStyle -> Optional.of(new Text[]{
ringStyle.toolip()
.setTooltipSupplier(ringShape -> Optional.of(new Text[]{
ringShape.toolip()
}))
.setSaveConsumer(value -> Knowledges.CONFIG.components.crosshair.ringStyle = value),
.setSaveConsumer(value -> Knowledges.CONFIG.components.crosshair.ringShape = value),

entryBuilder.startBooleanToggle(
localize("config", "cursor_ring_outline"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class Components implements ConfigData {
public InfoFluid infoFluid = new InfoFluid();

public static class Crosshair {
public CrosshairComponent.RingStyle ringStyle = CrosshairComponent.RingStyle.OVAL;
public CrosshairComponent.RingShape ringShape = CrosshairComponent.RingShape.OVAL;
public boolean cursorRingOutlineEnabled = false;
public boolean textsRightEnabled = true;
public boolean textsLeftEnabled = true;
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/assets/knowledges/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@
"musical_alphabet.knowledges.japanese" : "Japanese (%s)",
"musical_alphabet.knowledges.chinese" : "Chinese (%s)",

"ring_style.knowledges.oval" : "Oval",
"ring_style.knowledges.diamond": "Diamond",
"ring_shape.knowledges.oval" : "Oval",
"ring_shape.knowledges.diamond": "Diamond",

"ring_style.knowledges.oval.tooltip" : "Looks smoother, requires higher hardware performance",
"ring_style.knowledges.diamond.tooltip": "Looks sharp and angular, fast to render",
"ring_shape.knowledges.oval.tooltip" : "Looks smoother, requires higher hardware performance",
"ring_shape.knowledges.diamond.tooltip": "Looks sharp and angular, fast to render",

"util.knowledges.date_and_time": "§7Day %1$s, §r%2$s:%3$s",

"knowledge.knowledges.crosshair.name" : "Crosshair",
"knowledge.knowledges.crosshair.tooltip": "Indicates whether you are looking at something\n§cIf disabled, information such as §lblock breaking progress §r§cand §lentity health §r§cwill be invisible",

"knowledge.knowledges.crosshair.config.ring_style": "Ring Style",
"knowledge.knowledges.crosshair.config.ring_shape": "Ring Shape",

"knowledge.knowledges.crosshair.config.cursor_ring_outline" : "Cursor Ring Outline",
"knowledge.knowledges.crosshair.config.cursor_ring_outline.tooltip": "Whether to display an opaque ring outline around the crosshair ring",
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/assets/knowledges/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@
"musical_alphabet.knowledges.japanese" : "日式(%s)",
"musical_alphabet.knowledges.chinese" : "中国五声调式(%s)",

"ring_style.knowledges.oval" : "圆形",
"ring_style.knowledges.diamond": "菱形",
"ring_shape.knowledges.oval" : "圆形",
"ring_shape.knowledges.diamond": "菱形",

"ring_style.knowledges.oval.tooltip" : "看起来更加圆滑,需要更高的硬件性能",
"ring_style.knowledges.diamond.tooltip": "看起来棱角分明,渲染速度更快",
"ring_shape.knowledges.oval.tooltip" : "看起来更加圆滑,需要更高的硬件性能",
"ring_shape.knowledges.diamond.tooltip": "看起来棱角分明,渲染速度更快",

"util.knowledges.date_and_time": "§7第%1$s天,§r%2$s:%3$s",

"knowledge.knowledges.crosshair.name" : "准心",
"knowledge.knowledges.crosshair.tooltip": "用于指示你是否正看着任何东西\n§c如果禁用,则§l方块破坏进度§r§c和§l实体血量§r§c等信息将不再可见",

"knowledge.knowledges.crosshair.config.ring_style": "准心形状",
"knowledge.knowledges.crosshair.config.ring_shape": "准心形状",

"knowledge.knowledges.crosshair.config.cursor_ring_outline" : "准心指示区域描线",
"knowledge.knowledges.crosshair.config.cursor_ring_outline.tooltip": "在准心的指示区域外侧显示描线",
Expand Down

0 comments on commit feb81d2

Please sign in to comment.