mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-12 00:17:51 +00:00
Co-authored-by: Marcin Siekierski <marcin.siekierski97@gmail.com>
This commit is contained in:
1 parent
ee060b9253
commit
a41299dfca
2 files changed
+14
-5
No files matched your search
@@ -406,7 +406,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (!rightclick) {
|
||||
if (Keyboard.getEventKeyState() && getIsAccessibleControlEventKey()) {
|
||||
if (Keyboard.getEventKeyState() && getIsAccessibleControlEventKey()
|
||||
&& NEIClientConfig.canChangeCheatMode()) {
|
||||
NEIClientConfig.cycleSetting("inventory.cheatmode", 3);
|
||||
} else {
|
||||
if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT
|
||||
@@ -430,7 +431,10 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
else if (cheatMode == 2) modeColor = EnumChatFormatting.RED.toString();
|
||||
String controlKeyLocalization = translate(Minecraft.isRunningOnMac ? "key.ctrl.mac" : "key.ctrl");
|
||||
tooltip.add(modeColor + translate("inventory.options.tip.cheatmode." + cheatMode));
|
||||
tooltip.add(modeColor + translate("inventory.options.tip.cheatmode.disable", controlKeyLocalization));
|
||||
if (NEIClientConfig.canChangeCheatMode()) {
|
||||
tooltip.add(
|
||||
modeColor + translate("inventory.options.tip.cheatmode.disable", controlKeyLocalization));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -157,7 +157,7 @@ public class NEIClientConfig {
|
||||
return getLockedMode() == -1 || getLockedMode() == index && NEIInfo.isValidMode(index);
|
||||
}
|
||||
});
|
||||
checkCheatMode();
|
||||
canChangeCheatMode();
|
||||
|
||||
tag.getTag("inventory.utilities").setDefaultValue("delete, magnet");
|
||||
API.addOption(new OptionUtilities("inventory.utilities"));
|
||||
@@ -808,8 +808,13 @@ public class NEIClientConfig {
|
||||
return getIntSetting("inventory.cheatmode");
|
||||
}
|
||||
|
||||
private static void checkCheatMode() {
|
||||
if (getLockedMode() != -1) setIntSetting("inventory.cheatmode", getLockedMode());
|
||||
public static boolean canChangeCheatMode() {
|
||||
if (getLockedMode() != -1) {
|
||||
setIntSetting("inventory.cheatmode", getLockedMode());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int getLockedMode() {
|
||||
|
||||
Reference in new issue
Block a user