-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,283 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CMake on a single platform | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# UEVR UESDK submodule uses ssh, rewrite to https with access token | ||
- name: Set github url and credentials | ||
run: | | ||
git config --global url."https://${{ secrets.REPO_ACCESS_TOKEN }}@github.com/.insteadOf" [email protected]: | ||
- name: Configure CMake | ||
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ace_combat_plugin | ||
|
||
- name: Package | ||
working-directory: ${{github.workspace}} | ||
run: Invoke-Item package.cmd | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Ace7Game | ||
path: ${{github.workspace}}/build/Release/profile/* | ||
if-no-files-found: error | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: Ace7Game.zip | ||
body_path: ${{github.workspace}}/release-template.md |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Ace Combat 7 UEVR compatibility mod | ||
|
||
### Download UEVR Profile [here](https://github.com/keton/ace-combat-uevr/releases/latest) | ||
|
||
## Features | ||
1. fixes cockpit camera so it works out of the box in most situations | ||
1. adds 'unstuck cockpit instruments' button (left start/select button on Xbox controller) for those rare occurrences where automation fails. | ||
1. adds optional controls remap selectable in plugin overlay in UEVR menu. After remap controls are in line with typical flight sim - LS is elevator and rudder, RS is aileron and throttle. | ||
|
||
## Building | ||
|
||
1. Install Visual Studio 2022 with C++, Windows SDK and CMake support | ||
1. Make sure you follow all instructions [here](https://github.com/praydog/UEVR/blob/master/COMPILING.md) and are able to build UEVR from source | ||
1. Clone the repository | ||
1. Run `build.cmd` or in VS Developer Shell type: | ||
```shell | ||
cmake -S . -B build ./build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release | ||
cmake --build ./build --clean-first --config Release --target ace_combat_plugin | ||
``` | ||
1. copy resulting `ace_combat_plugin.dll` to your game profile `plugins` subfolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#pragma once | ||
|
||
#include "uevr/API.hpp" | ||
|
||
#include "uesdk/AActor.hpp" | ||
#include "uesdk/APawn.hpp" | ||
#include "uesdk/CameraComponent.hpp" | ||
#include "uesdk/USceneComponent.hpp" | ||
|
||
#include "acesdk/CameraViewComponent.hpp" | ||
|
||
using namespace uevr; | ||
|
||
// AcePlayerPawn has dynamic class name | ||
class AcePlayerPawn : public APawn | ||
{ | ||
public: | ||
static API::UClass *static_class(bool force_search = false) | ||
{ | ||
static API::UClass *result = nullptr; | ||
|
||
if(result == nullptr || force_search) { | ||
result = find_pawn_class(); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
CameraViewComponent *prop_camera_view() | ||
{ | ||
const auto p_prop = get_property_data<CameraViewComponent *>(L"CameraView"); | ||
if(p_prop && *p_prop) { | ||
return *p_prop; | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
CameraComponent *prop_cockpit_camera() | ||
{ | ||
const auto p_prop = get_property_data<CameraComponent *>(L"CockpitCamera"); | ||
if(p_prop && *p_prop) { | ||
return *p_prop; | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
USceneComponent *prop_cockpit_mesh() | ||
{ | ||
const auto p_prop = get_property_data<USceneComponent *>(L"CockpitMesh"); | ||
if(p_prop && *p_prop) { | ||
return *p_prop; | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
USceneComponent *prop_plane_body_mesh() | ||
{ | ||
const auto p_prop = get_property_data<USceneComponent *>(L"PlaneBodyMesh"); | ||
if(p_prop && *p_prop) { | ||
return *p_prop; | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
private: | ||
static inline API::UClass *find_pawn_class() | ||
{ | ||
const auto pawn = API::get()->get_local_pawn(0); | ||
if(!pawn) { | ||
return nullptr; | ||
} | ||
|
||
if(!pawn->get_full_name().starts_with(L"AcePlayerPawn_")) { | ||
return nullptr; | ||
} | ||
|
||
return pawn->get_class(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
#pragma once | ||
|
||
#include "uevr/API.hpp" | ||
|
||
using namespace uevr; | ||
|
||
enum CameraType : uint8_t | ||
{ | ||
FIRST_PERSON = 0, | ||
COCKPIT, | ||
THIRD_PERSON, | ||
REPLAY, | ||
MINIGAME_CAMERA, | ||
IMPACT_CAMERA, | ||
VR_CAMERA, | ||
NO_CAMERA, | ||
ECameraType_MAX, | ||
}; | ||
|
||
class CameraViewComponent : private API::UObject | ||
{ | ||
public: | ||
using API::UObject::get_full_name; | ||
|
||
static API::UClass *static_class() | ||
{ | ||
static auto result = | ||
API::get()->find_uobject<API::UClass>(L"Class /Script/Nimbus.CameraViewComponent"); | ||
return result; | ||
} | ||
|
||
CameraType get_current_camera_type() | ||
{ | ||
static const auto func = static_class()->find_function(L"GetCurrentCameraViewType"); | ||
if(!func) { | ||
API::get()->log_error("CameraViewComponent::GetCurrentCameraViewType not found"); | ||
return CameraType::NO_CAMERA; | ||
} | ||
|
||
struct | ||
{ | ||
uint8_t result; | ||
} params{.result = 0}; | ||
|
||
process_event(func, ¶ms); | ||
|
||
return (CameraType)params.result; | ||
} | ||
|
||
void switch_to_cockpit_view() | ||
{ | ||
static const auto func = static_class()->find_function(L"SwitchToCockpitView"); | ||
if(!func) { | ||
API::get()->log_error("CameraViewComponent::SwitchToCockpitView not found"); | ||
return; | ||
} | ||
|
||
struct | ||
{ | ||
intptr_t dummy; | ||
} params{0}; | ||
|
||
process_event(func, ¶ms); | ||
} | ||
|
||
void switch_to_first_person_view() | ||
{ | ||
static const auto func = static_class()->find_function(L"SwitchToFirstPersonView"); | ||
if(!func) { | ||
API::get()->log_error("CameraViewComponent::SwitchToFirstPersonView not found"); | ||
return; | ||
} | ||
|
||
struct | ||
{ | ||
intptr_t dummy; | ||
} params{0}; | ||
|
||
process_event(func, ¶ms); | ||
} | ||
|
||
void switch_to_third_person_view() | ||
{ | ||
static const auto func = static_class()->find_function(L"SwitchToThirdPersonView"); | ||
if(!func) { | ||
API::get()->log_error("CameraViewComponent::SwitchToThirdPersonView not found"); | ||
return; | ||
} | ||
|
||
struct | ||
{ | ||
intptr_t dummy; | ||
} params{0}; | ||
|
||
process_event(func, ¶ms); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include "uevr/API.hpp" | ||
|
||
using namespace uevr; | ||
|
||
class Mission : public API::UObject | ||
{ | ||
public: | ||
using API::UObject::get_full_name; | ||
|
||
static API::UClass *static_class(bool force_search = false) | ||
{ | ||
static API::UClass *result = nullptr; | ||
if(!result || force_search) { | ||
result = API::get()->find_uobject<API::UClass>(L"Class /Script/Nimbus.Mission"); | ||
} | ||
return result; | ||
} | ||
|
||
static Mission *get_instance(bool force_search = false) | ||
{ | ||
auto klass = static_class(force_search); | ||
if(klass) { | ||
return klass->get_first_object_matching<Mission>(); | ||
} | ||
return nullptr; | ||
} | ||
|
||
bool is_in_igc() | ||
{ | ||
static const auto func = Mission::static_class()->find_function(L"IsInIGC"); | ||
if(!func) { | ||
API::get()->log_error("Mission::IsInIGC not found"); | ||
return false; | ||
} | ||
|
||
struct | ||
{ | ||
bool res; | ||
} params{0}; | ||
|
||
process_event(func, ¶ms); | ||
|
||
return params.res; | ||
} | ||
}; |
Oops, something went wrong.