Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime compatible with MUI1 #7

Merged
merged 2 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
gtnh.settings.blowdryerTag = 0.2.1

# Human-readable mod name, available for mcmod.info population.
modName = Modular UI
modName = Modular UI 2

# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = modularui
modId = modularui2

# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cleanroommc/modularui/ModularUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(modid = ModularUI.ID, name = "Modular UI", version = Tags.VERSION, dependencies = ModularUI.DEPENDENCIES, guiFactory = "com.cleanroommc.modularui.config.GuiFactory")
@Mod(modid = ModularUI.ID, name = "Modular UI 2", version = Tags.VERSION, dependencies = ModularUI.DEPENDENCIES, guiFactory = "com.cleanroommc.modularui.config.GuiFactory")
public class ModularUI {

static final String DEPENDENCIES = "required-after:gtnhmixins@[2.0.1,); "
Expand All @@ -20,7 +20,7 @@ public class ModularUI {
+ "after:hodgepodge@[2.0.0,);"
+ "before:gregtech";

public static final String ID = "modularui";
public static final String ID = "modularui2";

public static final Logger LOGGER = LogManager.getLogger(ID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@IFMLLoadingPlugin.MCVersion("1.7.10")
public class ModularUICore implements IFMLLoadingPlugin, IEarlyMixinLoader {

public static final Logger LOGGER = LogManager.getLogger("modularui");
public static final Logger LOGGER = LogManager.getLogger("modularui2");
private static Boolean isDevEnv;

public static boolean isDevEnv() {
Expand All @@ -25,7 +25,7 @@ public static boolean isDevEnv() {

@Override
public String getMixinConfig() {
return "mixins.modularui.early.json";
return "mixins.modularui2.early.json";
}

@Override
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/cleanroommc/modularui/widgets/FluidSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,31 @@ protected void addToolTip(Tooltip tooltip) {
if (fluid != null) {
tooltip.addLine(IKey.str(fluid.getLocalizedName()));
if (this.syncHandler.controlsAmount()) {
tooltip.addLine(IKey.lang("modularui.fluid.phantom.amount", formatFluidAmount(fluid.amount), getBaseUnit()));
tooltip.addLine(IKey.lang("modularui2.fluid.phantom.amount", formatFluidAmount(fluid.amount), getBaseUnit()));
}
} else {
tooltip.addLine(IKey.lang("modularui.fluid.empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.empty"));
}
if (this.syncHandler.controlsAmount()) {
tooltip.addLine(IKey.lang("modularui.fluid.phantom.control"));
tooltip.addLine(IKey.lang("modularui2.fluid.phantom.control"));
}
} else {
if (fluid != null) {
tooltip.addLine(IKey.str(fluid.getLocalizedName()));
tooltip.addLine(IKey.lang("modularui.fluid.amount", formatFluidAmount(fluid.amount), formatFluidAmount(fluidTank.getCapacity()), getBaseUnit()));
tooltip.addLine(IKey.lang("modularui2.fluid.amount", formatFluidAmount(fluid.amount), formatFluidAmount(fluidTank.getCapacity()), getBaseUnit()));
addAdditionalFluidInfo(tooltip, fluid);
} else {
tooltip.addLine(IKey.lang("modularui.fluid.empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.empty"));
}
if (this.syncHandler.canFillSlot() || this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.EMPTY); // Add an empty line to separate from the bottom material tooltips
if (Interactable.hasShiftDown()) {
if (this.syncHandler.canFillSlot() && this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_combined"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_combined"));
} else if (this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_to_fill"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_to_fill"));
} else if (this.syncHandler.canFillSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_to_empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_to_empty"));
}
} else {
tooltip.addLine(IKey.lang("modularui.tooltip.shift"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,34 @@ protected void addToolTip(Tooltip tooltip) {
if (fluid != null) {
tooltip.addLine(IKey.str(fluid.getLocalizedName()));
if (this.syncHandler.controlsAmount()) {
tooltip.addLine(IKey.lang("modularui.fluid.phantom.amount",
tooltip.addLine(IKey.lang("modularui2.fluid.phantom.amount",
formatFluidAmount(fluidTank.getFluidAmountLong()),
getBaseUnit()));
}
} else {
tooltip.addLine(IKey.lang("modularui.fluid.empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.empty"));
}
if (this.syncHandler.controlsAmount()) {
tooltip.addLine(IKey.lang("modularui.fluid.phantom.control"));
tooltip.addLine(IKey.lang("modularui2.fluid.phantom.control"));
}
} else {
if (fluid != null) {
tooltip.addLine(IKey.str(fluid.getLocalizedName()));
tooltip.addLine(IKey.lang("modularui.fluid.amount", formatFluidAmount(fluidTank.getFluidAmountLong()),
tooltip.addLine(IKey.lang("modularui2.fluid.amount", formatFluidAmount(fluidTank.getFluidAmountLong()),
formatFluidAmount(fluidTank.getCapacityLong()), getBaseUnit()));
addAdditionalFluidInfo(tooltip, fluid);
} else {
tooltip.addLine(IKey.lang("modularui.fluid.empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.empty"));
}
if (this.syncHandler.canFillSlot() || this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.EMPTY); // Add an empty line to separate from the bottom material tooltips
if (Interactable.hasShiftDown()) {
if (this.syncHandler.canFillSlot() && this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_combined"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_combined"));
} else if (this.syncHandler.canDrainSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_to_fill"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_to_fill"));
} else if (this.syncHandler.canFillSlot()) {
tooltip.addLine(IKey.lang("modularui.fluid.click_to_empty"));
tooltip.addLine(IKey.lang("modularui2.fluid.click_to_empty"));
}
} else {
tooltip.addLine(IKey.lang("modularui.tooltip.shift"));
Expand Down
32 changes: 0 additions & 32 deletions src/main/resources/assets/modularui/lang/en_US.lang

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/resources/assets/modularui/themes.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "background",
"type": "image",
"fillParent": true,
"src": "modularui:textures/gui/background/background"
"src": "modularui2:textures/gui/background/background"
},
{
"name": "player_inventory",
Expand Down
32 changes: 32 additions & 0 deletions src/main/resources/assets/modularui2/lang/en_US.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
modularui2.test=Test Text\n2. Line
modularui2.tooltip.shift=§bHold Shift
modularui2.increment.tooltip=§7Click to increase the number by §6%d§7\nHold shift[§6%d§7], ctrl[§6%d§7] or shift+ctrl[§6%d§7]
modularui2.decrement.tooltip=§7Click to decrease the number by §6%d§7\nHold shift[§6%d§7], ctrl[§6%d§7] or shift+ctrl[§6%d§7]
modularui2.amount=§9Amount: %,d
modularui2.fluid.empty=Empty
modularui2.fluid.amount=§9Amount: %s/%s %s
modularui2.fluid.phantom.amount=§9Amount: %s %s
modularui2.fluid.phantom.control=§7Scroll wheel up increases amount, down decreases.\n§7Shift[§6x10§7],Ctrl[§ex100§7],Alt[§ax1000§7]\n§7Right click increases amount, left click decreases.\n§7Shift + left click to clear.
modularui2.item.phantom.control=§7Scroll wheel up increases amount, down decreases.\n§7Shift[§6x4§7],Ctrl[§ex16§7],Alt[§ax64§7]\n§7Right click increases amount, left click decreases.\n§7Shift + left click to clear.

modularui2.fluid.click_to_fill=§bLeft §7Click with a Fluid Container to §bfill §7the tank (Shift-click for a full stack).
modularui2.fluid.click_combined=§cRight §7or §bLeft §7Click with a Fluid Container to §cempty §7or §bfill §7the tank (Shift-click for a full stack).
modularui2.fluid.click_to_empty=§cRight §7Click with a Fluid Container to §cempty §7the tank (Shift-click for a full stack).

modularui2.config.rendering=Rendering
modularui2.config.debug=Debug

modularui2.config.animations.defaultScrollSpeed=Default scroll speed
modularui2.config.animations.defaultScrollSpeed.tooltip=Amount of pixels scrolled.
modularui2.config.animations.smoothProgressBar=Smooth progressbar
modularui2.config.animations.smoothProgressBar.tooltip=If progress bar should step in texture pixels or screen pixels. (Screen pixels are way smaller and therefore smoother)
modularui2.config.animations.panelOpenCloseAnimationTime=Duration of open/close animations
modularui2.config.animations.panelOpenCloseAnimationTime.tooltip=Time in 1/60 sec to open and close panels.
modularui2.config.animations.tooltipPos=Default tooltip position
modularui2.config.animations.tooltipPos.tooltip=Default tooltip position around the widget or its panel. Select: ABOVE, BELOW, LEFT, RIGHT, VERTICAL, HORIZONTAL, NEXT_TO_MOUSE
modularui2.config.animations.useDarkThemeByDefault=Dark theme
modularui2.config.animations.useDarkThemeByDefault.tooltip=If true and not specified otherwise, screens will try to use the 'vanilla_dark' theme.
modularui2.config.debug.guiDebugMode=GUI debug mode
modularui2.config.debug.guiDebugMode.tooltip=If true, widget outlines and widget information will be drawn.
modularui2.config.debug.enableTestGuis=Enable test GUIs
modularui2.config.debug.enableTestGuis.tooltip=Enables a test block, test item with a test gui and opening a gui by right clicking a diamond.
7 changes: 7 additions & 0 deletions src/main/resources/assets/modularui2/themes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"vanilla": "modularui2:vanilla",
"vanilla_dark": "modularui2:vanilla_dark",
"screens": {
"modularui2:test": "vanilla_dark"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.7.11",
"package": "com.cleanroommc.modularui.mixins.early",
"refmap": "mixins.modularui.refmap.json",
"refmap": "mixins.modularui2.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8.5-GTNH",
"package": "com.cleanroommc.modularui.mixins",
"refmap": "mixins.modularui.refmap.json",
"refmap": "mixins.modularui2.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8",
"mixins": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.7.11",
"package": "com.cleanroommc.modularui.mixins.late",
"refmap": "mixins.modularui.refmap.json",
"refmap": "mixins.modularui2.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}