Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20] Camera look straight up down FINISH #133

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@064a97fb0b4cef86a65f09898c572382f3af10e0

- name: Run unit test suite
uses: gradle/[email protected]
with:
arguments: :common:test

- name: Build Fabric with Gradle
uses: gradle/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ run/

# Ignore Gradle build output directory
build

# Ignore Gragle test report logs
/common/logs/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ This feature adds the following key bindings to control the camera through the k
10. Right Alt + Look Right Key or Look East Key (default: Keypad 9) = Snaps the camera to the east block.
11. Right Alt + Look Down Key or Look South Key (default: Keypad 3) = Snaps the camera to the south block.
12. Right Alt + Look Left Key or Look West Key (default: Keypad 1) = Snaps the camera to the west block.
13. Center Camera (default: Keypad 5) = Snaps the camera to the closest cardinal direction and centers it.
14. Left Alt + Center Camera = Snaps the camera to the closest opposite cardinal direction and centers it.
13. Right Alt + double Look Up Key or Look Straight Up Key (default: Keypad 0): Snaps the camera to the look above head direction.
14. Right Alt + double Look Down Key (default: O) or Look Straight Down Key (default: Keypad `.` (decimal, dot)): Snaps the camera to the look down at feet direction.
15. Center Camera (default: Keypad 5) = Snaps the camera to the closest cardinal direction and centers it.
16. Left Alt + Center Camera = Snaps the camera to the closest opposite cardinal direction and centers it.

**Configuration Options:-**

Expand Down
11 changes: 11 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"

// Unit test dependencies
testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0"
testImplementation "org.assertj:assertj-core:3.24.2"
testImplementation "org.mockito:mockito-core:5.4.0"
testImplementation "org.mockito:mockito-junit-jupiter:5.4.0"
}

test {
useJUnitPlatform()
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public class OtherConfigsMap {
@SerializedName("Debug Mode")
private boolean debugMode;

/**
* The maximum time interval between two keystrokes in multiple click operations like "double-click", in milliseconds.
* According to the UX QA, 500ms is quite a good default time, but I still want to extend it a bit.
* <a href="https://ux.stackexchange.com/questions/40364/what-is-the-expected-timeframe-of-a-double-click"></a>
* <p>
* Can be translated into config item if someone needs it, but not now.
*/
private int multipleClickSpeedInMilliseconds = 750;

public boolean isBiomeIndicatorEnabled() {
return biomeIndicatorEnabled;
}
Expand Down Expand Up @@ -115,6 +124,14 @@ public void setFishingHarvestEnabled(boolean fishingHarvestEnabled) {
this.fishingHarvestEnabled = fishingHarvestEnabled;
}

public int getMultipleClickSpeedInMilliseconds() {
return multipleClickSpeedInMilliseconds;
}

public void setMultipleClickSpeedInMilliseconds(int multipleClickSpeedInMilliseconds) {
this.multipleClickSpeedInMilliseconds = multipleClickSpeedInMilliseconds;
}

public static OtherConfigsMap getDefaultOtherConfigsMap() {
OtherConfigsMap defaultOtherConfigsMap = new OtherConfigsMap();
defaultOtherConfigsMap.setBiomeIndicatorEnabled(true);
Expand All @@ -128,6 +145,7 @@ public static OtherConfigsMap getDefaultOtherConfigsMap() {
defaultOtherConfigsMap.setFishingHarvestEnabled(true);
defaultOtherConfigsMap.setMenuFixEnabled(true);
defaultOtherConfigsMap.setDebugMode(false);
defaultOtherConfigsMap.setMultipleClickSpeedInMilliseconds(750);

return defaultOtherConfigsMap;
}
Expand Down
Loading