block cursor intercept sink movement
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d0fcded76d
commit
7fb0f5a489
@ -1,7 +1,5 @@
|
|||||||
package electrosphere.controls.categories;
|
package electrosphere.controls.categories;
|
||||||
|
|
||||||
import static org.lwjgl.glfw.GLFW.GLFW_KEY_LEFT_CONTROL;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -24,6 +22,7 @@ import electrosphere.controls.Control.ControlType;
|
|||||||
import electrosphere.controls.ControlHandler;
|
import electrosphere.controls.ControlHandler;
|
||||||
import electrosphere.controls.ControlHandler.ControlsState;
|
import electrosphere.controls.ControlHandler.ControlsState;
|
||||||
import electrosphere.controls.MouseState;
|
import electrosphere.controls.MouseState;
|
||||||
|
import electrosphere.controls.cursor.CursorState;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.engine.Main;
|
import electrosphere.engine.Main;
|
||||||
import electrosphere.engine.assetmanager.AssetDataStrings;
|
import electrosphere.engine.assetmanager.AssetDataStrings;
|
||||||
@ -45,6 +44,7 @@ import electrosphere.entity.types.common.CommonEntityFlags;
|
|||||||
import electrosphere.entity.types.common.CommonEntityUtils;
|
import electrosphere.entity.types.common.CommonEntityUtils;
|
||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
import electrosphere.entity.types.creature.CreatureUtils;
|
||||||
import electrosphere.game.data.common.interact.InteractionData;
|
import electrosphere.game.data.common.interact.InteractionData;
|
||||||
|
import electrosphere.game.data.item.Item;
|
||||||
import electrosphere.net.parser.net.message.EntityMessage;
|
import electrosphere.net.parser.net.message.EntityMessage;
|
||||||
import electrosphere.renderer.ui.elements.Window;
|
import electrosphere.renderer.ui.elements.Window;
|
||||||
import electrosphere.renderer.ui.events.MouseEvent;
|
import electrosphere.renderer.ui.events.MouseEvent;
|
||||||
@ -512,6 +512,17 @@ public class ControlCategoryMainGame {
|
|||||||
mainGameControlList.add(controlMap.get(INPUT_CODE_SINK));
|
mainGameControlList.add(controlMap.get(INPUT_CODE_SINK));
|
||||||
controlMap.get(INPUT_CODE_SINK).setOnPress(new ControlMethod(){public void execute(MouseState mouseState){
|
controlMap.get(INPUT_CODE_SINK).setOnPress(new ControlMethod(){public void execute(MouseState mouseState){
|
||||||
if(Globals.playerEntity != null){
|
if(Globals.playerEntity != null){
|
||||||
|
if(ClientToolbarState.hasClientToolbarState(Globals.playerEntity)){
|
||||||
|
ClientToolbarState clientToolbarState = ClientToolbarState.getClientToolbarState(Globals.playerEntity);
|
||||||
|
if(clientToolbarState.getCurrentPrimaryItem() != null){
|
||||||
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(clientToolbarState.getCurrentPrimaryItem());
|
||||||
|
if(Globals.playerCursor != null && Globals.playerBlockCursor != null){
|
||||||
|
if(itemData.getTokens().contains(CursorState.CURSOR_BLOCK_TOKEN)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(ClientEditorMovementTree.getClientEditorMovementTree(Globals.playerEntity) != null){
|
if(ClientEditorMovementTree.getClientEditorMovementTree(Globals.playerEntity) != null){
|
||||||
ClientEditorMovementTree clientEditorMovementTree = ClientEditorMovementTree.getClientEditorMovementTree(Globals.playerEntity);
|
ClientEditorMovementTree clientEditorMovementTree = ClientEditorMovementTree.getClientEditorMovementTree(Globals.playerEntity);
|
||||||
clientEditorMovementTree.start(electrosphere.entity.state.movement.editor.ClientEditorMovementTree.EditorMovementRelativeFacing.DOWN);
|
clientEditorMovementTree.start(electrosphere.entity.state.movement.editor.ClientEditorMovementTree.EditorMovementRelativeFacing.DOWN);
|
||||||
@ -601,7 +612,7 @@ public class ControlCategoryMainGame {
|
|||||||
mainGameControlList.add(controlMap.get(TOOLBAR_SCROLL));
|
mainGameControlList.add(controlMap.get(TOOLBAR_SCROLL));
|
||||||
controlMap.get(TOOLBAR_SCROLL).setOnScroll(new Control.ScrollCallback() {public void execute(MouseState mouseState, ScrollEvent scrollEvent){
|
controlMap.get(TOOLBAR_SCROLL).setOnScroll(new Control.ScrollCallback() {public void execute(MouseState mouseState, ScrollEvent scrollEvent){
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
if(Globals.controlCallback.getKey(GLFW_KEY_LEFT_CONTROL)){
|
if(Globals.controlCallback.getKey(GLFW.GLFW_KEY_LEFT_CONTROL)){
|
||||||
//if the block cursor is visible, capture this input and instead modify block cursor
|
//if the block cursor is visible, capture this input and instead modify block cursor
|
||||||
if(Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE).contains(Globals.playerBlockCursor)){
|
if(Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE).contains(Globals.playerBlockCursor)){
|
||||||
Globals.cursorState.updateCursorSize(scrollEvent);
|
Globals.cursorState.updateCursorSize(scrollEvent);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user