Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b251d1f
Add undo button in VOptionScreen.java
NotNekodev Nov 30, 2025
b2e7a4a
Change position of tooltips to be slightly below the option and align…
NotNekodev Nov 30, 2025
2b37f17
make colors more welcoming, add VGuiConstants.java add hovering colors
NotNekodev Nov 30, 2025
54caebf
rewrite tooltip system, to support different translations based on di…
NotNekodev Nov 30, 2025
2aad69d
more compact page button layout
NotNekodev Nov 30, 2025
8efec30
fix hovering of the undo button even when its not visible
NotNekodev Nov 30, 2025
9da51ec
make scrolling strings for options that are too long
NotNekodev Nov 30, 2025
701cf4c
Apply italicised option name for options, where the changes havent be…
NotNekodev Dec 1, 2025
d797d1b
Make the icon and the pageButtons more compact
NotNekodev Dec 1, 2025
a5ace88
initial revision for the search area + some ui positioning improvemen…
NotNekodev Dec 1, 2025
59d5413
fix warnings in the java code
NotNekodev Dec 1, 2025
51de9bc
first real search version
NotNekodev Dec 1, 2025
cf86e8f
add some styling for selection
NotNekodev Dec 1, 2025
0c353b4
add selection and such UX + a blinking cursor
NotNekodev Dec 1, 2025
68c0198
add a keybind for returning to the vanilla settings (Shift + P) and a…
NotNekodev Dec 1, 2025
a50e6c7
fix a bug, where you cant change to the vanilla screen when there is …
NotNekodev Dec 2, 2025
b7436ef
add fovEffectScale option
NotNekodev Dec 2, 2025
cb4e1df
add glint options (glintSpeed and glintStrength) + change vulkanmod.o…
NotNekodev Dec 2, 2025
f4fc07c
WindowMode, VideoMode and all that has been rewritten and Config has …
NotNekodev Dec 2, 2025
f9f3845
make error logging in Config.java more robust
NotNekodev Dec 2, 2025
85ddb21
fix some small warnings
NotNekodev Dec 2, 2025
7afac8a
Merge branch 'xCollateral:dev' into updated-settings
NotNekodev Jan 6, 2026
bd05eaf
Merge branch 'dev' into updated-settings
NotNekodev Mar 3, 2026
119a0b4
update to newest upstream commits
NotNekodev Mar 3, 2026
fd7ab7c
disable the hardcoded false in isUpdateAvailable, that was used for t…
NotNekodev Mar 3, 2026
843b6e2
OptionsRegistry system
NotNekodev Mar 4, 2026
6a59d88
Merge branch 'xCollateral:dev' into updated-settings
NotNekodev Mar 4, 2026
ba0422f
Page builder
NotNekodev Mar 4, 2026
3724d7a
Merge branch 'dev' into updated-settings
xCollateral Apr 21, 2026
a3d5460
Refactor and small adjustments to layout
xCollateral Apr 21, 2026
2c3d9f8
Add new features to option screen
xCollateral Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/main/java/net/vulkanmod/Initializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.vulkanmod.config.Config;
import net.vulkanmod.config.Platform;
import net.vulkanmod.config.UpdateChecker;
import net.vulkanmod.config.video.VideoModeManager;
import net.vulkanmod.render.chunk.build.frapi.VulkanModRenderer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -44,14 +43,7 @@ public void onInitializeClient() {
}

private static Config loadConfig(Path path) {
Config config = Config.load(path);

if(config == null) {
config = new Config();
config.write();
}

return config;
return Config.load(path);
}

public static String getVersion() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/vulkanmod/config/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public abstract class Platform {

public static void init() {
GLFW.glfwInitHint(GLFW_PLATFORM, activePlat);
LOGGER.info("Selecting Platform: {}", getStringFromPlat(activePlat));
LOGGER.info("Selecting Platform: {}", getStringFromPlat());
LOGGER.info("GLFW: {}", GLFW.glfwGetVersionString());
GLFW.glfwInit();
}
Expand All @@ -40,14 +40,14 @@ private static int getSupportedPlat() {
return GLFW_ANY_PLATFORM; //Unknown platform
}

private static String getStringFromPlat(int plat) {
return switch (plat) {
private static String getStringFromPlat() {
return switch (Platform.activePlat) {
case GLFW_PLATFORM_WIN32 -> "WIN32";
case GLFW_PLATFORM_WAYLAND -> "WAYLAND";
case GLFW_PLATFORM_X11 -> "X11";
case GLFW_PLATFORM_COCOA -> "MACOS";
case GLFW_ANY_PLATFORM -> "ANDROID";
default -> throw new IllegalStateException("Unexpected value: " + plat);
default -> throw new IllegalStateException("Unexpected value: " + Platform.activePlat);
};
}

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/net/vulkanmod/config/gui/GuiElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.client.gui.narration.NarrationElementOutput;
import net.minecraft.client.gui.navigation.FocusNavigationEvent;
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.client.input.MouseButtonEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class GuiElement implements GuiEventListener, NarratableEntry {
Expand All @@ -22,6 +22,7 @@ public abstract class GuiElement implements GuiEventListener, NarratableEntry {
protected int hoverTime;
protected long hoverStopTime;

@SuppressWarnings("unused") // this will surely be used some day
public void setPosition(int x, int y) {
this.x = x;
this.y = y;
Expand All @@ -34,6 +35,7 @@ public void setPosition(int x, int y, int width, int height) {
this.height = height;
}

@SuppressWarnings("unused") // this will surely be used someday
public void resize(int width, int height) {
this.width = width;
this.height = height;
Expand Down Expand Up @@ -102,7 +104,7 @@ public ComponentPath getCurrentFocusPath() {
}

@Override
public ScreenRectangle getRectangle() {
public @NotNull ScreenRectangle getRectangle() {
return GuiEventListener.super.getRectangle();
}

Expand All @@ -117,7 +119,7 @@ public boolean isFocused() {
}

@Override
public NarrationPriority narrationPriority() {
public @NotNull NarrationPriority narrationPriority() {
return NarrationPriority.NONE;
}

Expand Down
46 changes: 46 additions & 0 deletions src/main/java/net/vulkanmod/config/gui/ModSettingsEntry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package net.vulkanmod.config.gui;

import net.minecraft.network.chat.FormattedText;
import net.minecraft.resources.ResourceLocation;
import net.vulkanmod.config.option.OptionPage;

import java.util.List;
import java.util.function.Supplier;

public class ModSettingsEntry {
public final FormattedText modName;
public final Supplier<ResourceLocation> iconSupplier;
private final Supplier<List<OptionPage>> optionPageSupplier;
private final Runnable onApply;

private ResourceLocation icon;
List<OptionPage> pages;

public ModSettingsEntry(FormattedText modName, Supplier<ResourceLocation> iconSupplier, Supplier<List<OptionPage>> optionPageSupplier, Runnable onApply) {
this.modName = modName;
this.iconSupplier = iconSupplier;
this.optionPageSupplier = optionPageSupplier;
this.onApply = onApply;
}

public List<OptionPage> initPages() {
this.pages = this.optionPageSupplier.get();
return this.pages;
}

public List<OptionPage> getPages() {
return pages;
}

public ResourceLocation getIcon() {
if (this.icon == null) {
this.icon = this.iconSupplier.get();
}

return icon;
}

public void runOnApply() {
onApply.run();
}
}
34 changes: 34 additions & 0 deletions src/main/java/net/vulkanmod/config/gui/ModSettingsRegistry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package net.vulkanmod.config.gui;

import it.unimi.dsi.fastutil.objects.ObjectArraySet;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.vulkanmod.Initializer;
import net.vulkanmod.config.option.Options;

import java.util.Set;

public class ModSettingsRegistry {

public static final ModSettingsRegistry INSTANCE = new ModSettingsRegistry();

private final Set<ModSettingsEntry> modEntries = new ObjectArraySet<>();

ModSettingsRegistry() {
ModSettingsEntry vulkanModSettings = new ModSettingsEntry(Component.literal("VulkanMod").withStyle(ChatFormatting.DARK_RED),
() -> ResourceLocation.fromNamespaceAndPath("vulkanmod", "vlogo_transparent.png"),
Options::getOptionPages,
() -> Initializer.CONFIG.write());
this.addModEntry(vulkanModSettings);
}

public void addModEntry(ModSettingsEntry entry) {
this.modEntries.add(entry);
}

public Set<ModSettingsEntry> getModEntries() {
return modEntries;
}
}
65 changes: 46 additions & 19 deletions src/main/java/net/vulkanmod/config/gui/VOptionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.mojang.blaze3d.opengl.GlStateManager;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.util.Mth;
import net.vulkanmod.config.gui.render.GuiRenderer;
import net.vulkanmod.config.gui.widget.OptionWidget;
Expand Down Expand Up @@ -31,14 +33,15 @@ public VOptionList(int x, int y, int width, int height, int itemHeight) {
this.width = width;
this.height = height;

this.itemWidth = (int) (0.95f * this.width);
this.itemWidth = this.width - 7;
this.itemHeight = itemHeight;
this.itemMargin = 3;
this.totalItemHeight = this.itemHeight + this.itemMargin;
}

@SuppressWarnings("unused")
public void addButton(OptionWidget<?> widget) {
this.addEntry(new Entry(widget, this.itemMargin));
this.addEntry(new Entry(widget, this.itemMargin, null));
}

public void addAll(OptionBlock[] blocks) {
Expand All @@ -47,26 +50,30 @@ public void addAll(OptionBlock[] blocks) {
int width = this.itemWidth;
int height = this.itemHeight;

// add a header (this is MOSTLY for the search)
String title = block.title();
if (title != null && !title.isEmpty()) {
this.addEntry(new Entry(null, 8, title));
}

var options = block.options();
for (Option<?> option : options) {

int margin = this.itemMargin;

final OptionWidget<?> optionWidget = option.getWidget();
optionWidget.setDimensions(x0, 0, width, height);
this.addEntry(new Entry(optionWidget, margin));
OptionWidget<?> widget = option.getWidget();
widget.setDimensions(x0, 0, width, height);
this.addEntry(new Entry(widget, margin, null));
}

this.addEntry(new Entry(null, 12));
this.addEntry(new Entry(null, 12, null));
}
}

private void addEntry(Entry entry) {
this.children.add(entry);

this.listLength += entry.getTotalHeight();
}

@SuppressWarnings("unused")
public void clearEntries() {
this.listLength = 0;
this.children.clear();
Expand Down Expand Up @@ -229,7 +236,7 @@ public void renderWidget(int mouseX, int mouseY) {
}

protected int getScrollbarPosition() {
return this.x + this.itemWidth + 5;
return this.x + this.width;
}

public VAbstractWidget getHoveredWidget(double mouseX, double mouseY) {
Expand All @@ -254,13 +261,11 @@ protected void renderList(int mouseX, int mouseY) {

int rowTop = this.y - (int) this.getScrollAmount();
for (int j = 0; j < itemCount; ++j) {
int rowBottom = rowTop + this.itemHeight;

VOptionList.Entry entry = this.getEntry(j);
if (rowBottom >= this.y && rowTop <= (this.y + this.height)) {
boolean updateState = this.focused == null;

entry.render(rowTop, mouseX, mouseY, updateState);
if (rowTop + entry.getTotalHeight() >= this.y && rowTop <= (this.y + this.height)) {
boolean updateState = this.focused == null;
entry.render(rowTop, mouseX, mouseY, updateState, this.x);
}

rowTop += entry.getTotalHeight();
Expand All @@ -278,13 +283,28 @@ protected boolean isValidClickButton(int i) {
protected static class Entry implements GuiEventListener {
final VAbstractWidget widget;
final int margin;
final String headerTitle;

private Entry(OptionWidget<?> widget, int margin) {
private Entry(OptionWidget<?> widget, int margin, String headerTitle) {
this.widget = widget;
this.margin = margin;
this.headerTitle = headerTitle;
}

public void render(int y, int mouseX, int mouseY, boolean updateState) {
public void render(int y, int mouseX, int mouseY, boolean updateState, int listX) {
// if there is a title, RENDER IT!!!
if (headerTitle != null && !headerTitle.isEmpty()) {
int headerY = y + 4;
GuiRenderer.drawString(
Minecraft.getInstance().font,
Component.literal(headerTitle),
listX + 8,
headerY,
0xFFFFFFFF
);
return;
}

if (widget == null)
return;

Expand All @@ -297,6 +317,9 @@ public void render(int y, int mouseX, int mouseY, boolean updateState) {
}

public int getTotalHeight() {
if (headerTitle != null && !headerTitle.isEmpty()) {
return Minecraft.getInstance().font.lineHeight + margin;
}
if (widget != null)
return widget.height + margin;
else
Expand All @@ -305,16 +328,19 @@ public int getTotalHeight() {

@Override
public boolean mouseClicked(MouseButtonEvent event, boolean bl) {
if (widget == null) return false;
return widget.mouseClicked(event, bl);
}

@Override
public boolean mouseReleased(MouseButtonEvent event) {
if (widget == null) return false;
return widget.mouseReleased(event);
}

@Override
public boolean mouseDragged(MouseButtonEvent event, double deltaX, double deltaY) {
if (widget == null) return false;
return widget.mouseDragged(event, deltaX, deltaY);
}

Expand All @@ -325,7 +351,8 @@ public boolean isFocused() {

@Override
public void setFocused(boolean bl) {
widget.setFocused(bl);
if (widget != null)
widget.setFocused(bl);
}
}
}
}
Loading
Loading