Skip to content

Commit

Permalink
Release 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
teamclouday committed Nov 6, 2022
1 parent 239f5f0 commit 8229e37
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.example.androidsteering"
minSdkVersion 19
targetSdkVersion 33
versionCode 6
versionName "2.2.0"
versionCode 7
versionName "2.3.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,28 @@ public void run() {
vHorizontal.setProgress((int) progressHorizontal);
vVertical.setProgress((int) progressVertical);
}
if (controllerMode == ControllerMode.Alter || controllerMode == ControllerMode.GamePad) {
if (!LTPressed && !RTPressed)
if (controllerMode == ControllerMode.Alter) {
if (!LTPressed && !RTPressed) {
globalBuffer.addData(MotionStatus.ResetAccAngle, 0.0f);
if (LTPressed) {
} else if (LTPressed) {
ProgressBar bar = findViewById(R.id.progressBarLT);
globalBuffer.addData(MotionStatus.SetAccRatio, -bar.getProgress() / (float) bar.getMax());
}
if (RTPressed && (!LTPressed || controllerMode == ControllerMode.GamePad)) {
} else if (RTPressed) {
ProgressBar bar = findViewById(R.id.progressBarRT);
globalBuffer.addData(MotionStatus.SetAccRatio, bar.getProgress() / (float) bar.getMax());
}
} else if (controllerMode == ControllerMode.GamePad) {
if (!LTPressed && !RTPressed) {
globalBuffer.addData(MotionStatus.ResetAccAngle, 0.0f);
}
if (LTPressed) {
ProgressBar bar = findViewById(R.id.progressBarLT);
globalBuffer.addData(MotionStatus.SetLTValue, bar.getProgress() / (float) bar.getMax());
}
if (RTPressed) {
ProgressBar bar = findViewById(R.id.progressBarRT);
globalBuffer.addData(MotionStatus.SetRTValue, bar.getProgress() / (float) bar.getMax());
}
}
} catch (Exception e) {
Log.d(getString(R.string.logTagMain), Objects.requireNonNull(e.getMessage()));
Expand Down Expand Up @@ -458,8 +469,8 @@ private Pair<Float, Float> computeJoyStickXY(int angle, int strength) {
double r = Math.toRadians(angle);
double s = strength / 100.0;

float x = (float)(Math.cos(r) * s);
float y = (float)(Math.sin(r) * s);
float x = (float) (Math.cos(r) * s);
float y = (float) (Math.sin(r) * s);

return new Pair<>(x, y);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ enum MotionStatus {
SetLeftStickX(5),
SetLeftStickY(6),
SetRightStickX(7),
SetRightStickY(8);
SetRightStickY(8),
SetLTValue(9),
SetRTValue(10);

private final int val;

Expand Down
Binary file removed Assets/phone1.jpg
Binary file not shown.
Binary file added Assets/phone1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/phone2.jpg
Binary file not shown.
Binary file added Assets/phone2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/phone3.jpg
Binary file not shown.
Binary file added Assets/phone3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/phone4.jpg
Binary file not shown.
Binary file added Assets/phone4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/phone5.jpg
Binary file not shown.
Binary file added Assets/phone5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ See [Game Steering Wheel Settings](SETTINGS.md) for more details.
- [x] Slider bar on phone for LT/RT controls
- [x] Memorized user settings
- [x] Connection under same network (does not have to be Wifi hotspot)
- [x] Fully implemented Xbox controller emulator

------

Expand All @@ -115,15 +116,15 @@ Pre-built installers can be found [here](https://github.com/teamclouday/AndroidS

__Android Side__

<img src="Assets/phone1.jpg" width="400" alt="phone1">
<img src="Assets/phone1.png" width="600" alt="phone1">

<img src="Assets/phone2.jpg" width="400" alt="phone2">
<img src="Assets/phone2.png" width="600" alt="phone2">

<img src="Assets/phone3.jpg" width="400" alt="phone3">
<img src="Assets/phone3.png" width="600" alt="phone3">

<img src="Assets/phone4.jpg" width="400" alt="phone4">
<img src="Assets/phone4.png" width="600" alt="phone4">

<img src="Assets/phone5.jpg" width="400" alt="phone6">
<img src="Assets/phone5.png" width="600" alt="phone6">

__Windows Side__

Expand Down
18 changes: 18 additions & 0 deletions Windows/SteeringWheel/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public enum MotionStatus
SetLeftStickY = 6,
SetRightStickX = 7,
SetRightStickY = 8,
SetLTValue = 9,
SetRTValue = 10,
}

/// <summary>
Expand Down Expand Up @@ -308,6 +310,22 @@ private void SetupProcess()
}
break;
}
case MotionStatus.SetLTValue:
{
lock (joyReportLock)
{
joyReport.AxisZ = (int)(data.Value * axisMax);
}
break;
}
case MotionStatus.SetRTValue:
{
lock (joyReportLock)
{
joyReport.AxisZRot = (int)(data.Value * axisMax);
}
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Windows/SteeringWheel/SteeringWheel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PublisherName>Teamclouday</PublisherName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>2.2.0.0</ApplicationVersion>
<ApplicationVersion>2.3.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down

0 comments on commit 8229e37

Please sign in to comment.