public void scrollKeys() { if (world.map.param.option_edgeScroll == 1) { if (Input.mousePosition.y >= Screen.height - 5) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y -= scrollSpeed; if (GraphicalMap.y < 0) { GraphicalMap.y = 0; } } else if (Input.mousePosition.y <= 2) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y += scrollSpeed; if (GraphicalMap.y > world.map.sy) { GraphicalMap.y = world.map.sy; } } if (Input.mousePosition.x <= 0) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x += scrollSpeed; if (GraphicalMap.x > world.map.sx) { GraphicalMap.x = world.map.sx; } } else if (Input.mousePosition.x >= Screen.width - 5) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x -= scrollSpeed; if (GraphicalMap.x < 0) { GraphicalMap.x = 0; } } } if (UIKeybinds.getKey(UIKeybinds.Action.PAN_UP, true)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offY -= socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y -= scrollSpeed; if (GraphicalMap.y < 0) { GraphicalMap.y = 0; } } } else if (UIKeybinds.getKey(UIKeybinds.Action.PAN_DOWN, true)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offY += socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y += scrollSpeed; if (GraphicalMap.y > world.map.sy) { GraphicalMap.y = world.map.sy; } } } if (UIKeybinds.getKey(UIKeybinds.Action.PAN_LEFT, true)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offX += socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x += scrollSpeed; if (GraphicalMap.x > world.map.sx) { GraphicalMap.x = world.map.sx; } } } else if (UIKeybinds.getKey(UIKeybinds.Action.PAN_RIGHT, true)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offX -= socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x -= scrollSpeed; if (GraphicalMap.x < 0) { GraphicalMap.x = 0; } } } }
public void scrollKeys() { if (world.map.param.option_edgeScroll == 1) { if (Input.mousePosition.y >= Screen.height - 5) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y -= scrollSpeed; if (GraphicalMap.y < 0) { GraphicalMap.y = 0; } } else if (Input.mousePosition.y <= 2) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y += scrollSpeed; if (GraphicalMap.y > world.map.sy) { GraphicalMap.y = world.map.sy; } } if (Input.mousePosition.x <= 0) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x += scrollSpeed; if (GraphicalMap.x > world.map.sx) { GraphicalMap.x = world.map.sx; } } else if (Input.mousePosition.x >= Screen.width - 5) { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x -= scrollSpeed; if (GraphicalMap.x < 0) { GraphicalMap.x = 0; } } } if (Input.GetKey(KeyCode.UpArrow) || Input.GetKey(KeyCode.W)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offY -= socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y -= scrollSpeed; if (GraphicalMap.y < 0) { GraphicalMap.y = 0; } } } else if (Input.GetKey(KeyCode.DownArrow) || Input.GetKey(KeyCode.S)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offY += socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.y += scrollSpeed; if (GraphicalMap.y > world.map.sy) { GraphicalMap.y = world.map.sy; } } } if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offX += socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x += scrollSpeed; if (GraphicalMap.x > world.map.sx) { GraphicalMap.x = world.map.sx; } } } else if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D)) { if (world.ui.state == UIMaster.uiState.SOCIETY) { if (GraphicalSociety.focus != null) { GraphicalSociety.offX -= socScrollSpeed; GraphicalSociety.refreshOffset(); } } else { //GraphicalMap.panStepsToTake = 0; GraphicalMap.lastMapChange += 1; GraphicalMap.x -= scrollSpeed; if (GraphicalMap.x < 0) { GraphicalMap.x = 0; } } } }