Skip to content

Commit

Permalink
Merge pull request #258 from simlu/qa
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
simlu authored Sep 25, 2017
2 parents b8f2a08 + f14f9f0 commit 1923b4e
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 11 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java
dist: trusty
jdk:
- oraclejdk8
dist: precise

# -----------------
# Reference: https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
Expand All @@ -21,39 +21,32 @@ before_install:
- if [ "$TRAVIS_BRANCH" != "master" ]; then echo "$TRAVIS_BUILD_NUMBER" >> $TRAVIS_BUILD_DIR/target/classes/resource/build.txt; fi
- echo $(date +"%Y-%m-%d") >> $TRAVIS_BUILD_DIR/target/classes/resource/date.txt

deploy:
provider: s3
access_key_id: $S3_ACCESS_KEY_ID
secret_access_key: $S3_SECRET_ACCESS_KEY
bucket: $S3_BUCKET
region: $S3_REGION
upload-dir: build/$TRAVIS_BRANCH
local-dir: $TRAVIS_BUILD_DIR/target/build
skip_cleanup: true
acl: public_read
on:
all_branches: true
jdk: oraclejdk8
after_success:
- "mvn -DskipTests package"
- "pip install --user awscli"
- "~/.local/bin/aws s3 cp $TRAVIS_BUILD_DIR/target/build/voxelshop-bin.zip s3://$S3_BUCKET/build/$TRAVIS_BRANCH/voxelshop-bin.zip --region=$S3_REGION"

deploy:
provider: releases
prerelease: true
api_key:
secure: mA6DaAr2VXyE8Zn0LPq7XX3e3/Dnlk3trkNDhuWNbs4jCISbCLBJalJEaovgd392/tKYjmOdN7kN+PUVyOwQZgwl2v7Q4cx0epMksibLhjICvVegGRMM/epPaOBqrQXy31gZN6RDKxVG/XFw9K9ez3TUZr0GmsjaRjQ9rNL62eRwvywrNzNFHLDJAWtM4Jl/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uJpv54gAjtBUpoFb/nNnkMw6MuN/xSzcgKs/ZWQk3HSPNuSuiWi/XPftNPUYJIJsZCeZscfKIBupzUhU9W8NX4r+LmYHA="
file: $TRAVIS_BUILD_DIR/target/build/voxelshop-bin.zip
skip_cleanup: true
on:
repo: simlu/voxelshop
repo: $DEPLOY_REPO
branch: qa
tags: true
jdk: oraclejdk8

deploy:
provider: releases
api_key:
secure: mA6DaAr2VXyE8Zn0LPq7XX3e3/Dnlk3trkNDhuWNbs4jCISbCLBJalJEaovgd392/tKYjmOdN7kN+PUVyOwQZgwl2v7Q4cx0epMksibLhjICvVegGRMM/epPaOBqrQXy31gZN6RDKxVG/XFw9K9ez3TUZr0GmsjaRjQ9rNL62eRwvywrNzNFHLDJAWtM4Jl/DijN1LHO17OcecQArRA/Dk8y2r52DlKBXqQlksqfr3slJOH2natY/Nf2ZkfEyYZNRZ+6J9uKbkCTFncVoN80V/1nlA9QQ17gJx5ZnhpWqytebMgdRBKHgVECuLRHfw7vUzkQkk3V9U/VMxYTassWYYcfV9PNWCSshL4czl5LjMzRU65M+H2l/pISFwpwFM4E5u7A8lJ4KWclgfU7vFn/iWkb95NeAbYvPOfvB4OGIiaSI8xTWWL/tKdX+hmjWIKPSdhQd8B26syfJeqL2DcgE8uFjgisLZuBlWl7dKr11ausTPcA8lu4A4dWsZpuBVIPT6/Oi0XEFYVaTiy3CSV/XVV1XORME6G3UC0098DlWW/sZw5dA6jv/cf0o4IwttYDZdNq8fQVL2aXM7uJpv54gAjtBUpoFb/nNnkMw6MuN/xSzcgKs/ZWQk3HSPNuSuiWi/XPftNPUYJIJsZCeZscfKIBupzUhU9W8NX4r+LmYHA=
secure: "mA6DaAr2VXyE8Zn0LPq7XX3e3/Dnlk3trkNDhuWNbs4jCISbCLBJalJEaovgd392/tKYjmOdN7kN+PUVyOwQZgwl2v7Q4cx0epMksibLhjICvVegGRMM/epPaOBqrQXy31gZN6RDKxVG/XFw9K9ez3TUZr0GmsjaRjQ9rNL62eRwvywrNzNFHLDJAWtM4Jl/DijN1LHO17OcecQArRA/Dk8y2r52DlKBXqQlksqfr3slJOH2natY/Nf2ZkfEyYZNRZ+6J9uKbkCTFncVoN80V/1nlA9QQ17gJx5ZnhpWqytebMgdRBKHgVECuLRHfw7vUzkQkk3V9U/VMxYTassWYYcfV9PNWCSshL4czl5LjMzRU65M+H2l/pISFwpwFM4E5u7A8lJ4KWclgfU7vFn/iWkb95NeAbYvPOfvB4OGIiaSI8xTWWL/tKdX+hmjWIKPSdhQd8B26syfJeqL2DcgE8uFjgisLZuBlWl7dKr11ausTPcA8lu4A4dWsZpuBVIPT6/Oi0XEFYVaTiy3CSV/XVV1XORME6G3UC0098DlWW/sZw5dA6jv/cf0o4IwttYDZdNq8fQVL2aXM7uJpv54gAjtBUpoFb/nNnkMw6MuN/xSzcgKs/ZWQk3HSPNuSuiWi/XPftNPUYJIJsZCeZscfKIBupzUhU9W8NX4r+LmYHA="
file: $TRAVIS_BUILD_DIR/target/build/voxelshop-bin.zip
skip_cleanup: true
on:
repo: simlu/voxelshop
repo: $DEPLOY_REPO
branch: master
tags: true
jdk: oraclejdk8
2 changes: 1 addition & 1 deletion PS4k.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Documentation on how to use the program can be found [here](https://simlu.github
## Setup, Run Locally and Distributable

### Required Tools
Git, IntelliJ and JDK7 (e.g. http://downloads.puresoftware.org/files/android/JDK/)
Git, IntelliJ and JDK8 (e.g. http://downloads.puresoftware.org/files/android/JDK/)

### Git
Fork the git repository, open a terminal, go to the desired project location and type:
Expand All @@ -37,7 +37,7 @@ Make sure you use a different branch for each change set.

### IntelliJ
- Click Open and select PS4k Folder (within the folder you selected as root)
- Ensure the JDK7 is selected under File > Project Structure > Project
- Ensure the JDK8 is selected under File > Project Structure > Project
- Right click on PS4k > src > com > vitco > Main and "Run" to start VoxelShop
- **Important**: Click on Main and on "Edit Configuration" and add "debug" as a program argument

Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
5 changes: 5 additions & 0 deletions resource/bundle/LangBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ swap_mainView_with_yzView_caption = Swap YZ with 3D View

# shortcuts
global_shortcuts_caption = Global
mouse_shortcuts_caption = Mouse
mouse_button_left_caption = Mouse Left
mouse_button_middle_caption = Mouse Middle
mouse_button_right_caption = Mouse Right
shortcut_mg_header_action = Action
shortcut_mg_header_shortcut = Shortcut
shortcut_mg_header_mbutton = Mouse Button

# global hotkeys
toggle_animation_mode = Toggle Animation Mode
Expand Down
52 changes: 38 additions & 14 deletions src/main/java/com/vitco/app/layout/content/mainview/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,24 @@ public void performAction() {
});
}

private Point leftMouseDown = null;
private Point rightMouseDown = null;
// left, middle, right
private Point[] mouseDown = new Point[] {null, null, null};
private String[] mouseAction = new String[] {null, null, null};
{
preferences.addPrefChangeListener("mbutton1", newValue -> mouseAction[0] = (String) newValue);
preferences.addPrefChangeListener("mbutton2", newValue -> mouseAction[1] = (String) newValue);
preferences.addPrefChangeListener("mbutton3", newValue -> mouseAction[2] = (String) newValue);
}

@Override
public void mousePressed(final MouseEvent e) {
asyncActionManager.addAsyncAction(new AsyncAction() {
@Override
public void performAction() {
switch (e.getModifiers() & (MouseEvent.BUTTON1_MASK | MouseEvent.BUTTON2_MASK | MouseEvent.BUTTON3_MASK)) {
case MouseEvent.BUTTON1_MASK: case MouseEvent.BUTTON2_MASK: leftMouseDown = e.getPoint(); break;
case MouseEvent.BUTTON3_MASK: rightMouseDown = e.getPoint(); break;
case MouseEvent.BUTTON1_MASK: mouseDown[0] = e.getPoint(); break;
case MouseEvent.BUTTON2_MASK: mouseDown[1] = e.getPoint(); break;
case MouseEvent.BUTTON3_MASK: mouseDown[2] = e.getPoint(); break;
default: break;
}
}
Expand All @@ -351,8 +358,9 @@ public void mouseReleased(final MouseEvent e) {
@Override
public void performAction() {
switch (e.getModifiers() & (MouseEvent.BUTTON1_MASK | MouseEvent.BUTTON2_MASK | MouseEvent.BUTTON3_MASK)) {
case MouseEvent.BUTTON1_MASK: case MouseEvent.BUTTON2_MASK: leftMouseDown = null; break;
case MouseEvent.BUTTON3_MASK: rightMouseDown = null; break;
case MouseEvent.BUTTON1_MASK: mouseDown[0] = null; break;
case MouseEvent.BUTTON2_MASK: mouseDown[1] = null; break;
case MouseEvent.BUTTON3_MASK: mouseDown[2] = null; break;
default: break;
}
}
Expand All @@ -364,16 +372,32 @@ public void mouseDragged(final MouseEvent e) {
asyncActionManager.addAsyncAction(new AsyncAction() {
@Override
public void performAction() {
if (leftMouseDown != null) {
camera.rotate(e.getX() - leftMouseDown.x, e.getY() - leftMouseDown.y);
leftMouseDown.x = e.getX();
leftMouseDown.y = e.getY();
Point rotateMouseButton = null;
Point truckMouseButton = null;
for (int i = 0; i < 3; i++) {
switch (mouseAction[i]) {
case "rotate":
if (rotateMouseButton == null) {
rotateMouseButton = mouseDown[i];
}
break;
case "truck":
if (truckMouseButton == null) {
truckMouseButton = mouseDown[i];
}
break;
}
}
if (rotateMouseButton != null) {
camera.rotate(e.getX() - rotateMouseButton.x, e.getY() - rotateMouseButton.y);
rotateMouseButton.x = e.getX();
rotateMouseButton.y = e.getY();
container.doNotSkipNextWorldRender();
forceRepaint();
} else if (rightMouseDown != null) {
camera.shift(e.getX() - rightMouseDown.x, e.getY() - rightMouseDown.y, VitcoSettings.MAIN_VIEW_SIDE_MOVE_FACTOR);
rightMouseDown.x = e.getX();
rightMouseDown.y = e.getY();
} else if (truckMouseButton != null) {
camera.shift(e.getX() - truckMouseButton.x, e.getY() - truckMouseButton.y, VitcoSettings.MAIN_VIEW_SIDE_MOVE_FACTOR);
truckMouseButton.x = e.getX();
truckMouseButton.y = e.getY();
container.doNotSkipNextWorldRender();
forceRepaint();
}
Expand Down
Loading

0 comments on commit 1923b4e

Please sign in to comment.