Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nthxny committed May 26, 2024
1 parent f716e7a commit 11636b3
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 14 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Discord. You can report issues on the [Xenon GitHub](https://github.com/anthxnym
Xenon will work with everything Embeddium does, as it is a fork. We intend to keep compatibility
with upstream and Embeddium / Forge Sodium addons as much as possible.

If you're looking to add Embeddium to your development environment, please take a look at the [dedicated wiki page](https://github.com/embeddedt/embeddium/wiki/For-Developers) for instructions & recommended guidelines for integration.

For now, please continue to use [Oculus](https://www.curseforge.com/minecraft/mc-mods/oculus) if you want shader support.
If you encounter issues with shaders installed, disable Oculus first, and if that fixes it, report the issue to them instead.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.pipeline.RenderTarget;
import com.mojang.blaze3d.platform.Window;
import me.jellysquid.mods.sodium.client.compat.modernui.MuiGuiScaleHook;
import me.jellysquid.mods.sodium.client.compatibility.workarounds.Workarounds;
import me.jellysquid.mods.sodium.client.gl.arena.staging.MappedStagingBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class SodiumOptionsGUI extends Screen implements ScreenPromptable {
// Donation prompt should not be shown with Controllable present (as it's impossible to exit) or in a dev env.
private static final boolean IS_POPUP_SAFE = !PlatformUtil.modPresent("controllable") && !PlatformUtil.isDevelopmentEnvironment();

private final List<OptionPage> pages = new ArrayList<>();
public final List<OptionPage> pages = new ArrayList<>();

private final List<ControlElement<?>> controls = new ArrayList<>();

Expand All @@ -71,7 +71,7 @@ public class SodiumOptionsGUI extends Screen implements ScreenPromptable {
private boolean forceOldScreen;

public SodiumOptionsGUI(Screen prevScreen) {
super(Component.literal(MODNAME + " Options"));
super(Component.translatable(MODNAME + " Options"));

this.prevScreen = prevScreen;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.jellysquid.mods.sodium.client.gui.widgets;

import me.jellysquid.mods.sodium.client.gui.reesesoptions.client.gui.FlatButtonWidgetExtended;
import me.jellysquid.mods.sodium.client.util.Dim2i;
import net.minecraft.client.gui.ComponentPath;
import net.minecraft.client.gui.GuiGraphics;
Expand All @@ -14,7 +15,7 @@

import java.util.Objects;

public class FlatButtonWidget extends AbstractWidget implements Renderable {
public class FlatButtonWidget extends AbstractWidget implements Renderable, FlatButtonWidgetExtended {
protected final Dim2i dim;
private final Runnable action;

Expand Down Expand Up @@ -172,4 +173,8 @@ public static Style defaults() {
}
}

@Override
public boolean isLeftAligned() {
return this.leftAligned;
}
}
141 changes: 133 additions & 8 deletions src/main/java/me/jellysquid/mods/sodium/client/util/Dim2i.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
package me.jellysquid.mods.sodium.client.util;

public record Dim2i(int x, int y, int width, int height) implements Point2i {
public int getLimitX() {
return this.x + this.width;
import me.jellysquid.mods.sodium.client.gui.reesesoptions.client.gui.Dim2iExtended;
import me.jellysquid.mods.sodium.client.gui.reesesoptions.client.gui.Point2i;

import java.util.Objects;

public final class Dim2i implements Dim2iExtended, Point2i
{
private Point2i point2i;
private int x;
private int y;
private int width;
private int height;

public Dim2i(int x, int y, int width, int height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}

public int getLimitX()
Expand All @@ -25,6 +41,119 @@ public int getCenterX()
return (this.x() + this.width() / 2);
}

public int getCenterY()
{
return (this.y() + this.height() / 2);
}

public Point2i point2i()
{
return point2i;
}

public int x()
{
if (this.point2i != null) {
return (this.x + this.point2i.getX());
}

return x;
}

public int y()
{
if (this.point2i != null) {
return (this.y + this.point2i.getY());
}

return y;
}

public int width()
{
return width;
}

public int height()
{
return height;
}

@Override
public boolean equals(Object obj)
{
if (obj == this) return true;
if (obj == null || obj.getClass() != this.getClass()) return false;
var that = (Dim2i) obj;
return Objects.equals(this.point2i, that.point2i) &&
this.x == that.x &&
this.y == that.y &&
this.width == that.width &&
this.height == that.height;
}

@Override
public int hashCode()
{
return Objects.hash(point2i, x, y, width, height);
}

@Override
public String toString()
{
return "Dim2i[" +
"point2i=" + point2i + ", " +
"x=" + x + ", " +
"y=" + y + ", " +
"width=" + width + ", " +
"height=" + height + ']';
}

@Override
public void setPoint2i(Point2i point2i) {
this.point2i = point2i;
}

@Override
public void setX(int x) {
this.x = x;
}

@Override
public void setY(int y) {
this.y = y;
}

@Override
public void setWidth(int width) {
this.width = width;
}

@Override
public void setHeight(int height) {
this.height = height;
}

@Override
public int getX() {
return this.x();
}

@Override
public int getY() {
return this.y();
}

@Override
public boolean canFitDimension(Dim2i anotherDim) {
return this.x() <= anotherDim.x() && this.y() <= anotherDim.y() && this.getLimitX() >= anotherDim.getLimitX() && this.getLimitY() >= anotherDim.getLimitY();
}

@Override
public boolean overlapWith(Dim2i other) {
return this.x() < other.getLimitX() && this.getLimitX() > other.x() && this.y() < other.getLimitY() && this.getLimitY() > other.y();
}

public Dim2i withHeight(int newHeight) {
return new Dim2i(x, y, width, newHeight);
}
Expand All @@ -41,15 +170,11 @@ public Dim2i withY(int newY) {
return new Dim2i(x, newY, width, height);
}

public boolean canFitDimension(Dim2i anotherDim) {
return this.x() <= anotherDim.x() && this.y() <= anotherDim.y() && this.getLimitX() >= anotherDim.getLimitX() && this.getLimitY() >= anotherDim.getLimitY();
}

public boolean overlapsWith(Dim2i other) {
return this.x() < other.getLimitX() && this.getLimitX() > other.x() && this.y() < other.getLimitY() && this.getLimitY() > other.y();
}

public Dim2i withParentOffset(Point2i parent) {
return new Dim2i(parent.x() + x, parent.y() + y, width, height);
return new Dim2i(parent.getX() + x, parent.getY() + y, width, height);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"options.leaf_culling.none": "None",
"options.leaf_culling.hollow": "Hollow",
"options.leaf_culling.solid": "Solid",
"options.leaf_culling.solid_aggressive": "Solid Aggressive"
"options.leaf_culling.solid_aggressive": "Solid Aggressive",
"sodium.console.broken_nvidia_driver": "Your NVIDIA graphics drivers are out of date!\n * This will cause severe performance issues and crashes when Embeddium is installed.\n * Please update your graphics drivers to the latest version (version 536.23 or newer.)",
"sodium.console.pojav_launcher": "PojavLauncher is not supported when using Embeddium.\n * You are very likely to run into extreme performance issues, graphical bugs, and crashes.\n * You will be on your own if you decide to continue -- we will not help you with any bugs or crashes!",
"sodium.console.core_shaders_error": "The following resource packs are incompatible with Embeddium:",
Expand Down

0 comments on commit 11636b3

Please sign in to comment.