toggle mouse release control
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
df9401aba0
commit
ac47a4db83
@ -1612,6 +1612,7 @@ Voxel placement improvements
|
||||
Smaller wall section
|
||||
First proper house~!
|
||||
Rect area selection expands each axis independently
|
||||
Control to toggle mouse release (ie for eventual on-screen controls)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -324,27 +324,6 @@ public class AreaSelection {
|
||||
}
|
||||
}
|
||||
|
||||
//loops only break on the iteration where we encounter a barrier, so need to roll the radius values back by 1
|
||||
//in order to not include the blocks that caused the break itself
|
||||
// if(endOffset.x > 1){
|
||||
// endOffset.x--;
|
||||
// }
|
||||
// if(endOffset.y > 1){
|
||||
// endOffset.y--;
|
||||
// }
|
||||
// if(endOffset.z > 1){
|
||||
// endOffset.z--;
|
||||
// }
|
||||
// if(startOffset.x < 0){
|
||||
// startOffset.x++;
|
||||
// }
|
||||
// if(startOffset.y < 0){
|
||||
// startOffset.y++;
|
||||
// }
|
||||
// if(startOffset.z < 0){
|
||||
// startOffset.z++;
|
||||
// }
|
||||
|
||||
Vector3d startPos = new Vector3d(Globals.clientWorldData.convertBlockToRealSpace(chunkPos, blockPos))
|
||||
.add(
|
||||
startOffset.x * BlockChunkData.BLOCK_SIZE_MULTIPLIER,
|
||||
|
||||
@ -76,6 +76,7 @@ public class ControlCategoryMainGame {
|
||||
public static final String ITEM_SECONDARY = "actionItemSecondary";
|
||||
public static final String TOOLBAR_SCROLL = "toolbarScroll";
|
||||
public static final String OPEN_CRAFTING = "openCrafting";
|
||||
public static final String TOGGLE_RELEASE_MOUSE = "toggleReleaseMouse";
|
||||
|
||||
/**
|
||||
* Maps the controls
|
||||
@ -103,6 +104,7 @@ public class ControlCategoryMainGame {
|
||||
handler.addControl(ITEM_SECONDARY, new Control(ControlType.MOUSE_BUTTON,GLFW.GLFW_MOUSE_BUTTON_RIGHT,false,"Secondary","Uses the secondary equipped item"));
|
||||
handler.addControl(TOOLBAR_SCROLL, new Control(ControlType.MOUSE_SCROLL,0,false,"",""));
|
||||
handler.addControl(OPEN_CRAFTING, new Control(ControlType.KEY,GLFW.GLFW_KEY_C,true,"Open Crafting Menu", "Opens the crafting menu"));
|
||||
handler.addControl(TOGGLE_RELEASE_MOUSE, new Control(ControlType.KEY,GLFW.GLFW_KEY_LEFT_ALT,true,"Toggle Mouse", "Toggles whether the mouse is visible or not"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -783,6 +785,19 @@ public class ControlCategoryMainGame {
|
||||
WindowUtils.openInteractionMenu(WindowStrings.CRAFTING, CraftingWindow.HAND_CRAFTING_DATA);
|
||||
}});
|
||||
controlMap.get(OPEN_CRAFTING).setRepeatTimeout(0.5f * Main.targetFrameRate);
|
||||
|
||||
/*
|
||||
Open crafting
|
||||
*/
|
||||
mainGameControlList.add(controlMap.get(TOGGLE_RELEASE_MOUSE));
|
||||
controlMap.get(TOGGLE_RELEASE_MOUSE).setOnClick(new ControlMethod(){public void execute(MouseState mouseState){
|
||||
if(Globals.controlHandler.isMouseVisible()){
|
||||
Globals.controlHandler.hideMouse();
|
||||
} else {
|
||||
Globals.controlHandler.showMouse();
|
||||
}
|
||||
}});
|
||||
controlMap.get(TOGGLE_RELEASE_MOUSE).setRepeatTimeout(0.5f * Main.targetFrameRate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user