mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Merge pull request #6386 from Attack8/mc1.18/PonderRebind
Allow Ponder to be re-bound
This commit is contained in:
commit
1b34e52363
6 changed files with 32 additions and 25 deletions
|
@ -582,8 +582,8 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
|
|||
5616dda664dd106d576848124fc0fc1de18d0fd3 assets/create/blockstates/yellow_valve_handle.json
|
||||
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
|
||||
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
|
||||
390244ea1a4e56fb33c66490a033bd0b4870d0b8 assets/create/lang/en_ud.json
|
||||
9d2ef7ec16aec62ac33b2c0debb6b368d0fdf7f8 assets/create/lang/en_us.json
|
||||
9b0b65057342c778e8b442ad820b3400896f17ee assets/create/lang/en_ud.json
|
||||
a15459832a165e6d082d80b301e4459d3dfecd41 assets/create/lang/en_us.json
|
||||
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
|
||||
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
|
||||
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
|
||||
|
|
|
@ -1284,6 +1284,7 @@
|
|||
"create.item_attributes.smokable.inverted": "p\u01DD\u029Eo\u026FS \u01DDq \u0287ouu\u0250\u0254",
|
||||
"create.item_attributes.washable": "p\u01DD\u0265s\u0250M \u01DDq u\u0250\u0254",
|
||||
"create.item_attributes.washable.inverted": "p\u01DD\u0265s\u0250M \u01DDq \u0287ouu\u0250\u0254",
|
||||
"create.keyinfo.ponder": "\u0279\u01DDpuo\u0500",
|
||||
"create.keyinfo.scrolldown": ")p\u05DF\u0279o\u028Du\u0131( u\u028Do\u15E1 \u05DF\u01DD\u01DD\u0265\u028D\u01DDsnoW \u01DD\u0287\u0250\u05DFn\u026F\u0131S",
|
||||
"create.keyinfo.scrollup": ")p\u05DF\u0279o\u028Du\u0131( d\u2229 \u05DF\u01DD\u01DD\u0265\u028D\u01DDsnoW \u01DD\u0287\u0250\u05DFn\u026F\u0131S",
|
||||
"create.keyinfo.toolbelt": "s\u01DDxoq\u05DFoo\u27D8 \u028Eq\u0279\u0250\u01DDN ss\u01DD\u0254\u0254\u2C6F",
|
||||
|
|
|
@ -1284,6 +1284,7 @@
|
|||
"create.item_attributes.smokable.inverted": "cannot be Smoked",
|
||||
"create.item_attributes.washable": "can be Washed",
|
||||
"create.item_attributes.washable.inverted": "cannot be Washed",
|
||||
"create.keyinfo.ponder": "Ponder",
|
||||
"create.keyinfo.scrolldown": "Simulate Mousewheel Down (inworld)",
|
||||
"create.keyinfo.scrollup": "Simulate Mousewheel Up (inworld)",
|
||||
"create.keyinfo.toolbelt": "Access Nearby Toolboxes",
|
||||
|
|
|
@ -9,11 +9,14 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraftforge.client.ClientRegistry;
|
||||
|
||||
import org.lwjgl.opengl.GL;
|
||||
|
||||
public enum AllKeys {
|
||||
|
||||
TOOL_MENU("toolmenu", GLFW.GLFW_KEY_LEFT_ALT),
|
||||
ACTIVATE_TOOL("", GLFW.GLFW_KEY_LEFT_CONTROL),
|
||||
TOOLBELT("toolbelt", GLFW.GLFW_KEY_LEFT_ALT),
|
||||
PONDER("ponder", GLFW.GLFW_KEY_W)
|
||||
|
||||
;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.google.common.base.Strings;
|
||||
import com.mojang.blaze3d.platform.InputConstants;
|
||||
import com.simibubi.create.AllKeys;
|
||||
import com.simibubi.create.foundation.gui.ScreenOpener;
|
||||
import com.simibubi.create.foundation.ponder.ui.NavigatableSimiScreen;
|
||||
import com.simibubi.create.foundation.ponder.ui.PonderUI;
|
||||
|
@ -28,7 +29,7 @@ public class PonderTooltipHandler {
|
|||
|
||||
public static boolean enable = true;
|
||||
|
||||
static LerpedFloat holdWProgress = LerpedFloat.linear()
|
||||
static LerpedFloat holdKeyProgress = LerpedFloat.linear()
|
||||
.startWithValue(0);
|
||||
static ItemStack hoveredStack = ItemStack.EMPTY;
|
||||
static ItemStack trackingStack = ItemStack.EMPTY;
|
||||
|
@ -49,11 +50,11 @@ public class PonderTooltipHandler {
|
|||
|
||||
if (hoveredStack.isEmpty() || trackingStack.isEmpty()) {
|
||||
trackingStack = ItemStack.EMPTY;
|
||||
holdWProgress.startWithValue(0);
|
||||
holdKeyProgress.startWithValue(0);
|
||||
return;
|
||||
}
|
||||
|
||||
float value = holdWProgress.getValue();
|
||||
float value = holdKeyProgress.getValue();
|
||||
int keyCode = ponderKeybind().getKey()
|
||||
.getValue();
|
||||
long window = instance.getWindow()
|
||||
|
@ -64,12 +65,12 @@ public class PonderTooltipHandler {
|
|||
if (currentScreen instanceof NavigatableSimiScreen)
|
||||
((NavigatableSimiScreen) currentScreen).centerScalingOnMouse();
|
||||
ScreenOpener.transitionTo(PonderUI.of(trackingStack));
|
||||
holdWProgress.startWithValue(0);
|
||||
holdKeyProgress.startWithValue(0);
|
||||
return;
|
||||
}
|
||||
holdWProgress.setValue(Math.min(1, value + Math.max(.25f, value) * .25f));
|
||||
holdKeyProgress.setValue(Math.min(1, value + Math.max(.25f, value) * .25f));
|
||||
} else
|
||||
holdWProgress.setValue(Math.max(0, value - .05f));
|
||||
holdKeyProgress.setValue(Math.max(0, value - .05f));
|
||||
|
||||
hoveredStack = ItemStack.EMPTY;
|
||||
}
|
||||
|
@ -92,7 +93,7 @@ public class PonderTooltipHandler {
|
|||
.getFrameTime();
|
||||
Component component = subject ? Lang.translateDirect(SUBJECT)
|
||||
.withStyle(ChatFormatting.GREEN)
|
||||
: makeProgressBar(Math.min(1, holdWProgress.getValue(renderPartialTicks) * 8 / 7f));
|
||||
: makeProgressBar(Math.min(1, holdKeyProgress.getValue(renderPartialTicks) * 8 / 7f));
|
||||
List<Component> tooltip = event.getToolTip();
|
||||
if (tooltip.size() < 2)
|
||||
tooltip.add(component);
|
||||
|
@ -121,7 +122,7 @@ public class PonderTooltipHandler {
|
|||
return;
|
||||
|
||||
if (prevStack.isEmpty() || !prevStack.sameItem(stack))
|
||||
holdWProgress.startWithValue(0);
|
||||
holdKeyProgress.startWithValue(0);
|
||||
|
||||
hoveredStack = stack;
|
||||
trackingStack = stack;
|
||||
|
@ -130,13 +131,13 @@ public class PonderTooltipHandler {
|
|||
public static void handleTooltipColor(RenderTooltipEvent.Color event) {
|
||||
if (trackingStack != event.getItemStack())
|
||||
return;
|
||||
if (holdWProgress.getValue() == 0)
|
||||
if (holdKeyProgress.getValue() == 0)
|
||||
return;
|
||||
float renderPartialTicks = Minecraft.getInstance()
|
||||
.getFrameTime();
|
||||
int start = event.getOriginalBorderStart();
|
||||
int end = event.getOriginalBorderEnd();
|
||||
float progress = Math.min(1, holdWProgress.getValue(renderPartialTicks) * 8 / 7f);
|
||||
float progress = Math.min(1, holdKeyProgress.getValue(renderPartialTicks) * 8 / 7f);
|
||||
|
||||
start = getSmoothColorForProgress(progress);
|
||||
end = getSmoothColorForProgress((progress));
|
||||
|
@ -176,7 +177,7 @@ public class PonderTooltipHandler {
|
|||
}
|
||||
|
||||
protected static KeyMapping ponderKeybind() {
|
||||
return Minecraft.getInstance().options.keyUp;
|
||||
return AllKeys.PONDER.getKeybind();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,8 @@
|
|||
"create.keyinfo.toolmenu": "Focus Schematic Overlay",
|
||||
"create.keyinfo.toolbelt": "Access Nearby Toolboxes",
|
||||
"create.keyinfo.scrollup": "Simulate Mousewheel Up (inworld)",
|
||||
"create.keyinfo.scrolldown": "Simulate Mousewheel Down (inworld)",
|
||||
"create.keyinfo.scrolldown": "Simulate Mousewheel Down (inworld)",
|
||||
"create.keyinfo.ponder": "Ponder",
|
||||
|
||||
"create.gui.scrollInput.defaultTitle": "Choose an Option:",
|
||||
"create.gui.scrollInput.scrollToModify": "Scroll to Modify",
|
||||
|
|
Loading…
Reference in a new issue