mirror of
https://github.com/ApfelTeeSaft/OG-Fortnite-Cheat.git
synced 2026-08-26 19:33:33 +00:00
Revert "So many things, I don't even know"
This reverts commit cd7fa03dd4.
This commit is contained in:
@@ -5,359 +5,304 @@
|
||||
#include "../External-Libs/ImGui/imgui.h"
|
||||
#include "../Hooks/Hooks.h"
|
||||
|
||||
void Drawing::LineCache::DrawOutline()
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
void Drawing::LineCache::DrawOutline() {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddLine(ImVec2(ScreenPositionA.X, ScreenPositionA.Y), ImVec2(ScreenPositionB.X, ScreenPositionB.Y), OutlineColor, Thickness + 1.f);
|
||||
ImGui::GetBackgroundDrawList()->AddLine(ImVec2(ScreenPositionA.X, ScreenPositionA.Y), ImVec2(ScreenPositionB.X, ScreenPositionB.Y), OutlineColor, Thickness + 1.f);
|
||||
}
|
||||
void Drawing::LineCache::DrawLine()
|
||||
{
|
||||
ImGui::GetBackgroundDrawList()->AddLine(ImVec2(ScreenPositionA.X, ScreenPositionA.Y), ImVec2(ScreenPositionB.X, ScreenPositionB.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Thickness);
|
||||
void Drawing::LineCache::DrawLine() {
|
||||
ImGui::GetBackgroundDrawList()->AddLine(ImVec2(ScreenPositionA.X, ScreenPositionA.Y), ImVec2(ScreenPositionB.X, ScreenPositionB.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Thickness);
|
||||
}
|
||||
void Drawing::LineCache::Draw()
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
DrawOutline();
|
||||
}
|
||||
void Drawing::LineCache::Draw() {
|
||||
if (Outlined) {
|
||||
DrawOutline();
|
||||
}
|
||||
|
||||
DrawLine();
|
||||
DrawLine();
|
||||
}
|
||||
void Drawing::BatchLineCache::Draw()
|
||||
{
|
||||
for (auto& Line : Lines)
|
||||
{
|
||||
if (Line.Outlined)
|
||||
{
|
||||
Line.DrawOutline();
|
||||
}
|
||||
}
|
||||
void Drawing::BatchLineCache::Draw() {
|
||||
for (auto& Line : Lines) {
|
||||
if (Line.Outlined) {
|
||||
Line.DrawOutline();
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& Line : Lines)
|
||||
{
|
||||
Line.DrawLine();
|
||||
}
|
||||
for (auto& Line : Lines) {
|
||||
Line.DrawLine();
|
||||
}
|
||||
}
|
||||
void Drawing::TextCache::Draw()
|
||||
{
|
||||
ImVec2 TextPosition = ImVec2(ScreenPosition.X, ScreenPosition.Y);
|
||||
void Drawing::TextCache::Draw() {
|
||||
ImVec2 TextPosition = ImVec2(ScreenPosition.X, ScreenPosition.Y);
|
||||
|
||||
if (Outlined)
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
if (Outlined) {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImVec2 Offsets[] = {
|
||||
ImVec2(-1.f, 0),
|
||||
ImVec2(1.f, 0),
|
||||
ImVec2(0, -1.f),
|
||||
ImVec2(0, 1.f),
|
||||
};
|
||||
ImVec2 Offsets[] = {
|
||||
ImVec2(-1.f, 0),
|
||||
ImVec2(1.f, 0),
|
||||
ImVec2(0, -1.f),
|
||||
ImVec2(0, 1.f),
|
||||
};
|
||||
|
||||
for (ImVec2& Offset : Offsets)
|
||||
{
|
||||
ImVec2 OutlinePos = ImVec2(TextPosition.x + Offset.x, TextPosition.y + Offset.y);
|
||||
ImGui::GetBackgroundDrawList()->AddText(Hooks::Present::LargeFont, FontSize, OutlinePos, OutlineColor, RenderText.c_str());
|
||||
}
|
||||
}
|
||||
for (ImVec2& Offset : Offsets) {
|
||||
ImVec2 OutlinePos = ImVec2(TextPosition.x + Offset.x, TextPosition.y + Offset.y);
|
||||
ImGui::GetBackgroundDrawList()->AddText(Hooks::Present::LargeFont, FontSize, OutlinePos, OutlineColor, RenderText.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddText(Hooks::Present::LargeFont, FontSize, TextPosition, ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), RenderText.c_str());
|
||||
ImGui::GetBackgroundDrawList()->AddText(Hooks::Present::LargeFont, FontSize, TextPosition, ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), RenderText.c_str());
|
||||
}
|
||||
void Drawing::CircleCache::Draw()
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
void Drawing::CircleCache::Draw() {
|
||||
if (Outlined) {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius + 1.f, OutlineColor, Segments);
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius - 1.f, OutlineColor, Segments);
|
||||
}
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius + 1.f, OutlineColor, Segments);
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius - 1.f, OutlineColor, Segments);
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius, ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Segments);
|
||||
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(ScreenPosition.X, ScreenPosition.Y), Radius, ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Segments);
|
||||
}
|
||||
void Drawing::FilledRectCache::Draw()
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
void Drawing::FilledRectCache::Draw() {
|
||||
if (Outlined) {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRectFilled(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), OutlineColor);
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRectFilled(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A));
|
||||
ImGui::GetBackgroundDrawList()->AddRectFilled(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), OutlineColor);
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRectFilled(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A));
|
||||
}
|
||||
void Drawing::RectCache::Draw()
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
void Drawing::RectCache::Draw() {
|
||||
if (Outlined) {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRect(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), OutlineColor, 0, 0, Thickness + 1.f);
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRect(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), 0, 0, Thickness);
|
||||
ImGui::GetBackgroundDrawList()->AddRect(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), OutlineColor, 0, 0, Thickness + 1.f);
|
||||
}
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddRect(ImVec2(ScreenPosition.X, ScreenPosition.Y), ImVec2(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), 0, 0, Thickness);
|
||||
}
|
||||
void Drawing::TriangleCache::Draw()
|
||||
{
|
||||
ImVec2 Points[3] = {
|
||||
ImVec2(ScreenPositionA.X, ScreenPositionA.Y),
|
||||
ImVec2(ScreenPositionB.X, ScreenPositionB.Y),
|
||||
ImVec2(ScreenPositionC.X, ScreenPositionC.Y)
|
||||
};
|
||||
void Drawing::TriangleCache::Draw() {
|
||||
ImVec2 Points[3] = {
|
||||
ImVec2(ScreenPositionA.X, ScreenPositionA.Y),
|
||||
ImVec2(ScreenPositionB.X, ScreenPositionB.Y),
|
||||
ImVec2(ScreenPositionC.X, ScreenPositionC.Y)
|
||||
};
|
||||
|
||||
if (Outlined)
|
||||
{
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
if (Outlined) {
|
||||
ImU32 OutlineColor = ImColor(0.f, 0.f, 0.f, RenderColor.A);
|
||||
|
||||
ImGui::GetBackgroundDrawList()->AddTriangle(Points[0], Points[1], Points[2], OutlineColor, Thickness + 1.f);
|
||||
}
|
||||
ImGui::GetBackgroundDrawList()->AddTriangle(Points[0], Points[1], Points[2], OutlineColor, Thickness + 1.f);
|
||||
}
|
||||
|
||||
if (Filled)
|
||||
{
|
||||
ImGui::GetBackgroundDrawList()->AddTriangleFilled(Points[0], Points[1], Points[2], ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::GetBackgroundDrawList()->AddTriangle(Points[0], Points[1], Points[2], ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Thickness);
|
||||
}
|
||||
if (Filled) {
|
||||
ImGui::GetBackgroundDrawList()->AddTriangleFilled(Points[0], Points[1], Points[2], ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A));
|
||||
}
|
||||
else {
|
||||
ImGui::GetBackgroundDrawList()->AddTriangle(Points[0], Points[1], Points[2], ImColor(RenderColor.R, RenderColor.G, RenderColor.B, RenderColor.A), Thickness);
|
||||
}
|
||||
}
|
||||
|
||||
void Drawing::RenderDrawingData()
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
void Drawing::RenderDrawingData() {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
|
||||
for (auto& RenderObject : RenderBuffer)
|
||||
{
|
||||
RenderObject->Draw();
|
||||
}
|
||||
for (auto& RenderObject : RenderBuffer) {
|
||||
RenderObject->Draw();
|
||||
}
|
||||
}
|
||||
|
||||
void Drawing::Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<LineCache>(ScreenPositionA, ScreenPositionB, Thickness, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
void Drawing::Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<LineCache>(ScreenPositionA, ScreenPositionB, Thickness, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
if (Hooks::Present::LargeFont == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
void Drawing::Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
if (Hooks::Present::LargeFont == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto Cache = std::make_unique<TextCache>(RenderText, ScreenPosition, FontSize, RenderColor, CenteredX, CenteredY, Outlined);
|
||||
|
||||
// Handle centred text here so it doesn't go crazy
|
||||
if (CenteredX || CenteredY) {
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, FLT_MAX, RenderText);
|
||||
ImVec2 CentredPos = ImVec2(ScreenPosition.X - TextSize.x / 2.f, ScreenPosition.Y - TextSize.y / 2.f);
|
||||
|
||||
auto Cache = std::make_unique<TextCache>(RenderText, ScreenPosition, FontSize, RenderColor, CenteredX, CenteredY, Outlined);
|
||||
if (CenteredX) {
|
||||
Cache->ScreenPosition.X = CentredPos.x;
|
||||
}
|
||||
|
||||
// Handle centred text here so it doesn't go crazy
|
||||
if (CenteredX || CenteredY)
|
||||
{
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, FLT_MAX, RenderText);
|
||||
ImVec2 CentredPos = ImVec2(ScreenPosition.X - TextSize.x / 2.f, ScreenPosition.Y - TextSize.y / 2.f);
|
||||
|
||||
if (CenteredX)
|
||||
{
|
||||
Cache->ScreenPosition.X = CentredPos.x;
|
||||
}
|
||||
|
||||
if (CenteredY)
|
||||
{
|
||||
Cache->ScreenPosition.Y = CentredPos.y;
|
||||
}
|
||||
}
|
||||
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
if (CenteredY) {
|
||||
Cache->ScreenPosition.Y = CentredPos.y;
|
||||
}
|
||||
}
|
||||
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined)
|
||||
{
|
||||
std::string String = std::string(RenderText, RenderText + wcslen(RenderText));
|
||||
Text(String.c_str(), ScreenPosition, FontSize, RenderColor, CenteredX, CenteredY, Outlined);
|
||||
void Drawing::Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined) {
|
||||
std::string String = std::string(RenderText, RenderText + wcslen(RenderText));
|
||||
Text(String.c_str(), ScreenPosition, FontSize, RenderColor, CenteredX, CenteredY, Outlined);
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const char* RenderText, float FontSize)
|
||||
{
|
||||
if (Hooks::Present::LargeFont == nullptr)
|
||||
{
|
||||
return SDK::FVector2D();
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const char* RenderText, float FontSize) {
|
||||
if (Hooks::Present::LargeFont == nullptr) {
|
||||
return SDK::FVector2D();
|
||||
}
|
||||
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, 0.0f, RenderText);
|
||||
return SDK::FVector2D(TextSize.x, TextSize.y);
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, 0.0f, RenderText);
|
||||
return SDK::FVector2D(TextSize.x, TextSize.y);
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const wchar_t* RenderText, float FontSize)
|
||||
{
|
||||
if (Hooks::Present::LargeFont == nullptr)
|
||||
{
|
||||
return SDK::FVector2D();
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const wchar_t* RenderText, float FontSize) {
|
||||
if (Hooks::Present::LargeFont == nullptr) {
|
||||
return SDK::FVector2D();
|
||||
}
|
||||
|
||||
std::string str = std::string(RenderText, RenderText + wcslen(RenderText));
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, 0.0f, str.c_str());
|
||||
return SDK::FVector2D(TextSize.x, TextSize.y);
|
||||
std::string str = std::string(RenderText, RenderText + wcslen(RenderText));
|
||||
ImVec2 TextSize = Hooks::Present::LargeFont->CalcTextSizeA(FontSize, FLT_MAX, 0.0f, str.c_str());
|
||||
return SDK::FVector2D(TextSize.x, TextSize.y);
|
||||
}
|
||||
void Drawing::Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<CircleCache>(ScreenPosition, Radius, Segments, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
void Drawing::Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<CircleCache>(ScreenPosition, Radius, Segments, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<FilledRectCache>(ScreenPosition, ScreenSize, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
void Drawing::FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<FilledRectCache>(ScreenPosition, ScreenSize, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<RectCache>(ScreenPosition, ScreenSize, Thickness, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
void Drawing::Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<RectCache>(ScreenPosition, ScreenSize, Thickness, RenderColor, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
float LineW = ScreenSize.X / 4.f;
|
||||
float LineH = ScreenSize.Y / 4.f;
|
||||
void Drawing::CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
float LineW = ScreenSize.X / 4.f;
|
||||
float LineH = ScreenSize.Y / 4.f;
|
||||
|
||||
float Correction = Thickness / 2.f;
|
||||
Correction *= -1.f;
|
||||
float Correction = Thickness / 2.f;
|
||||
Correction *= -1.f;
|
||||
|
||||
auto Cache = std::make_unique<BatchLineCache>();
|
||||
auto Cache = std::make_unique<BatchLineCache>();
|
||||
|
||||
// Top-left corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + Correction, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + LineW, ScreenPosition.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + Correction), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + LineH), Thickness, RenderColor, Outlined));
|
||||
// Top-left corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + Correction, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + LineW, ScreenPosition.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + Correction), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + LineH), Thickness, RenderColor, Outlined));
|
||||
|
||||
// Top-right corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - LineW, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X - Correction, ScreenPosition.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + Correction), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + LineH), Thickness, RenderColor, Outlined));
|
||||
// Top-right corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - LineW, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X - Correction, ScreenPosition.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + Correction), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + LineH), Thickness, RenderColor, Outlined));
|
||||
|
||||
// Bottom-left corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + Correction, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + LineW, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - LineH), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - Correction), Thickness, RenderColor, Outlined));
|
||||
// Bottom-left corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + Correction, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + LineW, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - LineH), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - Correction), Thickness, RenderColor, Outlined));
|
||||
|
||||
// Bottom-right corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - LineW, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X - Correction, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - LineH), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - Correction), Thickness, RenderColor, Outlined));
|
||||
// Bottom-right corner horizontal and vertical
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - LineW, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X - Correction, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined));
|
||||
Cache->Lines.push_back(Drawing::LineCache(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - LineH), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - Correction), Thickness, RenderColor, Outlined));
|
||||
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
void Drawing::Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined)
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<TriangleCache>(ScreenPositionA, ScreenPositionB, ScreenPositionC, Thickness, RenderColor, Filled, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
void Drawing::Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined) {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
auto Cache = std::make_unique<TriangleCache>(ScreenPositionA, ScreenPositionB, ScreenPositionC, Thickness, RenderColor, Filled, Outlined);
|
||||
DrawingQueue.push_back(std::move(Cache));
|
||||
}
|
||||
#endif // _IMGUI
|
||||
#ifdef _ENGINE
|
||||
#include "../Game/SDK/Classes/Engine_Classes.h"
|
||||
#include "../Utilities/Math.h"
|
||||
|
||||
void Drawing::Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness + 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness - 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
void Drawing::Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
if (Outlined) {
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness + 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness - 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness, RenderColor);
|
||||
SDK::GetLocalCanvas()->K2_DrawLine(ScreenPositionA, ScreenPositionB, Thickness, RenderColor);
|
||||
}
|
||||
void Drawing::Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CentredX, bool CentredY, bool Outlined)
|
||||
{
|
||||
std::string String(RenderText);
|
||||
std::wstring WideString = std::wstring(String.begin(), String.end());
|
||||
void Drawing::Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CentredX, bool CentredY, bool Outlined) {
|
||||
std::string String(RenderText);
|
||||
std::wstring WideString = std::wstring(String.begin(), String.end());
|
||||
|
||||
Text(WideString.c_str(), ScreenPosition, FontSize, RenderColor, CentredX, CentredY, Outlined);
|
||||
Text(WideString.c_str(), ScreenPosition, FontSize, RenderColor, CentredX, CentredY, Outlined);
|
||||
}
|
||||
void Drawing::Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CentredX, bool CentredY, bool Outlined)
|
||||
{
|
||||
SDK::FString FString(RenderText);
|
||||
void Drawing::Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CentredX, bool CentredY, bool Outlined) {
|
||||
SDK::FString FString(RenderText);
|
||||
|
||||
// We need to adjust the font size because the engine's font size is different from ImGui's
|
||||
FontSize -= (FontSize * 0.1f);
|
||||
// We need to adjust the font size because the engine's font size is different from ImGui's
|
||||
FontSize -= (FontSize * 0.1f);
|
||||
|
||||
SDK::GetLocalCanvas()->K2_DrawText(FString, ScreenPosition, Outlined ? (int32)FontSize - 2 : (int32)FontSize, RenderColor, CentredX, CentredY, Outlined);
|
||||
SDK::GetLocalCanvas()->K2_DrawText(FString, ScreenPosition, Outlined ? (int32)FontSize - 2 : (int32)FontSize, RenderColor, CentredX, CentredY, Outlined);
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const char* RenderText, float FontSize)
|
||||
{
|
||||
std::string String(RenderText);
|
||||
std::wstring WideString = std::wstring(String.begin(), String.end());
|
||||
SDK::FVector2D Drawing::TextSize(const char* RenderText, float FontSize) {
|
||||
std::string String(RenderText);
|
||||
std::wstring WideString = std::wstring(String.begin(), String.end());
|
||||
|
||||
return TextSize(WideString.c_str(), FontSize);
|
||||
return TextSize(WideString.c_str(), FontSize);
|
||||
}
|
||||
SDK::FVector2D Drawing::TextSize(const wchar_t* RenderText, float FontSize)
|
||||
{
|
||||
SDK::FString FString(RenderText);
|
||||
SDK::FVector2D Drawing::TextSize(const wchar_t* RenderText, float FontSize) {
|
||||
SDK::FString FString(RenderText);
|
||||
|
||||
// We need to adjust the font size because the engine's font size is different from ImGui's
|
||||
FontSize -= (FontSize * 0.1f);
|
||||
// We need to adjust the font size because the engine's font size is different from ImGui's
|
||||
FontSize -= (FontSize * 0.1f);
|
||||
|
||||
return SDK::GetLocalCanvas()->K2_TextSize(FString, (int32)FontSize);
|
||||
return SDK::GetLocalCanvas()->K2_TextSize(FString, (int32)FontSize);
|
||||
}
|
||||
void Drawing::Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
if (Segments < 3)
|
||||
{
|
||||
Segments = 3;
|
||||
}
|
||||
void Drawing::Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
if (Segments < 3) {
|
||||
Segments = 3;
|
||||
}
|
||||
|
||||
float AngleStep = (2.f * M_PI) / static_cast<float>(Segments);
|
||||
SDK::FVector2D PreviousPoint = SDK::FVector2D(
|
||||
Radius * cos(0) + ScreenPosition.X,
|
||||
Radius * sin(0) + ScreenPosition.Y
|
||||
);
|
||||
float AngleStep = (2.f * M_PI) / static_cast<float>(Segments);
|
||||
SDK::FVector2D PreviousPoint = SDK::FVector2D(
|
||||
Radius * cos(0) + ScreenPosition.X,
|
||||
Radius * sin(0) + ScreenPosition.Y
|
||||
);
|
||||
|
||||
for (int SegmentCount = 1; SegmentCount <= Segments; SegmentCount++)
|
||||
{
|
||||
SDK::FVector2D CurrentPoint = SDK::FVector2D(
|
||||
Radius * cos(AngleStep * SegmentCount) + ScreenPosition.X,
|
||||
Radius * sin(AngleStep * SegmentCount) + ScreenPosition.Y
|
||||
);
|
||||
for (int SegmentCount = 1; SegmentCount <= Segments; SegmentCount++) {
|
||||
SDK::FVector2D CurrentPoint = SDK::FVector2D(
|
||||
Radius * cos(AngleStep * SegmentCount) + ScreenPosition.X,
|
||||
Radius * sin(AngleStep * SegmentCount) + ScreenPosition.Y
|
||||
);
|
||||
|
||||
Line(PreviousPoint, CurrentPoint, 1.0f, RenderColor, Outlined);
|
||||
Line(PreviousPoint, CurrentPoint, 1.0f, RenderColor, Outlined);
|
||||
|
||||
PreviousPoint = CurrentPoint;
|
||||
}
|
||||
PreviousPoint = CurrentPoint;
|
||||
}
|
||||
}
|
||||
void Drawing::FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
for (int i = 0; i < ScreenSize.X; i++)
|
||||
{
|
||||
Line(SDK::FVector2D(ScreenPosition.X + i, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + i, ScreenPosition.Y + ScreenSize.Y), 1.f, RenderColor, false);
|
||||
}
|
||||
void Drawing::FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
for (int i = 0; i < ScreenSize.X; i++) {
|
||||
Line(SDK::FVector2D(ScreenPosition.X + i, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + i, ScreenPosition.Y + ScreenSize.Y), 1.f, RenderColor, false);
|
||||
}
|
||||
|
||||
if (Outlined)
|
||||
{
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
if (Outlined) {
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
}
|
||||
void Drawing::Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
if (Outlined)
|
||||
{
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness + 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness - 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
void Drawing::Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
if (Outlined) {
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness + 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness - 1.f, SDK::FLinearColor(0.f, 0.f, 0.f, 1.f));
|
||||
}
|
||||
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness, RenderColor);
|
||||
SDK::GetLocalCanvas()->K2_DrawBox(ScreenPosition, ScreenSize, Thickness, RenderColor);
|
||||
}
|
||||
void Drawing::CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined)
|
||||
{
|
||||
float lineW = ScreenSize.X / 4;
|
||||
float lineH = ScreenSize.Y / 4;
|
||||
void Drawing::CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) {
|
||||
float lineW = ScreenSize.X / 4;
|
||||
float lineH = ScreenSize.Y / 4;
|
||||
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + lineW, ScreenPosition.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + lineH), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + lineH), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - lineW, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + lineW, ScreenPosition.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + lineH), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + lineH), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - lineW, ScreenPosition.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y), Thickness, RenderColor, Outlined);
|
||||
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + lineW, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - lineH), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - lineH), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - lineW, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + lineW, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y - lineH), SDK::FVector2D(ScreenPosition.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y - lineH), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
Line(SDK::FVector2D(ScreenPosition.X + ScreenSize.X - lineW, ScreenPosition.Y + ScreenSize.Y), SDK::FVector2D(ScreenPosition.X + ScreenSize.X, ScreenPosition.Y + ScreenSize.Y), Thickness, RenderColor, Outlined);
|
||||
}
|
||||
void Drawing::Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined)
|
||||
{
|
||||
// ADD LATER
|
||||
void Drawing::Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined) {
|
||||
// ADD LATER
|
||||
}
|
||||
|
||||
#endif // _ENGINE
|
||||
+196
-206
@@ -1,250 +1,240 @@
|
||||
#pragma once
|
||||
#ifdef _IMGUI
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
#include "../Game/SDK/Classes/Basic.h"
|
||||
|
||||
/* A wrapper for drawing functions */
|
||||
namespace Drawing
|
||||
{
|
||||
namespace Drawing {
|
||||
#ifdef _IMGUI
|
||||
class IDrawingCache
|
||||
{
|
||||
public:
|
||||
virtual void Draw() = 0;
|
||||
};
|
||||
class IDrawingCache {
|
||||
public:
|
||||
virtual void Draw() = 0;
|
||||
};
|
||||
|
||||
/* Cache lines for ImGui processing */
|
||||
class LineCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
LineCache(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPositionA(ScreenPositionA), ScreenPositionB(ScreenPositionB), Thickness(Thickness), RenderColor(RenderColor), Outlined(Outlined) {}
|
||||
/* Cache lines for ImGui processing */
|
||||
class LineCache : public IDrawingCache {
|
||||
public:
|
||||
LineCache(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPositionA(ScreenPositionA), ScreenPositionB(ScreenPositionB), Thickness(Thickness), RenderColor(RenderColor), Outlined(Outlined) { }
|
||||
|
||||
void DrawOutline();
|
||||
void DrawLine();
|
||||
void DrawOutline();
|
||||
void DrawLine();
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPositionA;
|
||||
SDK::FVector2D ScreenPositionB;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPositionA;
|
||||
SDK::FVector2D ScreenPositionB;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
/* Cache for multiple lines in batch for ImGui processing */
|
||||
class BatchLineCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
void Draw() override;
|
||||
public:
|
||||
std::vector<LineCache> Lines;
|
||||
};
|
||||
/* Cache for multiple lines in batch for ImGui processing */
|
||||
class BatchLineCache : public IDrawingCache {
|
||||
public:
|
||||
void Draw() override;
|
||||
public:
|
||||
std::vector<LineCache> Lines;
|
||||
};
|
||||
|
||||
/* Cache texts for ImGui processing */
|
||||
class TextCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
TextCache(std::string RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined) : RenderText(RenderText), ScreenPosition(ScreenPosition), FontSize(FontSize), RenderColor(RenderColor), CenteredX(CenteredX), CenteredY(CenteredY), Outlined(Outlined) {}
|
||||
/* Cache texts for ImGui processing */
|
||||
class TextCache : public IDrawingCache {
|
||||
public:
|
||||
TextCache(std::string RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined) : RenderText(RenderText), ScreenPosition(ScreenPosition), FontSize(FontSize), RenderColor(RenderColor), CenteredX(CenteredX), CenteredY(CenteredY), Outlined(Outlined) { }
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
std::string RenderText;
|
||||
SDK::FVector2D ScreenPosition;
|
||||
float FontSize;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool CenteredX;
|
||||
bool CenteredY;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
std::string RenderText;
|
||||
SDK::FVector2D ScreenPosition;
|
||||
float FontSize;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool CenteredX;
|
||||
bool CenteredY;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
/* Cache circles for ImGui processing */
|
||||
class CircleCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
CircleCache(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), Radius(Radius), Segments(Segments), RenderColor(RenderColor), Outlined(Outlined) {}
|
||||
/* Cache circles for ImGui processing */
|
||||
class CircleCache : public IDrawingCache {
|
||||
public:
|
||||
CircleCache(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), Radius(Radius), Segments(Segments), RenderColor(RenderColor), Outlined(Outlined) { }
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
float Radius;
|
||||
int32_t Segments;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
float Radius;
|
||||
int32_t Segments;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
/* Cache filled rectangles for ImGui processing */
|
||||
class FilledRectCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
FilledRectCache(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), ScreenSize(ScreenSize), RenderColor(RenderColor), Outlined(Outlined) {}
|
||||
/* Cache filled rectangles for ImGui processing */
|
||||
class FilledRectCache : public IDrawingCache {
|
||||
public:
|
||||
FilledRectCache(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), ScreenSize(ScreenSize), RenderColor(RenderColor), Outlined(Outlined) { }
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
SDK::FVector2D ScreenSize;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
SDK::FVector2D ScreenSize;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
/* Cache hollow rectangles for ImGui processing */
|
||||
class RectCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
RectCache(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), ScreenSize(ScreenSize), Thickness(Thickness), RenderColor(RenderColor), Outlined(Outlined) {}
|
||||
/* Cache hollow rectangles for ImGui processing */
|
||||
class RectCache : public IDrawingCache {
|
||||
public:
|
||||
RectCache(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined) : ScreenPosition(ScreenPosition), ScreenSize(ScreenSize), Thickness(Thickness), RenderColor(RenderColor), Outlined(Outlined) { }
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
SDK::FVector2D ScreenSize;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPosition;
|
||||
SDK::FVector2D ScreenSize;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
/* Cache triangles for ImGui processing */
|
||||
class TriangleCache : public IDrawingCache
|
||||
{
|
||||
public:
|
||||
TriangleCache(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined) : ScreenPositionA(ScreenPositionA), ScreenPositionB(ScreenPositionB), ScreenPositionC(ScreenPositionC), Thickness(Thickness), RenderColor(RenderColor), Filled(Filled), Outlined(Outlined) {}
|
||||
/* Cache triangles for ImGui processing */
|
||||
class TriangleCache : public IDrawingCache {
|
||||
public:
|
||||
TriangleCache(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined) : ScreenPositionA(ScreenPositionA), ScreenPositionB(ScreenPositionB), ScreenPositionC(ScreenPositionC), Thickness(Thickness), RenderColor(RenderColor), Filled(Filled), Outlined(Outlined) { }
|
||||
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPositionA;
|
||||
SDK::FVector2D ScreenPositionB;
|
||||
SDK::FVector2D ScreenPositionC;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Filled;
|
||||
bool Outlined;
|
||||
};
|
||||
void Draw() override;
|
||||
public:
|
||||
SDK::FVector2D ScreenPositionA;
|
||||
SDK::FVector2D ScreenPositionB;
|
||||
SDK::FVector2D ScreenPositionC;
|
||||
float Thickness;
|
||||
SDK::FLinearColor RenderColor;
|
||||
bool Filled;
|
||||
bool Outlined;
|
||||
};
|
||||
|
||||
|
||||
|
||||
inline std::mutex DrawingMutex;
|
||||
inline std::vector<std::unique_ptr<IDrawingCache>> RenderBuffer, DrawingQueue;
|
||||
inline std::mutex DrawingMutex;
|
||||
inline std::vector<std::unique_ptr<IDrawingCache>> RenderBuffer, DrawingQueue;
|
||||
|
||||
|
||||
|
||||
inline void SwapBuffers()
|
||||
{
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
inline void SwapBuffers() {
|
||||
std::lock_guard<std::mutex> Lock(DrawingMutex);
|
||||
|
||||
std::swap(RenderBuffer, DrawingQueue);
|
||||
std::swap(RenderBuffer, DrawingQueue);
|
||||
|
||||
DrawingQueue.clear();
|
||||
}
|
||||
DrawingQueue.clear();
|
||||
}
|
||||
|
||||
/* Render the queued data for drawing */
|
||||
void RenderDrawingData();
|
||||
/* Render the queued data for drawing */
|
||||
void RenderDrawingData();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @brief Draws a line on the screen
|
||||
*
|
||||
* @param ScreenPositionA - The starting position of the line
|
||||
* @param ScreenPositionB - The ending position of the line
|
||||
* @param Thickness - The thickness of the line
|
||||
* @param RenderColor - The color of the line
|
||||
* @param Outlined - Whether or not the line should be outlined
|
||||
*/
|
||||
void Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
/*
|
||||
* @brief Draws a line on the screen
|
||||
*
|
||||
* @param ScreenPositionA - The starting position of the line
|
||||
* @param ScreenPositionB - The ending position of the line
|
||||
* @param Thickness - The thickness of the line
|
||||
* @param RenderColor - The color of the line
|
||||
* @param Outlined - Whether or not the line should be outlined
|
||||
*/
|
||||
void Line(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Overloaded function for drawing text on the screen (char*)
|
||||
*
|
||||
* @param RenderText - The text to draw
|
||||
* @param ScreenPosition - The position of the text
|
||||
* @param FontSize - The size of the text
|
||||
* @param RenderColor - The color of the text
|
||||
* @param CenteredX - Whether or not the text should be centered on the X axis
|
||||
* @param CenteredY - Whether or not the text should be centered on the Y axis
|
||||
* @param Outlined - Whether or not the text should be outlined
|
||||
*/
|
||||
void Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined);
|
||||
/*
|
||||
* @brief Overloaded function for drawing text on the screen (char*)
|
||||
*
|
||||
* @param RenderText - The text to draw
|
||||
* @param ScreenPosition - The position of the text
|
||||
* @param FontSize - The size of the text
|
||||
* @param RenderColor - The color of the text
|
||||
* @param CenteredX - Whether or not the text should be centered on the X axis
|
||||
* @param CenteredY - Whether or not the text should be centered on the Y axis
|
||||
* @param Outlined - Whether or not the text should be outlined
|
||||
*/
|
||||
void Text(const char* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Overloaded function for drawing text on the screen (wchar_t*)
|
||||
*
|
||||
* @param RenderText - The text to draw
|
||||
* @param ScreenPosition - The position of the text
|
||||
* @param FontSize - The size of the text
|
||||
* @param RenderColor - The color of the text
|
||||
* @param CenteredX - Whether or not the text should be centered on the X axis
|
||||
* @param CenteredY - Whether or not the text should be centered on the Y axis
|
||||
* @param Outlined - Whether or not the text should be outlined
|
||||
*/
|
||||
void Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined);
|
||||
/*
|
||||
* @brief Overloaded function for drawing text on the screen (wchar_t*)
|
||||
*
|
||||
* @param RenderText - The text to draw
|
||||
* @param ScreenPosition - The position of the text
|
||||
* @param FontSize - The size of the text
|
||||
* @param RenderColor - The color of the text
|
||||
* @param CenteredX - Whether or not the text should be centered on the X axis
|
||||
* @param CenteredY - Whether or not the text should be centered on the Y axis
|
||||
* @param Outlined - Whether or not the text should be outlined
|
||||
*/
|
||||
void Text(const wchar_t* RenderText, SDK::FVector2D ScreenPosition, float FontSize, SDK::FLinearColor RenderColor, bool CenteredX, bool CenteredY, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Gets the estimated size of text drawn on the screen (char*)
|
||||
*
|
||||
* @param RenderText - The text to get the size of
|
||||
* @param FontSize - The size of the text
|
||||
*/
|
||||
SDK::FVector2D TextSize(const char* RenderText, float FontSize);
|
||||
|
||||
/*
|
||||
* @brief Gets the estimated size of text drawn on the screen (char*)
|
||||
*
|
||||
* @param RenderText - The text to get the size of
|
||||
* @param FontSize - The size of the text
|
||||
*/
|
||||
SDK::FVector2D TextSize(const char* RenderText, float FontSize);
|
||||
/*
|
||||
* @brief Gets the estimated size of text drawn on the screen (wchar_t*)
|
||||
*
|
||||
* @param RenderText - The text to get the size of
|
||||
* @param FontSize - The size of the text
|
||||
*/
|
||||
SDK::FVector2D TextSize(const wchar_t* RenderText, float FontSize);
|
||||
|
||||
/*
|
||||
* @brief Gets the estimated size of text drawn on the screen (wchar_t*)
|
||||
*
|
||||
* @param RenderText - The text to get the size of
|
||||
* @param FontSize - The size of the text
|
||||
*/
|
||||
SDK::FVector2D TextSize(const wchar_t* RenderText, float FontSize);
|
||||
/*
|
||||
* @brief Draws a circle on the screen (wchar_t*)
|
||||
*
|
||||
* @param ScreenPosition - The position of the circle
|
||||
* @param Radius - The radius of the circle
|
||||
* @param Segments - The amount of segments the circle should have
|
||||
* @param RenderColor - The color of the circle
|
||||
*/
|
||||
void Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Draws a circle on the screen (wchar_t*)
|
||||
*
|
||||
* @param ScreenPosition - The position of the circle
|
||||
* @param Radius - The radius of the circle
|
||||
* @param Segments - The amount of segments the circle should have
|
||||
* @param RenderColor - The color of the circle
|
||||
*/
|
||||
void Circle(SDK::FVector2D ScreenPosition, float Radius, int32_t Segments, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
/*
|
||||
* @brief Draws a filled rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
*/
|
||||
void FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Draws a filled rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
*/
|
||||
void FilledRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
/*
|
||||
* @brief Draws a hollow rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param Thickness - The thickness of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
* @param Outlined - Whether or not the rectangle should be outlined
|
||||
*/
|
||||
void Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Draws a hollow rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param Thickness - The thickness of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
* @param Outlined - Whether or not the rectangle should be outlined
|
||||
*/
|
||||
void Rect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
/*
|
||||
* @brief Draws a cornered rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param Thickness - The thickness of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
*/
|
||||
void CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Draws a cornered rectangle on the screen
|
||||
*
|
||||
* @param ScreenPosition - The starting position of the rectangle
|
||||
* @param ScreenSize - The size of the rectangle
|
||||
* @param Thickness - The thickness of the rectangle
|
||||
* @param RenderColor - The color of the rectangle
|
||||
*/
|
||||
void CorneredRect(SDK::FVector2D ScreenPosition, SDK::FVector2D ScreenSize, float Thickness, SDK::FLinearColor RenderColor, bool Outlined);
|
||||
|
||||
/*
|
||||
* @brief Draws a triangle on the screen
|
||||
*
|
||||
* @param ScreenPositionA - The first position of the triangle
|
||||
* @param ScreenPositionB - The second position of the triangle
|
||||
* @param ScreenPositionC - The third position of the triangle
|
||||
* @param Thickness - The thickness of the triangle
|
||||
* @param RenderColor - The color of the triangle
|
||||
* @param Filled - Whether or not the triangle should be filled
|
||||
* @param Outlined - Whether or not the triangle should be outlined
|
||||
*/
|
||||
void Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined);
|
||||
/*
|
||||
* @brief Draws a triangle on the screen
|
||||
*
|
||||
* @param ScreenPositionA - The first position of the triangle
|
||||
* @param ScreenPositionB - The second position of the triangle
|
||||
* @param ScreenPositionC - The third position of the triangle
|
||||
* @param Thickness - The thickness of the triangle
|
||||
* @param RenderColor - The color of the triangle
|
||||
* @param Filled - Whether or not the triangle should be filled
|
||||
* @param Outlined - Whether or not the triangle should be outlined
|
||||
*/
|
||||
void Triangle(SDK::FVector2D ScreenPositionA, SDK::FVector2D ScreenPositionB, SDK::FVector2D ScreenPositionC, float Thickness, SDK::FLinearColor RenderColor, bool Filled, bool Outlined);
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,248 +1,215 @@
|
||||
#include "../../Game/Input/Input.h"
|
||||
#include "RaaxGUI.h"
|
||||
#include "RaaxGUIInput.h"
|
||||
#include "RaaxGUI.h"
|
||||
#include "../../Game/Input/Input.h"
|
||||
|
||||
void RaaxGUIInput::NotifyDanglingPointer(RaaxGUI::Window* Window)
|
||||
{
|
||||
if (ResizingWindow == Window) ClearResizingWindow(true);
|
||||
if (DraggingWindow == Window) ClearDraggingWindow(true);
|
||||
void RaaxGUIInput::NotifyDanglingPointer(RaaxGUI::Window* Window) {
|
||||
if (ResizingWindow == Window) ClearResizingWindow(true);
|
||||
if (DraggingWindow == Window) ClearDraggingWindow(true);
|
||||
}
|
||||
void RaaxGUIInput::NotifyDanglingPointer(RaaxGUI::Element* Element)
|
||||
{
|
||||
if (ClickingElement == Element) ClearClickedElement(true);
|
||||
void RaaxGUIInput::NotifyDanglingPointer(RaaxGUI::Element* Element) {
|
||||
if (ClickingElement == Element) ClearClickedElement(true);
|
||||
}
|
||||
|
||||
void RaaxGUIInput::SetResizingWindow(RaaxGUI::Window* Window)
|
||||
{
|
||||
Window->OnClickBegin(MousePosition);
|
||||
void RaaxGUIInput::SetResizingWindow(RaaxGUI::Window* Window) {
|
||||
Window->OnClickBegin(MousePosition);
|
||||
|
||||
RaaxGUIInput::ResizingWindow = Window;
|
||||
RaaxGUIInput::ResizingWindowOffset = RaaxGUIInput::MousePosition - Window->Position;
|
||||
RaaxGUIInput::ResizingWindowOriginal = Window->Position;
|
||||
RaaxGUIInput::ResizingWindowSize = Window->Size;
|
||||
RaaxGUIInput::ResizingWindow = Window;
|
||||
RaaxGUIInput::ResizingWindowOffset = RaaxGUIInput::MousePosition - Window->Position;
|
||||
RaaxGUIInput::ResizingWindowOriginal = Window->Position;
|
||||
RaaxGUIInput::ResizingWindowSize = Window->Size;
|
||||
}
|
||||
void RaaxGUIInput::TickResizingWindow()
|
||||
{
|
||||
SDK::FVector2D PotentialNewPosition = SDK::FVector2D();
|
||||
SDK::FVector2D PotentialNewSize = SDK::FVector2D();
|
||||
void RaaxGUIInput::TickResizingWindow() {
|
||||
SDK::FVector2D PotentialNewPosition = SDK::FVector2D();
|
||||
SDK::FVector2D PotentialNewSize = SDK::FVector2D();
|
||||
|
||||
switch (ResizingWindow->CurrentResizeDirection)
|
||||
{
|
||||
// TODO: Fix resizing issues when moving the mouuse fast
|
||||
switch (ResizingWindow->CurrentResizeDirection) {
|
||||
// TODO: Fix resizing issues when moving the mouuse fast
|
||||
#if 0
|
||||
case RaaxGUI::ResizeDirection::TopLeft:
|
||||
PotentialNewPosition = MousePosition - ResizingWindowOffset;
|
||||
PotentialNewSize = ResizingWindowSize + (ResizingWindowOriginal - MousePosition);
|
||||
case RaaxGUI::ResizeDirection::TopLeft:
|
||||
PotentialNewPosition = MousePosition - ResizingWindowOffset;
|
||||
PotentialNewSize = ResizingWindowSize + (ResizingWindowOriginal - MousePosition);
|
||||
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
break;
|
||||
case RaaxGUI::ResizeDirection::TopRight:
|
||||
PotentialNewPosition = SDK::FVector2D(ResizingWindowOriginal.X, MousePosition.Y - ResizingWindowOffset.Y);
|
||||
PotentialNewSize = SDK::FVector2D(MousePosition.X - ResizingWindowOriginal.X, ResizingWindowSize.Y + (ResizingWindowOriginal.Y - MousePosition.Y));
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
break;
|
||||
case RaaxGUI::ResizeDirection::TopRight:
|
||||
PotentialNewPosition = SDK::FVector2D(ResizingWindowOriginal.X, MousePosition.Y - ResizingWindowOffset.Y);
|
||||
PotentialNewSize = SDK::FVector2D(MousePosition.X - ResizingWindowOriginal.X, ResizingWindowSize.Y + (ResizingWindowOriginal.Y - MousePosition.Y));
|
||||
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
|
||||
break;
|
||||
case RaaxGUI::ResizeDirection::BottomLeft:
|
||||
PotentialNewPosition = SDK::FVector2D(MousePosition.X - ResizingWindowOffset.X, ResizingWindowOriginal.Y);
|
||||
PotentialNewSize = SDK::FVector2D(ResizingWindowSize.X + (ResizingWindowOriginal.X - MousePosition.X), MousePosition.Y - ResizingWindowOriginal.Y);
|
||||
break;
|
||||
case RaaxGUI::ResizeDirection::BottomLeft:
|
||||
PotentialNewPosition = SDK::FVector2D(MousePosition.X - ResizingWindowOffset.X, ResizingWindowOriginal.Y);
|
||||
PotentialNewSize = SDK::FVector2D(ResizingWindowSize.X + (ResizingWindowOriginal.X - MousePosition.X), MousePosition.Y - ResizingWindowOriginal.Y);
|
||||
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
ResizingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
ResizingWindow->Position = PotentialNewPosition;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
case RaaxGUI::ResizeDirection::BottomRight:
|
||||
PotentialNewSize = MousePosition - ResizingWindowOriginal;
|
||||
case RaaxGUI::ResizeDirection::BottomRight:
|
||||
PotentialNewSize = MousePosition - ResizingWindowOriginal;
|
||||
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
ResizingWindow->FixWindowSize(PotentialNewSize);
|
||||
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
ResizingWindow->Size = PotentialNewSize;
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
void RaaxGUIInput::ClearResizingWindow(const bool DanglingPointer)
|
||||
{
|
||||
if (DanglingPointer == false)
|
||||
{
|
||||
ResizingWindow->OnClickEnd();
|
||||
}
|
||||
void RaaxGUIInput::ClearResizingWindow(bool DanglingPointer) {
|
||||
if (DanglingPointer == false) {
|
||||
ResizingWindow->OnClickEnd();
|
||||
}
|
||||
|
||||
RaaxGUIInput::ResizingWindow = nullptr;
|
||||
RaaxGUIInput::ResizingWindowOffset = SDK::FVector2D();
|
||||
RaaxGUIInput::ResizingWindowOriginal = SDK::FVector2D();
|
||||
RaaxGUIInput::ResizingWindowSize = SDK::FVector2D();
|
||||
RaaxGUIInput::ResizingWindow = nullptr;
|
||||
RaaxGUIInput::ResizingWindowOffset = SDK::FVector2D();
|
||||
RaaxGUIInput::ResizingWindowOriginal = SDK::FVector2D();
|
||||
RaaxGUIInput::ResizingWindowSize = SDK::FVector2D();
|
||||
}
|
||||
|
||||
void RaaxGUIInput::SetDraggingWindow(RaaxGUI::Window* Window)
|
||||
{
|
||||
Window->OnClickBegin(MousePosition);
|
||||
void RaaxGUIInput::SetDraggingWindow(RaaxGUI::Window* Window) {
|
||||
Window->OnClickBegin(MousePosition);
|
||||
|
||||
RaaxGUIInput::DraggingWindow = Window;
|
||||
RaaxGUIInput::DraggingWindowOffset = RaaxGUIInput::MousePosition - Window->Position;
|
||||
RaaxGUIInput::DraggingWindowOriginal = Window->Position;
|
||||
RaaxGUIInput::DraggingWindowPosition = Window->Position;
|
||||
RaaxGUIInput::DraggingWindow = Window;
|
||||
RaaxGUIInput::DraggingWindowOffset = RaaxGUIInput::MousePosition - Window->Position;
|
||||
RaaxGUIInput::DraggingWindowOriginal = Window->Position;
|
||||
RaaxGUIInput::DraggingWindowPosition = Window->Position;
|
||||
}
|
||||
void RaaxGUIInput::TickDraggingWindow()
|
||||
{
|
||||
SDK::FVector2D PotentialNewPosition = MousePosition - DraggingWindowOffset;
|
||||
DraggingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
void RaaxGUIInput::TickDraggingWindow() {
|
||||
SDK::FVector2D PotentialNewPosition = MousePosition - DraggingWindowOffset;
|
||||
DraggingWindow->FixWindowPosition(PotentialNewPosition);
|
||||
|
||||
DraggingWindow->Position = PotentialNewPosition;
|
||||
DraggingWindowPosition = PotentialNewPosition;
|
||||
DraggingWindow->Position = PotentialNewPosition;
|
||||
DraggingWindowPosition = PotentialNewPosition;
|
||||
}
|
||||
void RaaxGUIInput::ClearDraggingWindow(const bool DanglingPointer)
|
||||
{
|
||||
if (DanglingPointer == false)
|
||||
{
|
||||
DraggingWindow->OnClickEnd();
|
||||
}
|
||||
void RaaxGUIInput::ClearDraggingWindow(bool DanglingPointer) {
|
||||
if (DanglingPointer == false) {
|
||||
DraggingWindow->OnClickEnd();
|
||||
}
|
||||
|
||||
RaaxGUIInput::DraggingWindow = nullptr;
|
||||
RaaxGUIInput::DraggingWindowOffset = SDK::FVector2D();
|
||||
RaaxGUIInput::DraggingWindowOriginal = SDK::FVector2D();
|
||||
RaaxGUIInput::DraggingWindowPosition = SDK::FVector2D();
|
||||
RaaxGUIInput::DraggingWindow = nullptr;
|
||||
RaaxGUIInput::DraggingWindowOffset = SDK::FVector2D();
|
||||
RaaxGUIInput::DraggingWindowOriginal = SDK::FVector2D();
|
||||
RaaxGUIInput::DraggingWindowPosition = SDK::FVector2D();
|
||||
}
|
||||
|
||||
void RaaxGUIInput::SetClickedElement(RaaxGUI::Element* Element)
|
||||
{
|
||||
Element->OnClickBegin(MousePosition);
|
||||
void RaaxGUIInput::SetClickedElement(RaaxGUI::Element* Element) {
|
||||
Element->OnClickBegin(MousePosition);
|
||||
|
||||
ClickingElement = Element;
|
||||
ClickingElement = Element;
|
||||
}
|
||||
void RaaxGUIInput::TickClickingElement()
|
||||
{
|
||||
if (ClickingElement->ParentWindow->Open == false)
|
||||
{
|
||||
ClearClickedElement(false);
|
||||
return;
|
||||
}
|
||||
void RaaxGUIInput::TickClickingElement() {
|
||||
if (ClickingElement->ParentWindow->Open == false) {
|
||||
ClearClickedElement(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ClickingElement->ClickTick(MousePosition);
|
||||
ClickingElement->ClickTick(MousePosition);
|
||||
}
|
||||
void RaaxGUIInput::ClearClickedElement(const bool DanglingPointer)
|
||||
{
|
||||
if (DanglingPointer == false)
|
||||
{
|
||||
ClickingElement->OnClickEnd();
|
||||
}
|
||||
void RaaxGUIInput::ClearClickedElement(bool DanglingPointer) {
|
||||
if (DanglingPointer == false) {
|
||||
ClickingElement->OnClickEnd();
|
||||
}
|
||||
|
||||
ClickingElement = nullptr;
|
||||
ClickingElement = nullptr;
|
||||
}
|
||||
|
||||
bool RaaxGUIInput::CanClickNewWindow()
|
||||
{
|
||||
if (DraggingWindow) return false;
|
||||
if (ResizingWindow) return false;
|
||||
if (ClickingElement) return false;
|
||||
bool RaaxGUIInput::CanClickNewWindow() {
|
||||
if (DraggingWindow) return false;
|
||||
if (ResizingWindow) return false;
|
||||
if (ClickingElement) return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
bool RaaxGUIInput::CanClickNewElement()
|
||||
{
|
||||
if (DraggingWindow) return false;
|
||||
if (ResizingWindow) return false;
|
||||
if (ClickingElement) return false;
|
||||
bool RaaxGUIInput::CanClickNewElement() {
|
||||
if (DraggingWindow) return false;
|
||||
if (ResizingWindow) return false;
|
||||
if (ClickingElement) return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
RaaxGUIInput::CollisionTraceData RaaxGUIInput::MouseCollisionTrace(const SDK::FVector2D& MousePosition)
|
||||
{
|
||||
CollisionTraceData TraceData{};
|
||||
RaaxGUIInput::CollisionTraceData RaaxGUIInput::MouseCollisionTrace(SDK::FVector2D MousePosition) {
|
||||
CollisionTraceData TraceData{};
|
||||
|
||||
// Reverse the windows so the top most window is checked first
|
||||
std::vector ReverseWindowsTemp = RaaxGUI::GetContext()->RenderQue.Windows;
|
||||
std::reverse(ReverseWindowsTemp.begin(), ReverseWindowsTemp.end());
|
||||
// Reverse the windows so the top most window is checked first
|
||||
std::vector ReverseWindowsTemp = RaaxGUI::GetContext()->RenderQue.Windows;
|
||||
std::reverse(ReverseWindowsTemp.begin(), ReverseWindowsTemp.end());
|
||||
|
||||
for (auto Window : ReverseWindowsTemp)
|
||||
{
|
||||
if (Window->Open)
|
||||
{
|
||||
if (Window->IsInMenuBounds(MousePosition))
|
||||
{
|
||||
TraceData.CollidedWindow = Window;
|
||||
for (auto Window : ReverseWindowsTemp) {
|
||||
if (Window->Open) {
|
||||
if (Window->IsInMenuBounds(MousePosition)) {
|
||||
TraceData.CollidedWindow = Window;
|
||||
|
||||
for (auto Element : Window->Elements)
|
||||
{
|
||||
if (Element->IsInElementBounds(MousePosition))
|
||||
{
|
||||
TraceData.CollidedElement = Element;
|
||||
for (auto Element : Window->Elements) {
|
||||
if (Element->IsInElementBounds(MousePosition)) {
|
||||
TraceData.CollidedElement = Element;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TraceData;
|
||||
return TraceData;
|
||||
}
|
||||
|
||||
void RaaxGUIInput::Tick()
|
||||
{
|
||||
// Check for collisions with the mouse position
|
||||
MousePosition = Input::GetMousePosition();
|
||||
CollisionTraceData TraceData = MouseCollisionTrace(MousePosition);
|
||||
void RaaxGUIInput::Tick() {
|
||||
// Check for collisions with the mouse position
|
||||
MousePosition = Input::GetMousePosition();
|
||||
CollisionTraceData TraceData = MouseCollisionTrace(MousePosition);
|
||||
|
||||
// Check for input
|
||||
bool LMBDown = Input::IsKeyDown(Input::KeyName::LeftMouseButton);
|
||||
bool LMBJustPressed = Input::WasKeyJustPressed(Input::KeyName::LeftMouseButton);
|
||||
// Check for input
|
||||
bool LMBDown = Input::IsKeyDown(Input::KeyName::LeftMouseButton);
|
||||
bool LMBJustPressed = Input::WasKeyJustPressed(Input::KeyName::LeftMouseButton);
|
||||
|
||||
// If the left mouse button is down, handle clicking events. Otherwise, handle releasing events on any clicked objects.
|
||||
if (LMBDown)
|
||||
{
|
||||
// If the left mouse button was just pressed, check for new objects to click.
|
||||
if (LMBJustPressed)
|
||||
{
|
||||
// Elements take priority over windows, so check for elements first.
|
||||
if (TraceData.CollidedElement && CanClickNewElement())
|
||||
{
|
||||
SetClickedElement(TraceData.CollidedElement);
|
||||
}
|
||||
// If the left mouse button is down, handle clicking events. Otherwise, handle releasing events on any clicked objects.
|
||||
if (LMBDown) {
|
||||
// If the left mouse button was just pressed, check for new objects to click.
|
||||
if (LMBJustPressed) {
|
||||
// Elements take priority over windows, so check for elements first.
|
||||
if (TraceData.CollidedElement && CanClickNewElement()) {
|
||||
SetClickedElement(TraceData.CollidedElement);
|
||||
}
|
||||
|
||||
// If no elements were clicked, check for windows.
|
||||
else if (TraceData.CollidedWindow && CanClickNewWindow())
|
||||
{
|
||||
// Resizing takes priority over dragging, so check for resizing first.
|
||||
if (TraceData.CollidedWindow->IsInResizeBounds(MousePosition))
|
||||
{
|
||||
SetResizingWindow(TraceData.CollidedWindow);
|
||||
}
|
||||
// If the position is not in the resize bounds, check for dragging.
|
||||
else if (TraceData.CollidedWindow->IsInMenuBounds(MousePosition))
|
||||
{
|
||||
SetDraggingWindow(TraceData.CollidedWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the left mouse button is down, but the left mouse button was not just pressed, process the clicked object.
|
||||
if (ClickingElement) TickClickingElement();
|
||||
if (ResizingWindow) TickResizingWindow();
|
||||
if (DraggingWindow) TickDraggingWindow();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the left mouse button is not down, clear any clicked objects.
|
||||
if (ClickingElement) ClearClickedElement(false);
|
||||
if (ResizingWindow) ClearResizingWindow(false);
|
||||
if (DraggingWindow) ClearDraggingWindow(false);
|
||||
}
|
||||
// If no elements were clicked, check for windows.
|
||||
else if (TraceData.CollidedWindow && CanClickNewWindow()) {
|
||||
// Resizing takes priority over dragging, so check for resizing first.
|
||||
if (TraceData.CollidedWindow->IsInResizeBounds(MousePosition)) {
|
||||
SetResizingWindow(TraceData.CollidedWindow);
|
||||
}
|
||||
// If the position is not in the resize bounds, check for dragging.
|
||||
else if (TraceData.CollidedWindow->IsInMenuBounds(MousePosition)) {
|
||||
SetDraggingWindow(TraceData.CollidedWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the left mouse button is down, but the left mouse button was not just pressed, process the clicked object.
|
||||
if (ClickingElement) TickClickingElement();
|
||||
if (ResizingWindow) TickResizingWindow();
|
||||
if (DraggingWindow) TickDraggingWindow();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the left mouse button is not down, clear any clicked objects.
|
||||
if (ClickingElement) ClearClickedElement(false);
|
||||
if (ResizingWindow) ClearResizingWindow(false);
|
||||
if (DraggingWindow) ClearDraggingWindow(false);
|
||||
}
|
||||
}
|
||||
@@ -3,55 +3,53 @@
|
||||
|
||||
#include "../../Game/SDK/Classes/Basic.h"
|
||||
|
||||
namespace RaaxGUIInput
|
||||
{
|
||||
struct CollisionTraceData
|
||||
{
|
||||
RaaxGUI::Window* CollidedWindow = nullptr; // A pointer to the collided window, nullptr if no collision.
|
||||
RaaxGUI::Element* CollidedElement = nullptr; // A pointer to the collided element (will always be in the collided window), nullptr if no collision.
|
||||
};
|
||||
namespace RaaxGUIInput {
|
||||
struct CollisionTraceData {
|
||||
RaaxGUI::Window* CollidedWindow = nullptr; // A pointer to the collided window, nullptr if no collision.
|
||||
RaaxGUI::Element* CollidedElement = nullptr; // A pointer to the collided element (will always be in the collided window), nullptr if no collision.
|
||||
};
|
||||
|
||||
inline SDK::FVector2D MousePosition; // The current mouse position.
|
||||
inline SDK::FVector2D MousePosition; // The current mouse position.
|
||||
|
||||
inline RaaxGUI::Element* ClickingElement; // The element that is currently clicked.
|
||||
inline RaaxGUI::Element* ClickingElement; // The element that is currently clicked.
|
||||
|
||||
inline RaaxGUI::Window* ResizingWindow; // The window that is currently being resized.
|
||||
inline SDK::FVector2D ResizingWindowOffset;
|
||||
inline SDK::FVector2D ResizingWindowOriginal;
|
||||
inline SDK::FVector2D ResizingWindowSize;
|
||||
inline RaaxGUI::Window* ResizingWindow; // The window that is currently being resized.
|
||||
inline SDK::FVector2D ResizingWindowOffset;
|
||||
inline SDK::FVector2D ResizingWindowOriginal;
|
||||
inline SDK::FVector2D ResizingWindowSize;
|
||||
|
||||
inline RaaxGUI::Window* DraggingWindow; // The window that is currently being dragged.
|
||||
inline SDK::FVector2D DraggingWindowOffset;
|
||||
inline SDK::FVector2D DraggingWindowOriginal;
|
||||
inline SDK::FVector2D DraggingWindowPosition;
|
||||
inline RaaxGUI::Window* DraggingWindow; // The window that is currently being dragged.
|
||||
inline SDK::FVector2D DraggingWindowOffset;
|
||||
inline SDK::FVector2D DraggingWindowOriginal;
|
||||
inline SDK::FVector2D DraggingWindowPosition;
|
||||
|
||||
|
||||
|
||||
/* Called from the garbage collector in RaaxGUI to clear any dangling window pointers. */
|
||||
void NotifyDanglingPointer(RaaxGUI::Window* Window);
|
||||
/* Called from the garbage collector in RaaxGUI to clear any dangling element pointers. */
|
||||
void NotifyDanglingPointer(RaaxGUI::Element* Element);
|
||||
/* Called from the garbage collector in RaaxGUI to clear any dangling window pointers. */
|
||||
void NotifyDanglingPointer(RaaxGUI::Window* Window);
|
||||
/* Called from the garbage collector in RaaxGUI to clear any dangling element pointers. */
|
||||
void NotifyDanglingPointer(RaaxGUI::Element* Element);
|
||||
|
||||
// Everything below is very self-explanatory.
|
||||
// Everything below is very self-explanatory.
|
||||
|
||||
void SetResizingWindow(RaaxGUI::Window* Window);
|
||||
void TickResizingWindow();
|
||||
void ClearResizingWindow(const bool DanglingPointer);
|
||||
void SetResizingWindow(RaaxGUI::Window* Window);
|
||||
void TickResizingWindow();
|
||||
void ClearResizingWindow(bool DanglingPointer);
|
||||
|
||||
void SetDraggingWindow(RaaxGUI::Window* Window);
|
||||
void TickDraggingWindow();
|
||||
void ClearDraggingWindow(const bool DanglingPointer);
|
||||
void SetDraggingWindow(RaaxGUI::Window* Window);
|
||||
void TickDraggingWindow();
|
||||
void ClearDraggingWindow(bool DanglingPointer);
|
||||
|
||||
void SetClickedElement(RaaxGUI::Element* Element);
|
||||
void TickClickingElement();
|
||||
void ClearClickedElement(const bool DanglingPointer);
|
||||
void SetClickedElement(RaaxGUI::Element* Element);
|
||||
void TickClickingElement();
|
||||
void ClearClickedElement(bool DanglingPointer);
|
||||
|
||||
bool CanClickNewWindow();
|
||||
bool CanClickNewElement();
|
||||
bool CanClickNewWindow();
|
||||
bool CanClickNewElement();
|
||||
|
||||
/* Returns a CollisionTraceData struct containing information about the collision. */
|
||||
CollisionTraceData MouseCollisionTrace(const SDK::FVector2D& MousePosition);
|
||||
/* Returns a CollisionTraceData struct containing information about the collision. */
|
||||
CollisionTraceData MouseCollisionTrace(SDK::FVector2D MousePosition);
|
||||
|
||||
/* Called every frame to update the input system. */
|
||||
void Tick();
|
||||
/* Called every frame to update the input system. */
|
||||
void Tick();
|
||||
};
|
||||
+12
-18
@@ -4,8 +4,6 @@
|
||||
|
||||
#ifdef _ENGINE
|
||||
#include "Drawing/RaaxGUI/RaaxGUI.h"
|
||||
#else
|
||||
#include "Drawing/Drawing.h"
|
||||
#endif // _ENGINE
|
||||
|
||||
#include "Game/Features/Features.h"
|
||||
@@ -22,7 +20,7 @@
|
||||
|
||||
/*
|
||||
* NOTES
|
||||
*
|
||||
*
|
||||
* All specific offsets, VFT indexes, function addresses, visual explanations etc
|
||||
* mentioned in comments are from Fortnite 7.40.
|
||||
*/
|
||||
@@ -44,12 +42,9 @@
|
||||
#if UNLOAD_THREAD
|
||||
const Input::KeyName UnloadKey = Input::KeyName::F5;
|
||||
|
||||
VOID UnloadThread()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (Input::IsKeyDown(UnloadKey))
|
||||
{
|
||||
VOID UnloadThread() {
|
||||
while (true) {
|
||||
if (Input::IsKeyDown(UnloadKey)) {
|
||||
// Beep to notify that the cheat has been unloaded
|
||||
LI_FN(Beep).safe()(500, 250);
|
||||
|
||||
@@ -84,8 +79,7 @@ VOID UnloadThread()
|
||||
}
|
||||
#endif // UNLOAD_THREAD
|
||||
|
||||
VOID Main()
|
||||
{
|
||||
VOID Main() {
|
||||
#ifdef _IMGUI
|
||||
#if LOAD_D3DCOMPILER_47
|
||||
// Load D3DCompiler_47.dll for ImGui
|
||||
@@ -97,10 +91,10 @@ VOID Main()
|
||||
LI_FN(Beep).safe()(500, 500);
|
||||
|
||||
#if LOG_LEVEL > LOG_NONE
|
||||
//static_assert(false, "Please set a custom path for your logger! i.e. \"C:\\Users\\YOUR_USER\\Desktop\\LOG_NAME.log\". DOUBLE CLICK ME AND REMOVE ME!");
|
||||
static_assert(false, "Please set a custom path for your logger! i.e. \"C:\\Users\\YOUR_USER\\Desktop\\LOG_NAME.log\". DOUBLE CLICK ME AND REMOVE ME!");
|
||||
|
||||
// Init logger
|
||||
Logger::InitLogger(std::string(skCrypt("C:\\Users\\raax\\Desktop\\cheat.log")));
|
||||
Logger::InitLogger(std::string(skCrypt("C:\\Users\\YOUR_USER\\Desktop\\LOG_NAME.log")));
|
||||
#endif // LOG_LEVEL > LOG_NONE
|
||||
|
||||
// Init base address, GObjects, function addresses, offsets etc
|
||||
@@ -120,13 +114,13 @@ VOID Main()
|
||||
#endif // UNLOAD_THREAD
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
CurrentModule = hModule;
|
||||
|
||||
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
|
||||
Binary file not shown.
@@ -3604,7 +3604,7 @@ void ImGui::Initialize()
|
||||
|
||||
// Create default viewport
|
||||
ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)();
|
||||
viewport->Id = IMGUI_VIEWPORT_DEFAULT_ID;
|
||||
viewport->ID = IMGUI_VIEWPORT_DEFAULT_ID;
|
||||
g.Viewports.push_back(viewport);
|
||||
g.TempBuffer.resize(1024 * 3 + 1, 0);
|
||||
|
||||
@@ -3742,8 +3742,8 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* ctx, const char* name) : DrawListInst(NUL
|
||||
Ctx = ctx;
|
||||
Name = ImStrdup(name);
|
||||
NameBufLen = (int)strlen(name) + 1;
|
||||
Id = ImHashStr(name);
|
||||
IDStack.push_back(Id);
|
||||
ID = ImHashStr(name);
|
||||
IDStack.push_back(ID);
|
||||
MoveId = GetID("#MOVE");
|
||||
ScrollTarget = ImVec2(FLT_MAX, FLT_MAX);
|
||||
ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f);
|
||||
@@ -3872,7 +3872,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
|
||||
// This could be written in a more general way (e.g associate a hook to ActiveId),
|
||||
// but since this is currently quite an exception we'll leave it as is.
|
||||
// One common scenario leading to this is: pressing Key ->NavMoveRequestApplyResult() -> ClearActiveId()
|
||||
if (g.InputTextState.Id == g.ActiveId)
|
||||
if (g.InputTextState.ID == g.ActiveId)
|
||||
InputTextDeactivateHook(g.ActiveId);
|
||||
}
|
||||
|
||||
@@ -4039,7 +4039,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
|
||||
return false;
|
||||
|
||||
// Test if another item is active (e.g. being dragged)
|
||||
const ImGuiID id = g.LastItemData.Id;
|
||||
const ImGuiID id = g.LastItemData.ID;
|
||||
if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0)
|
||||
if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId)
|
||||
return false;
|
||||
@@ -4061,7 +4061,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
|
||||
// Test if using AllowOverlap and overlapped
|
||||
if ((g.LastItemData.InFlags & ImGuiItemFlags_AllowOverlap) && id != 0)
|
||||
if ((flags & ImGuiHoveredFlags_AllowWhenOverlappedByItem) == 0)
|
||||
if (g.HoveredIdPreviousFrame != g.LastItemData.Id)
|
||||
if (g.HoveredIdPreviousFrame != g.LastItemData.ID)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4070,7 +4070,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
|
||||
const float delay = CalcDelayFromHoveredFlags(flags);
|
||||
if (delay > 0.0f || (flags & ImGuiHoveredFlags_Stationary))
|
||||
{
|
||||
ImGuiID hover_delay_id = (g.LastItemData.Id != 0) ? g.LastItemData.Id : window->GetIDFromRectangle(g.LastItemData.Rect);
|
||||
ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect);
|
||||
if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverItemDelayIdPreviousFrame != hover_delay_id))
|
||||
g.HoverItemDelayTimer = 0.0f;
|
||||
g.HoverItemDelayId = hover_delay_id;
|
||||
@@ -4184,7 +4184,7 @@ bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id)
|
||||
void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags item_flags, const ImRect& item_rect)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
g.LastItemData.Id = item_id;
|
||||
g.LastItemData.ID = item_id;
|
||||
g.LastItemData.InFlags = in_flags;
|
||||
g.LastItemData.StatusFlags = item_flags;
|
||||
g.LastItemData.Rect = g.LastItemData.NavRect = item_rect;
|
||||
@@ -4681,7 +4681,7 @@ void ImGui::NewFrame()
|
||||
else if (g.HoverItemDelayId == 0)
|
||||
g.HoverItemUnlockedStationaryId = 0;
|
||||
if (g.HoveredWindow != NULL && g.MouseStationaryTimer >= g.Style.HoverStationaryDelay)
|
||||
g.HoverWindowUnlockedStationaryId = g.HoveredWindow->Id;
|
||||
g.HoverWindowUnlockedStationaryId = g.HoveredWindow->ID;
|
||||
else if (g.HoveredWindow == NULL)
|
||||
g.HoverWindowUnlockedStationaryId = 0;
|
||||
|
||||
@@ -5257,7 +5257,7 @@ bool ImGui::IsItemActive()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.ActiveId)
|
||||
return g.ActiveId == g.LastItemData.Id;
|
||||
return g.ActiveId == g.LastItemData.ID;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5265,7 +5265,7 @@ bool ImGui::IsItemActivated()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.ActiveId)
|
||||
if (g.ActiveId == g.LastItemData.Id && g.ActiveIdPreviousFrame != g.LastItemData.Id)
|
||||
if (g.ActiveId == g.LastItemData.ID && g.ActiveIdPreviousFrame != g.LastItemData.ID)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -5275,7 +5275,7 @@ bool ImGui::IsItemDeactivated()
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDeactivated)
|
||||
return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Deactivated) != 0;
|
||||
return (g.ActiveIdPreviousFrame == g.LastItemData.Id && g.ActiveIdPreviousFrame != 0 && g.ActiveId != g.LastItemData.Id);
|
||||
return (g.ActiveIdPreviousFrame == g.LastItemData.ID && g.ActiveIdPreviousFrame != 0 && g.ActiveId != g.LastItemData.ID);
|
||||
}
|
||||
|
||||
bool ImGui::IsItemDeactivatedAfterEdit()
|
||||
@@ -5288,7 +5288,7 @@ bool ImGui::IsItemDeactivatedAfterEdit()
|
||||
bool ImGui::IsItemFocused()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.NavId != g.LastItemData.Id || g.NavId == 0)
|
||||
if (g.NavId != g.LastItemData.ID || g.NavId == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -5360,7 +5360,7 @@ void ImGui::SetNextItemAllowOverlap()
|
||||
void ImGui::SetItemAllowOverlap()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiID id = g.LastItemData.Id;
|
||||
ImGuiID id = g.LastItemData.ID;
|
||||
if (g.HoveredId == id)
|
||||
g.HoveredIdAllowOverlap = true;
|
||||
if (g.ActiveId == id) // Before we made this obsolete, most calls to SetItemAllowOverlap() used to avoid this path by testing g.ActiveId != id.
|
||||
@@ -5381,7 +5381,7 @@ void ImGui::SetActiveIdUsingAllKeyboardKeys()
|
||||
ImGuiID ImGui::GetItemID()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
return g.LastItemData.Id;
|
||||
return g.LastItemData.ID;
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetItemRectMin()
|
||||
@@ -5651,7 +5651,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name);
|
||||
window->Flags = flags;
|
||||
g.WindowsById.SetVoidPtr(window->Id, window);
|
||||
g.WindowsById.SetVoidPtr(window->ID, window);
|
||||
|
||||
ImGuiWindowSettings* settings = NULL;
|
||||
if (!(flags & ImGuiWindowFlags_NoSavedSettings))
|
||||
@@ -5854,7 +5854,7 @@ static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_
|
||||
ImGuiID ImGui::GetWindowResizeCornerID(ImGuiWindow* window, int n)
|
||||
{
|
||||
IM_ASSERT(n >= 0 && n < 4);
|
||||
ImGuiID id = window->Id;
|
||||
ImGuiID id = window->ID;
|
||||
id = ImHashStr("#RESIZE", 0, id);
|
||||
id = ImHashData(&n, sizeof(int), id);
|
||||
return id;
|
||||
@@ -5865,7 +5865,7 @@ ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir)
|
||||
{
|
||||
IM_ASSERT(dir >= 0 && dir < 4);
|
||||
int n = (int)dir + 4;
|
||||
ImGuiID id = window->Id;
|
||||
ImGuiID id = window->ID;
|
||||
id = ImHashStr("#RESIZE", 0, id);
|
||||
id = ImHashData(&n, sizeof(int), id);
|
||||
return id;
|
||||
@@ -6380,7 +6380,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window = CreateNewWindow(name, flags);
|
||||
|
||||
// [DEBUG] Debug break requested by user
|
||||
if (g.DebugBreakInWindow == window->Id)
|
||||
if (g.DebugBreakInWindow == window->ID)
|
||||
IM_DEBUG_BREAK();
|
||||
|
||||
// Automatically disable manual moving/resizing when NoInputs is set
|
||||
@@ -6429,7 +6429,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
|
||||
// We allow window memory to be compacted so recreate the base stack when needed.
|
||||
if (window->IDStack.Size == 0)
|
||||
window->IDStack.push_back(window->Id);
|
||||
window->IDStack.push_back(window->ID);
|
||||
|
||||
// Add to stack
|
||||
g.CurrentWindow = window;
|
||||
@@ -6453,7 +6453,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
}
|
||||
|
||||
// Add to focus scope stack
|
||||
PushFocusScope((flags & ImGuiWindowFlags_NavFlattened) ? g.CurrentFocusScopeId : window->Id);
|
||||
PushFocusScope((flags & ImGuiWindowFlags_NavFlattened) ? g.CurrentFocusScopeId : window->ID);
|
||||
window->NavRootFocusScopeId = g.CurrentFocusScopeId;
|
||||
|
||||
// Add to popup stack
|
||||
@@ -6994,7 +6994,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
|
||||
// [DEBUG]
|
||||
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||
if (g.DebugLocateId != 0 && (window->Id == g.DebugLocateId || window->MoveId == g.DebugLocateId))
|
||||
if (g.DebugLocateId != 0 && (window->ID == g.DebugLocateId || window->MoveId == g.DebugLocateId))
|
||||
DebugLocateItemResolveWithLastItem();
|
||||
#endif
|
||||
|
||||
@@ -7516,7 +7516,7 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
|
||||
// We can implement this for _Stationary because the data is linked to HoveredWindow rather than CurrentWindow.
|
||||
if (flags & ImGuiHoveredFlags_ForTooltip)
|
||||
flags = ApplyHoverFlagsForTooltip(flags, g.Style.HoverFlagsForTooltipMouse);
|
||||
if ((flags & ImGuiHoveredFlags_Stationary) != 0 && g.HoverWindowUnlockedStationaryId != ref_window->Id)
|
||||
if ((flags & ImGuiHoveredFlags_Stationary) != 0 && g.HoverWindowUnlockedStationaryId != ref_window->ID)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -7821,8 +7821,8 @@ void ImGui::PushFocusScope(ImGuiID id)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiFocusScopeData data;
|
||||
data.Id = id;
|
||||
data.WindowID = g.CurrentWindow->Id;
|
||||
data.ID = id;
|
||||
data.WindowID = g.CurrentWindow->ID;
|
||||
g.FocusScopeStack.push_back(data);
|
||||
g.CurrentFocusScopeId = id;
|
||||
}
|
||||
@@ -7836,7 +7836,7 @@ void ImGui::PopFocusScope()
|
||||
return;
|
||||
}
|
||||
g.FocusScopeStack.pop_back();
|
||||
g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back().Id : 0;
|
||||
g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back().ID : 0;
|
||||
}
|
||||
|
||||
void ImGui::SetNavFocusScope(ImGuiID focus_scope_id)
|
||||
@@ -7852,17 +7852,17 @@ void ImGui::SetNavFocusScope(ImGuiID focus_scope_id)
|
||||
if (focus_scope_id == g.CurrentFocusScopeId)
|
||||
{
|
||||
// Top of focus stack contains local focus scopes inside current window
|
||||
for (int n = g.FocusScopeStack.Size - 1; n >= 0 && g.FocusScopeStack.Data[n].WindowID == g.CurrentWindow->Id; n--)
|
||||
for (int n = g.FocusScopeStack.Size - 1; n >= 0 && g.FocusScopeStack.Data[n].WindowID == g.CurrentWindow->ID; n--)
|
||||
g.NavFocusRoute.push_back(g.FocusScopeStack.Data[n]);
|
||||
}
|
||||
else if (focus_scope_id == g.NavWindow->NavRootFocusScopeId)
|
||||
g.NavFocusRoute.push_back({ focus_scope_id, g.NavWindow->Id });
|
||||
g.NavFocusRoute.push_back({ focus_scope_id, g.NavWindow->ID });
|
||||
else
|
||||
return;
|
||||
|
||||
// Then follow on manually set ParentWindowForFocusRoute field (#6798)
|
||||
for (ImGuiWindow* window = g.NavWindow->ParentWindowForFocusRoute; window != NULL; window = window->ParentWindowForFocusRoute)
|
||||
g.NavFocusRoute.push_back({ window->NavRootFocusScopeId, window->Id });
|
||||
g.NavFocusRoute.push_back({ window->NavRootFocusScopeId, window->ID });
|
||||
IM_ASSERT(g.NavFocusRoute.Size < 100); // Maximum depth is technically 251 as per CalcRoutingScore(): 254 - 3
|
||||
}
|
||||
|
||||
@@ -7871,7 +7871,7 @@ void ImGui::FocusItem()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
IMGUI_DEBUG_LOG_FOCUS("FocusItem(0x%08x) in window \"%s\"\n", g.LastItemData.Id, window->Name);
|
||||
IMGUI_DEBUG_LOG_FOCUS("FocusItem(0x%08x) in window \"%s\"\n", g.LastItemData.ID, window->Name);
|
||||
if (g.DragDropActive || g.MovingWindow != NULL) // FIXME: Opt-in flags for this?
|
||||
{
|
||||
IMGUI_DEBUG_LOG_FOCUS("FocusItem() ignored while DragDropActive!\n");
|
||||
@@ -7933,7 +7933,7 @@ void ImGui::SetItemDefaultFocus()
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
if (!window->Appearing)
|
||||
return;
|
||||
if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResult.Id == 0) || g.NavLayer != window->DC.NavLayerCurrent)
|
||||
if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResult.ID == 0) || g.NavLayer != window->DC.NavLayerCurrent)
|
||||
return;
|
||||
|
||||
g.NavInitRequest = false;
|
||||
@@ -8400,7 +8400,7 @@ static int CalcRoutingScore(ImGuiID focus_scope_id, ImGuiID owner_id, ImGuiInput
|
||||
if (focus_scope_id == 0)
|
||||
return 255;
|
||||
for (int index_in_focus_path = 0; index_in_focus_path < g.NavFocusRoute.Size; index_in_focus_path++)
|
||||
if (g.NavFocusRoute.Data[index_in_focus_path].Id == focus_scope_id)
|
||||
if (g.NavFocusRoute.Data[index_in_focus_path].ID == focus_scope_id)
|
||||
return 3 + index_in_focus_path;
|
||||
|
||||
return 255;
|
||||
@@ -9426,7 +9426,7 @@ void ImGui::SetKeyOwnersForKeyChord(ImGuiKeyChord key_chord, ImGuiID owner_id, I
|
||||
void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiID id = g.LastItemData.Id;
|
||||
ImGuiID id = g.LastItemData.ID;
|
||||
if (id == 0 || (g.HoveredId != id && g.ActiveId != id))
|
||||
return;
|
||||
if ((flags & ImGuiInputFlags_CondMask_) == 0)
|
||||
@@ -9818,7 +9818,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
|
||||
|
||||
// Set item data
|
||||
// (DisplayRect is left untouched, made valid when ImGuiItemStatusFlags_HasDisplayRect is set)
|
||||
g.LastItemData.Id = id;
|
||||
g.LastItemData.ID = id;
|
||||
g.LastItemData.Rect = bb;
|
||||
g.LastItemData.NavRect = nav_bb_arg ? *nav_bb_arg : bb;
|
||||
g.LastItemData.InFlags = g.CurrentItemFlags | g.NextItemData.ItemFlags | extra_flags;
|
||||
@@ -9884,7 +9884,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
|
||||
// [DEBUG] People keep stumbling on this problem and using "" as identifier in the root of a window instead of "##something".
|
||||
// Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something".
|
||||
// READ THE FAQ: https://dearimgui.com/faq
|
||||
IM_ASSERT(id != window->Id && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
|
||||
IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
|
||||
}
|
||||
//if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG]
|
||||
//if ((g.LastItemData.InFlags & ImGuiItemFlags_NoNav) == 0)
|
||||
@@ -10245,7 +10245,7 @@ void ImGui::BeginGroup()
|
||||
|
||||
g.GroupStack.resize(g.GroupStack.Size + 1);
|
||||
ImGuiGroupData& group_data = g.GroupStack.back();
|
||||
group_data.WindowID = window->Id;
|
||||
group_data.WindowID = window->ID;
|
||||
group_data.BackupCursorPos = window->DC.CursorPos;
|
||||
group_data.BackupCursorPosPrevLine = window->DC.CursorPosPrevLine;
|
||||
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
|
||||
@@ -10274,7 +10274,7 @@ void ImGui::EndGroup()
|
||||
IM_ASSERT(g.GroupStack.Size > 0); // Mismatched BeginGroup()/EndGroup() calls
|
||||
|
||||
ImGuiGroupData& group_data = g.GroupStack.back();
|
||||
IM_ASSERT(group_data.WindowID == window->Id); // EndGroup() in wrong window?
|
||||
IM_ASSERT(group_data.WindowID == window->ID); // EndGroup() in wrong window?
|
||||
|
||||
if (window->DC.IsSetPos)
|
||||
ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
||||
@@ -10309,9 +10309,9 @@ void ImGui::EndGroup()
|
||||
const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId;
|
||||
const bool group_contains_prev_active_id = (group_data.BackupActiveIdPreviousFrameIsAlive == false) && (g.ActiveIdPreviousFrameIsAlive == true);
|
||||
if (group_contains_curr_active_id)
|
||||
g.LastItemData.Id = g.ActiveId;
|
||||
g.LastItemData.ID = g.ActiveId;
|
||||
else if (group_contains_prev_active_id)
|
||||
g.LastItemData.Id = g.ActiveIdPreviousFrame;
|
||||
g.LastItemData.ID = g.ActiveIdPreviousFrame;
|
||||
g.LastItemData.Rect = group_bb;
|
||||
|
||||
// Forward Hovered flag
|
||||
@@ -11026,7 +11026,7 @@ void ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiPopupFlags popup_flags
|
||||
int mouse_button = (popup_flags & ImGuiPopupFlags_MouseButtonMask_);
|
||||
if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
|
||||
{
|
||||
ImGuiID id = str_id ? window->GetID(str_id) : g.LastItemData.Id; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
|
||||
ImGuiID id = str_id ? window->GetID(str_id) : g.LastItemData.ID; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
|
||||
IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
|
||||
OpenPopupEx(id, popup_flags);
|
||||
}
|
||||
@@ -11054,7 +11054,7 @@ bool ImGui::BeginPopupContextItem(const char* str_id, ImGuiPopupFlags popup_flag
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
if (window->SkipItems)
|
||||
return false;
|
||||
ImGuiID id = str_id ? window->GetID(str_id) : g.LastItemData.Id; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
|
||||
ImGuiID id = str_id ? window->GetID(str_id) : g.LastItemData.ID; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
|
||||
IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
|
||||
int mouse_button = (popup_flags & ImGuiPopupFlags_MouseButtonMask_);
|
||||
if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
|
||||
@@ -11289,7 +11289,7 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
|
||||
g.NavLayer = nav_layer;
|
||||
SetNavFocusScope(g.CurrentFocusScopeId);
|
||||
window->NavLastIds[nav_layer] = id;
|
||||
if (g.LastItemData.Id == id)
|
||||
if (g.LastItemData.ID == id)
|
||||
window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect);
|
||||
|
||||
if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
|
||||
@@ -11375,7 +11375,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
|
||||
else
|
||||
{
|
||||
// Degenerate case: two overlapping buttons with same center, break ties arbitrarily (note that LastItemId here is really the _previous_ item order, but it doesn't matter)
|
||||
quadrant = (g.LastItemData.Id < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right;
|
||||
quadrant = (g.LastItemData.ID < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right;
|
||||
}
|
||||
|
||||
const ImGuiDir move_dir = g.NavMoveDir;
|
||||
@@ -11462,7 +11462,7 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result)
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
result->Window = window;
|
||||
result->Id = g.LastItemData.Id;
|
||||
result->ID = g.LastItemData.ID;
|
||||
result->FocusScopeId = g.CurrentFocusScopeId;
|
||||
result->InFlags = g.LastItemData.InFlags;
|
||||
result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect);
|
||||
@@ -11488,7 +11488,7 @@ static void ImGui::NavProcessItem()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
const ImGuiID id = g.LastItemData.Id;
|
||||
const ImGuiID id = g.LastItemData.ID;
|
||||
const ImGuiItemFlags item_flags = g.LastItemData.InFlags;
|
||||
|
||||
// When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221)
|
||||
@@ -11504,7 +11504,7 @@ static void ImGui::NavProcessItem()
|
||||
{
|
||||
// Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback
|
||||
const bool candidate_for_nav_default_focus = (item_flags & ImGuiItemFlags_NoNavDefaultFocus) == 0;
|
||||
if (candidate_for_nav_default_focus || g.NavInitResult.Id == 0)
|
||||
if (candidate_for_nav_default_focus || g.NavInitResult.ID == 0)
|
||||
{
|
||||
NavApplyItemToResult(&g.NavInitResult);
|
||||
}
|
||||
@@ -11593,7 +11593,7 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag
|
||||
if (g.NavTabbingDir == +1)
|
||||
{
|
||||
// Tab Forward or SetKeyboardFocusHere() with >= 0
|
||||
if (can_stop && g.NavTabbingResultFirst.Id == 0)
|
||||
if (can_stop && g.NavTabbingResultFirst.ID == 0)
|
||||
NavApplyItemToResult(&g.NavTabbingResultFirst);
|
||||
if (can_stop && g.NavTabbingCounter > 0 && --g.NavTabbingCounter == 0)
|
||||
NavMoveRequestResolveWithLastItem(result);
|
||||
@@ -11605,7 +11605,7 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag
|
||||
// Tab Backward
|
||||
if (g.NavId == id)
|
||||
{
|
||||
if (result->Id)
|
||||
if (result->ID)
|
||||
{
|
||||
g.NavMoveScoringItems = false;
|
||||
NavUpdateAnyRequestFlag();
|
||||
@@ -11621,7 +11621,7 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag
|
||||
{
|
||||
if (can_stop && g.NavId == id)
|
||||
NavMoveRequestResolveWithLastItem(result);
|
||||
if (can_stop && g.NavTabbingResultFirst.Id == 0) // Tab init
|
||||
if (can_stop && g.NavTabbingResultFirst.ID == 0) // Tab init
|
||||
NavApplyItemToResult(&g.NavTabbingResultFirst);
|
||||
}
|
||||
}
|
||||
@@ -11629,7 +11629,7 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag
|
||||
bool ImGui::NavMoveRequestButNoResultYet()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
return g.NavMoveScoringItems && g.NavMoveResultLocal.Id == 0 && g.NavMoveResultOther.Id == 0;
|
||||
return g.NavMoveScoringItems && g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0;
|
||||
}
|
||||
|
||||
// FIXME: ScoringRect is not set
|
||||
@@ -11670,7 +11670,7 @@ void ImGui::NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGu
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
g.NavMoveScoringItems = false;
|
||||
g.LastItemData.Id = tree_node_data->Id;
|
||||
g.LastItemData.ID = tree_node_data->ID;
|
||||
g.LastItemData.InFlags = tree_node_data->InFlags & ~ImGuiItemFlags_HasSelectionUserData; // Losing SelectionUserData, recovered next-frame (cheaper).
|
||||
g.LastItemData.NavRect = tree_node_data->NavRect;
|
||||
NavApplyItemToResult(result); // Result this instead of implementing a NavApplyPastTreeNodeToResult()
|
||||
@@ -11791,7 +11791,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
|
||||
SetNavID(0, g.NavLayer, window->NavRootFocusScopeId, ImRect());
|
||||
g.NavInitRequest = true;
|
||||
g.NavInitRequestFromMove = false;
|
||||
g.NavInitResult.Id = 0;
|
||||
g.NavInitResult.ID = 0;
|
||||
NavUpdateAnyRequestFlag();
|
||||
}
|
||||
else
|
||||
@@ -11877,11 +11877,11 @@ static void ImGui::NavUpdate()
|
||||
|
||||
// Process navigation init request (select first/default focus)
|
||||
g.NavJustMovedToId = 0;
|
||||
if (g.NavInitResult.Id != 0)
|
||||
if (g.NavInitResult.ID != 0)
|
||||
NavInitRequestApplyResult();
|
||||
g.NavInitRequest = false;
|
||||
g.NavInitRequestFromMove = false;
|
||||
g.NavInitResult.Id = 0;
|
||||
g.NavInitResult.ID = 0;
|
||||
|
||||
// Process navigation move request
|
||||
if (g.NavMoveSubmitted)
|
||||
@@ -12027,17 +12027,17 @@ void ImGui::NavInitRequestApplyResult()
|
||||
return;
|
||||
|
||||
ImGuiNavItemData* result = &g.NavInitResult;
|
||||
if (g.NavId != result->Id)
|
||||
if (g.NavId != result->ID)
|
||||
{
|
||||
g.NavJustMovedToId = result->Id;
|
||||
g.NavJustMovedToId = result->ID;
|
||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||
g.NavJustMovedToKeyMods = 0;
|
||||
}
|
||||
|
||||
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
|
||||
// FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently.
|
||||
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", result->Id, g.NavLayer, g.NavWindow->Name);
|
||||
SetNavID(result->Id, g.NavLayer, result->FocusScopeId, result->RectRel);
|
||||
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
|
||||
SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
|
||||
g.NavIdIsAlive = true; // Mark as alive from previous frame as we got a result
|
||||
if (result->SelectionUserData != ImGuiSelectionUserData_Invalid)
|
||||
g.NavLastValidSelectionUserData = result->SelectionUserData;
|
||||
@@ -12138,7 +12138,7 @@ void ImGui::NavUpdateCreateMoveRequest()
|
||||
{
|
||||
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->Name : "<NULL>", g.NavLayer);
|
||||
g.NavInitRequest = g.NavInitRequestFromMove = true;
|
||||
g.NavInitResult.Id = 0;
|
||||
g.NavInitResult.ID = 0;
|
||||
g.NavDisableHighlight = false;
|
||||
}
|
||||
|
||||
@@ -12223,11 +12223,11 @@ void ImGui::NavMoveRequestApplyResult()
|
||||
#endif
|
||||
|
||||
// Select which result to use
|
||||
ImGuiNavItemData* result = (g.NavMoveResultLocal.Id != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.Id != 0) ? &g.NavMoveResultOther : NULL;
|
||||
ImGuiNavItemData* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.ID != 0) ? &g.NavMoveResultOther : NULL;
|
||||
|
||||
// Tabbing forward wrap
|
||||
if ((g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && result == NULL)
|
||||
if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.Id)
|
||||
if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID)
|
||||
result = &g.NavTabbingResultFirst;
|
||||
|
||||
// In a situation when there are no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
|
||||
@@ -12245,11 +12245,11 @@ void ImGui::NavMoveRequestApplyResult()
|
||||
|
||||
// PageUp/PageDown behavior first jumps to the bottom/top mostly visible item, _otherwise_ use the result from the previous/next page.
|
||||
if (g.NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet)
|
||||
if (g.NavMoveResultLocalVisible.Id != 0 && g.NavMoveResultLocalVisible.Id != g.NavId)
|
||||
if (g.NavMoveResultLocalVisible.ID != 0 && g.NavMoveResultLocalVisible.ID != g.NavId)
|
||||
result = &g.NavMoveResultLocalVisible;
|
||||
|
||||
// Maybe entering a flattened child from the outside? In this case solve the tie using the regular scoring rules.
|
||||
if (result != &g.NavMoveResultOther && g.NavMoveResultOther.Id != 0 && g.NavMoveResultOther.Window->ParentWindow == g.NavWindow)
|
||||
if (result != &g.NavMoveResultOther && g.NavMoveResultOther.ID != 0 && g.NavMoveResultOther.Window->ParentWindow == g.NavWindow)
|
||||
if ((g.NavMoveResultOther.DistBox < result->DistBox) || (g.NavMoveResultOther.DistBox == result->DistBox && g.NavMoveResultOther.DistCenter < result->DistCenter))
|
||||
result = &g.NavMoveResultOther;
|
||||
IM_ASSERT(g.NavWindow && result->Window);
|
||||
@@ -12276,22 +12276,22 @@ void ImGui::NavMoveRequestApplyResult()
|
||||
}
|
||||
|
||||
// FIXME: Could become optional e.g. ImGuiNavMoveFlags_NoClearActiveId if we later want to apply navigation requests without altering active input.
|
||||
if (g.ActiveId != result->Id)
|
||||
if (g.ActiveId != result->ID)
|
||||
ClearActiveID();
|
||||
|
||||
// Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
|
||||
// PageUp/PageDown however sets always set NavJustMovedTo (vs Home/End which doesn't) mimicking Windows behavior.
|
||||
if ((g.NavId != result->Id || (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)) && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSelect) == 0)
|
||||
if ((g.NavId != result->ID || (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)) && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSelect) == 0)
|
||||
{
|
||||
g.NavJustMovedToId = result->Id;
|
||||
g.NavJustMovedToId = result->ID;
|
||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
|
||||
}
|
||||
|
||||
// Apply new NavID/Focus
|
||||
IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->Id, g.NavLayer, g.NavWindow->Name);
|
||||
IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
|
||||
ImVec2 preferred_scoring_pos_rel = g.NavWindow->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer];
|
||||
SetNavID(result->Id, g.NavLayer, result->FocusScopeId, result->RectRel);
|
||||
SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
|
||||
if (result->SelectionUserData != ImGuiSelectionUserData_Invalid)
|
||||
g.NavLastValidSelectionUserData = result->SelectionUserData;
|
||||
|
||||
@@ -12310,7 +12310,7 @@ void ImGui::NavMoveRequestApplyResult()
|
||||
// Activate
|
||||
if (g.NavMoveFlags & ImGuiNavMoveFlags_Activate)
|
||||
{
|
||||
g.NavNextActivateId = result->Id;
|
||||
g.NavNextActivateId = result->ID;
|
||||
g.NavNextActivateFlags = ImGuiActivateFlags_None;
|
||||
if (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing)
|
||||
g.NavNextActivateFlags |= ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState | ImGuiActivateFlags_FromTabbing;
|
||||
@@ -12851,7 +12851,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
|
||||
ImGuiID source_parent_id = 0;
|
||||
if (!(flags & ImGuiDragDropFlags_SourceExtern))
|
||||
{
|
||||
source_id = g.LastItemData.Id;
|
||||
source_id = g.LastItemData.ID;
|
||||
if (source_id != 0)
|
||||
{
|
||||
// Common path: items with ID
|
||||
@@ -12884,7 +12884,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
|
||||
// THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING/RESIZINGG OF THE WIDGET, so if your widget moves your dragging operation will be canceled.
|
||||
// We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive.
|
||||
// Rely on keeping other window->LastItemXXX fields intact.
|
||||
source_id = g.LastItemData.Id = window->GetIDFromRectangle(g.LastItemData.Rect);
|
||||
source_id = g.LastItemData.ID = window->GetIDFromRectangle(g.LastItemData.Rect);
|
||||
KeepAliveID(source_id);
|
||||
bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id, g.LastItemData.InFlags);
|
||||
if (is_hovered && g.IO.MouseClicked[mouse_button])
|
||||
@@ -13051,7 +13051,7 @@ bool ImGui::BeginDragDropTarget()
|
||||
return false;
|
||||
|
||||
const ImRect& display_rect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? g.LastItemData.DisplayRect : g.LastItemData.Rect;
|
||||
ImGuiID id = g.LastItemData.Id;
|
||||
ImGuiID id = g.LastItemData.ID;
|
||||
if (id == 0)
|
||||
{
|
||||
id = window->GetIDFromRectangle(display_rect);
|
||||
@@ -13477,7 +13477,7 @@ ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
|
||||
const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
|
||||
ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
|
||||
IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
|
||||
settings->Id = ImHashStr(name, name_len);
|
||||
settings->ID = ImHashStr(name, name_len);
|
||||
memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
|
||||
|
||||
return settings;
|
||||
@@ -13489,7 +13489,7 @@ ImGuiWindowSettings* ImGui::FindWindowSettingsByID(ImGuiID id)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
|
||||
if (settings->Id == id && !settings->WantDelete)
|
||||
if (settings->ID == id && !settings->WantDelete)
|
||||
return settings;
|
||||
return NULL;
|
||||
}
|
||||
@@ -13500,7 +13500,7 @@ ImGuiWindowSettings* ImGui::FindWindowSettingsByWindow(ImGuiWindow* window)
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (window->SettingsOffset != -1)
|
||||
return g.SettingsWindows.ptr_from_offset(window->SettingsOffset);
|
||||
return FindWindowSettingsByID(window->Id);
|
||||
return FindWindowSettingsByID(window->ID);
|
||||
}
|
||||
|
||||
// This will revert window to its initial state, including enabling the ImGuiCond_FirstUseEver/ImGuiCond_Once conditions once more.
|
||||
@@ -13533,7 +13533,7 @@ static void* WindowSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*
|
||||
*settings = ImGuiWindowSettings(); // Clear existing if recycling previous entry
|
||||
else
|
||||
settings = ImGui::CreateNewWindowSettings(name);
|
||||
settings->Id = id;
|
||||
settings->ID = id;
|
||||
settings->WantApply = true;
|
||||
return (void*)settings;
|
||||
}
|
||||
@@ -13556,7 +13556,7 @@ static void WindowSettingsHandler_ApplyAll(ImGuiContext* ctx, ImGuiSettingsHandl
|
||||
for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
|
||||
if (settings->WantApply)
|
||||
{
|
||||
if (ImGuiWindow* window = ImGui::FindWindowByID(settings->Id))
|
||||
if (ImGuiWindow* window = ImGui::FindWindowByID(settings->ID))
|
||||
ApplyWindowSettings(window, settings);
|
||||
settings->WantApply = false;
|
||||
}
|
||||
@@ -13578,7 +13578,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
|
||||
settings = ImGui::CreateNewWindowSettings(window->Name);
|
||||
window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings);
|
||||
}
|
||||
IM_ASSERT(settings->Id == window->Id);
|
||||
IM_ASSERT(settings->ID == window->ID);
|
||||
settings->Pos = ImVec2ih(window->Pos);
|
||||
settings->Size = ImVec2ih(window->SizeFull);
|
||||
settings->IsChild = (window->Flags & ImGuiWindowFlags_ChildWindow) != 0;
|
||||
@@ -13893,7 +13893,7 @@ void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP*
|
||||
window->DrawList->AddText(g.Font, g.FontSize * 1.0f, title_r.Min, GetColorU32(ImGuiCol_Text, alpha_mul), thumb_window->Name, FindRenderedTextEnd(thumb_window->Name));
|
||||
}
|
||||
draw_list->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border, alpha_mul));
|
||||
if (viewport->Id == g.DebugMetricsConfig.HighlightViewportID)
|
||||
if (viewport->ID == g.DebugMetricsConfig.HighlightViewportID)
|
||||
window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255));
|
||||
}
|
||||
|
||||
@@ -14191,7 +14191,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
if (table == NULL || table->LastFrameActive < g.FrameCount - 1 || (table->OuterWindow != g.NavWindow && table->InnerWindow != g.NavWindow))
|
||||
continue;
|
||||
|
||||
BulletText("Table 0x%08X (%d columns, in '%s')", table->Id, table->ColumnsCount, table->OuterWindow->Name);
|
||||
BulletText("Table 0x%08X (%d columns, in '%s')", table->ID, table->ColumnsCount, table->OuterWindow->Name);
|
||||
if (IsItemHovered())
|
||||
GetForegroundDrawList()->AddRect(table->OuterRect.Min - ImVec2(1, 1), table->OuterRect.Max + ImVec2(1, 1), IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
|
||||
Indent();
|
||||
@@ -14561,7 +14561,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
{
|
||||
const ImGuiFocusScopeData& focus_scope = g.NavFocusRoute[path_n];
|
||||
SameLine(0.0f, 0.0f);
|
||||
Text("0x%08X/", focus_scope.Id);
|
||||
Text("0x%08X/", focus_scope.ID);
|
||||
SetItemTooltip("In window \"%s\"", FindWindowByID(focus_scope.WindowID)->Name);
|
||||
}
|
||||
Text("NavWindowingTarget: '%s'", g.NavWindowingTarget ? g.NavWindowingTarget->Name : "NULL");
|
||||
@@ -14692,7 +14692,7 @@ bool ImGui::DebugBreakButton(const char* label, const char* description_of_locat
|
||||
// [DEBUG] Display contents of Columns
|
||||
void ImGui::DebugNodeColumns(ImGuiOldColumns* columns)
|
||||
{
|
||||
if (!TreeNode((void*)(uintptr_t)columns->Id, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->Id, columns->Count, columns->Flags))
|
||||
if (!TreeNode((void*)(uintptr_t)columns->ID, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->ID, columns->Count, columns->Flags))
|
||||
return;
|
||||
BulletText("Width: %.1f (MinX: %.1f, MaxX: %.1f)", columns->OffMaxX - columns->OffMinX, columns->OffMinX, columns->OffMaxX);
|
||||
for (ImGuiOldColumnData& column : columns->Columns)
|
||||
@@ -14955,7 +14955,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
|
||||
char* p = buf;
|
||||
const char* buf_end = buf + IM_ARRAYSIZE(buf);
|
||||
const bool is_active = (tab_bar->PrevFrameVisible >= GetFrameCount() - 2);
|
||||
p += ImFormatString(p, buf_end - p, "%s 0x%08X (%d tabs)%s {", label, tab_bar->Id, tab_bar->Tabs.Size, is_active ? "" : " *Inactive*");
|
||||
p += ImFormatString(p, buf_end - p, "%s 0x%08X (%d tabs)%s {", label, tab_bar->ID, tab_bar->Tabs.Size, is_active ? "" : " *Inactive*");
|
||||
for (int tab_n = 0; tab_n < ImMin(tab_bar->Tabs.Size, 3); tab_n++)
|
||||
{
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
|
||||
@@ -14981,7 +14981,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
|
||||
if (SmallButton("<")) { TabBarQueueReorder(tab_bar, tab, -1); } SameLine(0, 2);
|
||||
if (SmallButton(">")) { TabBarQueueReorder(tab_bar, tab, +1); } SameLine();
|
||||
Text("%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f",
|
||||
tab_n, (tab->Id == tab_bar->SelectedTabId) ? '*' : ' ', tab->Id, TabBarGetTabName(tab_bar, tab), tab->Offset, tab->Width, tab->ContentWidth);
|
||||
tab_n, (tab->ID == tab_bar->SelectedTabId) ? '*' : ' ', tab->ID, TabBarGetTabName(tab_bar, tab), tab->Offset, tab->Width, tab->ContentWidth);
|
||||
PopID();
|
||||
}
|
||||
TreePop();
|
||||
@@ -14994,7 +14994,7 @@ void ImGui::DebugNodeViewport(ImGuiViewportP* viewport)
|
||||
SetNextItemOpen(true, ImGuiCond_Once);
|
||||
bool open = TreeNode("viewport0", "Viewport #%d", 0);
|
||||
if (IsItemHovered())
|
||||
g.DebugMetricsConfig.HighlightViewportID = viewport->Id;
|
||||
g.DebugMetricsConfig.HighlightViewportID = viewport->ID;
|
||||
if (open)
|
||||
{
|
||||
ImGuiWindowFlags flags = viewport->Flags;
|
||||
@@ -15034,7 +15034,7 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label)
|
||||
TextDisabled("Note: some memory buffers have been compacted/freed.");
|
||||
|
||||
if (g.IO.ConfigDebugIsDebuggerPresent && DebugBreakButton("**DebugBreak**", "in Begin()"))
|
||||
g.DebugBreakInWindow = window->Id;
|
||||
g.DebugBreakInWindow = window->ID;
|
||||
|
||||
ImGuiWindowFlags flags = window->Flags;
|
||||
DebugNodeDrawList(window, window->Viewport, window->DrawList, "DrawList");
|
||||
@@ -15078,7 +15078,7 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings* settings)
|
||||
if (settings->WantDelete)
|
||||
BeginDisabled();
|
||||
Text("0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d",
|
||||
settings->Id, settings->GetName(), settings->Pos.x, settings->Pos.y, settings->Size.x, settings->Size.y, settings->Collapsed);
|
||||
settings->ID, settings->GetName(), settings->Pos.x, settings->Pos.y, settings->Size.x, settings->Size.y, settings->Collapsed);
|
||||
if (settings->WantDelete)
|
||||
EndDisabled();
|
||||
}
|
||||
@@ -15390,7 +15390,7 @@ void ImGui::UpdateDebugToolStackQueries()
|
||||
g.DebugHookIdInfo = query_id;
|
||||
if (stack_level >= 0 && stack_level < tool->Results.Size)
|
||||
{
|
||||
g.DebugHookIdInfo = tool->Results[stack_level].Id;
|
||||
g.DebugHookIdInfo = tool->Results[stack_level].ID;
|
||||
tool->Results[stack_level].QueryFrameCount++;
|
||||
}
|
||||
}
|
||||
@@ -15409,7 +15409,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
|
||||
tool->StackLevel++;
|
||||
tool->Results.resize(window->IDStack.Size + 1, ImGuiStackLevelInfo());
|
||||
for (int n = 0; n < window->IDStack.Size + 1; n++)
|
||||
tool->Results[n].Id = (n < window->IDStack.Size) ? window->IDStack[n] : id;
|
||||
tool->Results[n].ID = (n < window->IDStack.Size) ? window->IDStack[n] : id;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15418,7 +15418,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
|
||||
if (tool->StackLevel != window->IDStack.Size)
|
||||
return;
|
||||
ImGuiStackLevelInfo* info = &tool->Results[tool->StackLevel];
|
||||
IM_ASSERT(info->Id == id && info->QueryFrameCount > 0);
|
||||
IM_ASSERT(info->ID == id && info->QueryFrameCount > 0);
|
||||
|
||||
switch (data_type)
|
||||
{
|
||||
@@ -15446,7 +15446,7 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
|
||||
static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size)
|
||||
{
|
||||
ImGuiStackLevelInfo* info = &tool->Results[n];
|
||||
ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->Id) : NULL;
|
||||
ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL;
|
||||
if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked)
|
||||
return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name);
|
||||
if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id)
|
||||
@@ -15523,12 +15523,12 @@ void ImGui::ShowIDStackToolWindow(bool* p_open)
|
||||
{
|
||||
ImGuiStackLevelInfo* info = &tool->Results[n];
|
||||
TableNextColumn();
|
||||
Text("0x%08X", (n > 0) ? tool->Results[n - 1].Id : 0);
|
||||
Text("0x%08X", (n > 0) ? tool->Results[n - 1].ID : 0);
|
||||
TableNextColumn();
|
||||
StackToolFormatLevelInfo(tool, n, true, g.TempBuffer.Data, g.TempBuffer.Size);
|
||||
TextUnformatted(g.TempBuffer.Data);
|
||||
TableNextColumn();
|
||||
Text("0x%08X", info->Id);
|
||||
Text("0x%08X", info->ID);
|
||||
if (n == tool->Results.Size - 1)
|
||||
TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_Header));
|
||||
}
|
||||
|
||||
@@ -3122,7 +3122,7 @@ enum ImGuiViewportFlags_
|
||||
// - Windows are generally trying to stay within the Work Area of their host viewport.
|
||||
struct ImGuiViewport
|
||||
{
|
||||
ImGuiID Id; // Unique identifier for the viewport
|
||||
ImGuiID ID; // Unique identifier for the viewport
|
||||
ImGuiViewportFlags Flags; // See ImGuiViewportFlags_
|
||||
ImVec2 Pos; // Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)
|
||||
ImVec2 Size; // Main Area: Size of the viewport.
|
||||
|
||||
@@ -2450,8 +2450,8 @@ static void ShowDemoWindowWidgets()
|
||||
static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
|
||||
for (int n = 0; n < IM_ARRAYSIZE(item_names); n++)
|
||||
{
|
||||
const char* Item = item_names[n];
|
||||
ImGui::Selectable(Item);
|
||||
const char* item = item_names[n];
|
||||
ImGui::Selectable(item);
|
||||
|
||||
if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
|
||||
{
|
||||
@@ -2459,7 +2459,7 @@ static void ShowDemoWindowWidgets()
|
||||
if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names))
|
||||
{
|
||||
item_names[n] = item_names[n_next];
|
||||
item_names[n_next] = Item;
|
||||
item_names[n_next] = item;
|
||||
ImGui::ResetMouseDragDelta();
|
||||
}
|
||||
}
|
||||
@@ -2989,8 +2989,8 @@ static void ShowDemoWindowLayout()
|
||||
static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f;
|
||||
ImGui::PushItemWidth(80);
|
||||
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
|
||||
static int Item = -1;
|
||||
ImGui::Combo("Combo", &Item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
|
||||
static int item = -1;
|
||||
ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
|
||||
ImGui::SliderFloat("X", &f0, 0.0f, 5.0f); ImGui::SameLine();
|
||||
ImGui::SliderFloat("Y", &f1, 0.0f, 5.0f); ImGui::SameLine();
|
||||
ImGui::SliderFloat("Z", &f2, 0.0f, 5.0f);
|
||||
@@ -3258,16 +3258,16 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_pos_px, i * 0.25f);
|
||||
if (child_is_visible) // Avoid calling SetScrollHereY when running with culled items
|
||||
{
|
||||
for (int Item = 0; Item < 100; Item++)
|
||||
for (int item = 0; item < 100; item++)
|
||||
{
|
||||
if (enable_track && Item == track_item)
|
||||
if (enable_track && item == track_item)
|
||||
{
|
||||
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", Item);
|
||||
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item);
|
||||
ImGui::SetScrollHereY(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text("Item %d", Item);
|
||||
ImGui::Text("Item %d", item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3300,18 +3300,18 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::SetScrollFromPosX(ImGui::GetCursorStartPos().x + scroll_to_pos_px, i * 0.25f);
|
||||
if (child_is_visible) // Avoid calling SetScrollHereY when running with culled items
|
||||
{
|
||||
for (int Item = 0; Item < 100; Item++)
|
||||
for (int item = 0; item < 100; item++)
|
||||
{
|
||||
if (Item > 0)
|
||||
if (item > 0)
|
||||
ImGui::SameLine();
|
||||
if (enable_track && Item == track_item)
|
||||
if (enable_track && item == track_item)
|
||||
{
|
||||
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", Item);
|
||||
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item);
|
||||
ImGui::SetScrollHereX(i * 0.25f); // 0.0f:left, 0.5f:center, 1.0f:right
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text("Item %d", Item);
|
||||
ImGui::Text("Item %d", item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3839,9 +3839,9 @@ static void ShowDemoWindowPopups()
|
||||
ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it.");
|
||||
|
||||
// Testing behavior of widgets stacking their own regular popups over the modal.
|
||||
static int Item = 1;
|
||||
static int item = 1;
|
||||
static float color[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
|
||||
ImGui::Combo("Combo", &Item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
|
||||
ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
|
||||
ImGui::ColorEdit4("color", color);
|
||||
|
||||
if (ImGui::Button("Add another modal.."))
|
||||
@@ -3903,7 +3903,7 @@ enum MyItemColumnID
|
||||
|
||||
struct MyItem
|
||||
{
|
||||
int Id;
|
||||
int ID;
|
||||
const char* Name;
|
||||
int Quantity;
|
||||
|
||||
@@ -3937,7 +3937,7 @@ struct MyItem
|
||||
int delta = 0;
|
||||
switch (sort_spec->ColumnUserID)
|
||||
{
|
||||
case MyItemColumnID_ID: delta = (a->Id - b->Id); break;
|
||||
case MyItemColumnID_ID: delta = (a->ID - b->ID); break;
|
||||
case MyItemColumnID_Name: delta = (strcmp(a->Name, b->Name)); break;
|
||||
case MyItemColumnID_Quantity: delta = (a->Quantity - b->Quantity); break;
|
||||
case MyItemColumnID_Description: delta = (strcmp(a->Name, b->Name)); break;
|
||||
@@ -3952,7 +3952,7 @@ struct MyItem
|
||||
// qsort() is instable so always return a way to differenciate items.
|
||||
// Your own compare function may want to avoid fallback on implicit sort specs.
|
||||
// e.g. a Name compare if it wasn't already part of the sort specs.
|
||||
return (a->Id - b->Id);
|
||||
return (a->ID - b->ID);
|
||||
}
|
||||
};
|
||||
const ImGuiTableSortSpecs* MyItem::s_current_sort_specs = NULL;
|
||||
@@ -4139,10 +4139,10 @@ static void ShowDemoWindowTables()
|
||||
"Columns API, and provided to facilitate the Columns->Tables API transition.");
|
||||
if (ImGui::BeginTable("table3", 3))
|
||||
{
|
||||
for (int Item = 0; Item < 14; Item++)
|
||||
for (int item = 0; item < 14; item++)
|
||||
{
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Item %d", Item);
|
||||
ImGui::Text("Item %d", item);
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
@@ -5526,10 +5526,10 @@ static void ShowDemoWindowTables()
|
||||
for (int n = 0; n < items.Size; n++)
|
||||
{
|
||||
const int template_n = n % IM_ARRAYSIZE(template_items_names);
|
||||
MyItem& Item = items[n];
|
||||
Item.Id = n;
|
||||
Item.Name = template_items_names[template_n];
|
||||
Item.Quantity = (n * n - n) % 20; // Assign default quantities
|
||||
MyItem& item = items[n];
|
||||
item.ID = n;
|
||||
item.Name = template_items_names[template_n];
|
||||
item.Quantity = (n * n - n) % 20; // Assign default quantities
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5576,17 +5576,17 @@ static void ShowDemoWindowTables()
|
||||
for (int row_n = clipper.DisplayStart; row_n < clipper.DisplayEnd; row_n++)
|
||||
{
|
||||
// Display a data item
|
||||
MyItem* Item = &items[row_n];
|
||||
ImGui::PushID(Item->Id);
|
||||
MyItem* item = &items[row_n];
|
||||
ImGui::PushID(item->ID);
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%04d", Item->Id);
|
||||
ImGui::Text("%04d", item->ID);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextUnformatted(Item->Name);
|
||||
ImGui::TextUnformatted(item->Name);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SmallButton("None");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%d", Item->Quantity);
|
||||
ImGui::Text("%d", item->Quantity);
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
@@ -5755,10 +5755,10 @@ static void ShowDemoWindowTables()
|
||||
for (int n = 0; n < items_count; n++)
|
||||
{
|
||||
const int template_n = n % IM_ARRAYSIZE(template_items_names);
|
||||
MyItem& Item = items[n];
|
||||
Item.Id = n;
|
||||
Item.Name = template_items_names[template_n];
|
||||
Item.Quantity = (template_n == 3) ? 10 : (template_n == 4) ? 20 : 0; // Assign default quantities
|
||||
MyItem& item = items[n];
|
||||
item.ID = n;
|
||||
item.Name = template_items_names[template_n];
|
||||
item.Quantity = (template_n == 3) ? 10 : (template_n == 4) ? 20 : 0; // Assign default quantities
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5819,18 +5819,18 @@ static void ShowDemoWindowTables()
|
||||
for (int row_n = 0; row_n < items.Size; row_n++)
|
||||
#endif
|
||||
{
|
||||
MyItem* Item = &items[row_n];
|
||||
MyItem* item = &items[row_n];
|
||||
//if (!filter.PassFilter(item->Name))
|
||||
// continue;
|
||||
|
||||
const bool item_is_selected = selection.contains(Item->Id);
|
||||
ImGui::PushID(Item->Id);
|
||||
const bool item_is_selected = selection.contains(item->ID);
|
||||
ImGui::PushID(item->ID);
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_None, row_min_height);
|
||||
|
||||
// For the demo purpose we can select among different type of items submitted in the first column
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
char label[32];
|
||||
sprintf(label, "%04d", Item->Id);
|
||||
sprintf(label, "%04d", item->ID);
|
||||
if (contents_type == CT_Text)
|
||||
ImGui::TextUnformatted(label);
|
||||
else if (contents_type == CT_Button)
|
||||
@@ -5847,20 +5847,20 @@ static void ShowDemoWindowTables()
|
||||
if (ImGui::GetIO().KeyCtrl)
|
||||
{
|
||||
if (item_is_selected)
|
||||
selection.find_erase_unsorted(Item->Id);
|
||||
selection.find_erase_unsorted(item->ID);
|
||||
else
|
||||
selection.push_back(Item->Id);
|
||||
selection.push_back(item->ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
selection.clear();
|
||||
selection.push_back(Item->Id);
|
||||
selection.push_back(item->ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::TableSetColumnIndex(1))
|
||||
ImGui::TextUnformatted(Item->Name);
|
||||
ImGui::TextUnformatted(item->Name);
|
||||
|
||||
// Here we demonstrate marking our data set as needing to be sorted again if we modified a quantity,
|
||||
// and we are currently sorting on the column showing the Quantity.
|
||||
@@ -5868,15 +5868,15 @@ static void ShowDemoWindowTables()
|
||||
// You will probably need some extra logic if you want to automatically sort when a specific entry changes.
|
||||
if (ImGui::TableSetColumnIndex(2))
|
||||
{
|
||||
if (ImGui::SmallButton("Chop")) { Item->Quantity += 1; }
|
||||
if (ImGui::SmallButton("Chop")) { item->Quantity += 1; }
|
||||
if (sorts_specs_using_quantity && ImGui::IsItemDeactivated()) { items_need_sort = true; }
|
||||
ImGui::SameLine();
|
||||
if (ImGui::SmallButton("Eat")) { Item->Quantity -= 1; }
|
||||
if (ImGui::SmallButton("Eat")) { item->Quantity -= 1; }
|
||||
if (sorts_specs_using_quantity && ImGui::IsItemDeactivated()) { items_need_sort = true; }
|
||||
}
|
||||
|
||||
if (ImGui::TableSetColumnIndex(3))
|
||||
ImGui::Text("%d", Item->Quantity);
|
||||
ImGui::Text("%d", item->Quantity);
|
||||
|
||||
ImGui::TableSetColumnIndex(4);
|
||||
if (show_wrapped_text)
|
||||
@@ -7122,20 +7122,20 @@ struct ExampleAppConsole
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 1)); // Tighten spacing
|
||||
if (copy_to_clipboard)
|
||||
ImGui::LogToClipboard();
|
||||
for (const char* Item : Items)
|
||||
for (const char* item : Items)
|
||||
{
|
||||
if (!Filter.PassFilter(Item))
|
||||
if (!Filter.PassFilter(item))
|
||||
continue;
|
||||
|
||||
// Normally you would store more information in your item than just a string.
|
||||
// (e.g. make Items[] an array of structure, store color/type etc.)
|
||||
ImVec4 color;
|
||||
bool has_color = false;
|
||||
if (strstr(Item, "[error]")) { color = ImVec4(1.0f, 0.4f, 0.4f, 1.0f); has_color = true; }
|
||||
else if (strncmp(Item, "# ", 2) == 0) { color = ImVec4(1.0f, 0.8f, 0.6f, 1.0f); has_color = true; }
|
||||
if (strstr(item, "[error]")) { color = ImVec4(1.0f, 0.4f, 0.4f, 1.0f); has_color = true; }
|
||||
else if (strncmp(item, "# ", 2) == 0) { color = ImVec4(1.0f, 0.8f, 0.6f, 1.0f); has_color = true; }
|
||||
if (has_color)
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, color);
|
||||
ImGui::TextUnformatted(Item);
|
||||
ImGui::TextUnformatted(item);
|
||||
if (has_color)
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
@@ -1054,18 +1054,18 @@ struct IMGUI_API ImGuiMenuColumns
|
||||
// Internal temporary state for deactivating InputText() instances.
|
||||
struct IMGUI_API ImGuiInputTextDeactivatedState
|
||||
{
|
||||
ImGuiID Id; // widget id owning the text state (which just got deactivated)
|
||||
ImGuiID ID; // widget id owning the text state (which just got deactivated)
|
||||
ImVector<char> TextA; // text buffer
|
||||
|
||||
ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); }
|
||||
void ClearFreeMemory() { Id = 0; TextA.clear(); }
|
||||
void ClearFreeMemory() { ID = 0; TextA.clear(); }
|
||||
};
|
||||
// Internal state of the currently focused/edited text input box
|
||||
// For a given item ID, access with ImGui::GetInputTextState()
|
||||
struct IMGUI_API ImGuiInputTextState
|
||||
{
|
||||
ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
|
||||
ImGuiID Id; // widget id owning the text state
|
||||
ImGuiID ID; // widget id owning the text state
|
||||
int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
|
||||
ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
|
||||
ImVector<char> TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
|
||||
@@ -1179,7 +1179,7 @@ struct ImGuiNextItemData
|
||||
// Status storage for the last submitted item
|
||||
struct ImGuiLastItemData
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiItemFlags InFlags; // See ImGuiItemFlags_
|
||||
ImGuiItemStatusFlags StatusFlags; // See ImGuiItemStatusFlags_
|
||||
ImRect Rect; // Full rectangle
|
||||
@@ -1196,7 +1196,7 @@ struct ImGuiLastItemData
|
||||
// Only stored when the node is a potential candidate for landing on a Left arrow jump.
|
||||
struct ImGuiNavTreeNodeData
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiItemFlags InFlags;
|
||||
ImRect NavRect;
|
||||
};
|
||||
@@ -1590,7 +1590,7 @@ enum ImGuiNavLayer
|
||||
struct ImGuiNavItemData
|
||||
{
|
||||
ImGuiWindow* Window; // Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window)
|
||||
ImGuiID Id; // Init,Move // Best candidate item ID
|
||||
ImGuiID ID; // Init,Move // Best candidate item ID
|
||||
ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID
|
||||
ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space
|
||||
ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags
|
||||
@@ -1600,12 +1600,12 @@ struct ImGuiNavItemData
|
||||
float DistAxial; // Move // Best candidate axial distance to current NavId
|
||||
|
||||
ImGuiNavItemData() { Clear(); }
|
||||
void Clear() { Window = NULL; Id = FocusScopeId = 0; InFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
||||
void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; SelectionUserData = -1; DistBox = DistCenter = DistAxial = FLT_MAX; }
|
||||
};
|
||||
|
||||
struct ImGuiFocusScopeData
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiID WindowID;
|
||||
};
|
||||
|
||||
@@ -1683,7 +1683,7 @@ struct ImGuiOldColumnData
|
||||
|
||||
struct ImGuiOldColumns
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiOldColumnFlags Flags;
|
||||
bool IsFirstFrame;
|
||||
bool IsBeingResized;
|
||||
@@ -1761,7 +1761,7 @@ struct ImGuiViewportP : public ImGuiViewport
|
||||
// (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)
|
||||
struct ImGuiWindowSettings
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImVec2ih Pos;
|
||||
ImVec2ih Size;
|
||||
bool Collapsed;
|
||||
@@ -1871,7 +1871,7 @@ struct ImGuiMetricsConfig
|
||||
|
||||
struct ImGuiStackLevelInfo
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImS8 QueryFrameCount; // >= 1: Query in progress
|
||||
bool QuerySuccess; // Obtained result from DebugHookIdInfo()
|
||||
ImGuiDataType DataType : 8;
|
||||
@@ -2496,7 +2496,7 @@ struct IMGUI_API ImGuiWindow
|
||||
{
|
||||
ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
|
||||
char* Name; // Window name, owned by the window.
|
||||
ImGuiID Id; // == ImHashStr(Name)
|
||||
ImGuiID ID; // == ImHashStr(Name)
|
||||
ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
|
||||
ImGuiChildFlags ChildFlags; // Set when window is a child window. See enum ImGuiChildFlags_
|
||||
ImGuiViewportP* Viewport; // Always set in Begin(). Inactive windows may have a NULL value here if their viewport was discarded.
|
||||
@@ -2638,7 +2638,7 @@ enum ImGuiTabItemFlagsPrivate_
|
||||
// Storage for one active tab item (sizeof() 40 bytes)
|
||||
struct ImGuiTabItem
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiTabItemFlags Flags;
|
||||
int LastFrameVisible;
|
||||
int LastFrameSelected; // This allows us to infer an ordered list of the last activated tabs with little maintenance
|
||||
@@ -2659,7 +2659,7 @@ struct IMGUI_API ImGuiTabBar
|
||||
{
|
||||
ImVector<ImGuiTabItem> Tabs;
|
||||
ImGuiTabBarFlags Flags;
|
||||
ImGuiID Id; // Zero for tab-bars used by docking
|
||||
ImGuiID ID; // Zero for tab-bars used by docking
|
||||
ImGuiID SelectedTabId; // Selected tab/window
|
||||
ImGuiID NextSelectedTabId; // Next selected tab/window. Will also trigger a scrolling animation
|
||||
ImGuiID VisibleTabId; // Can occasionally be != SelectedTabId (e.g. when previewing contents for CTRL+TAB preview)
|
||||
@@ -2792,7 +2792,7 @@ struct ImGuiTableInstanceData
|
||||
// sizeof() ~ 580 bytes + heap allocs described in TableBeginInitMemory()
|
||||
struct IMGUI_API ImGuiTable
|
||||
{
|
||||
ImGuiID Id;
|
||||
ImGuiID ID;
|
||||
ImGuiTableFlags Flags;
|
||||
void* RawData; // Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
|
||||
ImGuiTableTempData* TempData; // Transient data while table is active. Point within g.CurrentTableStack[]
|
||||
@@ -2961,7 +2961,7 @@ struct ImGuiTableColumnSettings
|
||||
// This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
|
||||
struct ImGuiTableSettings
|
||||
{
|
||||
ImGuiID Id; // Set to 0 to invalidate/delete the setting
|
||||
ImGuiID ID; // Set to 0 to invalidate/delete the setting
|
||||
ImGuiTableFlags SaveFlags; // Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
|
||||
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
|
||||
ImGuiTableColumnIdx ColumnsCount;
|
||||
@@ -3446,7 +3446,7 @@ namespace ImGui
|
||||
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags);
|
||||
IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL);
|
||||
inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); }
|
||||
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.Id == id) ? &g.InputTextState : NULL; } // Get input text state if active
|
||||
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
|
||||
|
||||
// Color
|
||||
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
|
||||
|
||||
@@ -353,7 +353,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
// Initialize
|
||||
const int previous_frame_active = table->LastFrameActive;
|
||||
const int instance_no = (previous_frame_active != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
||||
table->Id = id;
|
||||
table->ID = id;
|
||||
table->Flags = flags;
|
||||
table->LastFrameActive = g.FrameCount;
|
||||
table->OuterWindow = table->InnerWindow = outer_window;
|
||||
@@ -2095,7 +2095,7 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
||||
window->SkipItems = column->IsSkipItems;
|
||||
if (column->IsSkipItems)
|
||||
{
|
||||
g.LastItemData.Id = 0;
|
||||
g.LastItemData.ID = 0;
|
||||
g.LastItemData.StatusFlags = 0;
|
||||
}
|
||||
|
||||
@@ -3311,7 +3311,7 @@ void ImGui::TableOpenContextMenu(int column_n)
|
||||
table->IsContextPopupOpen = true;
|
||||
table->ContextPopupColumn = (ImGuiTableColumnIdx)column_n;
|
||||
table->InstanceInteracted = table->InstanceCurrent;
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->Id);
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
||||
OpenPopupEx(context_menu_id, ImGuiPopupFlags_None);
|
||||
}
|
||||
}
|
||||
@@ -3320,7 +3320,7 @@ bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
|
||||
{
|
||||
if (!table->IsContextPopupOpen || table->InstanceCurrent != table->InstanceInteracted)
|
||||
return false;
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->Id);
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
||||
if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
|
||||
return true;
|
||||
table->IsContextPopupOpen = false;
|
||||
@@ -3457,7 +3457,7 @@ static void TableSettingsInit(ImGuiTableSettings* settings, ImGuiID id, int colu
|
||||
ImGuiTableColumnSettings* settings_column = settings->GetColumnSettings();
|
||||
for (int n = 0; n < columns_count_max; n++, settings_column++)
|
||||
IM_PLACEMENT_NEW(settings_column) ImGuiTableColumnSettings();
|
||||
settings->Id = id;
|
||||
settings->ID = id;
|
||||
settings->ColumnsCount = (ImGuiTableColumnIdx)columns_count;
|
||||
settings->ColumnsCountMax = (ImGuiTableColumnIdx)columns_count_max;
|
||||
settings->WantApply = true;
|
||||
@@ -3482,7 +3482,7 @@ ImGuiTableSettings* ImGui::TableSettingsFindByID(ImGuiID id)
|
||||
// FIXME-OPT: Might want to store a lookup map for this?
|
||||
ImGuiContext& g = *GImGui;
|
||||
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
|
||||
if (settings->Id == id)
|
||||
if (settings->ID == id)
|
||||
return settings;
|
||||
return NULL;
|
||||
}
|
||||
@@ -3494,10 +3494,10 @@ ImGuiTableSettings* ImGui::TableGetBoundSettings(ImGuiTable* table)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTableSettings* settings = g.SettingsTables.ptr_from_offset(table->SettingsOffset);
|
||||
IM_ASSERT(settings->Id == table->Id);
|
||||
IM_ASSERT(settings->ID == table->ID);
|
||||
if (settings->ColumnsCountMax >= table->ColumnsCount)
|
||||
return settings; // OK
|
||||
settings->Id = 0; // Invalidate storage, we won't fit because of a count change
|
||||
settings->ID = 0; // Invalidate storage, we won't fit because of a count change
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -3522,13 +3522,13 @@ void ImGui::TableSaveSettings(ImGuiTable* table)
|
||||
ImGuiTableSettings* settings = TableGetBoundSettings(table);
|
||||
if (settings == NULL)
|
||||
{
|
||||
settings = TableSettingsCreate(table->Id, table->ColumnsCount);
|
||||
settings = TableSettingsCreate(table->ID, table->ColumnsCount);
|
||||
table->SettingsOffset = g.SettingsTables.offset_from_ptr(settings);
|
||||
}
|
||||
settings->ColumnsCount = (ImGuiTableColumnIdx)table->ColumnsCount;
|
||||
|
||||
// Serialize ImGuiTable/ImGuiTableColumn into ImGuiTableSettings/ImGuiTableColumnSettings
|
||||
IM_ASSERT(settings->Id == table->Id);
|
||||
IM_ASSERT(settings->ID == table->ID);
|
||||
IM_ASSERT(settings->ColumnsCount == table->ColumnsCount && settings->ColumnsCountMax >= settings->ColumnsCount);
|
||||
ImGuiTableColumn* column = table->Columns.Data;
|
||||
ImGuiTableColumnSettings* column_settings = settings->GetColumnSettings();
|
||||
@@ -3577,7 +3577,7 @@ void ImGui::TableLoadSettings(ImGuiTable* table)
|
||||
ImGuiTableSettings* settings;
|
||||
if (table->SettingsOffset == -1)
|
||||
{
|
||||
settings = TableSettingsFindByID(table->Id);
|
||||
settings = TableSettingsFindByID(table->ID);
|
||||
if (settings == NULL)
|
||||
return;
|
||||
if (settings->ColumnsCount != table->ColumnsCount) // Allow settings if columns count changed. We could otherwise decide to return...
|
||||
@@ -3666,7 +3666,7 @@ static void* TableSettingsHandler_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*,
|
||||
TableSettingsInit(settings, id, columns_count, settings->ColumnsCountMax); // Recycle
|
||||
return settings;
|
||||
}
|
||||
settings->Id = 0; // Invalidate storage, we won't fit because of a count change
|
||||
settings->ID = 0; // Invalidate storage, we won't fit because of a count change
|
||||
}
|
||||
return ImGui::TableSettingsCreate(id, columns_count);
|
||||
}
|
||||
@@ -3702,7 +3702,7 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
|
||||
ImGuiContext& g = *ctx;
|
||||
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
|
||||
{
|
||||
if (settings->Id == 0) // Skip ditched settings
|
||||
if (settings->ID == 0) // Skip ditched settings
|
||||
continue;
|
||||
|
||||
// TableSaveSettings() may clear some of those flags when we establish that the data can be stripped
|
||||
@@ -3715,7 +3715,7 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
|
||||
continue;
|
||||
|
||||
buf->reserve(buf->size() + 30 + settings->ColumnsCount * 50); // ballpark reserve
|
||||
buf->appendf("[%s][0x%08X,%d]\n", handler->TypeName, settings->Id, settings->ColumnsCount);
|
||||
buf->appendf("[%s][0x%08X,%d]\n", handler->TypeName, settings->ID, settings->ColumnsCount);
|
||||
if (settings->RefScale != 0.0f)
|
||||
buf->appendf("RefScale=%g\n", settings->RefScale);
|
||||
ImGuiTableColumnSettings* column = settings->GetColumnSettings();
|
||||
@@ -3767,7 +3767,7 @@ void ImGui::TableRemove(ImGuiTable* table)
|
||||
int table_idx = g.Tables.GetIndex(table);
|
||||
//memset(table->RawData.Data, 0, table->RawData.size_in_bytes());
|
||||
//memset(table, 0, sizeof(ImGuiTable));
|
||||
g.Tables.Remove(table->Id, table);
|
||||
g.Tables.Remove(table->ID, table);
|
||||
g.TablesLastTimeActive[table_idx] = -1.0f;
|
||||
}
|
||||
|
||||
@@ -3799,14 +3799,14 @@ void ImGui::TableGcCompactSettings()
|
||||
ImGuiContext& g = *GImGui;
|
||||
int required_memory = 0;
|
||||
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
|
||||
if (settings->Id != 0)
|
||||
if (settings->ID != 0)
|
||||
required_memory += (int)TableSettingsCalcChunkSize(settings->ColumnsCount);
|
||||
if (required_memory == g.SettingsTables.Buf.Size)
|
||||
return;
|
||||
ImChunkStream<ImGuiTableSettings> new_chunk_stream;
|
||||
new_chunk_stream.Buf.reserve(required_memory);
|
||||
for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
|
||||
if (settings->Id != 0)
|
||||
if (settings->ID != 0)
|
||||
memcpy(new_chunk_stream.alloc_chunk(TableSettingsCalcChunkSize(settings->ColumnsCount)), settings, TableSettingsCalcChunkSize(settings->ColumnsCount));
|
||||
g.SettingsTables.swap(new_chunk_stream);
|
||||
}
|
||||
@@ -3835,7 +3835,7 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
||||
ImGuiContext& g = *GImGui;
|
||||
const bool is_active = (table->LastFrameActive >= g.FrameCount - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
|
||||
if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
|
||||
bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->Id, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
|
||||
bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
|
||||
if (!is_active) { PopStyleColor(); }
|
||||
if (IsItemHovered())
|
||||
GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
|
||||
@@ -3848,7 +3848,7 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
||||
if (g.IO.ConfigDebugIsDebuggerPresent)
|
||||
{
|
||||
if (DebugBreakButton("**DebugBreak**", "in BeginTable()"))
|
||||
g.DebugBreakInTable = table->Id;
|
||||
g.DebugBreakInTable = table->ID;
|
||||
SameLine();
|
||||
}
|
||||
|
||||
@@ -3906,7 +3906,7 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
||||
|
||||
void ImGui::DebugNodeTableSettings(ImGuiTableSettings* settings)
|
||||
{
|
||||
if (!TreeNode((void*)(intptr_t)settings->Id, "Settings 0x%08X (%d columns)", settings->Id, settings->ColumnsCount))
|
||||
if (!TreeNode((void*)(intptr_t)settings->ID, "Settings 0x%08X (%d columns)", settings->ID, settings->ColumnsCount))
|
||||
return;
|
||||
BulletText("SaveFlags: 0x%08X", settings->SaveFlags);
|
||||
BulletText("ColumnsCount: %d (max %d)", settings->ColumnsCount, settings->ColumnsCountMax);
|
||||
@@ -3997,7 +3997,7 @@ static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index)
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
IM_ASSERT(column_index > 0); // We are not supposed to drag column 0.
|
||||
IM_ASSERT(g.ActiveId == columns->Id + ImGuiID(column_index));
|
||||
IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index));
|
||||
|
||||
float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x;
|
||||
x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing);
|
||||
@@ -4123,12 +4123,12 @@ ImGuiOldColumns* ImGui::FindOrCreateColumns(ImGuiWindow* window, ImGuiID id)
|
||||
{
|
||||
// We have few columns per window so for now we don't need bother much with turning this into a faster lookup.
|
||||
for (int n = 0; n < window->ColumnsStorage.Size; n++)
|
||||
if (window->ColumnsStorage[n].Id == id)
|
||||
if (window->ColumnsStorage[n].ID == id)
|
||||
return &window->ColumnsStorage[n];
|
||||
|
||||
window->ColumnsStorage.push_back(ImGuiOldColumns());
|
||||
ImGuiOldColumns* columns = &window->ColumnsStorage.back();
|
||||
columns->Id = id;
|
||||
columns->ID = id;
|
||||
return columns;
|
||||
}
|
||||
|
||||
@@ -4156,7 +4156,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
|
||||
// Acquire storage for the columns set
|
||||
ImGuiID id = GetColumnsID(str_id, columns_count);
|
||||
ImGuiOldColumns* columns = FindOrCreateColumns(window, id);
|
||||
IM_ASSERT(columns->Id == id);
|
||||
IM_ASSERT(columns->ID == id);
|
||||
columns->Current = 0;
|
||||
columns->Count = columns_count;
|
||||
columns->Flags = flags;
|
||||
@@ -4313,7 +4313,7 @@ void ImGui::EndColumns()
|
||||
{
|
||||
ImGuiOldColumnData* column = &columns->Columns[n];
|
||||
float x = window->Pos.x + GetColumnOffset(n);
|
||||
const ImGuiID column_id = columns->Id + ImGuiID(n);
|
||||
const ImGuiID column_id = columns->ID + ImGuiID(n);
|
||||
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
|
||||
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
|
||||
if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
|
||||
|
||||
@@ -495,7 +495,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
||||
|
||||
// Default behavior inherited from item flags
|
||||
// Note that _both_ ButtonFlags and ItemFlags are valid sources, so copy one into the item_flags and only check that.
|
||||
ImGuiItemFlags item_flags = (g.LastItemData.Id == id ? g.LastItemData.InFlags : g.CurrentItemFlags);
|
||||
ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags);
|
||||
if (flags & ImGuiButtonFlags_AllowOverlap)
|
||||
item_flags |= ImGuiItemFlags_AllowOverlap;
|
||||
if (flags & ImGuiButtonFlags_Repeat)
|
||||
@@ -1939,7 +1939,7 @@ bool ImGui::Combo(const char* label, int* current_item, const char* (*getter)(vo
|
||||
EndCombo();
|
||||
|
||||
if (value_changed)
|
||||
MarkItemEdited(g.LastItemData.Id);
|
||||
MarkItemEdited(g.LastItemData.ID);
|
||||
|
||||
return value_changed;
|
||||
}
|
||||
@@ -3487,7 +3487,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
|
||||
SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2));
|
||||
if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
|
||||
value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.Id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable);
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Inputable);
|
||||
|
||||
// Step buttons
|
||||
const ImVec2 backup_frame_padding = style.FramePadding;
|
||||
@@ -3522,7 +3522,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
|
||||
EndGroup();
|
||||
}
|
||||
if (value_changed)
|
||||
MarkItemEdited(g.LastItemData.Id);
|
||||
MarkItemEdited(g.LastItemData.ID);
|
||||
|
||||
return value_changed;
|
||||
}
|
||||
@@ -3895,7 +3895,7 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons
|
||||
// Contrary to STB_TEXTEDIT_INSERTCHARS() this is working in the UTF8 buffer, hence the mildly similar code (until we remove the U16 buffer altogether!)
|
||||
ImGuiContext& g = *Ctx;
|
||||
ImGuiInputTextState* edit_state = &g.InputTextState;
|
||||
IM_ASSERT(edit_state->Id != 0 && g.ActiveId == edit_state->Id);
|
||||
IM_ASSERT(edit_state->ID != 0 && g.ActiveId == edit_state->ID);
|
||||
IM_ASSERT(Buf == edit_state->TextA.Data);
|
||||
int new_buf_size = BufTextLen + ImClamp(new_text_len * 4, 32, ImMax(256, new_text_len)) + 1;
|
||||
edit_state->TextA.reserve(new_buf_size + 1);
|
||||
@@ -4060,9 +4060,9 @@ void ImGui::InputTextDeactivateHook(ImGuiID id)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiInputTextState* state = &g.InputTextState;
|
||||
if (id == 0 || state->Id != id)
|
||||
if (id == 0 || state->ID != id)
|
||||
return;
|
||||
g.InputTextDeactivatedState.Id = state->Id;
|
||||
g.InputTextDeactivatedState.ID = state->ID;
|
||||
if (state->Flags & ImGuiInputTextFlags_ReadOnly)
|
||||
{
|
||||
g.InputTextDeactivatedState.TextA.resize(0); // In theory this data won't be used, but clear to be neat.
|
||||
@@ -4200,7 +4200,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
state->ReloadUserBuf = false;
|
||||
|
||||
// Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714)
|
||||
InputTextDeactivateHook(state->Id);
|
||||
InputTextDeactivateHook(state->ID);
|
||||
|
||||
// From the moment we focused we are normally ignoring the content of 'buf' (unless we are in read-only mode)
|
||||
const int buf_len = (int)strlen(buf);
|
||||
@@ -4213,13 +4213,13 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
|
||||
// Preserve cursor position and undo/redo stack if we come back to same widget
|
||||
// FIXME: Since we reworked this on 2022/06, may want to differentiate recycle_cursor vs recycle_undostate?
|
||||
bool recycle_state = (state->Id == id && !init_changed_specs && !init_reload_from_user_buf);
|
||||
bool recycle_state = (state->ID == id && !init_changed_specs && !init_reload_from_user_buf);
|
||||
if (recycle_state && (state->CurLenA != buf_len || (state->TextAIsValid && strncmp(state->TextA.Data, buf, buf_len) != 0)))
|
||||
recycle_state = false;
|
||||
|
||||
// Start edition
|
||||
const char* buf_end = NULL;
|
||||
state->Id = id;
|
||||
state->ID = id;
|
||||
state->TextW.resize(buf_size + 1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data is always pointing to at least an empty string.
|
||||
state->TextA.resize(0);
|
||||
state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then)
|
||||
@@ -4261,7 +4261,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
const bool is_osx = io.ConfigMacOSXBehaviors;
|
||||
if (g.ActiveId != id && init_make_active)
|
||||
{
|
||||
IM_ASSERT(state && state->Id == id);
|
||||
IM_ASSERT(state && state->ID == id);
|
||||
SetActiveID(id, window);
|
||||
SetFocusID(id, window);
|
||||
FocusWindow(window);
|
||||
@@ -4756,7 +4756,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
}
|
||||
|
||||
// Handle reapplying final data on deactivation (see InputTextDeactivateHook() for details)
|
||||
if (g.InputTextDeactivatedState.Id == id)
|
||||
if (g.InputTextDeactivatedState.ID == id)
|
||||
{
|
||||
if (g.ActiveId != id && IsItemDeactivatedAfterEdit() && !is_readonly && strcmp(g.InputTextDeactivatedState.TextA.Data, buf) != 0)
|
||||
{
|
||||
@@ -4765,7 +4765,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
value_changed = true;
|
||||
//IMGUI_DEBUG_LOG("InputText(): apply Deactivated data for 0x%08X: \"%.*s\".\n", id, apply_new_text_length, apply_new_text);
|
||||
}
|
||||
g.InputTextDeactivatedState.Id = 0;
|
||||
g.InputTextDeactivatedState.ID = 0;
|
||||
}
|
||||
|
||||
// Copy result to user buffer. This can currently only happen when (g.ActiveId == id)
|
||||
@@ -5024,9 +5024,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
// ...and then we need to undo the group overriding last item data, which gets a bit messy as EndGroup() tries to forward scrollbar being active...
|
||||
// FIXME: This quite messy/tricky, should attempt to get rid of the child window.
|
||||
EndGroup();
|
||||
if (g.LastItemData.Id == 0)
|
||||
if (g.LastItemData.ID == 0)
|
||||
{
|
||||
g.LastItemData.Id = id;
|
||||
g.LastItemData.ID = id;
|
||||
g.LastItemData.InFlags = item_data_backup.InFlags;
|
||||
g.LastItemData.StatusFlags = item_data_backup.StatusFlags;
|
||||
}
|
||||
@@ -5058,8 +5058,8 @@ void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state)
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImStb::STB_TexteditState* stb_state = &state->Stb;
|
||||
ImStb::StbUndoState* undo_state = &stb_state->undostate;
|
||||
Text("ID: 0x%08X, ActiveID: 0x%08X", state->Id, g.ActiveId);
|
||||
DebugLocateItemOnHover(state->Id);
|
||||
Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId);
|
||||
DebugLocateItemOnHover(state->ID);
|
||||
Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenW, state->CurLenA, stb_state->cursor, stb_state->select_start, stb_state->select_end);
|
||||
Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x);
|
||||
Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point);
|
||||
@@ -5379,10 +5379,10 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
||||
|
||||
// When picker is being actively used, use its active id so IsItemActive() will function on ColorEdit4().
|
||||
if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window)
|
||||
g.LastItemData.Id = g.ActiveId;
|
||||
g.LastItemData.ID = g.ActiveId;
|
||||
|
||||
if (value_changed && g.LastItemData.Id != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
||||
MarkItemEdited(g.LastItemData.Id);
|
||||
if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
||||
MarkItemEdited(g.LastItemData.ID);
|
||||
|
||||
return value_changed;
|
||||
}
|
||||
@@ -5769,8 +5769,8 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
|
||||
|
||||
if (value_changed && memcmp(backup_initial_col, col, components * sizeof(float)) == 0)
|
||||
value_changed = false;
|
||||
if (value_changed && g.LastItemData.Id != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
||||
MarkItemEdited(g.LastItemData.Id);
|
||||
if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
||||
MarkItemEdited(g.LastItemData.ID);
|
||||
|
||||
if (set_current_color_edit_id)
|
||||
g.ColorEditCurrentID = 0;
|
||||
@@ -6237,7 +6237,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
{
|
||||
g.NavTreeNodeStack.resize(g.NavTreeNodeStack.Size + 1);
|
||||
ImGuiNavTreeNodeData* nav_tree_node_data = &g.NavTreeNodeStack.back();
|
||||
nav_tree_node_data->Id = id;
|
||||
nav_tree_node_data->ID = id;
|
||||
nav_tree_node_data->InFlags = g.LastItemData.InFlags;
|
||||
nav_tree_node_data->NavRect = g.LastItemData.NavRect;
|
||||
window->DC.TreeJumpToParentOnPopMask |= (1 << window->DC.TreeDepth);
|
||||
@@ -6248,7 +6248,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
{
|
||||
if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
|
||||
TreePushOverrideID(id);
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.Id, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
|
||||
return is_open;
|
||||
}
|
||||
|
||||
@@ -6430,7 +6430,7 @@ void ImGui::TreePop()
|
||||
if (window->DC.TreeJumpToParentOnPopMask & tree_depth_mask) // Only set during request
|
||||
{
|
||||
ImGuiNavTreeNodeData* nav_tree_node_data = &g.NavTreeNodeStack.back();
|
||||
IM_ASSERT(nav_tree_node_data->Id == window->IDStack.back());
|
||||
IM_ASSERT(nav_tree_node_data->ID == window->IDStack.back());
|
||||
if (g.NavIdIsAlive && g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
|
||||
NavMoveRequestResolveWithPastTreeNode(&g.NavMoveResultLocal, nav_tree_node_data);
|
||||
g.NavTreeNodeStack.pop_back();
|
||||
@@ -6992,7 +6992,7 @@ bool ImGui::ListBox(const char* label, int* current_item, const char* (*getter)(
|
||||
EndListBox();
|
||||
|
||||
if (value_changed)
|
||||
MarkItemEdited(g.LastItemData.Id);
|
||||
MarkItemEdited(g.LastItemData.ID);
|
||||
|
||||
return value_changed;
|
||||
}
|
||||
@@ -7731,7 +7731,7 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
|
||||
RenderCheckMark(window->DrawList, pos + ImVec2(offsets->OffsetMark + stretch_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(ImGuiCol_Text), g.FontSize * 0.866f);
|
||||
}
|
||||
}
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.Id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0));
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0));
|
||||
if (!enabled)
|
||||
EndDisabled();
|
||||
PopID();
|
||||
@@ -7856,7 +7856,7 @@ bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags)
|
||||
ImGuiID id = window->GetID(str_id);
|
||||
ImGuiTabBar* tab_bar = g.TabBars.GetOrAddByKey(id);
|
||||
ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->WorkRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2);
|
||||
tab_bar->Id = id;
|
||||
tab_bar->ID = id;
|
||||
tab_bar->SeparatorMinX = tab_bar->BarRect.Min.x - IM_TRUNC(window->WindowPadding.x * 0.5f);
|
||||
tab_bar->SeparatorMaxX = tab_bar->BarRect.Max.x + IM_TRUNC(window->WindowPadding.x * 0.5f);
|
||||
return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused);
|
||||
@@ -7869,9 +7869,9 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
|
||||
if (window->SkipItems)
|
||||
return false;
|
||||
|
||||
IM_ASSERT(tab_bar->Id != 0);
|
||||
IM_ASSERT(tab_bar->ID != 0);
|
||||
if ((flags & ImGuiTabBarFlags_DockNode) == 0)
|
||||
PushOverrideID(tab_bar->Id);
|
||||
PushOverrideID(tab_bar->ID);
|
||||
|
||||
// Add to stack
|
||||
g.CurrentTabBarStack.push_back(GetTabBarRefFromTabBar(tab_bar));
|
||||
@@ -7986,9 +7986,9 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
if (tab->LastFrameVisible < tab_bar->PrevFrameVisible || tab->WantClose)
|
||||
{
|
||||
// Remove tab
|
||||
if (tab_bar->VisibleTabId == tab->Id) { tab_bar->VisibleTabId = 0; }
|
||||
if (tab_bar->SelectedTabId == tab->Id) { tab_bar->SelectedTabId = 0; }
|
||||
if (tab_bar->NextSelectedTabId == tab->Id) { tab_bar->NextSelectedTabId = 0; }
|
||||
if (tab_bar->VisibleTabId == tab->ID) { tab_bar->VisibleTabId = 0; }
|
||||
if (tab_bar->SelectedTabId == tab->ID) { tab_bar->SelectedTabId = 0; }
|
||||
if (tab_bar->NextSelectedTabId == tab->ID) { tab_bar->NextSelectedTabId = 0; }
|
||||
continue;
|
||||
}
|
||||
if (tab_dst_n != tab_src_n)
|
||||
@@ -8044,7 +8044,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
const bool tab_list_popup_button = (tab_bar->Flags & ImGuiTabBarFlags_TabListPopupButton) != 0;
|
||||
if (tab_list_popup_button)
|
||||
if (ImGuiTabItem* tab_to_select = TabBarTabListPopupButton(tab_bar)) // NB: Will alter BarRect.Min.x!
|
||||
scroll_to_tab_id = tab_bar->SelectedTabId = tab_to_select->Id;
|
||||
scroll_to_tab_id = tab_bar->SelectedTabId = tab_to_select->ID;
|
||||
|
||||
// Leading/Trailing tabs will be shrink only if central one aren't visible anymore, so layout the shrink data as: leading, trailing, central
|
||||
// (whereas our tabs are stored as: leading, central, trailing)
|
||||
@@ -8062,10 +8062,10 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
|
||||
if ((most_recently_selected_tab == NULL || most_recently_selected_tab->LastFrameSelected < tab->LastFrameSelected) && !(tab->Flags & ImGuiTabItemFlags_Button))
|
||||
most_recently_selected_tab = tab;
|
||||
if (tab->Id == tab_bar->SelectedTabId)
|
||||
if (tab->ID == tab_bar->SelectedTabId)
|
||||
found_selected_tab_id = true;
|
||||
if (scroll_to_tab_id == 0 && g.NavJustMovedToId == tab->Id)
|
||||
scroll_to_tab_id = tab->Id;
|
||||
if (scroll_to_tab_id == 0 && g.NavJustMovedToId == tab->ID)
|
||||
scroll_to_tab_id = tab->ID;
|
||||
|
||||
// Refresh tab width immediately, otherwise changes of style e.g. style.FramePadding.x would noticeably lag in the tab bar.
|
||||
// Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet,
|
||||
@@ -8097,7 +8097,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
if ((tab_bar->WidthAllTabsIdeal > tab_bar->BarRect.GetWidth() && tab_bar->Tabs.Size > 1) && !(tab_bar->Flags & ImGuiTabBarFlags_NoTabListScrollingButtons) && (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll))
|
||||
if (ImGuiTabItem* scroll_and_select_tab = TabBarScrollingButtons(tab_bar))
|
||||
{
|
||||
scroll_to_tab_id = scroll_and_select_tab->Id;
|
||||
scroll_to_tab_id = scroll_and_select_tab->ID;
|
||||
if ((scroll_and_select_tab->Flags & ImGuiTabItemFlags_Button) == 0)
|
||||
tab_bar->SelectedTabId = scroll_to_tab_id;
|
||||
}
|
||||
@@ -8164,7 +8164,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
if (found_selected_tab_id == false)
|
||||
tab_bar->SelectedTabId = 0;
|
||||
if (tab_bar->SelectedTabId == 0 && tab_bar->NextSelectedTabId == 0 && most_recently_selected_tab != NULL)
|
||||
scroll_to_tab_id = tab_bar->SelectedTabId = most_recently_selected_tab->Id;
|
||||
scroll_to_tab_id = tab_bar->SelectedTabId = most_recently_selected_tab->ID;
|
||||
|
||||
// Lock in visible tab
|
||||
tab_bar->VisibleTabId = tab_bar->SelectedTabId;
|
||||
@@ -8177,13 +8177,13 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||
{
|
||||
const float wheel = g.IO.MouseWheelRequestAxisSwap ? g.IO.MouseWheel : g.IO.MouseWheelH;
|
||||
const ImGuiKey wheel_key = g.IO.MouseWheelRequestAxisSwap ? ImGuiKey_MouseWheelY : ImGuiKey_MouseWheelX;
|
||||
if (TestKeyOwner(wheel_key, tab_bar->Id) && wheel != 0.0f)
|
||||
if (TestKeyOwner(wheel_key, tab_bar->ID) && wheel != 0.0f)
|
||||
{
|
||||
const float scroll_step = wheel * TabBarCalcScrollableWidth(tab_bar, sections) / 3.0f;
|
||||
tab_bar->ScrollingTargetDistToVisibility = 0.0f;
|
||||
tab_bar->ScrollingTarget = TabBarScrollClamp(tab_bar, tab_bar->ScrollingTarget - scroll_step);
|
||||
}
|
||||
SetKeyOwner(wheel_key, tab_bar->Id);
|
||||
SetKeyOwner(wheel_key, tab_bar->ID);
|
||||
}
|
||||
|
||||
// Update scrolling
|
||||
@@ -8240,7 +8240,7 @@ ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id)
|
||||
{
|
||||
if (tab_id != 0)
|
||||
for (int n = 0; n < tab_bar->Tabs.Size; n++)
|
||||
if (tab_bar->Tabs[n].Id == tab_id)
|
||||
if (tab_bar->Tabs[n].ID == tab_id)
|
||||
return &tab_bar->Tabs[n];
|
||||
return NULL;
|
||||
}
|
||||
@@ -8289,7 +8289,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
|
||||
// This will remove a frame of lag for selecting another tab on closure.
|
||||
// However we don't run it in the case where the 'Unsaved' flag is set, so user gets a chance to fully undo the closure
|
||||
tab->WantClose = true;
|
||||
if (tab_bar->VisibleTabId == tab->Id)
|
||||
if (tab_bar->VisibleTabId == tab->ID)
|
||||
{
|
||||
tab->LastFrameVisible = -1;
|
||||
tab_bar->SelectedTabId = tab_bar->NextSelectedTabId = 0;
|
||||
@@ -8298,7 +8298,7 @@ void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
|
||||
else
|
||||
{
|
||||
// Actually select before expecting closure attempt (on an UnsavedDocument tab user is expect to e.g. show a popup)
|
||||
if (tab_bar->VisibleTabId != tab->Id)
|
||||
if (tab_bar->VisibleTabId != tab->ID)
|
||||
TabBarQueueFocus(tab_bar, tab);
|
||||
}
|
||||
}
|
||||
@@ -8345,14 +8345,14 @@ static void ImGui::TabBarScrollToTab(ImGuiTabBar* tab_bar, ImGuiID tab_id, ImGui
|
||||
|
||||
void ImGui::TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
|
||||
{
|
||||
tab_bar->NextSelectedTabId = tab->Id;
|
||||
tab_bar->NextSelectedTabId = tab->ID;
|
||||
}
|
||||
|
||||
void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset)
|
||||
{
|
||||
IM_ASSERT(offset != 0);
|
||||
IM_ASSERT(tab_bar->ReorderRequestTabId == 0);
|
||||
tab_bar->ReorderRequestTabId = tab->Id;
|
||||
tab_bar->ReorderRequestTabId = tab->ID;
|
||||
tab_bar->ReorderRequestOffset = (ImS16)offset;
|
||||
}
|
||||
|
||||
@@ -8512,7 +8512,7 @@ static ImGuiTabItem* ImGui::TabBarTabListPopupButton(ImGuiTabBar* tab_bar)
|
||||
continue;
|
||||
|
||||
const char* tab_name = TabBarGetTabName(tab_bar, tab);
|
||||
if (Selectable(tab_name, tab_bar->SelectedTabId == tab->Id))
|
||||
if (Selectable(tab_name, tab_bar->SelectedTabId == tab->ID))
|
||||
tab_to_select = tab;
|
||||
}
|
||||
EndCombo();
|
||||
@@ -8554,7 +8554,7 @@ bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f
|
||||
if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
|
||||
{
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
|
||||
PushOverrideID(tab->Id); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label)
|
||||
PushOverrideID(tab->ID); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -8636,7 +8636,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
||||
{
|
||||
tab_bar->Tabs.push_back(ImGuiTabItem());
|
||||
tab = &tab_bar->Tabs.back();
|
||||
tab->Id = id;
|
||||
tab->ID = id;
|
||||
tab_bar->TabsAddedNew = tab_is_new = true;
|
||||
}
|
||||
tab_bar->LastTabItemIdx = (ImS16)tab_bar->Tabs.index_from_ptr(tab);
|
||||
@@ -8810,7 +8810,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
||||
if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip) && !(tab->Flags & ImGuiTabItemFlags_NoTooltip))
|
||||
SetItemTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
|
||||
|
||||
IM_ASSERT(!is_tab_button || !(tab_bar->SelectedTabId == tab->Id && is_tab_button)); // TabItemButton should not be selected
|
||||
IM_ASSERT(!is_tab_button || !(tab_bar->SelectedTabId == tab->ID && is_tab_button)); // TabItemButton should not be selected
|
||||
if (is_tab_button)
|
||||
return pressed;
|
||||
return tab_contents_visible;
|
||||
|
||||
@@ -1550,18 +1550,18 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
|
||||
|
||||
{
|
||||
stbtt_uint16 offset, start, last;
|
||||
stbtt_uint16 Item = (stbtt_uint16) ((search - endCount) >> 1);
|
||||
stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1);
|
||||
|
||||
start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*Item);
|
||||
last = ttUSHORT(data + endCount + 2*Item);
|
||||
start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
|
||||
last = ttUSHORT(data + endCount + 2*item);
|
||||
if (unicode_codepoint < start || unicode_codepoint > last)
|
||||
return 0;
|
||||
|
||||
offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*Item);
|
||||
offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
|
||||
if (offset == 0)
|
||||
return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*Item));
|
||||
return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item));
|
||||
|
||||
return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*Item);
|
||||
return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item);
|
||||
}
|
||||
} else if (format == 12 || format == 13) {
|
||||
stbtt_uint32 ngroups = ttULONG(data+index_map+12);
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
EXPORTS
|
||||
MH_Initialize
|
||||
MH_Uninitialize
|
||||
|
||||
MH_CreateHook
|
||||
MH_CreateHookApi
|
||||
MH_CreateHookApiEx
|
||||
MH_RemoveHook
|
||||
MH_EnableHook
|
||||
MH_DisableHook
|
||||
MH_QueueEnableHook
|
||||
MH_QueueDisableHook
|
||||
MH_ApplyQueued
|
||||
MH_StatusToString
|
||||
@@ -69,7 +69,7 @@ typedef enum MH_STATUS
|
||||
// The specified target function cannot be hooked.
|
||||
MH_ERROR_UNSUPPORTED_FUNCTION,
|
||||
|
||||
// Failed to allocate Memory::
|
||||
// Failed to allocate memory.
|
||||
MH_ERROR_MEMORY_ALLOC,
|
||||
|
||||
// Failed to change the memory protection.
|
||||
|
||||
@@ -230,8 +230,7 @@
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
<Command>powershell -ExecutionPolicy Bypass -File "$(SolutionDir)\Post-Build Scripts\ClearPathStrings.ps1" "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,54 +5,49 @@
|
||||
#include "../SDK/Classes/Engine_classes.h"
|
||||
#include "../SDK/Classes/FortniteGame_Classes.h"
|
||||
|
||||
namespace Actors
|
||||
{
|
||||
namespace Caches
|
||||
{
|
||||
/* Cache for FortPawns, stores information like bone positions, distance from local pawn, visibilities etc */
|
||||
struct FortPawnCache
|
||||
{
|
||||
SDK::AFortPawn* FortPawn = nullptr; // FortPawn
|
||||
SDK::USkeletalMeshComponent* Mesh = nullptr; // Player mesh
|
||||
namespace Actors {
|
||||
namespace Caches {
|
||||
/* Cache for FortPawns, stores information like bone positions, distance from local pawn, visibilities etc */
|
||||
struct FortPawnCache {
|
||||
SDK::AFortPawn* FortPawn = nullptr; // FortPawn
|
||||
SDK::USkeletalMeshComponent* Mesh = nullptr; // Player mesh
|
||||
|
||||
SDK::AFortWeapon* Weapon = nullptr; // Player weapon
|
||||
int32 BulletsPerClip = 0; // Weapon tier
|
||||
SDK::AFortWeapon* Weapon = nullptr; // Player weapon
|
||||
int32 BulletsPerClip = 0; // Weapon tier
|
||||
|
||||
int TeamIndex = -1; // Team index
|
||||
SDK::FString PlayerName = SDK::FString(); // Player name
|
||||
int TeamIndex = -1; // Team index
|
||||
SDK::FString PlayerName = SDK::FString(); // Player name
|
||||
|
||||
float DistanceFromLocalPawn = 0.f; // Distance from the local player (meters)
|
||||
bool IsAnyBoneVisible = false; // If any bones were visible from LineTraceSingle
|
||||
bool IsPlayerVisibleOnScreen = false; // If the player is on the screen
|
||||
bool IsBoneRegister2DPopulated = false; // If the 2D bone register was fully populated
|
||||
float DistanceFromLocalPawn = 0.f; // Distance from the local player (meters)
|
||||
bool IsAnyBoneVisible = false; // If any bones were visible from LineTraceSingle
|
||||
bool IsPlayerVisibleOnScreen = false; // If the player is on the screen
|
||||
bool IsBoneRegister2DPopulated = false; // If the 2D bone register was fully populated
|
||||
|
||||
std::vector<SDK::FVector> BonePositions3D; // Contains all bones
|
||||
std::vector<SDK::FVector2D> BonePositions2D; // Contains all bones in 2D (world to screen)
|
||||
std::vector<bool> BoneVisibilityStates; // Contains all bones visibilities (from LineTraceSingle)
|
||||
};
|
||||
std::vector<SDK::FVector> BonePositions3D; // Contains all bones
|
||||
std::vector<SDK::FVector2D> BonePositions2D; // Contains all bones in 2D (world to screen)
|
||||
std::vector<bool> BoneVisibilityStates; // Contains all bones visibilities (from LineTraceSingle)
|
||||
};
|
||||
|
||||
/* Minimal Cache for FortPawns, stores position and team index */
|
||||
struct MinimalFortPawnCache
|
||||
{
|
||||
SDK::FVector Position = SDK::FVector();
|
||||
uint8_t TeamIndex = 0;
|
||||
};
|
||||
/* Minimal Cache for FortPawns, stores position and team index */
|
||||
struct MinimalFortPawnCache {
|
||||
SDK::FVector Position = SDK::FVector();
|
||||
uint8_t TeamIndex = 0;
|
||||
};
|
||||
|
||||
/* Cache for the camera, stores position, rotation and FOV */
|
||||
struct CameraCache
|
||||
{
|
||||
SDK::FVector Position = SDK::FVector();
|
||||
SDK::FRotator Rotation = SDK::FRotator();
|
||||
float FOV = 0.f;
|
||||
};
|
||||
}
|
||||
/* Cache for the camera, stores position, rotation and FOV */
|
||||
struct CameraCache {
|
||||
SDK::FVector Position = SDK::FVector();
|
||||
SDK::FRotator Rotation = SDK::FRotator();
|
||||
float FOV = 0.f;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Cache
|
||||
// Cache
|
||||
|
||||
inline Caches::CameraCache MainCamera; // Cache for the main camera
|
||||
inline Caches::CameraCache AimbotCamera; // Cache for the aimbot camera (used for silent aim)
|
||||
inline Caches::CameraCache MainCamera; // Cache for the main camera
|
||||
inline Caches::CameraCache AimbotCamera; // Cache for the aimbot camera (used for silent aim)
|
||||
|
||||
inline Caches::MinimalFortPawnCache LocalPawnCache; // Cache for the local pawn (position, team index)
|
||||
inline Caches::MinimalFortPawnCache LocalPawnCache; // Cache for the local pawn (position, team index)
|
||||
}
|
||||
@@ -5,208 +5,184 @@
|
||||
#include "../Features/Aimbot/Target.h"
|
||||
#include "../Features/FortPawnHelper/Bone.h"
|
||||
|
||||
#include "../../Configs/Config.h"
|
||||
#include "../../Drawing/Drawing.h"
|
||||
#include "../../Configs/Config.h"
|
||||
|
||||
#include "../Game.h"
|
||||
|
||||
void Actors::Tick()
|
||||
{
|
||||
// Update FPS scale
|
||||
{
|
||||
auto currentTime = std::chrono::high_resolution_clock::now();
|
||||
float deltaTime = std::chrono::duration_cast<std::chrono::duration<float>>(currentTime - LastAimbotFrameTime).count();
|
||||
LastAimbotFrameTime = currentTime;
|
||||
void Actors::Tick() {
|
||||
// Update FPS scale
|
||||
{
|
||||
auto currentTime = std::chrono::high_resolution_clock::now();
|
||||
float deltaTime = std::chrono::duration_cast<std::chrono::duration<float>>(currentTime - LastAimbotFrameTime).count();
|
||||
LastAimbotFrameTime = currentTime;
|
||||
|
||||
float targetFrameTime = 1.0f / 60.0f; // Targeting 60 FPS frame time
|
||||
float targetFrameTime = 1.0f / 60.0f; // Targeting 60 FPS frame time
|
||||
|
||||
FPSScale = targetFrameTime / deltaTime;
|
||||
}
|
||||
FPSScale = targetFrameTime / deltaTime;
|
||||
}
|
||||
|
||||
// Update Camera and AimbotCamera
|
||||
{
|
||||
SDK::APlayerCameraManager* CameraManager = SDK::GetLocalController()->PlayerCameraManager();
|
||||
if (SDK::IsValidPointer(CameraManager))
|
||||
{
|
||||
MainCamera.Position = CameraManager->GetCameraLocation();
|
||||
MainCamera.Rotation = CameraManager->GetCameraRotation();
|
||||
MainCamera.FOV = CameraManager->GetFOVAngle();
|
||||
// Update Camera and AimbotCamera
|
||||
{
|
||||
SDK::APlayerCameraManager* CameraManager = SDK::GetLocalController()->PlayerCameraManager();
|
||||
if (SDK::IsValidPointer(CameraManager)) {
|
||||
MainCamera.Position = CameraManager->GetCameraLocation();
|
||||
MainCamera.Rotation = CameraManager->GetCameraRotation();
|
||||
MainCamera.FOV = CameraManager->GetFOVAngle();
|
||||
|
||||
AimbotCamera.Position = MainCamera.Position;
|
||||
AimbotCamera.FOV = MainCamera.FOV;
|
||||
AimbotCamera.Position = MainCamera.Position;
|
||||
AimbotCamera.FOV = MainCamera.FOV;
|
||||
|
||||
if (Config::Aimbot::SilentAim)
|
||||
{
|
||||
if (Config::Aimbot::UseAimKeyForSilent == false || Config::Aimbot::UseAimKeyForSilent && MainTarget.LocalInfo.IsTargeting)
|
||||
{
|
||||
AimbotCamera.Rotation = MainTarget.LocalInfo.TargetRotationWithSmooth;
|
||||
if (Config::Aimbot::SilentAim) {
|
||||
if (Config::Aimbot::UseAimKeyForSilent == false || Config::Aimbot::UseAimKeyForSilent && MainTarget.LocalInfo.IsTargeting) {
|
||||
AimbotCamera.Rotation = MainTarget.LocalInfo.TargetRotationWithSmooth;
|
||||
|
||||
// Account for if the players actual rotation is closer than the silent aim rotation (so silent aim can't throw for you)
|
||||
float SilentPitchDistance = AimbotCamera.Rotation.GetPitchDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
float SilentYawDistance = AimbotCamera.Rotation.GetYawDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
// Account for if the players actual rotation is closer than the silent aim rotation (so silent aim can't throw for you)
|
||||
float SilentPitchDistance = AimbotCamera.Rotation.GetPitchDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
float SilentYawDistance = AimbotCamera.Rotation.GetYawDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
|
||||
float RealPitchDistance = MainCamera.Rotation.GetPitchDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
float RealYawDistance = MainCamera.Rotation.GetYawDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
float RealPitchDistance = MainCamera.Rotation.GetPitchDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
float RealYawDistance = MainCamera.Rotation.GetYawDistance(MainTarget.LocalInfo.TargetRotation);
|
||||
|
||||
if (std::abs(RealPitchDistance) < std::abs(SilentPitchDistance))
|
||||
{
|
||||
AimbotCamera.Rotation.Pitch = MainCamera.Rotation.Pitch;
|
||||
}
|
||||
if (std::abs(RealYawDistance) < std::abs(SilentYawDistance))
|
||||
{
|
||||
AimbotCamera.Rotation.Yaw = MainCamera.Rotation.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AimbotCamera.Rotation = MainCamera.Rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (std::abs(RealPitchDistance) < std::abs(SilentPitchDistance)) {
|
||||
AimbotCamera.Rotation.Pitch = MainCamera.Rotation.Pitch;
|
||||
}
|
||||
if (std::abs(RealYawDistance) < std::abs(SilentYawDistance)) {
|
||||
AimbotCamera.Rotation.Yaw = MainCamera.Rotation.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
AimbotCamera.Rotation = MainCamera.Rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update local player
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn()->RootComponent() == nullptr)
|
||||
{
|
||||
LocalPawnCache.Position = SDK::GetLocalController()->PlayerCameraManager()->GetCameraLocation();
|
||||
LocalPawnCache.TeamIndex = INT_FAST8_MAX;
|
||||
}
|
||||
}
|
||||
// Update local player
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn()->RootComponent() == nullptr) {
|
||||
LocalPawnCache.Position = SDK::GetLocalController()->PlayerCameraManager()->GetCameraLocation();
|
||||
LocalPawnCache.TeamIndex = INT_FAST8_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the current FOV size
|
||||
{
|
||||
switch (MainTarget.GlobalInfo.Type)
|
||||
{
|
||||
case Features::Aimbot::Target::TargetType::ClosePlayer:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::CloseAim::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
case Features::Aimbot::Target::TargetType::Weakspot:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::Weakspot::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
default:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Update the current FOV size
|
||||
{
|
||||
switch (MainTarget.GlobalInfo.Type) {
|
||||
case Features::Aimbot::Target::TargetType::ClosePlayer:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::CloseAim::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
case Features::Aimbot::Target::TargetType::Weakspot:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::Weakspot::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
default:
|
||||
CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
CurrentFOVSizePixels = CurrentFOVSizeDegrees * Game::PixelsPerDegree;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void Actors::Draw()
|
||||
{
|
||||
// Draw the aim line
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn())
|
||||
{
|
||||
if (Config::Aimbot::ShowAimLine && Config::Aimbot::Enabled)
|
||||
{
|
||||
if (MainTarget.GlobalInfo.TargetActor)
|
||||
{
|
||||
// If the target is behind us, we need to flip the aim line to make it look correct (K2_Project is weird with things behind us)
|
||||
SDK::FVector AimLineEnd = SDK::Project3D(MainTarget.GlobalInfo.TargetBonePosition);
|
||||
void Actors::Draw() {
|
||||
// Draw the aim line
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn()) {
|
||||
if (Config::Aimbot::ShowAimLine && Config::Aimbot::Enabled) {
|
||||
if (MainTarget.GlobalInfo.TargetActor) {
|
||||
// If the target is behind us, we need to flip the aim line to make it look correct (K2_Project is weird with things behind us)
|
||||
SDK::FVector AimLineEnd = SDK::Project3D(MainTarget.GlobalInfo.TargetBonePosition);
|
||||
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot)
|
||||
{
|
||||
Drawing::Line(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), SDK::FVector2D(AimLineEnd.X, AimLineEnd.Y), 1.f, SDK::FLinearColor(1.f, 0.f, 0.f, 1.f), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Drawing::Line(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), SDK::FVector2D(AimLineEnd.X, AimLineEnd.Y), 1.f, SDK::FLinearColor(1.f, 1.f, 1.f, 1.f), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot) {
|
||||
Drawing::Line(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), SDK::FVector2D(AimLineEnd.X, AimLineEnd.Y), 1.f, SDK::FLinearColor(1.f, 0.f, 0.f, 1.f), true);
|
||||
}
|
||||
else {
|
||||
Drawing::Line(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), SDK::FVector2D(AimLineEnd.X, AimLineEnd.Y), 1.f, SDK::FLinearColor(1.f, 1.f, 1.f, 1.f), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw FOV circle
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn())
|
||||
{
|
||||
if (Config::Aimbot::ShowFOV && Config::Aimbot::Enabled)
|
||||
{
|
||||
// Only do high segment count for ImGui (since we don't have overhead of ProcessEvent)
|
||||
// Draw FOV circle
|
||||
{
|
||||
if (SDK::GetLocalController()->AcknowledgedPawn()) {
|
||||
if (Config::Aimbot::ShowFOV && Config::Aimbot::Enabled) {
|
||||
// Only do high segment count for ImGui (since we don't have overhead of ProcessEvent)
|
||||
#ifdef _IMGUI
|
||||
const int Segments = 128;
|
||||
const int Segments = 128;
|
||||
#else
|
||||
const int Segments = 32;
|
||||
const int Segments = 32;
|
||||
#endif
|
||||
|
||||
Drawing::Circle(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), Actors::CurrentFOVSizePixels, Segments, MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot ? SDK::FLinearColor(1.f, 0.f, 0.f, 1.f) : SDK::FLinearColor(1.f, 1.f, 1.f, 1.f), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Drawing::Circle(SDK::FVector2D(Game::ScreenCenterX, Game::ScreenCenterY), Actors::CurrentFOVSizePixels , Segments, MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot ? SDK::FLinearColor(1.f, 0.f, 0.f, 1.f) : SDK::FLinearColor(1.f, 1.f, 1.f, 1.f), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void Actors::UpdateCaches()
|
||||
{
|
||||
// Player Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortPawn::LastCacheTime).count();
|
||||
void Actors::UpdateCaches() {
|
||||
// Player Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortPawn::LastCacheTime).count();
|
||||
|
||||
if (ElapsedTime >= FortPawn::IntervalSeconds)
|
||||
{
|
||||
FortPawn::LastCacheTime = Game::CurrentTime;
|
||||
if (ElapsedTime >= FortPawn::IntervalSeconds) {
|
||||
FortPawn::LastCacheTime = Game::CurrentTime;
|
||||
|
||||
SDK::TArray<SDK::AActor*> ReturnArray = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortPawn::StaticClass());
|
||||
SDK::TArray<SDK::AActor*> ReturnArray = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortPawn::StaticClass());
|
||||
|
||||
std::vector<Actors::Caches::FortPawnCache> TempCache;
|
||||
std::vector<Actors::Caches::FortPawnCache> TempCache;
|
||||
|
||||
for (int i = 0; i < ReturnArray.Num(); i++)
|
||||
{
|
||||
Actors::Caches::FortPawnCache FortPawnCache{};
|
||||
for (int i = 0; i < ReturnArray.Num(); i++) {
|
||||
Actors::Caches::FortPawnCache FortPawnCache{};
|
||||
|
||||
FortPawnCache.FortPawn = SDK::Cast<SDK::AFortPawn, true>(ReturnArray[i]);
|
||||
SDK::APlayerState* PlayerState = FortPawnCache.FortPawn->PlayerState();
|
||||
if (SDK::IsValidPointer(PlayerState))
|
||||
{
|
||||
FortPawnCache.PlayerName = PlayerState->GetPlayerName();
|
||||
FortPawnCache.TeamIndex = SDK::Cast<SDK::AFortPlayerState>(PlayerState)->TeamIndex();
|
||||
}
|
||||
FortPawnCache.FortPawn = SDK::Cast<SDK::AFortPawn, true>(ReturnArray[i]);
|
||||
SDK::APlayerState* PlayerState = FortPawnCache.FortPawn->PlayerState();
|
||||
if (SDK::IsValidPointer(PlayerState)) {
|
||||
FortPawnCache.PlayerName = PlayerState->GetPlayerName();
|
||||
FortPawnCache.TeamIndex = SDK::Cast<SDK::AFortPlayerState>(PlayerState)->TeamIndex();
|
||||
}
|
||||
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
|
||||
TempCache.push_back(FortPawnCache);
|
||||
}
|
||||
TempCache.push_back(FortPawnCache);
|
||||
}
|
||||
|
||||
FortPawn::CachedPlayers = TempCache;
|
||||
}
|
||||
}
|
||||
FortPawn::CachedPlayers = TempCache;
|
||||
}
|
||||
}
|
||||
|
||||
// Weapon Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortPickup::LastCacheTime).count();
|
||||
// Weapon Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortPickup::LastCacheTime).count();
|
||||
|
||||
if (ElapsedTime >= FortPickup::IntervalSeconds)
|
||||
{
|
||||
FortPickup::LastCacheTime = Game::CurrentTime;
|
||||
if (ElapsedTime >= FortPickup::IntervalSeconds) {
|
||||
FortPickup::LastCacheTime = Game::CurrentTime;
|
||||
|
||||
FortPickup::CachedWeapons = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortPickup::StaticClass());
|
||||
}
|
||||
}
|
||||
FortPickup::CachedWeapons = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortPickup::StaticClass());
|
||||
}
|
||||
}
|
||||
|
||||
// Weakspot Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - BuildingWeakSpot::LastCacheTime).count();
|
||||
// Weakspot Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - BuildingWeakSpot::LastCacheTime).count();
|
||||
|
||||
if (ElapsedTime >= BuildingWeakSpot::IntervalSeconds)
|
||||
{
|
||||
BuildingWeakSpot::LastCacheTime = Game::CurrentTime;
|
||||
if (ElapsedTime >= BuildingWeakSpot::IntervalSeconds) {
|
||||
BuildingWeakSpot::LastCacheTime = Game::CurrentTime;
|
||||
|
||||
BuildingWeakSpot::CachedBuildingWeakSpot = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::ABuildingWeakSpot::StaticClass());
|
||||
}
|
||||
}
|
||||
BuildingWeakSpot::CachedBuildingWeakSpot = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::ABuildingWeakSpot::StaticClass());
|
||||
}
|
||||
}
|
||||
|
||||
// FortAthenaVehicle Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortAthenaVehicle::LastCacheTime).count();
|
||||
// FortAthenaVehicle Cache
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - FortAthenaVehicle::LastCacheTime).count();
|
||||
|
||||
if (ElapsedTime >= FortAthenaVehicle::IntervalSeconds)
|
||||
{
|
||||
FortAthenaVehicle::LastCacheTime = Game::CurrentTime;
|
||||
if (ElapsedTime >= FortAthenaVehicle::IntervalSeconds) {
|
||||
FortAthenaVehicle::LastCacheTime = Game::CurrentTime;
|
||||
|
||||
FortAthenaVehicle::CachedVehicles = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortAthenaVehicle::StaticClass());
|
||||
}
|
||||
}
|
||||
FortAthenaVehicle::CachedVehicles = SDK::UGameplayStatics::GetAllActorsOfClass(SDK::GetWorld(), SDK::AFortAthenaVehicle::StaticClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,73 +4,68 @@
|
||||
#include "../Features/Aimbot/Target.h"
|
||||
#include "ActorCache.h"
|
||||
|
||||
namespace Actors
|
||||
{
|
||||
// Actor Loops
|
||||
namespace Actors {
|
||||
// Actor Loops
|
||||
|
||||
namespace FortPawn
|
||||
{
|
||||
void Tick();
|
||||
namespace FortPawn {
|
||||
void Tick();
|
||||
|
||||
inline std::vector<Actors::Caches::FortPawnCache> CachedPlayers;
|
||||
inline std::vector<Actors::Caches::FortPawnCache> CachedPlayers;
|
||||
|
||||
inline const float IntervalSeconds = 0.25f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
inline const float IntervalSeconds = 0.25f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
namespace FortPickup
|
||||
{
|
||||
void Tick();
|
||||
namespace FortPickup {
|
||||
void Tick();
|
||||
|
||||
inline SDK::TArray<SDK::AActor*> CachedWeapons;
|
||||
inline SDK::TArray<SDK::AActor*> CachedWeapons;
|
||||
|
||||
inline const float IntervalSeconds = 0.10f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
inline const float IntervalSeconds = 0.10f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
|
||||
inline std::chrono::steady_clock::time_point LastAutoPickupTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
inline std::chrono::steady_clock::time_point LastAutoPickupTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
namespace FortAthenaVehicle
|
||||
{
|
||||
void Tick();
|
||||
namespace FortAthenaVehicle {
|
||||
void Tick();
|
||||
|
||||
inline SDK::TArray<SDK::AActor*> CachedVehicles;
|
||||
inline SDK::TArray<SDK::AActor*> CachedVehicles;
|
||||
|
||||
inline const float IntervalSeconds = 0.25f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
inline const float IntervalSeconds = 0.25f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
namespace BuildingWeakSpot
|
||||
{
|
||||
void Tick();
|
||||
namespace BuildingWeakSpot {
|
||||
void Tick();
|
||||
|
||||
inline SDK::TArray<SDK::AActor*> CachedBuildingWeakSpot;
|
||||
inline SDK::TArray<SDK::AActor*> CachedBuildingWeakSpot;
|
||||
|
||||
inline const float IntervalSeconds = 0.10f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
inline const float IntervalSeconds = 0.10f;
|
||||
inline std::chrono::steady_clock::time_point LastCacheTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Cache
|
||||
// Cache
|
||||
|
||||
inline Features::Aimbot::Target MainTarget;
|
||||
inline Features::Aimbot::Target MainTarget;
|
||||
|
||||
inline float CurrentFOVSizeDegrees;
|
||||
inline float CurrentFOVSizePixels;
|
||||
inline float CurrentFOVSizeDegrees;
|
||||
inline float CurrentFOVSizePixels;
|
||||
|
||||
|
||||
|
||||
// FPS Scaling
|
||||
// FPS Scaling
|
||||
|
||||
inline std::chrono::high_resolution_clock::time_point LastAimbotFrameTime;
|
||||
inline float FPSScale;
|
||||
inline std::chrono::high_resolution_clock::time_point LastAimbotFrameTime;
|
||||
inline float FPSScale;
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
// Functions
|
||||
|
||||
void Tick();
|
||||
void Draw();
|
||||
void UpdateCaches();
|
||||
void Tick();
|
||||
void Draw();
|
||||
void UpdateCaches();
|
||||
}
|
||||
@@ -2,54 +2,47 @@
|
||||
|
||||
#include "../../SDK/Classes/Engine_classes.h"
|
||||
|
||||
#include "../../../Configs/Config.h"
|
||||
#include "../../Features/Aimbot/Aimbot.h"
|
||||
#include "../../../Configs/Config.h"
|
||||
|
||||
void Actors::BuildingWeakSpot::Tick()
|
||||
{
|
||||
bool SeenTarget = false;
|
||||
void Actors::BuildingWeakSpot::Tick() {
|
||||
bool SeenTarget = false;
|
||||
|
||||
for (int i = 0; i < CachedBuildingWeakSpot.Num(); i++)
|
||||
{
|
||||
if (Config::Aimbot::Weakspot::Enabled == false) break;
|
||||
if (SDK::Cast<SDK::AFortPawn>(SDK::GetLocalPawn())->CurrentWeapon()->IsPickaxe() == false) break;
|
||||
for (int i = 0; i < CachedBuildingWeakSpot.Num(); i++) {
|
||||
if (Config::Aimbot::Weakspot::Enabled == false) break;
|
||||
if (SDK::Cast<SDK::AFortPawn>(SDK::GetLocalPawn())->CurrentWeapon()->IsPickaxe() == false) break;
|
||||
|
||||
SDK::AActor* Actor = CachedBuildingWeakSpot[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::ABuildingWeakSpot* WeakSpot = SDK::Cast<SDK::ABuildingWeakSpot>(Actor); if (SDK::IsValidPointer(WeakSpot) == false) continue;
|
||||
SDK::AActor* Actor = CachedBuildingWeakSpot[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::ABuildingWeakSpot* WeakSpot = SDK::Cast<SDK::ABuildingWeakSpot>(Actor); if (SDK::IsValidPointer(WeakSpot) == false) continue;
|
||||
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
float DistanceFromLocal = LocalPawnCache.Position.Distance(RootPosition) / 100.f;
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
float DistanceFromLocal = LocalPawnCache.Position.Distance(RootPosition) / 100.f;
|
||||
|
||||
// Max distance from local player
|
||||
if (DistanceFromLocal > 5.f) continue;
|
||||
// Max distance from local player
|
||||
if (DistanceFromLocal > 5.f) continue;
|
||||
|
||||
if (WeakSpot->bActive() && WeakSpot->bFadeOut() == false && WeakSpot->bHit() == false)
|
||||
{
|
||||
// Aimbot
|
||||
if (Config::Aimbot::Enabled && SDK::GetLocalController()->AcknowledgedPawn())
|
||||
{
|
||||
if (((MainTarget.LocalInfo.IsTargeting == false || Config::Aimbot::StickyAim == false) || MainTarget.GlobalInfo.TargetActor == nullptr))
|
||||
{
|
||||
Features::Aimbot::Target PotentialNewTarget{};
|
||||
if (WeakSpot->bActive() && WeakSpot->bFadeOut() == false && WeakSpot->bHit() == false) {
|
||||
// Aimbot
|
||||
if (Config::Aimbot::Enabled && SDK::GetLocalController()->AcknowledgedPawn()) {
|
||||
if (((MainTarget.LocalInfo.IsTargeting == false || Config::Aimbot::StickyAim == false) || MainTarget.GlobalInfo.TargetActor == nullptr)) {
|
||||
Features::Aimbot::Target PotentialNewTarget{};
|
||||
|
||||
Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(PotentialNewTarget, WeakSpot, MainCamera, AimbotCamera);
|
||||
MainTarget.SetTarget(PotentialNewTarget);
|
||||
}
|
||||
Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(PotentialNewTarget, WeakSpot, MainCamera, AimbotCamera);
|
||||
MainTarget.SetTarget(PotentialNewTarget);
|
||||
}
|
||||
|
||||
if (MainTarget.GlobalInfo.TargetActor == WeakSpot)
|
||||
{
|
||||
SeenTarget = true;
|
||||
if (MainTarget.GlobalInfo.TargetActor == WeakSpot) {
|
||||
SeenTarget = true;
|
||||
|
||||
Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(MainTarget, WeakSpot, MainCamera, AimbotCamera, FPSScale);
|
||||
Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(MainTarget, WeakSpot, MainCamera, AimbotCamera, FPSScale);
|
||||
|
||||
Features::Aimbot::AimbotTarget(MainTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Features::Aimbot::AimbotTarget(MainTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot)
|
||||
{
|
||||
MainTarget.TargetTick(SeenTarget);
|
||||
}
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::Weakspot) {
|
||||
MainTarget.TargetTick(SeenTarget);
|
||||
}
|
||||
}
|
||||
@@ -9,35 +9,30 @@
|
||||
|
||||
#include "../../../Utilities/Math.h"
|
||||
|
||||
void Actors::FortAthenaVehicle::Tick()
|
||||
{
|
||||
for (int i = 0; i < CachedVehicles.Num(); i++)
|
||||
{
|
||||
if (Config::Visuals::Vehicles::Enabled)
|
||||
{
|
||||
if (CachedVehicles.IsValidIndex(i) == false) continue;
|
||||
void Actors::FortAthenaVehicle::Tick() {
|
||||
for (int i = 0; i < CachedVehicles.Num(); i++) {
|
||||
if (Config::Visuals::Vehicles::Enabled) {
|
||||
if (CachedVehicles.IsValidIndex(i) == false) continue;
|
||||
|
||||
SDK::AActor* Actor = CachedVehicles[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AFortAthenaVehicle* FortAthenaVehicle = SDK::Cast<SDK::AFortAthenaVehicle>(Actor); if (SDK::IsValidPointer(FortAthenaVehicle) == false) continue;
|
||||
SDK::AActor* Actor = CachedVehicles[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AFortAthenaVehicle* FortAthenaVehicle = SDK::Cast<SDK::AFortAthenaVehicle>(Actor); if (SDK::IsValidPointer(FortAthenaVehicle) == false) continue;
|
||||
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
if (RootPosition.Distance(Actors::LocalPawnCache.Position) / 100 > Config::Visuals::Vehicles::MaxDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
if (RootPosition.Distance(Actors::LocalPawnCache.Position) / 100 > Config::Visuals::Vehicles::MaxDistance) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SDK::Cast<SDK::AFortPlayerPawn>(SDK::GetLocalPawn())->VehicleStateLocal()->Vehicle() == FortAthenaVehicle)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (SDK::Cast<SDK::AFortPlayerPawn>(SDK::GetLocalPawn())->VehicleStateLocal()->Vehicle() == FortAthenaVehicle) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SDK::FVector2D Project = SDK::Project(RootPosition);
|
||||
if (Math::IsOnScreen(Project) == false) continue;
|
||||
SDK::FVector2D Project = SDK::Project(RootPosition);
|
||||
if (Math::IsOnScreen(Project) == false) continue;
|
||||
|
||||
std::string VehicleName = FortAthenaVehicle->Class->GetName();
|
||||
SDK::FLinearColor VehicleColor = SDK::FLinearColor(1.f, 1.f, 1.f, 1.f);
|
||||
std::string VehicleName = FortAthenaVehicle->Class->GetName();
|
||||
SDK::FLinearColor VehicleColor = SDK::FLinearColor(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
Drawing::Text(VehicleName.c_str(), Project, 16.f, VehicleColor, true, true, true);
|
||||
}
|
||||
}
|
||||
Drawing::Text(VehicleName.c_str(), Project, 16.f, VehicleColor, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,306 +4,271 @@
|
||||
|
||||
#include "../../Game.h"
|
||||
|
||||
#include "../../../Configs/Config.h"
|
||||
#include "../../../Drawing/Drawing.h"
|
||||
#include "../../../Configs/Config.h"
|
||||
|
||||
#include "../../Features/FortPawnHelper/Bone.h"
|
||||
#include "../../Features/Visuals/Chams.h"
|
||||
#include "../../Features/FortPawnHelper/FortPawnHelper.h"
|
||||
#include "../../Features/Aimbot/Aimbot.h"
|
||||
#include "../../Features/Exploits/Player.h"
|
||||
#include "../../Features/Exploits/Vehicle.h"
|
||||
#include "../../Features/Exploits/Weapon.h"
|
||||
#include "../../Features/FortPawnHelper/Bone.h"
|
||||
#include "../../Features/FortPawnHelper/FortPawnHelper.h"
|
||||
#include "../../Features/Visuals/Chams.h"
|
||||
#include "../../Features/Exploits/Player.h"
|
||||
|
||||
#include "../../../Utilities/Math.h"
|
||||
|
||||
void Actors::FortPawn::Tick()
|
||||
{
|
||||
bool SeenTarget = false;
|
||||
void Actors::FortPawn::Tick() {
|
||||
bool SeenTarget = false;
|
||||
|
||||
// move somewhere better later this is gay here
|
||||
if (SDK::GetLocalPawn() == nullptr) LocalPawnCache.TeamIndex = INT_FAST8_MAX;
|
||||
// move somewhere better later this is gay here
|
||||
if (SDK::GetLocalPawn() == nullptr) LocalPawnCache.TeamIndex = INT_FAST8_MAX;
|
||||
|
||||
std::vector<Actors::Caches::FortPawnCache> CachedPlayersLocal = Actors::FortPawn::CachedPlayers;
|
||||
std::vector<Actors::Caches::FortPawnCache> CachedPlayersLocal = Actors::FortPawn::CachedPlayers;
|
||||
|
||||
for (auto it = CachedPlayersLocal.begin(); it != CachedPlayersLocal.end(); ++it)
|
||||
{
|
||||
Actors::Caches::FortPawnCache& CurrentPlayer = *it;
|
||||
for (auto it = CachedPlayersLocal.begin(); it != CachedPlayersLocal.end(); ++it) {
|
||||
Actors::Caches::FortPawnCache& CurrentPlayer = *it;
|
||||
|
||||
SDK::AFortPawn* FortPawn = CurrentPlayer.FortPawn; if (SDK::IsValidPointer(FortPawn) == false) continue;
|
||||
SDK::AFortPlayerState* FortPlayerState = SDK::Cast<SDK::AFortPlayerState>(FortPawn->PlayerState()); //if (SDK::IsValidPointer(FortPlayerState) == false) continue;
|
||||
CurrentPlayer.Mesh = FortPawn->Mesh(); if (SDK::IsValidPointer(CurrentPlayer.Mesh) == false) continue;
|
||||
SDK::AFortPawn* FortPawn = CurrentPlayer.FortPawn; if (SDK::IsValidPointer(FortPawn) == false) continue;
|
||||
SDK::AFortPlayerState* FortPlayerState = SDK::Cast<SDK::AFortPlayerState>(FortPawn->PlayerState()); //if (SDK::IsValidPointer(FortPlayerState) == false) continue;
|
||||
CurrentPlayer.Mesh = FortPawn->Mesh(); if (SDK::IsValidPointer(CurrentPlayer.Mesh) == false) continue;
|
||||
|
||||
// LocalPawn caching and exploit ticks
|
||||
if (FortPawn == SDK::GetLocalPawn())
|
||||
{
|
||||
LocalPawnCache.Position = CurrentPlayer.Mesh->GetBonePosition(Features::FortPawnHelper::Bone::Head);
|
||||
LocalPawnCache.TeamIndex = CurrentPlayer.TeamIndex;
|
||||
// LocalPawn caching and exploit ticks
|
||||
if (FortPawn == SDK::GetLocalPawn()) {
|
||||
LocalPawnCache.Position = CurrentPlayer.Mesh->GetBonePosition(Features::FortPawnHelper::Bone::Head);
|
||||
LocalPawnCache.TeamIndex = CurrentPlayer.TeamIndex;
|
||||
|
||||
Features::Exploits::Vehicle::Tick(SDK::Cast<SDK::AFortPlayerPawnAthena>(FortPawn));
|
||||
Features::Exploits::Weapon::Tick(FortPawn->CurrentWeapon());
|
||||
Features::Exploits::Player::Tick(SDK::Cast<SDK::AFortPlayerPawnAthena>(FortPawn), SDK::Cast<SDK::AFortPlayerController>(SDK::GetLocalController()));
|
||||
Features::Exploits::Vehicle::Tick(SDK::Cast<SDK::AFortPlayerPawnAthena>(FortPawn));
|
||||
Features::Exploits::Weapon::Tick(FortPawn->CurrentWeapon());
|
||||
Features::Exploits::Player::Tick(SDK::Cast<SDK::AFortPlayerPawnAthena>(FortPawn), SDK::Cast<SDK::AFortPlayerController>(SDK::GetLocalController()));
|
||||
|
||||
// Apply chams (if enabled and ShowLocal is enabled)
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Tick(FortPawn);
|
||||
// Apply chams (if enabled and ShowLocal is enabled)
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Tick(FortPawn);
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Player state validation
|
||||
if (CurrentPlayer.TeamIndex == LocalPawnCache.TeamIndex) continue;
|
||||
if (CurrentPlayer.FortPawn->IsDying()) continue;
|
||||
SDK::AFortPlayerStateZone* SpectatingTarget = SDK::Cast<SDK::AFortPlayerStateZone>(SDK::GetLocalPawn()->PlayerState())->SpectatingTarget();
|
||||
if (SpectatingTarget == SDK::Cast<SDK::AFortPlayerStateZone>(FortPlayerState) && (SDK::IsValidPointer(SpectatingTarget) && SDK::IsValidPointer(FortPlayerState))) continue;
|
||||
// Player state validation
|
||||
if (CurrentPlayer.TeamIndex == LocalPawnCache.TeamIndex) continue;
|
||||
if (CurrentPlayer.FortPawn->IsDying()) continue;
|
||||
SDK::AFortPlayerStateZone* SpectatingTarget = SDK::Cast<SDK::AFortPlayerStateZone>(SDK::GetLocalPawn()->PlayerState())->SpectatingTarget();
|
||||
if (SpectatingTarget == SDK::Cast<SDK::AFortPlayerStateZone>(FortPlayerState) && (SDK::IsValidPointer(SpectatingTarget) && SDK::IsValidPointer(FortPlayerState))) continue;
|
||||
|
||||
// Apply chams (if enabled)
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Tick(FortPawn);
|
||||
// Apply chams (if enabled)
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Tick(FortPawn);
|
||||
|
||||
// Kill all players by teleporting them infront of the local pawn allowing free shots
|
||||
if (Config::Exploits::Player::KillAll)
|
||||
{
|
||||
SDK::FVector ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(SDK::FRotator(0.f, Actors::MainCamera.Rotation.Yaw, Actors::MainCamera.Rotation.Roll));
|
||||
// Kill all players by teleporting them infront of the local pawn allowing free shots
|
||||
if (Config::Exploits::Player::KillAll) {
|
||||
SDK::FVector ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(SDK::FRotator(0.f, Actors::MainCamera.Rotation.Yaw, Actors::MainCamera.Rotation.Roll));
|
||||
|
||||
FortPawn->K2_SetActorLocation(Actors::MainCamera.Position + (ForwardVector * 350.f), false, nullptr, true);
|
||||
}
|
||||
FortPawn->K2_SetActorLocation(Actors::MainCamera.Position + (ForwardVector * 350.f), false, nullptr, true);
|
||||
}
|
||||
|
||||
// Bone positions and visibility caching
|
||||
// If this returns false, the player isn't on the screen and only 5 of the bones were WorldToScreened
|
||||
CurrentPlayer.IsBoneRegister2DPopulated = Features::FortPawnHelper::PopulateBones(CurrentPlayer);
|
||||
Features::FortPawnHelper::PopulateVisibilities(CurrentPlayer);
|
||||
// Bone positions and visibility caching
|
||||
// If this returns false, the player isn't on the screen and only 5 of the bones were WorldToScreened
|
||||
CurrentPlayer.IsBoneRegister2DPopulated = Features::FortPawnHelper::PopulateBones(CurrentPlayer);
|
||||
Features::FortPawnHelper::PopulateVisibilities(CurrentPlayer);
|
||||
|
||||
// Update IsPlayerVisibleOnScreen based on if any of the bones 2D positions are on the screen
|
||||
CurrentPlayer.IsPlayerVisibleOnScreen = false;
|
||||
for (int i = 0; i < CurrentPlayer.BonePositions2D.size(); i++)
|
||||
{
|
||||
if (CurrentPlayer.BonePositions2D[i] == SDK::FVector2D()) continue;
|
||||
// Update IsPlayerVisibleOnScreen based on if any of the bones 2D positions are on the screen
|
||||
CurrentPlayer.IsPlayerVisibleOnScreen = false;
|
||||
for (int i = 0; i < CurrentPlayer.BonePositions2D.size(); i++) {
|
||||
if (CurrentPlayer.BonePositions2D[i] == SDK::FVector2D()) continue;
|
||||
|
||||
if (Math::IsOnScreen(CurrentPlayer.BonePositions2D[i]))
|
||||
{
|
||||
CurrentPlayer.IsPlayerVisibleOnScreen = true;
|
||||
}
|
||||
}
|
||||
if (Math::IsOnScreen(CurrentPlayer.BonePositions2D[i])) {
|
||||
CurrentPlayer.IsPlayerVisibleOnScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentPlayer.DistanceFromLocalPawn = LocalPawnCache.Position.Distance(CurrentPlayer.BonePositions3D[Features::FortPawnHelper::Bone::Root]) / 100.f;
|
||||
CurrentPlayer.DistanceFromLocalPawn = LocalPawnCache.Position.Distance(CurrentPlayer.BonePositions3D[Features::FortPawnHelper::Bone::Root]) / 100.f;
|
||||
|
||||
// Hardcoded max distance, should move to bone population for optimisation
|
||||
if (CurrentPlayer.DistanceFromLocalPawn > 500.f) continue;
|
||||
// Hardcoded max distance, should move to bone population for optimisation
|
||||
if (CurrentPlayer.DistanceFromLocalPawn > 500.f) continue;
|
||||
|
||||
// Update any bone visibility
|
||||
CurrentPlayer.IsAnyBoneVisible = false;
|
||||
for (int i = 0; i < CurrentPlayer.BoneVisibilityStates.size(); i++)
|
||||
{
|
||||
if (CurrentPlayer.BoneVisibilityStates[i])
|
||||
{
|
||||
CurrentPlayer.IsAnyBoneVisible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Update any bone visibility
|
||||
CurrentPlayer.IsAnyBoneVisible = false;
|
||||
for (int i = 0; i < CurrentPlayer.BoneVisibilityStates.size(); i++) {
|
||||
if (CurrentPlayer.BoneVisibilityStates[i]) {
|
||||
CurrentPlayer.IsAnyBoneVisible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the current weapon and magazine ammo count
|
||||
SDK::AFortWeapon* CurrentWeapon = FortPawn->CurrentWeapon();
|
||||
if (CurrentWeapon != CurrentPlayer.Weapon)
|
||||
{
|
||||
CurrentPlayer.Weapon = CurrentWeapon;
|
||||
CurrentPlayer.BulletsPerClip = CurrentWeapon->GetBulletsPerClip();
|
||||
}
|
||||
// Update the current weapon and magazine ammo count
|
||||
SDK::AFortWeapon* CurrentWeapon = FortPawn->CurrentWeapon();
|
||||
if (CurrentWeapon != CurrentPlayer.Weapon) {
|
||||
CurrentPlayer.Weapon = CurrentWeapon;
|
||||
CurrentPlayer.BulletsPerClip = CurrentWeapon->GetBulletsPerClip();
|
||||
}
|
||||
|
||||
// Visuals
|
||||
if (CurrentPlayer.IsPlayerVisibleOnScreen)
|
||||
{
|
||||
SDK::FVector2D TopLeft, BottomRight;
|
||||
Features::FortPawnHelper::PopulateBoundCorners(CurrentPlayer, TopLeft, BottomRight);
|
||||
// Visuals
|
||||
if (CurrentPlayer.IsPlayerVisibleOnScreen) {
|
||||
SDK::FVector2D TopLeft, BottomRight;
|
||||
Features::FortPawnHelper::PopulateBoundCorners(CurrentPlayer, TopLeft, BottomRight);
|
||||
|
||||
float FontSize = Math::CalculateInterpolatedValue(150.f, CurrentPlayer.DistanceFromLocalPawn, 12.f, 20.f);
|
||||
float PrimaryThicknessMultiplier = Math::CalculateInterpolatedValue(75.f, CurrentPlayer.DistanceFromLocalPawn, 1.f, 3.f);
|
||||
float SecondaryThicknessMultiplier = Math::CalculateInterpolatedValue(75.f, CurrentPlayer.DistanceFromLocalPawn, 1.f, 2.f);
|
||||
float FontSize = Math::CalculateInterpolatedValue(150.f, CurrentPlayer.DistanceFromLocalPawn, 12.f, 20.f);
|
||||
float PrimaryThicknessMultiplier = Math::CalculateInterpolatedValue(75.f, CurrentPlayer.DistanceFromLocalPawn, 1.f, 3.f);
|
||||
float SecondaryThicknessMultiplier = Math::CalculateInterpolatedValue(75.f, CurrentPlayer.DistanceFromLocalPawn, 1.f, 2.f);
|
||||
|
||||
float PrimaryThickness = 1.f * PrimaryThicknessMultiplier;
|
||||
float SecondaryThickness = 1.f * SecondaryThicknessMultiplier;
|
||||
float PrimaryThickness = 1.f * PrimaryThicknessMultiplier;
|
||||
float SecondaryThickness = 1.f * SecondaryThicknessMultiplier;
|
||||
|
||||
SDK::FLinearColor PrimaryColor = SDK::FLinearColor(1.f, 1.f, 1.f, 1.f);
|
||||
if (CurrentPlayer.IsAnyBoneVisible)
|
||||
{
|
||||
PrimaryColor = SDK::FLinearColor(1.f, 0.f, 0.f, 1.f);
|
||||
}
|
||||
SDK::FLinearColor PrimaryColor = SDK::FLinearColor(1.f, 1.f, 1.f, 1.f);
|
||||
if (CurrentPlayer.IsAnyBoneVisible) {
|
||||
PrimaryColor = SDK::FLinearColor(1.f, 0.f, 0.f, 1.f);
|
||||
}
|
||||
|
||||
SDK::FLinearColor SecondaryColor = SDK::FLinearColor(1.0f, 0.f, 0.f, 1.0f);
|
||||
if (CurrentPlayer.IsAnyBoneVisible)
|
||||
{
|
||||
SecondaryColor = SDK::FLinearColor(0.0f, 1.f, 1.f, 1.0f);
|
||||
}
|
||||
SDK::FLinearColor SecondaryColor = SDK::FLinearColor(1.0f, 0.f, 0.f, 1.0f);
|
||||
if (CurrentPlayer.IsAnyBoneVisible) {
|
||||
SecondaryColor = SDK::FLinearColor(0.0f, 1.f, 1.f, 1.0f);
|
||||
}
|
||||
|
||||
if (CurrentPlayer.IsPlayerVisibleOnScreen)
|
||||
{
|
||||
if (Config::Visuals::Players::Enabled)
|
||||
{
|
||||
if (Config::Visuals::Players::Skeleton)
|
||||
{
|
||||
for (const auto& Pair : Features::FortPawnHelper::Bone::SkeletonBonePairs)
|
||||
{
|
||||
int BoneIDs[2] = { (int)Pair.first, (int)Pair.second };
|
||||
SDK::FVector2D ScreenPos[2];
|
||||
if (CurrentPlayer.IsPlayerVisibleOnScreen){
|
||||
if (Config::Visuals::Players::Enabled) {
|
||||
if (Config::Visuals::Players::Skeleton) {
|
||||
for (const auto& Pair : Features::FortPawnHelper::Bone::SkeletonBonePairs) {
|
||||
int BoneIDs[2] = { (int)Pair.first, (int)Pair.second };
|
||||
SDK::FVector2D ScreenPos[2];
|
||||
|
||||
bool BoneVisibleToPlayer = false;
|
||||
bool BoneVisibleToPlayer = false;
|
||||
|
||||
if (Math::IsOnScreen(ScreenPos[0]) == false && Math::IsOnScreen(ScreenPos[1]) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Math::IsOnScreen(ScreenPos[0]) == false && Math::IsOnScreen(ScreenPos[1]) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 1; ++i)
|
||||
{
|
||||
int BoneID = BoneIDs[i];
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
int BoneID = BoneIDs[i];
|
||||
|
||||
if (BoneID <= Features::FortPawnHelper::Bone::None || BoneID >= Features::FortPawnHelper::Bone::BONEID_MAX)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (BoneID <= Features::FortPawnHelper::Bone::None || BoneID >= Features::FortPawnHelper::Bone::BONEID_MAX) {
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenPos[i] = CurrentPlayer.BonePositions2D[BoneID];
|
||||
ScreenPos[i] = CurrentPlayer.BonePositions2D[BoneID];
|
||||
|
||||
if (CurrentPlayer.BoneVisibilityStates[BoneID])
|
||||
{
|
||||
BoneVisibleToPlayer = true;
|
||||
}
|
||||
}
|
||||
if (CurrentPlayer.BoneVisibilityStates[BoneID]) {
|
||||
BoneVisibleToPlayer = true;
|
||||
}
|
||||
}
|
||||
|
||||
Drawing::Line(
|
||||
SDK::FVector2D(ScreenPos[0].X, ScreenPos[0].Y),
|
||||
SDK::FVector2D(ScreenPos[1].X, ScreenPos[1].Y),
|
||||
SecondaryThicknessMultiplier,
|
||||
Config::Visuals::Players::IndividualBoneVisibilities ? BoneVisibleToPlayer ? SDK::FLinearColor(0.0f, 1.f, 1.f, 1.0f) : SDK::FLinearColor(1.0f, 0.f, 0.f, 1.0f) : SecondaryColor,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
Drawing::Line(
|
||||
SDK::FVector2D(ScreenPos[0].X, ScreenPos[0].Y),
|
||||
SDK::FVector2D(ScreenPos[1].X, ScreenPos[1].Y),
|
||||
SecondaryThicknessMultiplier,
|
||||
Config::Visuals::Players::IndividualBoneVisibilities ? BoneVisibleToPlayer ? SDK::FLinearColor(0.0f, 1.f, 1.f, 1.0f) : SDK::FLinearColor(1.0f, 0.f, 0.f, 1.0f) : SecondaryColor,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Visuals::Players::Box)
|
||||
{
|
||||
switch (Config::Visuals::Players::BoxType)
|
||||
{
|
||||
case ConfigTypes::BoxType::Full3D:
|
||||
// ADD THIS LATER
|
||||
break;
|
||||
case ConfigTypes::BoxType::Cornered3D:
|
||||
// ADD THIS LATER
|
||||
break;
|
||||
case ConfigTypes::BoxType::Full2D:
|
||||
Drawing::Rect(TopLeft, SDK::FVector2D(BottomRight - TopLeft), PrimaryThickness, PrimaryColor, true);
|
||||
break;
|
||||
case ConfigTypes::BoxType::Cornered2D:
|
||||
Drawing::CorneredRect(TopLeft, SDK::FVector2D(BottomRight - TopLeft), PrimaryThickness, PrimaryColor, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Config::Visuals::Players::Box) {
|
||||
switch (Config::Visuals::Players::BoxType) {
|
||||
case ConfigTypes::BoxType::Full3D:
|
||||
// ADD THIS LATER
|
||||
break;
|
||||
case ConfigTypes::BoxType::Cornered3D:
|
||||
// ADD THIS LATER
|
||||
break;
|
||||
case ConfigTypes::BoxType::Full2D:
|
||||
Drawing::Rect(TopLeft, SDK::FVector2D(BottomRight - TopLeft), PrimaryThickness, PrimaryColor, true);
|
||||
break;
|
||||
case ConfigTypes::BoxType::Cornered2D:
|
||||
Drawing::CorneredRect(TopLeft, SDK::FVector2D(BottomRight - TopLeft), PrimaryThickness, PrimaryColor, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Visuals::Players::Name)
|
||||
{
|
||||
// Text position at the top of the box
|
||||
SDK::FVector2D PlayerNameTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, TopLeft.Y - FontSize - 2);
|
||||
if (Config::Visuals::Players::Name) {
|
||||
// Text position at the top of the box
|
||||
SDK::FVector2D PlayerNameTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, TopLeft.Y - FontSize - 2);
|
||||
|
||||
Drawing::Text(CurrentPlayer.PlayerName.ToString().c_str(), PlayerNameTextPos, FontSize, PrimaryColor, true, false, true);
|
||||
}
|
||||
Drawing::Text(CurrentPlayer.PlayerName.ToString().c_str(), PlayerNameTextPos, FontSize, PrimaryColor, true, false, true);
|
||||
}
|
||||
|
||||
if (Config::Visuals::Players::Distance)
|
||||
{
|
||||
// Text position at the bottom of the box
|
||||
SDK::FVector2D PlayerDistanceTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, BottomRight.Y + 2);
|
||||
if (Config::Visuals::Players::Distance) {
|
||||
// Text position at the bottom of the box
|
||||
SDK::FVector2D PlayerDistanceTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, BottomRight.Y + 2);
|
||||
|
||||
// Cast to int to remove decimal places
|
||||
std::string DistanceString = skCrypt("[ ").decrypt() + std::to_string((int)CurrentPlayer.DistanceFromLocalPawn) + skCrypt(" m ]").decrypt();
|
||||
Drawing::Text(DistanceString.c_str(), PlayerDistanceTextPos, FontSize, PrimaryColor, true, false, true);
|
||||
}
|
||||
// Cast to int to remove decimal places
|
||||
std::string DistanceString = skCrypt("[ ").decrypt() + std::to_string((int)CurrentPlayer.DistanceFromLocalPawn) + skCrypt(" m ]").decrypt();
|
||||
Drawing::Text(DistanceString.c_str(), PlayerDistanceTextPos, FontSize, PrimaryColor, true, false, true);
|
||||
}
|
||||
|
||||
if (Config::Visuals::Players::CurrentWeapon) {
|
||||
if (CurrentWeapon) {
|
||||
std::string WeaponDisplayName = CurrentWeapon->WeaponData()->DisplayName().ToString();
|
||||
int CurrentAmmoCount = CurrentWeapon->AmmoCount();
|
||||
|
||||
if (Config::Visuals::Players::CurrentWeapon)
|
||||
{
|
||||
if (CurrentWeapon)
|
||||
{
|
||||
std::string WeaponDisplayName = CurrentWeapon->WeaponData()->DisplayName().ToString();
|
||||
int CurrentAmmoCount = CurrentWeapon->AmmoCount();
|
||||
// Add the ammo count to the weapon display name (only if the clip isn't infinite)
|
||||
if (CurrentPlayer.BulletsPerClip != 0) {
|
||||
WeaponDisplayName += std::string(skCrypt(" [ ")) + std::to_string(CurrentAmmoCount) + std::string(skCrypt(" / ")) + std::to_string(CurrentPlayer.BulletsPerClip) + std::string(skCrypt(" ]"));
|
||||
}
|
||||
|
||||
// Add the ammo count to the weapon display name (only if the clip isn't infinite)
|
||||
if (CurrentPlayer.BulletsPerClip != 0)
|
||||
{
|
||||
WeaponDisplayName += std::string(skCrypt(" [ ")) + std::to_string(CurrentAmmoCount) + std::string(skCrypt(" / ")) + std::to_string(CurrentPlayer.BulletsPerClip) + std::string(skCrypt(" ]"));
|
||||
}
|
||||
SDK::FVector2D WeaponTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, BottomRight.Y);
|
||||
WeaponTextPos.Y += Config::Visuals::Players::Distance ? FontSize + 1 : 0;
|
||||
|
||||
SDK::FVector2D WeaponTextPos = SDK::FVector2D(TopLeft.X + (BottomRight.X - TopLeft.X) / 2, BottomRight.Y);
|
||||
WeaponTextPos.Y += Config::Visuals::Players::Distance ? FontSize + 1 : 0;
|
||||
Drawing::Text(WeaponDisplayName.c_str(), WeaponTextPos, FontSize, CurrentWeapon->WeaponData()->GetRarityColor(), true, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Config::Visuals::Players::Enabled) {
|
||||
if (Config::Visuals::Players::OffScreenIndicators::Enabled) {
|
||||
SDK::FVector2D TipPoint, BasePoint1, BasePoint2;
|
||||
|
||||
Drawing::Text(WeaponDisplayName.c_str(), WeaponTextPos, FontSize, CurrentWeapon->WeaponData()->GetRarityColor(), true, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Config::Visuals::Players::Enabled)
|
||||
{
|
||||
if (Config::Visuals::Players::OffScreenIndicators::Enabled)
|
||||
{
|
||||
SDK::FVector2D TipPoint, BasePoint1, BasePoint2;
|
||||
// Calculate offscreen indicator triangle points
|
||||
{
|
||||
// TO-DO: Cache this so we don't have to get the head pos twice per tick
|
||||
const SDK::FVector HeadPosition = CurrentPlayer.BonePositions3D[Features::FortPawnHelper::Bone::Head];
|
||||
SDK::FVector HeadPosition2D = SDK::Project3D(HeadPosition);
|
||||
|
||||
// Calculate offscreen indicator triangle points
|
||||
{
|
||||
// TO-DO: Cache this so we don't have to get the head pos twice per tick
|
||||
const SDK::FVector HeadPosition = CurrentPlayer.BonePositions3D[Features::FortPawnHelper::Bone::Head];
|
||||
SDK::FVector HeadPosition2D = SDK::Project3D(HeadPosition);
|
||||
// Calculate the indicator's position
|
||||
float Radius = Config::Visuals::Players::OffScreenIndicators::CopyAimbotFOV ? Actors::CurrentFOVSizePixels : Config::Visuals::Players::OffScreenIndicators::FOV * Game::PixelsPerDegree;
|
||||
SDK::FVector2D DirectionToPlayer = SDK::FVector2D(HeadPosition2D.X - Game::ScreenCenterX, HeadPosition2D.Y - Game::ScreenCenterY);
|
||||
float Magnitude = std::sqrt(DirectionToPlayer.X * DirectionToPlayer.X + DirectionToPlayer.Y * DirectionToPlayer.Y);
|
||||
DirectionToPlayer = DirectionToPlayer / Magnitude;
|
||||
|
||||
// Calculate the indicator's position
|
||||
float Radius = Config::Visuals::Players::OffScreenIndicators::CopyAimbotFOV ? Actors::CurrentFOVSizePixels : Config::Visuals::Players::OffScreenIndicators::FOV * Game::PixelsPerDegree;
|
||||
SDK::FVector2D DirectionToPlayer = SDK::FVector2D(HeadPosition2D.X - Game::ScreenCenterX, HeadPosition2D.Y - Game::ScreenCenterY);
|
||||
float Magnitude = std::sqrt(DirectionToPlayer.X * DirectionToPlayer.X + DirectionToPlayer.Y * DirectionToPlayer.Y);
|
||||
DirectionToPlayer = DirectionToPlayer / Magnitude;
|
||||
float Angle = std::atan2(DirectionToPlayer.Y, DirectionToPlayer.X);
|
||||
SDK::FVector2D IndicatorPosition = {
|
||||
Game::ScreenCenterX + std::cos(Angle) * Radius,
|
||||
Game::ScreenCenterY + std::sin(Angle) * Radius
|
||||
};
|
||||
|
||||
float Angle = std::atan2(DirectionToPlayer.Y, DirectionToPlayer.X);
|
||||
SDK::FVector2D IndicatorPosition = {
|
||||
Game::ScreenCenterX + std::cos(Angle) * Radius,
|
||||
Game::ScreenCenterY + std::sin(Angle) * Radius
|
||||
};
|
||||
// Calculate the points for the indicator triangle
|
||||
TipPoint = IndicatorPosition + DirectionToPlayer * Config::Visuals::Players::OffScreenIndicators::Height;
|
||||
BasePoint1 = IndicatorPosition + SDK::FVector2D(-DirectionToPlayer.Y, DirectionToPlayer.X) * Config::Visuals::Players::OffScreenIndicators::Width;
|
||||
BasePoint2 = IndicatorPosition - SDK::FVector2D(-DirectionToPlayer.Y, DirectionToPlayer.X) * Config::Visuals::Players::OffScreenIndicators::Width;
|
||||
|
||||
// Calculate the points for the indicator triangle
|
||||
TipPoint = IndicatorPosition + DirectionToPlayer * Config::Visuals::Players::OffScreenIndicators::Height;
|
||||
BasePoint1 = IndicatorPosition + SDK::FVector2D(-DirectionToPlayer.Y, DirectionToPlayer.X) * Config::Visuals::Players::OffScreenIndicators::Width;
|
||||
BasePoint2 = IndicatorPosition - SDK::FVector2D(-DirectionToPlayer.Y, DirectionToPlayer.X) * Config::Visuals::Players::OffScreenIndicators::Width;
|
||||
}
|
||||
|
||||
}
|
||||
SDK::FLinearColor IndicatorColor = CurrentPlayer.IsAnyBoneVisible ? SDK::FLinearColor(0.2f, 1.f, 0.2f, 1.f) : SDK::FLinearColor(1.f, 0.2f, 0.2f, 1.f);
|
||||
Drawing::Triangle(BasePoint1, BasePoint2, TipPoint, 1.f, IndicatorColor, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
SDK::FLinearColor IndicatorColor = CurrentPlayer.IsAnyBoneVisible ? SDK::FLinearColor(0.2f, 1.f, 0.2f, 1.f) : SDK::FLinearColor(1.f, 0.2f, 0.2f, 1.f);
|
||||
Drawing::Triangle(BasePoint1, BasePoint2, TipPoint, 1.f, IndicatorColor, true, true);
|
||||
}
|
||||
}
|
||||
// Aimbot
|
||||
if (Config::Aimbot::Enabled && SDK::GetLocalPawn()) {
|
||||
if ((CurrentPlayer.IsAnyBoneVisible || Config::Aimbot::VisibleCheck == false || Config::Aimbot::BulletTP == true || Config::Aimbot::BulletTPV2 == true) && ((MainTarget.LocalInfo.IsTargeting == false || Config::Aimbot::StickyAim == false) || MainTarget.GlobalInfo.TargetActor == nullptr)) {
|
||||
Features::Aimbot::Target PotentialNewTarget{};
|
||||
|
||||
// Aimbot
|
||||
if (Config::Aimbot::Enabled && SDK::GetLocalPawn())
|
||||
{
|
||||
if ((CurrentPlayer.IsAnyBoneVisible || Config::Aimbot::VisibleCheck == false || Config::Aimbot::BulletTP == true || Config::Aimbot::BulletTPV2 == true) && ((MainTarget.LocalInfo.IsTargeting == false || Config::Aimbot::StickyAim == false) || MainTarget.GlobalInfo.TargetActor == nullptr))
|
||||
{
|
||||
Features::Aimbot::Target PotentialNewTarget{};
|
||||
Features::Aimbot::PlayerTarget::UpdateTargetInfo(PotentialNewTarget, CurrentPlayer, MainCamera, AimbotCamera);
|
||||
MainTarget.SetTarget(PotentialNewTarget);
|
||||
}
|
||||
|
||||
Features::Aimbot::PlayerTarget::UpdateTargetInfo(PotentialNewTarget, CurrentPlayer, MainCamera, AimbotCamera);
|
||||
MainTarget.SetTarget(PotentialNewTarget);
|
||||
}
|
||||
if (MainTarget.GlobalInfo.TargetActor == FortPawn) {
|
||||
if (CurrentPlayer.IsAnyBoneVisible == false && (Config::Aimbot::VisibleCheck == true && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false)) {
|
||||
MainTarget.ResetTarget();
|
||||
}
|
||||
else {
|
||||
SeenTarget = true;
|
||||
|
||||
if (MainTarget.GlobalInfo.TargetActor == FortPawn)
|
||||
{
|
||||
if (CurrentPlayer.IsAnyBoneVisible == false && (Config::Aimbot::VisibleCheck == true && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false))
|
||||
{
|
||||
MainTarget.ResetTarget();
|
||||
}
|
||||
else
|
||||
{
|
||||
SeenTarget = true;
|
||||
Features::Aimbot::PlayerTarget::UpdateTargetInfo(MainTarget, CurrentPlayer, MainCamera, AimbotCamera, FPSScale);
|
||||
Features::Aimbot::AimbotTarget(MainTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Features::Aimbot::PlayerTarget::UpdateTargetInfo(MainTarget, CurrentPlayer, MainCamera, AimbotCamera, FPSScale);
|
||||
Features::Aimbot::AimbotTarget(MainTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::ClosePlayer
|
||||
|| MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::FarPlayer)
|
||||
{
|
||||
MainTarget.TargetTick(SeenTarget);
|
||||
}
|
||||
if (MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::ClosePlayer
|
||||
|| MainTarget.GlobalInfo.Type == Features::Aimbot::Target::TargetType::FarPlayer) {
|
||||
MainTarget.TargetTick(SeenTarget);
|
||||
}
|
||||
}
|
||||
@@ -17,118 +17,103 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
void Actors::FortPickup::Tick()
|
||||
{
|
||||
for (int i = 0; i < CachedWeapons.Num(); i++)
|
||||
{
|
||||
Features::Visuals::ChamManagerFortPickup::Manager->Tick(CachedWeapons[i]);
|
||||
void Actors::FortPickup::Tick() {
|
||||
for (int i = 0; i < CachedWeapons.Num(); i++) {
|
||||
Features::Visuals::ChamManagerFortPickup::Manager->Tick(CachedWeapons[i]);
|
||||
|
||||
if (Config::Visuals::Weapons::Enabled)
|
||||
{
|
||||
if (!CachedWeapons.IsValidIndex(i)) continue;
|
||||
if (Config::Visuals::Weapons::Enabled) {
|
||||
if (!CachedWeapons.IsValidIndex(i)) continue;
|
||||
|
||||
SDK::AActor* Actor = CachedWeapons[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AActor* Actor = CachedWeapons[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
if (RootPosition.Distance(Actors::LocalPawnCache.Position) / 100 > Config::Visuals::Weapons::MaxDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
if (RootPosition.Distance(Actors::LocalPawnCache.Position) / 100 > Config::Visuals::Weapons::MaxDistance) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SDK::FVector2D Project = SDK::Project(RootPosition);
|
||||
if (Math::IsOnScreen(Project) == false) continue;
|
||||
SDK::FVector2D Project = SDK::Project(RootPosition);
|
||||
if (Math::IsOnScreen(Project) == false) continue;
|
||||
|
||||
SDK::AFortPickup* FortPickup = SDK::Cast<SDK::AFortPickup>(Actor); if (SDK::IsValidPointer(FortPickup) == false) continue;
|
||||
SDK::AFortPickup* FortPickup = SDK::Cast<SDK::AFortPickup>(Actor); if (SDK::IsValidPointer(FortPickup) == false) continue;
|
||||
|
||||
SDK::FFortItemEntry* FortItemEntry = FortPickup->PrimaryPickupItemEntry(); if (SDK::IsValidPointer(FortItemEntry) == false) continue;
|
||||
SDK::UFortItemDefinition* FortItemDefinition = FortItemEntry->ItemDefinition(); if (SDK::IsValidPointer(FortItemDefinition) == false) continue;
|
||||
SDK::FFortItemEntry* FortItemEntry = FortPickup->PrimaryPickupItemEntry(); if (SDK::IsValidPointer(FortItemEntry) == false) continue;
|
||||
SDK::UFortItemDefinition* FortItemDefinition = FortItemEntry->ItemDefinition(); if (SDK::IsValidPointer(FortItemDefinition) == false) continue;
|
||||
|
||||
SDK::FText WeaponName = FortItemDefinition->DisplayName();
|
||||
SDK::FText WeaponName = FortItemDefinition->DisplayName();
|
||||
|
||||
if (WeaponName.Data && WeaponName.Data->Name && WeaponName.Data->Length > 0)
|
||||
{
|
||||
SDK::EFortItemTier Rarity = FortItemDefinition->Tier();
|
||||
if (WeaponName.Data && WeaponName.Data->Name && WeaponName.Data->Length > 0) {
|
||||
SDK::EFortItemTier Rarity = FortItemDefinition->Tier();
|
||||
|
||||
SDK::FLinearColor WeaponColor = FortItemDefinition->GetRarityColor();
|
||||
SDK::FLinearColor WeaponColor = FortItemDefinition->GetRarityColor();
|
||||
|
||||
Drawing::Text(WeaponName.ToString().c_str(), Project, 16.f, WeaponColor, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Drawing::Text(WeaponName.ToString().c_str(), Project, 16.f, WeaponColor, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Exploits::Pickup::AutoPickup || Input::WasKeyJustPressed((Input::KeyName)Config::Exploits::Pickup::PickupAllKey))
|
||||
{
|
||||
if (Config::Exploits::Pickup::AutoPickup)
|
||||
{
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - LastAutoPickupTime).count();
|
||||
if (Config::Exploits::Pickup::AutoPickup || Input::WasKeyJustPressed((Input::KeyName)Config::Exploits::Pickup::PickupAllKey)) {
|
||||
if (Config::Exploits::Pickup::AutoPickup) {
|
||||
double ElapsedTime = std::chrono::duration_cast<std::chrono::duration<double>>(Game::CurrentTime - LastAutoPickupTime).count();
|
||||
|
||||
if (ElapsedTime < (Config::Exploits::Pickup::AutoPickupDelaySecs))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ElapsedTime < (Config::Exploits::Pickup::AutoPickupDelaySecs)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LastAutoPickupTime = Game::CurrentTime;
|
||||
LastAutoPickupTime = Game::CurrentTime;
|
||||
|
||||
struct OrderedWeaponsType
|
||||
{
|
||||
SDK::AActor* Actor;
|
||||
float DistanceFromLocal;
|
||||
};
|
||||
struct OrderedWeaponsType {
|
||||
SDK::AActor* Actor;
|
||||
float DistanceFromLocal;
|
||||
};
|
||||
|
||||
std::vector<OrderedWeaponsType> OrderedWeapons;
|
||||
for (int i = 0; i < CachedWeapons.Num(); i++)
|
||||
{
|
||||
if (!CachedWeapons.IsValidIndex(i)) continue;
|
||||
std::vector<OrderedWeaponsType> OrderedWeapons;
|
||||
for (int i = 0; i < CachedWeapons.Num(); i++) {
|
||||
if (!CachedWeapons.IsValidIndex(i)) continue;
|
||||
|
||||
SDK::AActor* Actor = CachedWeapons[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AActor* Actor = CachedWeapons[i]; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
float DistanceFromLocal = RootPosition.Distance(Actors::LocalPawnCache.Position);
|
||||
if (DistanceFromLocal / 100 >= Config::Exploits::Pickup::MaxDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
SDK::FVector RootPosition = Actor->RootComponent()->RelativeLocation();
|
||||
float DistanceFromLocal = RootPosition.Distance(Actors::LocalPawnCache.Position);
|
||||
if (DistanceFromLocal / 100 >= Config::Exploits::Pickup::MaxDistance) {
|
||||
continue;
|
||||
}
|
||||
|
||||
OrderedWeaponsType OrderedWeapon;
|
||||
OrderedWeapon.Actor = Actor;
|
||||
OrderedWeapon.DistanceFromLocal = DistanceFromLocal / 100;
|
||||
OrderedWeaponsType OrderedWeapon;
|
||||
OrderedWeapon.Actor = Actor;
|
||||
OrderedWeapon.DistanceFromLocal = DistanceFromLocal / 100;
|
||||
|
||||
OrderedWeapons.push_back(OrderedWeapon);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Pickup::PrioritizeFarthestWeapons)
|
||||
{
|
||||
// Order so that the farthest weapons are first
|
||||
std::sort(OrderedWeapons.begin(), OrderedWeapons.end(), [](const OrderedWeaponsType& a, const OrderedWeaponsType& b) {
|
||||
return a.DistanceFromLocal > b.DistanceFromLocal;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Order so that the closest weapons are first
|
||||
std::sort(OrderedWeapons.begin(), OrderedWeapons.end(), [](const OrderedWeaponsType& a, const OrderedWeaponsType& b) {
|
||||
return a.DistanceFromLocal < b.DistanceFromLocal;
|
||||
});
|
||||
}
|
||||
OrderedWeapons.push_back(OrderedWeapon);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Pickup::PrioritizeFarthestWeapons) {
|
||||
// Order so that the farthest weapons are first
|
||||
std::sort(OrderedWeapons.begin(), OrderedWeapons.end(), [](const OrderedWeaponsType& a, const OrderedWeaponsType& b) {
|
||||
return a.DistanceFromLocal > b.DistanceFromLocal;
|
||||
});
|
||||
}
|
||||
else {
|
||||
// Order so that the closest weapons are first
|
||||
std::sort(OrderedWeapons.begin(), OrderedWeapons.end(), [](const OrderedWeaponsType& a, const OrderedWeaponsType& b) {
|
||||
return a.DistanceFromLocal < b.DistanceFromLocal;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ItemsPickedUp = 0;
|
||||
int ItemsPickedUp = 0;
|
||||
|
||||
for (auto OrderedWeapon : OrderedWeapons)
|
||||
{
|
||||
SDK::AActor* Actor = OrderedWeapon.Actor; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AFortPickup* FortPickup = reinterpret_cast<SDK::AFortPickup*>(Actor); if (SDK::IsValidPointer(FortPickup) == false) continue;
|
||||
for (auto OrderedWeapon : OrderedWeapons) {
|
||||
SDK::AActor* Actor = OrderedWeapon.Actor; if (SDK::IsValidPointer(Actor) == false) continue;
|
||||
SDK::AFortPickup* FortPickup = reinterpret_cast<SDK::AFortPickup*>(Actor); if (SDK::IsValidPointer(FortPickup) == false) continue;
|
||||
|
||||
SDK::Cast<SDK::AFortPawn>(SDK::GetLocalPawn())->ServerHandlePickup(FortPickup, 0.1f, SDK::FVector(), false);
|
||||
SDK::Cast<SDK::AFortPawn>(SDK::GetLocalPawn())->ServerHandlePickup(FortPickup, 0.1f, SDK::FVector(), false);
|
||||
|
||||
ItemsPickedUp++;
|
||||
ItemsPickedUp++;
|
||||
|
||||
if (ItemsPickedUp >= Config::Exploits::Pickup::MaxItems)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ItemsPickedUp >= Config::Exploits::Pickup::MaxItems) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,91 +6,78 @@
|
||||
|
||||
#include "../../Actors/Actors.h"
|
||||
|
||||
void Features::Aimbot::AimbotTarget(Target& TargetToAimot)
|
||||
{
|
||||
if (Input::IsKeyDown((Input::KeyName)Config::Aimbot::AimKey))
|
||||
{
|
||||
TargetToAimot.LocalInfo.IsTargeting = true;
|
||||
void Features::Aimbot::AimbotTarget(Target& TargetToAimot) {
|
||||
if (Input::IsKeyDown((Input::KeyName)Config::Aimbot::AimKey)) {
|
||||
TargetToAimot.LocalInfo.IsTargeting = true;
|
||||
|
||||
// We don't need to aimbot the target if using SilentAim or BulletTP
|
||||
if (Config::Aimbot::SilentAim == false && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false)
|
||||
{
|
||||
SDK::GetLocalController()->AddPitchInput(TargetToAimot.LocalInfo.TargetRotationChangeWithSmooth.Pitch / SDK::GetLocalController()->InputPitchScale());
|
||||
SDK::GetLocalController()->AddYawInput(TargetToAimot.LocalInfo.TargetRotationChangeWithSmooth.Yaw / SDK::GetLocalController()->InputYawScale());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetToAimot.LocalInfo.IsTargeting = false;
|
||||
}
|
||||
// We don't need to aimbot the target if using SilentAim or BulletTP
|
||||
if (Config::Aimbot::SilentAim == false && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false) {
|
||||
SDK::GetLocalController()->AddPitchInput(TargetToAimot.LocalInfo.TargetRotationChangeWithSmooth.Pitch / SDK::GetLocalController()->InputPitchScale());
|
||||
SDK::GetLocalController()->AddYawInput(TargetToAimot.LocalInfo.TargetRotationChangeWithSmooth.Yaw / SDK::GetLocalController()->InputYawScale());
|
||||
}
|
||||
}
|
||||
else {
|
||||
TargetToAimot.LocalInfo.IsTargeting = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::CalculateShotCallback(SDK::FTransform* BulletTransform)
|
||||
{
|
||||
if (Config::Aimbot::BulletTP && Actors::MainTarget.GlobalInfo.TargetActor)
|
||||
{
|
||||
SDK::FVector Position = Actors::MainTarget.GlobalInfo.TargetBonePosition;
|
||||
Position.Z += 10.f; // Add 0.01 meters to the Z axis to make sue it always hits the correct bone
|
||||
void Features::Aimbot::CalculateShotCallback(SDK::FTransform* BulletTransform) {
|
||||
if (Config::Aimbot::BulletTP && Actors::MainTarget.GlobalInfo.TargetActor) {
|
||||
SDK::FVector Position = Actors::MainTarget.GlobalInfo.TargetBonePosition;
|
||||
Position.Z += 10.f; // Add 0.01 meters to the Z axis to make sue it always hits the correct bone
|
||||
|
||||
BulletTransform->Translation = Position;
|
||||
}
|
||||
BulletTransform->Translation = Position;
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::RaycastMultiCallback(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::ECollisionChannel TraceChannel)
|
||||
{
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor && Config::Aimbot::BulletTPV2)
|
||||
{
|
||||
// Only modify the line trace for the bullet
|
||||
if (TraceChannel != SDK::ECollisionChannel::ECC_GameTraceChannel7) return;
|
||||
void Features::Aimbot::RaycastMultiCallback(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, SDK::ECollisionChannel TraceChannel) {
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor && Config::Aimbot::BulletTPV2) {
|
||||
// Only modify the line trace for the bullet
|
||||
if (TraceChannel != SDK::ECollisionChannel::ECC_GameTraceChannel7) return;
|
||||
|
||||
for (int i = 0; i < OutHits.Num(); i++)
|
||||
{
|
||||
SDK::FHitResult OutHit = OutHits[i];
|
||||
for (int i = 0; i < OutHits.Num(); i++) {
|
||||
SDK::FHitResult OutHit = OutHits[i];
|
||||
|
||||
// Prepare data for our own line trace
|
||||
SDK::TArray<SDK::AActor*> ActorsToIgnore;
|
||||
SDK::FVector Position = Actors::MainTarget.GlobalInfo.TargetBonePosition;
|
||||
Position.Z += 100.f; // Add 0.1 meters to the Z axis to make sure it always hits the correct bone
|
||||
// Prepare data for our own line trace
|
||||
SDK::TArray<SDK::AActor*> ActorsToIgnore;
|
||||
SDK::FVector Position = Actors::MainTarget.GlobalInfo.TargetBonePosition;
|
||||
Position.Z += 100.f; // Add 0.1 meters to the Z axis to make sure it always hits the correct bone
|
||||
|
||||
// Save the original start position of the RaycastMulti
|
||||
SDK::FVector OriginalStart = OutHits[i].TraceStart();
|
||||
// Save the original start position of the RaycastMulti
|
||||
SDK::FVector OriginalStart = OutHits[i].TraceStart();
|
||||
|
||||
// Run our own line trace that is guaranteed to hit the target bone
|
||||
SDK::UKismetSystemLibrary::LineTraceSingle(World, Position, Actors::MainTarget.GlobalInfo.TargetBonePosition, (SDK::ETraceTypeQuery)TraceChannel, true, ActorsToIgnore, SDK::EDrawDebugTrace::None, OutHit, false, SDK::FLinearColor(), SDK::FLinearColor(), 0.f);
|
||||
// Run our own line trace that is guaranteed to hit the target bone
|
||||
SDK::UKismetSystemLibrary::LineTraceSingle(World, Position, Actors::MainTarget.GlobalInfo.TargetBonePosition, (SDK::ETraceTypeQuery)TraceChannel, true, ActorsToIgnore, SDK::EDrawDebugTrace::None, OutHit, false, SDK::FLinearColor(), SDK::FLinearColor(), 0.f);
|
||||
|
||||
// Revert some data back to the original RaycastMulti (to avoid some possible detections)
|
||||
OutHit.SetTraceStart(OriginalStart);
|
||||
OutHit.SetDistance(OriginalStart.Distance(Actors::MainTarget.GlobalInfo.TargetBonePosition));
|
||||
// Revert some data back to the original RaycastMulti (to avoid some possible detections)
|
||||
OutHit.SetTraceStart(OriginalStart);
|
||||
OutHit.SetDistance(OriginalStart.Distance(Actors::MainTarget.GlobalInfo.TargetBonePosition));
|
||||
|
||||
// Set the new hit result
|
||||
OutHits[i] = OutHit;
|
||||
}
|
||||
}
|
||||
// Set the new hit result
|
||||
OutHits[i] = OutHit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::GetViewpointCallback(SDK::FMinimalViewInfo* OutViewInfo)
|
||||
{
|
||||
if (Config::Aimbot::SilentAim == false) return;
|
||||
if (!Actors::MainTarget.LocalInfo.IsTargeting == false && Config::Aimbot::UseAimKeyForSilent) return;
|
||||
void Features::Aimbot::GetViewpointCallback(SDK::FMinimalViewInfo* OutViewInfo) {
|
||||
if (Config::Aimbot::SilentAim == false) return;
|
||||
if (!Actors::MainTarget.LocalInfo.IsTargeting == false && Config::Aimbot::UseAimKeyForSilent) return;
|
||||
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor)
|
||||
{
|
||||
// This function is called when gettting the camera viewpoint for rendering
|
||||
// Revert the cameras location and rotation to the original values
|
||||
OutViewInfo->SetRotation(Actors::MainCamera.Rotation);
|
||||
OutViewInfo->SetLocation(Actors::MainCamera.Position);
|
||||
}
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor) {
|
||||
// This function is called when gettting the camera viewpoint for rendering
|
||||
// Revert the cameras location and rotation to the original values
|
||||
OutViewInfo->SetRotation(Actors::MainCamera.Rotation);
|
||||
OutViewInfo->SetLocation(Actors::MainCamera.Position);
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::GetPlayerViewpointCallback(SDK::FVector* Location, SDK::FRotator* Rotation)
|
||||
{
|
||||
if (Config::Aimbot::SilentAim == false) return;
|
||||
if (Actors::MainTarget.LocalInfo.IsTargeting == false && Config::Aimbot::UseAimKeyForSilent) return;
|
||||
void Features::Aimbot::GetPlayerViewpointCallback(SDK::FVector* Location, SDK::FRotator* Rotation) {
|
||||
if (Config::Aimbot::SilentAim == false) return;
|
||||
if (Actors::MainTarget.LocalInfo.IsTargeting == false && Config::Aimbot::UseAimKeyForSilent) return;
|
||||
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor)
|
||||
{
|
||||
// This function is called when calculating bullet trajectories
|
||||
// Set the rotation to the target aimbot rotation
|
||||
*Rotation = Actors::MainTarget.LocalInfo.TargetRotationWithSmooth;
|
||||
}
|
||||
if (Actors::MainTarget.GlobalInfo.TargetActor) {
|
||||
// This function is called when calculating bullet trajectories
|
||||
// Set the rotation to the target aimbot rotation
|
||||
*Rotation = Actors::MainTarget.LocalInfo.TargetRotationWithSmooth;
|
||||
}
|
||||
}
|
||||
@@ -3,46 +3,44 @@
|
||||
|
||||
#include "../../SDK/Classes/Engine_Classes.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Aimbot
|
||||
{
|
||||
/*
|
||||
* @brief Aimot a player target
|
||||
*
|
||||
* @param TargetToAimot The target to aimot
|
||||
*/
|
||||
void AimbotTarget(Aimbot::Target& TargetToAimot);
|
||||
namespace Features {
|
||||
namespace Aimbot {
|
||||
/*
|
||||
* @brief Aimot a player target
|
||||
*
|
||||
* @param TargetToAimot The target to aimot
|
||||
*/
|
||||
void AimbotTarget(Aimbot::Target& TargetToAimot);
|
||||
|
||||
/*
|
||||
* @brief Callback for the CalculateShot hook (used for silent aim and bullet TP V1)
|
||||
*
|
||||
* @param ShotTransform The bullet transform
|
||||
*/
|
||||
void CalculateShotCallback(SDK::FTransform* BulletTransform);
|
||||
/*
|
||||
* @brief Callback for the CalculateShot hook (used for silent aim and bullet TP V1)
|
||||
*
|
||||
* @param ShotTransform The bullet transform
|
||||
*/
|
||||
void CalculateShotCallback(SDK::FTransform* BulletTransform);
|
||||
|
||||
/*
|
||||
* @brief Callback for the RaycastMulti hook (used for bullet TP V2)
|
||||
*
|
||||
* @param World The world (from the RaycastMulti hook)
|
||||
* @param OutHits The hit results (from the RaycastMulti hook)
|
||||
* @param TraceChannel The trace channel (from the RaycastMulti hook)
|
||||
*/
|
||||
void RaycastMultiCallback(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::ECollisionChannel TraceChannel);
|
||||
/*
|
||||
* @brief Callback for the RaycastMulti hook (used for bullet TP V2)
|
||||
*
|
||||
* @param World The world (from the RaycastMulti hook)
|
||||
* @param OutHits The hit results (from the RaycastMulti hook)
|
||||
* @param TraceChannel The trace channel (from the RaycastMulti hook)
|
||||
*/
|
||||
void RaycastMultiCallback(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, SDK::ECollisionChannel TraceChannel);
|
||||
|
||||
/*
|
||||
* @brief Callback for the GetViewpoint hook (used for silent aim)
|
||||
*
|
||||
* @param OutViewInfo The view info
|
||||
*/
|
||||
void GetViewpointCallback(SDK::FMinimalViewInfo* OutViewInfo);
|
||||
/*
|
||||
* @brief Callback for the GetViewpoint hook (used for silent aim)
|
||||
*
|
||||
* @param OutViewInfo The view info
|
||||
*/
|
||||
void GetViewpointCallback(SDK::FMinimalViewInfo* OutViewInfo);
|
||||
|
||||
/*
|
||||
* @brief Callback for the GetPlayerViewpoint hook (used for silent aim)
|
||||
*
|
||||
* @param Location The location of the camera
|
||||
* @param Rotation The rotation of the camera
|
||||
*/
|
||||
void GetPlayerViewpointCallback(SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
};
|
||||
/*
|
||||
* @brief Callback for the GetPlayerViewpoint hook (used for silent aim)
|
||||
*
|
||||
* @param Location The location of the camera
|
||||
* @param Rotation The rotation of the camera
|
||||
*/
|
||||
void GetPlayerViewpointCallback(SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
};
|
||||
}
|
||||
@@ -1,310 +1,277 @@
|
||||
#include "Target.h"
|
||||
|
||||
#include "../../../Configs/Config.h"
|
||||
#include "../../../Utilities/Math.h"
|
||||
#include "../../../Configs/Config.h"
|
||||
|
||||
#include "../FortPawnHelper/Bone.h"
|
||||
|
||||
#include "../../Game.h"
|
||||
|
||||
void Features::Aimbot::Target::UpdateLocalInfoAndType(Target& TargetToUpdate)
|
||||
{
|
||||
switch (TargetToUpdate.GlobalInfo.Type)
|
||||
{
|
||||
case TargetType::ClosePlayer:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::CloseAim::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::CloseAim::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::CloseAim::Smoothing;
|
||||
void Features::Aimbot::Target::UpdateLocalInfoAndType(Target& TargetToUpdate) {
|
||||
switch (TargetToUpdate.GlobalInfo.Type) {
|
||||
case TargetType::ClosePlayer:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::CloseAim::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::CloseAim::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::CloseAim::Smoothing;
|
||||
|
||||
if (TargetToUpdate.LocalInfo.DistanceFromPlayer > Config::Aimbot::CloseAim::Range || !Config::Aimbot::CloseAim::Enabled)
|
||||
{
|
||||
TargetToUpdate.GlobalInfo.Type = TargetType::FarPlayer;
|
||||
}
|
||||
break;
|
||||
case TargetType::FarPlayer:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Standard::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Standard::Smoothing;
|
||||
if (TargetToUpdate.LocalInfo.DistanceFromPlayer > Config::Aimbot::CloseAim::Range || !Config::Aimbot::CloseAim::Enabled) {
|
||||
TargetToUpdate.GlobalInfo.Type = TargetType::FarPlayer;
|
||||
}
|
||||
break;
|
||||
case TargetType::FarPlayer:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Standard::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Standard::Smoothing;
|
||||
|
||||
if (TargetToUpdate.LocalInfo.DistanceFromPlayer <= Config::Aimbot::CloseAim::Range && Config::Aimbot::CloseAim::Enabled)
|
||||
{
|
||||
TargetToUpdate.GlobalInfo.Type = TargetType::ClosePlayer;
|
||||
}
|
||||
break;
|
||||
case TargetType::Weakspot:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Weakspot::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Weakspot::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Weakspot::Smoothing;
|
||||
break;
|
||||
case TargetType::Other:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Standard::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Standard::Smoothing;
|
||||
break;
|
||||
}
|
||||
if (TargetToUpdate.LocalInfo.DistanceFromPlayer <= Config::Aimbot::CloseAim::Range && Config::Aimbot::CloseAim::Enabled) {
|
||||
TargetToUpdate.GlobalInfo.Type = TargetType::ClosePlayer;
|
||||
}
|
||||
break;
|
||||
case TargetType::Weakspot:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Weakspot::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Weakspot::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Weakspot::Smoothing;
|
||||
break;
|
||||
case TargetType::Other:
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizePixels = (float)Config::Aimbot::Standard::FOV * Game::PixelsPerDegree;
|
||||
TargetToUpdate.LocalInfo.CurrentFOVSizeDegrees = Config::Aimbot::Standard::FOV;
|
||||
TargetToUpdate.LocalInfo.CurrentSmoothing = Config::Aimbot::Standard::Smoothing;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void Features::Aimbot::Target::ResetTarget()
|
||||
{
|
||||
// Reset the global info
|
||||
{
|
||||
GlobalInfo.Type = TargetType::NONE;
|
||||
void Features::Aimbot::Target::ResetTarget() {
|
||||
// Reset the global info
|
||||
{
|
||||
GlobalInfo.Type = TargetType::NONE;
|
||||
|
||||
GlobalInfo.TargetActor = nullptr;
|
||||
GlobalInfo.TargetActor = nullptr;
|
||||
|
||||
GlobalInfo.TargetActorPosition = SDK::FVector(0, 0, 0);
|
||||
GlobalInfo.TargetActorPosition2D = SDK::FVector2D(0, 0);
|
||||
GlobalInfo.TargetActorPosition = SDK::FVector(0, 0, 0);
|
||||
GlobalInfo.TargetActorPosition2D = SDK::FVector2D(0, 0);
|
||||
|
||||
GlobalInfo.TargetBonePosition = SDK::FVector(0, 0, 0);
|
||||
GlobalInfo.TargetBonePosition2D = SDK::FVector2D(0, 0);
|
||||
GlobalInfo.TargetBoneId = Features::FortPawnHelper::Bone::None;
|
||||
}
|
||||
GlobalInfo.TargetBonePosition = SDK::FVector(0, 0, 0);
|
||||
GlobalInfo.TargetBonePosition2D = SDK::FVector2D(0, 0);
|
||||
GlobalInfo.TargetBoneId = Features::FortPawnHelper::Bone::None;
|
||||
}
|
||||
|
||||
// Reset the local info
|
||||
{
|
||||
// Set to float max so that any target will be less than this
|
||||
LocalInfo.DistanceFromCrosshairDegrees = FLT_MAX;
|
||||
LocalInfo.DistanceFromCrosshairPixels = FLT_MAX;
|
||||
LocalInfo.DistanceFromPlayer = FLT_MAX;
|
||||
LocalInfo.SmartTargetingDistance = FLT_MAX;
|
||||
// Reset the local info
|
||||
{
|
||||
// Set to float max so that any target will be less than this
|
||||
LocalInfo.DistanceFromCrosshairDegrees = FLT_MAX;
|
||||
LocalInfo.DistanceFromCrosshairPixels = FLT_MAX;
|
||||
LocalInfo.DistanceFromPlayer = FLT_MAX;
|
||||
LocalInfo.SmartTargetingDistance = FLT_MAX;
|
||||
|
||||
LocalInfo.IsTargeting = false;
|
||||
LocalInfo.IsOnScreen = false;
|
||||
LocalInfo.IsTargeting = false;
|
||||
LocalInfo.IsOnScreen = false;
|
||||
|
||||
LocalInfo.TargetRotation = SDK::FRotator(0, 0, 0);
|
||||
LocalInfo.TargetRotationChange = SDK::FRotator(0, 0, 0);
|
||||
LocalInfo.TargetRotation = SDK::FRotator(0, 0, 0);
|
||||
LocalInfo.TargetRotationChange = SDK::FRotator(0, 0, 0);
|
||||
|
||||
LocalInfo.CurrentFOVSizePixels = 0;
|
||||
LocalInfo.CurrentFOVSizeDegrees = 0;
|
||||
LocalInfo.CurrentSmoothing = 0.f;
|
||||
}
|
||||
LocalInfo.CurrentFOVSizePixels = 0;
|
||||
LocalInfo.CurrentFOVSizeDegrees = 0;
|
||||
LocalInfo.CurrentSmoothing = 0.f;
|
||||
}
|
||||
}
|
||||
void Features::Aimbot::Target::TargetTick(const bool SeenTargetThisFrame)
|
||||
{
|
||||
// Reset if:
|
||||
// - The target wasn't seen this frame
|
||||
// - The target is outside of the FOV circle in pixels and is on the screen
|
||||
// - The target is outside of the FOV circle in degrees and is NOT on the screen
|
||||
// - The target pointer is null
|
||||
void Features::Aimbot::Target::TargetTick(bool SeenTargetThisFrame) {
|
||||
// Reset if:
|
||||
// - The target wasn't seen this frame
|
||||
// - The target is outside of the FOV circle in pixels and is on the screen
|
||||
// - The target is outside of the FOV circle in degrees and is NOT on the screen
|
||||
// - The target pointer is null
|
||||
|
||||
UpdateLocalInfoAndType(*this);
|
||||
UpdateLocalInfoAndType(*this);
|
||||
|
||||
if (LocalInfo.IsOnScreen)
|
||||
{
|
||||
if (LocalInfo.DistanceFromCrosshairPixels > LocalInfo.CurrentFOVSizePixels)
|
||||
{
|
||||
// If the player is on the screen and outside of the FOV circle in pixels, then don't update the target
|
||||
ResetTarget();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LocalInfo.DistanceFromCrosshairDegrees > LocalInfo.CurrentFOVSizeDegrees)
|
||||
{
|
||||
// If the player is on the screen and outside of the FOV circle in degrees, then don't update the target
|
||||
ResetTarget();
|
||||
}
|
||||
}
|
||||
if (LocalInfo.IsOnScreen) {
|
||||
if (LocalInfo.DistanceFromCrosshairPixels > LocalInfo.CurrentFOVSizePixels) {
|
||||
// If the player is on the screen and outside of the FOV circle in pixels, then don't update the target
|
||||
ResetTarget();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (LocalInfo.DistanceFromCrosshairDegrees > LocalInfo.CurrentFOVSizeDegrees) {
|
||||
// If the player is on the screen and outside of the FOV circle in degrees, then don't update the target
|
||||
ResetTarget();
|
||||
}
|
||||
}
|
||||
|
||||
if (!SeenTargetThisFrame || GlobalInfo.TargetActor == nullptr)
|
||||
{
|
||||
ResetTarget();
|
||||
return;
|
||||
}
|
||||
if (!SeenTargetThisFrame || GlobalInfo.TargetActor == nullptr) {
|
||||
ResetTarget();
|
||||
return;
|
||||
}
|
||||
}
|
||||
bool Features::Aimbot::Target::ShouldSetTarget(Target& PotentialTarget)
|
||||
{
|
||||
// We have to do this goofy method to simulate the distance from the crosshair in degrees. It's not perfect, but it's good enough and not noticeable.
|
||||
bool Features::Aimbot::Target::ShouldSetTarget(Target PotentialTarget) {
|
||||
// We have to do this goofy method to simulate the distance from the crosshair in degrees. It's not perfect, but it's good enough and not noticeable.
|
||||
|
||||
// Update the info so that we use the correct FOV size for verifying if we should update the target
|
||||
UpdateLocalInfoAndType(PotentialTarget);
|
||||
// Update the info so that we use the correct FOV size for verifying if we should update the target
|
||||
UpdateLocalInfoAndType(PotentialTarget);
|
||||
|
||||
if (PotentialTarget.LocalInfo.IsOnScreen)
|
||||
{
|
||||
if (PotentialTarget.LocalInfo.DistanceFromCrosshairPixels > PotentialTarget.LocalInfo.CurrentFOVSizePixels)
|
||||
{
|
||||
// If the player is on the screen and outside of the FOV circle in pixels, then don't update the target
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PotentialTarget.LocalInfo.DistanceFromCrosshairDegrees > PotentialTarget.LocalInfo.CurrentFOVSizeDegrees)
|
||||
{
|
||||
// If the player is on the screen and outside of the FOV circle in degrees, then don't update the target
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (PotentialTarget.LocalInfo.IsOnScreen) {
|
||||
if (PotentialTarget.LocalInfo.DistanceFromCrosshairPixels > PotentialTarget.LocalInfo.CurrentFOVSizePixels) {
|
||||
// If the player is on the screen and outside of the FOV circle in pixels, then don't update the target
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (PotentialTarget.LocalInfo.DistanceFromCrosshairDegrees > PotentialTarget.LocalInfo.CurrentFOVSizeDegrees) {
|
||||
// If the player is on the screen and outside of the FOV circle in degrees, then don't update the target
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (PotentialTarget.GlobalInfo.Type > GlobalInfo.Type)
|
||||
{
|
||||
// If the target priority is lower than the current target, then don't update the target
|
||||
return false;
|
||||
}
|
||||
else if (PotentialTarget.GlobalInfo.Type < GlobalInfo.Type)
|
||||
{
|
||||
// If the target priority is higher than the current target, then update the target
|
||||
return true;
|
||||
}
|
||||
else if (PotentialTarget.GlobalInfo.Type == GlobalInfo.Type)
|
||||
{
|
||||
// If the target priority is the same as the current target, then check the parameters
|
||||
if (LocalInfo.IsTargeting && Config::Aimbot::StickyAim)
|
||||
{
|
||||
// If we are targeting and using sticky aim, then don't update
|
||||
return false;
|
||||
}
|
||||
if (PotentialTarget.GlobalInfo.Type > GlobalInfo.Type) {
|
||||
// If the target priority is lower than the current target, then don't update the target
|
||||
return false;
|
||||
}
|
||||
else if (PotentialTarget.GlobalInfo.Type < GlobalInfo.Type) {
|
||||
// If the target priority is higher than the current target, then update the target
|
||||
return true;
|
||||
}
|
||||
else if (PotentialTarget.GlobalInfo.Type == GlobalInfo.Type) {
|
||||
// If the target priority is the same as the current target, then check the parameters
|
||||
if (LocalInfo.IsTargeting && Config::Aimbot::StickyAim) {
|
||||
// If we are targeting and using sticky aim, then don't update
|
||||
return false;
|
||||
}
|
||||
|
||||
float CurrentDistance = 0.f;
|
||||
float PotentialTargetDistance = 0.f;
|
||||
float CurrentDistance = 0.f;
|
||||
float PotentialTargetDistance = 0.f;
|
||||
|
||||
// Get the distance based off the target distance types
|
||||
switch (Config::Aimbot::TargettingType)
|
||||
{
|
||||
case ConfigTypes::AimbotType::Smart:
|
||||
CurrentDistance = LocalInfo.SmartTargetingDistance;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.SmartTargetingDistance;
|
||||
break;
|
||||
case ConfigTypes::AimbotType::Crosshair:
|
||||
CurrentDistance = LocalInfo.DistanceFromCrosshairDegrees;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.DistanceFromCrosshairDegrees;
|
||||
break;
|
||||
case ConfigTypes::AimbotType::Distance:
|
||||
CurrentDistance = LocalInfo.DistanceFromPlayer;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.DistanceFromPlayer;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
// Get the distance based off the target distance types
|
||||
switch (Config::Aimbot::TargettingType) {
|
||||
case ConfigTypes::AimbotType::Smart:
|
||||
CurrentDistance = LocalInfo.SmartTargetingDistance;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.SmartTargetingDistance;
|
||||
break;
|
||||
case ConfigTypes::AimbotType::Crosshair:
|
||||
CurrentDistance = LocalInfo.DistanceFromCrosshairDegrees;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.DistanceFromCrosshairDegrees;
|
||||
break;
|
||||
case ConfigTypes::AimbotType::Distance:
|
||||
CurrentDistance = LocalInfo.DistanceFromPlayer;
|
||||
PotentialTargetDistance = PotentialTarget.LocalInfo.DistanceFromPlayer;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PotentialTargetDistance < CurrentDistance)
|
||||
{
|
||||
// If the potential new target distance is less than the current target distance, then update the target
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (PotentialTargetDistance < CurrentDistance) {
|
||||
// If the potential new target distance is less than the current target distance, then update the target
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
void Features::Aimbot::Target::SetTarget(Target& NewTarget, const bool ForceSetTarget)
|
||||
{
|
||||
UpdateLocalInfoAndType(NewTarget);
|
||||
void Features::Aimbot::Target::SetTarget(Target NewTarget, bool ForceSetTarget) {
|
||||
UpdateLocalInfoAndType(NewTarget);
|
||||
|
||||
if (ForceSetTarget)
|
||||
{
|
||||
*this = NewTarget;
|
||||
return;
|
||||
}
|
||||
else if (ShouldSetTarget(NewTarget))
|
||||
{
|
||||
*this = NewTarget;
|
||||
return;
|
||||
}
|
||||
if (ForceSetTarget) {
|
||||
*this = NewTarget;
|
||||
return;
|
||||
}
|
||||
else if (ShouldSetTarget(NewTarget)) {
|
||||
*this = NewTarget;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::PlayerTarget::UpdateTargetInfo(Target& Target, Actors::Caches::FortPawnCache& TargetCache, const Actors::Caches::CameraCache& MainCamera, const Actors::Caches::CameraCache& AimbotCamera, const float FPSScale)
|
||||
{
|
||||
// Update global information
|
||||
Target.GlobalInfo.TargetActor = TargetCache.FortPawn;
|
||||
Target.GlobalInfo.TargetBoneId = Features::FortPawnHelper::Bone::FindBestBone(Features::FortPawnHelper::Bone::Head, TargetCache, (Config::Aimbot::VisibleCheck && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false));
|
||||
void Features::Aimbot::PlayerTarget::UpdateTargetInfo(Target& Target, Actors::Caches::FortPawnCache& TargetCache, const Actors::Caches::CameraCache& MainCamera, const Actors::Caches::CameraCache& AimbotCamera, const float FPSScale) {
|
||||
// Update global information
|
||||
Target.GlobalInfo.TargetActor = TargetCache.FortPawn;
|
||||
Target.GlobalInfo.TargetBoneId = Features::FortPawnHelper::Bone::FindBestBone(Features::FortPawnHelper::Bone::Head, TargetCache, (Config::Aimbot::VisibleCheck && Config::Aimbot::BulletTP == false && Config::Aimbot::BulletTPV2 == false));
|
||||
|
||||
// Determine target type
|
||||
Target.GlobalInfo.Type = (Target.LocalInfo.DistanceFromPlayer <= Config::Aimbot::CloseAim::Range && Config::Aimbot::CloseAim::Enabled) ? Target::TargetType::ClosePlayer : Target::TargetType::FarPlayer;
|
||||
// Determine target type
|
||||
Target.GlobalInfo.Type = (Target.LocalInfo.DistanceFromPlayer <= Config::Aimbot::CloseAim::Range && Config::Aimbot::CloseAim::Enabled) ? Target::TargetType::ClosePlayer : Target::TargetType::FarPlayer;
|
||||
|
||||
// Update positions
|
||||
Target.GlobalInfo.TargetActorPosition = TargetCache.BonePositions3D[Features::FortPawnHelper::Bone::Root];
|
||||
Target.GlobalInfo.TargetActorPosition2D = TargetCache.BonePositions2D[Features::FortPawnHelper::Bone::Root];
|
||||
Target.GlobalInfo.TargetBonePosition = TargetCache.BonePositions3D[Target.GlobalInfo.TargetBoneId];
|
||||
Target.GlobalInfo.TargetBonePosition2D = TargetCache.BonePositions2D[Target.GlobalInfo.TargetBoneId];
|
||||
// Update positions
|
||||
Target.GlobalInfo.TargetActorPosition = TargetCache.BonePositions3D[Features::FortPawnHelper::Bone::Root];
|
||||
Target.GlobalInfo.TargetActorPosition2D = TargetCache.BonePositions2D[Features::FortPawnHelper::Bone::Root];
|
||||
Target.GlobalInfo.TargetBonePosition = TargetCache.BonePositions3D[Target.GlobalInfo.TargetBoneId];
|
||||
Target.GlobalInfo.TargetBonePosition2D = TargetCache.BonePositions2D[Target.GlobalInfo.TargetBoneId];
|
||||
|
||||
SDK::FRotator TargetCameraRotation = SDK::UKismetMathLibrary::FindLookAtRotation(AimbotCamera.Position, Target.GlobalInfo.TargetBonePosition);
|
||||
SDK::FRotator TargetCameraRotation = SDK::UKismetMathLibrary::FindLookAtRotation(AimbotCamera.Position, Target.GlobalInfo.TargetBonePosition);
|
||||
|
||||
// Update local information
|
||||
Target.LocalInfo.DistanceFromCrosshairDegrees = Math::GetDegreeDistance(MainCamera.Rotation, TargetCameraRotation);
|
||||
Target.LocalInfo.DistanceFromCrosshairPixels = Math::GetDistance2D(Target.GlobalInfo.TargetBonePosition2D.X, Target.GlobalInfo.TargetBonePosition2D.Y, Game::ScreenCenterX, Game::ScreenCenterY);
|
||||
Target.LocalInfo.DistanceFromPlayer = TargetCache.DistanceFromLocalPawn;
|
||||
Target.LocalInfo.SmartTargetingDistance = (Target.LocalInfo.DistanceFromCrosshairDegrees * 20) + Target.LocalInfo.DistanceFromPlayer;
|
||||
Target.LocalInfo.IsOnScreen = TargetCache.IsPlayerVisibleOnScreen;
|
||||
// Update local information
|
||||
Target.LocalInfo.DistanceFromCrosshairDegrees = Math::GetDegreeDistance(MainCamera.Rotation, TargetCameraRotation);
|
||||
Target.LocalInfo.DistanceFromCrosshairPixels = Math::GetDistance2D(Target.GlobalInfo.TargetBonePosition2D.X, Target.GlobalInfo.TargetBonePosition2D.Y, Game::ScreenCenterX, Game::ScreenCenterY);
|
||||
Target.LocalInfo.DistanceFromPlayer = TargetCache.DistanceFromLocalPawn;
|
||||
Target.LocalInfo.SmartTargetingDistance = (Target.LocalInfo.DistanceFromCrosshairDegrees * 20) + Target.LocalInfo.DistanceFromPlayer;
|
||||
Target.LocalInfo.IsOnScreen = TargetCache.IsPlayerVisibleOnScreen;
|
||||
|
||||
// Apply FPS scaling for smoothing
|
||||
if (FPSScale)
|
||||
{
|
||||
UpdateLocalInfoAndType(Target);
|
||||
// Apply FPS scaling for smoothing
|
||||
if (FPSScale) {
|
||||
UpdateLocalInfoAndType(Target);
|
||||
|
||||
float AimbotSpeed;
|
||||
if (Target.LocalInfo.CurrentSmoothing <= 1.f)
|
||||
{
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing;
|
||||
}
|
||||
else
|
||||
{
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing * FPSScale;
|
||||
}
|
||||
Target.LocalInfo.TargetRotation = TargetCameraRotation;
|
||||
float AimbotSpeed;
|
||||
if (Target.LocalInfo.CurrentSmoothing <= 1.f) {
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing;
|
||||
}
|
||||
else {
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing * FPSScale;
|
||||
}
|
||||
Target.LocalInfo.TargetRotation = TargetCameraRotation;
|
||||
|
||||
// Calculate smoothed rotation
|
||||
Target.LocalInfo.TargetRotationChange = SDK::FRotator(Target.LocalInfo.TargetRotation.Pitch - AimbotCamera.Rotation.Pitch, Target.LocalInfo.TargetRotation.Yaw - AimbotCamera.Rotation.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationChange = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChange);
|
||||
// Calculate smoothed rotation
|
||||
Target.LocalInfo.TargetRotationChange = SDK::FRotator(Target.LocalInfo.TargetRotation.Pitch - AimbotCamera.Rotation.Pitch, Target.LocalInfo.TargetRotation.Yaw - AimbotCamera.Rotation.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationChange = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChange);
|
||||
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Target.LocalInfo.TargetRotationChange / AimbotSpeed;
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChangeWithSmooth);
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Target.LocalInfo.TargetRotationChange / AimbotSpeed;
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChangeWithSmooth);
|
||||
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(AimbotCamera.Rotation.Pitch + Target.LocalInfo.TargetRotationChangeWithSmooth.Pitch, AimbotCamera.Rotation.Yaw + Target.LocalInfo.TargetRotationChangeWithSmooth.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationWithSmooth);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(Target.LocalInfo.TargetRotationWithSmooth.Pitch, Target.LocalInfo.TargetRotationWithSmooth.Yaw, 0.f); // 0 on the roll so the camera doesn't get stuck tilted
|
||||
}
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(AimbotCamera.Rotation.Pitch + Target.LocalInfo.TargetRotationChangeWithSmooth.Pitch, AimbotCamera.Rotation.Yaw + Target.LocalInfo.TargetRotationChangeWithSmooth.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationWithSmooth);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(Target.LocalInfo.TargetRotationWithSmooth.Pitch, Target.LocalInfo.TargetRotationWithSmooth.Yaw, 0.f); // 0 on the roll so the camera doesn't get stuck tilted
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(Target& Target, SDK::ABuildingWeakSpot* WeakSpot, const Actors::Caches::CameraCache& MainCamera, const Actors::Caches::CameraCache& AimbotCamera, const float FPSScale)
|
||||
{
|
||||
// Update global information
|
||||
Target.GlobalInfo.TargetActor = WeakSpot;
|
||||
void Features::Aimbot::WeakSpotTarget::UpdateTargetInfo(Target& Target, SDK::ABuildingWeakSpot* WeakSpot, const Actors::Caches::CameraCache& MainCamera, const Actors::Caches::CameraCache& AimbotCamera, const float FPSScale) {
|
||||
// Update global information
|
||||
Target.GlobalInfo.TargetActor = WeakSpot;
|
||||
|
||||
// Set target type
|
||||
Target.GlobalInfo.Type = Target::TargetType::Weakspot;
|
||||
// Set target type
|
||||
Target.GlobalInfo.Type = Target::TargetType::Weakspot;
|
||||
|
||||
// Update positions
|
||||
SDK::FVector RootComponentPosition = WeakSpot->RootComponent()->RelativeLocation();
|
||||
SDK::FVector2D RootComponentPosition2D = SDK::Project(RootComponentPosition);
|
||||
// Update positions
|
||||
SDK::FVector RootComponentPosition = WeakSpot->RootComponent()->RelativeLocation();
|
||||
SDK::FVector2D RootComponentPosition2D = SDK::Project(RootComponentPosition);
|
||||
|
||||
Target.GlobalInfo.TargetActorPosition = RootComponentPosition;
|
||||
Target.GlobalInfo.TargetActorPosition2D = RootComponentPosition2D;
|
||||
Target.GlobalInfo.TargetBonePosition = RootComponentPosition;
|
||||
Target.GlobalInfo.TargetBonePosition2D = RootComponentPosition2D;
|
||||
Target.GlobalInfo.TargetActorPosition = RootComponentPosition;
|
||||
Target.GlobalInfo.TargetActorPosition2D = RootComponentPosition2D;
|
||||
Target.GlobalInfo.TargetBonePosition = RootComponentPosition;
|
||||
Target.GlobalInfo.TargetBonePosition2D = RootComponentPosition2D;
|
||||
|
||||
SDK::FRotator TargetCameraRotation = SDK::UKismetMathLibrary::FindLookAtRotation(AimbotCamera.Position, Target.GlobalInfo.TargetActorPosition);
|
||||
SDK::FRotator TargetCameraRotation = SDK::UKismetMathLibrary::FindLookAtRotation(AimbotCamera.Position, Target.GlobalInfo.TargetActorPosition);
|
||||
|
||||
// Update local information
|
||||
Target.LocalInfo.DistanceFromCrosshairDegrees = Math::GetDegreeDistance(MainCamera.Rotation, TargetCameraRotation);
|
||||
Target.LocalInfo.DistanceFromCrosshairPixels = Math::GetDistance2D(Target.GlobalInfo.TargetActorPosition2D.X, Target.GlobalInfo.TargetActorPosition2D.Y, Game::ScreenCenterX, Game::ScreenCenterY);
|
||||
Target.LocalInfo.DistanceFromPlayer = Actors::LocalPawnCache.Position.Distance(Target.GlobalInfo.TargetActorPosition) / 100.f;
|
||||
Target.LocalInfo.SmartTargetingDistance = (Target.LocalInfo.DistanceFromCrosshairDegrees * 20) + Target.LocalInfo.DistanceFromPlayer;
|
||||
Target.LocalInfo.IsOnScreen = Math::IsOnScreen(Target.GlobalInfo.TargetActorPosition2D);
|
||||
// Update local information
|
||||
Target.LocalInfo.DistanceFromCrosshairDegrees = Math::GetDegreeDistance(MainCamera.Rotation, TargetCameraRotation);
|
||||
Target.LocalInfo.DistanceFromCrosshairPixels = Math::GetDistance2D(Target.GlobalInfo.TargetActorPosition2D.X, Target.GlobalInfo.TargetActorPosition2D.Y, Game::ScreenCenterX, Game::ScreenCenterY);
|
||||
Target.LocalInfo.DistanceFromPlayer = Actors::LocalPawnCache.Position.Distance(Target.GlobalInfo.TargetActorPosition) / 100.f;
|
||||
Target.LocalInfo.SmartTargetingDistance = (Target.LocalInfo.DistanceFromCrosshairDegrees * 20) + Target.LocalInfo.DistanceFromPlayer;
|
||||
Target.LocalInfo.IsOnScreen = Math::IsOnScreen(Target.GlobalInfo.TargetActorPosition2D);
|
||||
|
||||
// Apply FPS scaling for smoothing
|
||||
if (FPSScale)
|
||||
{
|
||||
UpdateLocalInfoAndType(Target);
|
||||
// Apply FPS scaling for smoothing
|
||||
if (FPSScale) {
|
||||
UpdateLocalInfoAndType(Target);
|
||||
|
||||
float AimbotSpeed;
|
||||
if (Target.LocalInfo.CurrentSmoothing <= 1)
|
||||
{
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing;
|
||||
}
|
||||
else
|
||||
{
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing * FPSScale;
|
||||
}
|
||||
Target.LocalInfo.TargetRotation = TargetCameraRotation;
|
||||
float AimbotSpeed;
|
||||
if (Target.LocalInfo.CurrentSmoothing <= 1) {
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing;
|
||||
}
|
||||
else {
|
||||
AimbotSpeed = Target.LocalInfo.CurrentSmoothing * FPSScale;
|
||||
}
|
||||
Target.LocalInfo.TargetRotation = TargetCameraRotation;
|
||||
|
||||
// Calculate smoothed rotation
|
||||
Target.LocalInfo.TargetRotationChange = SDK::FRotator(Target.LocalInfo.TargetRotation.Pitch - AimbotCamera.Rotation.Pitch, Target.LocalInfo.TargetRotation.Yaw - AimbotCamera.Rotation.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationChange = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChange);
|
||||
// Calculate smoothed rotation
|
||||
Target.LocalInfo.TargetRotationChange = SDK::FRotator(Target.LocalInfo.TargetRotation.Pitch - AimbotCamera.Rotation.Pitch, Target.LocalInfo.TargetRotation.Yaw - AimbotCamera.Rotation.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationChange = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChange);
|
||||
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Target.LocalInfo.TargetRotationChange / AimbotSpeed;
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChangeWithSmooth);
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Target.LocalInfo.TargetRotationChange / AimbotSpeed;
|
||||
Target.LocalInfo.TargetRotationChangeWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationChangeWithSmooth);
|
||||
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(AimbotCamera.Rotation.Pitch + Target.LocalInfo.TargetRotationChangeWithSmooth.Pitch, AimbotCamera.Rotation.Yaw + Target.LocalInfo.TargetRotationChangeWithSmooth.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationWithSmooth);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(Target.LocalInfo.TargetRotationWithSmooth.Pitch, Target.LocalInfo.TargetRotationWithSmooth.Yaw, 0.f); // 0 on the roll so the camera doesn't get stuck tilted
|
||||
}
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(AimbotCamera.Rotation.Pitch + Target.LocalInfo.TargetRotationChangeWithSmooth.Pitch, AimbotCamera.Rotation.Yaw + Target.LocalInfo.TargetRotationChangeWithSmooth.Yaw, 0.f);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = Math::NormalizeAxis(Target.LocalInfo.TargetRotationWithSmooth);
|
||||
Target.LocalInfo.TargetRotationWithSmooth = SDK::FRotator(Target.LocalInfo.TargetRotationWithSmooth.Pitch, Target.LocalInfo.TargetRotationWithSmooth.Yaw, 0.f); // 0 on the roll so the camera doesn't get stuck tilted
|
||||
}
|
||||
}
|
||||
@@ -3,140 +3,132 @@
|
||||
|
||||
#include "../../Actors/ActorCache.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Aimbot
|
||||
{
|
||||
/* Represents an Actor target */
|
||||
class Target
|
||||
{
|
||||
public:
|
||||
// The type of the target (Affects the priority of the target)
|
||||
// The lower number, the higher the priority
|
||||
enum class TargetType
|
||||
{
|
||||
ClosePlayer = 0,
|
||||
FarPlayer = 1,
|
||||
Weakspot = 2,
|
||||
Other = 3,
|
||||
namespace Features {
|
||||
namespace Aimbot {
|
||||
/* Represents an Actor target */
|
||||
class Target {
|
||||
public:
|
||||
// The type of the target (Affects the priority of the target)
|
||||
// The lower number, the higher the priority
|
||||
enum class TargetType {
|
||||
ClosePlayer = 0,
|
||||
FarPlayer = 1,
|
||||
Weakspot = 2,
|
||||
Other = 3,
|
||||
|
||||
NONE = 4,
|
||||
};
|
||||
NONE = 4,
|
||||
};
|
||||
|
||||
protected:
|
||||
// Information about the target, not relative to any player
|
||||
struct GlobalTargetInfo
|
||||
{
|
||||
// General information
|
||||
TargetType Type = TargetType::NONE; // The type of the target (Affects the priority of the target)
|
||||
protected:
|
||||
// Information about the target, not relative to any player
|
||||
struct GlobalTargetInfo {
|
||||
// General information
|
||||
TargetType Type = TargetType::NONE; // The type of the target (Affects the priority of the target)
|
||||
|
||||
// The target actor information
|
||||
SDK::AActor* TargetActor = nullptr; // The target actor
|
||||
SDK::FVector TargetActorPosition = SDK::FVector(0, 0, 0); // The position of the actors's root component
|
||||
SDK::FVector2D TargetActorPosition2D = SDK::FVector2D(0, 0); // The position of the actors's root component on the screen
|
||||
// The target actor information
|
||||
SDK::AActor* TargetActor = nullptr; // The target actor
|
||||
SDK::FVector TargetActorPosition = SDK::FVector(0, 0, 0); // The position of the actors's root component
|
||||
SDK::FVector2D TargetActorPosition2D = SDK::FVector2D(0, 0); // The position of the actors's root component on the screen
|
||||
|
||||
// The target's bone information
|
||||
// If the target doesn't have a bone, then the bone position will be the same as the actor position
|
||||
SDK::FVector TargetBonePosition = SDK::FVector(0, 0, 0); // The position of the target's bone
|
||||
SDK::FVector2D TargetBonePosition2D = SDK::FVector2D(0, 0); // The position of the target's bone on the screen
|
||||
uint8_t TargetBoneId = 0; // The bone id of the target (only if used if the target is a FortPawn)
|
||||
};
|
||||
// The target's bone information
|
||||
// If the target doesn't have a bone, then the bone position will be the same as the actor position
|
||||
SDK::FVector TargetBonePosition = SDK::FVector(0, 0, 0); // The position of the target's bone
|
||||
SDK::FVector2D TargetBonePosition2D = SDK::FVector2D(0, 0); // The position of the target's bone on the screen
|
||||
uint8_t TargetBoneId = 0; // The bone id of the target (only if used if the target is a FortPawn)
|
||||
};
|
||||
|
||||
// Information about the target, relative to the local player
|
||||
struct LocalTargetInfo
|
||||
{
|
||||
// Target distance information (FLT_MAX so that any value is less than it)
|
||||
float DistanceFromCrosshairPixels = FLT_MAX; // The distance from the crosshair in pixels
|
||||
float DistanceFromCrosshairDegrees = FLT_MAX; // The distance from the crosshair in degrees
|
||||
float DistanceFromPlayer = FLT_MAX; // The distance from the local player in meters
|
||||
float SmartTargetingDistance = FLT_MAX; // The physical distance and the crosshair distance combined (hence smart targeting)
|
||||
// Information about the target, relative to the local player
|
||||
struct LocalTargetInfo {
|
||||
// Target distance information (FLT_MAX so that any value is less than it)
|
||||
float DistanceFromCrosshairPixels = FLT_MAX; // The distance from the crosshair in pixels
|
||||
float DistanceFromCrosshairDegrees = FLT_MAX; // The distance from the crosshair in degrees
|
||||
float DistanceFromPlayer = FLT_MAX; // The distance from the local player in meters
|
||||
float SmartTargetingDistance = FLT_MAX; // The physical distance and the crosshair distance combined (hence smart targeting)
|
||||
|
||||
// Aimbot information
|
||||
bool IsTargeting = false; // Is the local player currently aimbotting the target
|
||||
bool IsOnScreen = false; // Is the target on the screen
|
||||
// Aimbot information
|
||||
bool IsTargeting = false; // Is the local player currently aimbotting the target
|
||||
bool IsOnScreen = false; // Is the target on the screen
|
||||
|
||||
SDK::FRotator TargetRotation = SDK::FRotator(0, 0, 0); // The target rotation to aimbot the target
|
||||
SDK::FRotator TargetRotationWithSmooth = SDK::FRotator(0, 0, 0); // The target rotation to aimbot the target with smoothing applied
|
||||
SDK::FRotator TargetRotationChange = SDK::FRotator(0, 0, 0); // The current rotation change required to achieve the target rotation
|
||||
SDK::FRotator TargetRotationChangeWithSmooth = SDK::FRotator(0, 0, 0); // The current rotation change required to achieve the target rotation with smoothing applied
|
||||
SDK::FRotator TargetRotation = SDK::FRotator(0, 0, 0); // The target rotation to aimbot the target
|
||||
SDK::FRotator TargetRotationWithSmooth = SDK::FRotator(0, 0, 0); // The target rotation to aimbot the target with smoothing applied
|
||||
SDK::FRotator TargetRotationChange = SDK::FRotator(0, 0, 0); // The current rotation change required to achieve the target rotation
|
||||
SDK::FRotator TargetRotationChangeWithSmooth = SDK::FRotator(0, 0, 0); // The current rotation change required to achieve the target rotation with smoothing applied
|
||||
|
||||
int CurrentFOVSizeDegrees = 0; // The current FOV size in degrees
|
||||
int CurrentFOVSizePixels = 0; // The current FOV size in pixels
|
||||
float CurrentSmoothing = 0; // The current smoothing
|
||||
};
|
||||
int CurrentFOVSizeDegrees = 0; // The current FOV size in degrees
|
||||
int CurrentFOVSizePixels = 0; // The current FOV size in pixels
|
||||
float CurrentSmoothing = 0; // The current smoothing
|
||||
};
|
||||
|
||||
public:
|
||||
// Target information
|
||||
GlobalTargetInfo GlobalInfo{}; // Information about the target, not relative to any player
|
||||
LocalTargetInfo LocalInfo{}; // Information about the target, relative to the local player
|
||||
public:
|
||||
// Target information
|
||||
GlobalTargetInfo GlobalInfo{}; // Information about the target, not relative to any player
|
||||
LocalTargetInfo LocalInfo{}; // Information about the target, relative to the local player
|
||||
|
||||
protected:
|
||||
/* Update the FOV, smoothing and type of the target */
|
||||
static void UpdateLocalInfoAndType(Target& TargetToUpdate);
|
||||
protected:
|
||||
/* Update the FOV, smoothing and type of the target */
|
||||
static void UpdateLocalInfoAndType(Target& TargetToUpdate);
|
||||
|
||||
public:
|
||||
/* Reset the target data to default values */
|
||||
virtual void ResetTarget();
|
||||
public:
|
||||
/* Reset the target data to default values */
|
||||
virtual void ResetTarget();
|
||||
|
||||
/*
|
||||
* @brief Update the target data based off the current target
|
||||
*
|
||||
* @param SeenTargetLastFrame - Was the target seen this frame
|
||||
*/
|
||||
virtual void TargetTick(const bool SeenTargetThisFrame);
|
||||
/*
|
||||
* @brief Update the target data based off the current target
|
||||
*
|
||||
* @param SeenTargetLastFrame - Was the target seen this frame
|
||||
*/
|
||||
virtual void TargetTick(bool SeenTargetThisFrame);
|
||||
|
||||
/*
|
||||
* @brief Should the target be set to the new target
|
||||
*
|
||||
* @param PotentialTarget - The potential new target
|
||||
*/
|
||||
virtual bool ShouldSetTarget(Target& PotentialTarget);
|
||||
/*
|
||||
* @brief Should the target be set to the new target
|
||||
*
|
||||
* @param PotentialTarget - The potential new target
|
||||
*/
|
||||
virtual bool ShouldSetTarget(Target PotentialTarget);
|
||||
|
||||
/*
|
||||
* @brief Set the target to the new target
|
||||
*
|
||||
* @param NewTarget - The new target to set
|
||||
* @param ForceSetTarget - Should the target be set regardless
|
||||
*/
|
||||
virtual void SetTarget(Target& NewTarget, const bool ForceSetTarget = false);
|
||||
};
|
||||
/*
|
||||
* @brief Set the target to the new target
|
||||
*
|
||||
* @param NewTarget - The new target to set
|
||||
* @param ForceSetTarget - Should the target be set regardless
|
||||
*/
|
||||
virtual void SetTarget(Target NewTarget, bool ForceSetTarget = false);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Represents a player target, inherits from Target with extended functions for dealing with player targets */
|
||||
class PlayerTarget : public Target
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* @brief Propagates a FortPawn target's info to the target
|
||||
*
|
||||
* (If the optional arguments are not provided, then no aimbot calculations are made)
|
||||
*
|
||||
* @param Target - The target to update
|
||||
* @param TargetCache - The target's fort pawn cache
|
||||
* @param MainCamera - The local player's camera (optional)
|
||||
* @param AimbotCamera - The aimbot camera (optional) (used for silent aim)
|
||||
* @param FPSScale - The scale to apply to the smoothing (optional)
|
||||
*/
|
||||
static void UpdateTargetInfo(Target& Target, Actors::Caches::FortPawnCache& TargetCache, const Actors::Caches::CameraCache& MainCamera = Actors::Caches::CameraCache(), const Actors::Caches::CameraCache& AimbotCamera = Actors::Caches::CameraCache(), const float FPSScale = 0.f);
|
||||
};
|
||||
/* Represents a player target, inherits from Target with extended functions for dealing with player targets */
|
||||
class PlayerTarget : public Target {
|
||||
public:
|
||||
/*
|
||||
* @brief Propagates a FortPawn target's info to the target
|
||||
*
|
||||
* (If the optional arguments are not provided, then no aimbot calculations are made)
|
||||
*
|
||||
* @param Target - The target to update
|
||||
* @param TargetCache - The target's fort pawn cache
|
||||
* @param MainCamera - The local player's camera (optional)
|
||||
* @param AimbotCamera - The aimbot camera (optional) (used for silent aim)
|
||||
* @param FPSScale - The scale to apply to the smoothing (optional)
|
||||
*/
|
||||
static void UpdateTargetInfo(Target& Target, Actors::Caches::FortPawnCache& TargetCache, const Actors::Caches::CameraCache& MainCamera = Actors::Caches::CameraCache(), const Actors::Caches::CameraCache& AimbotCamera = Actors::Caches::CameraCache(), const float FPSScale = 0.f);
|
||||
};
|
||||
|
||||
/* Represents a building weak spot target, inherits from Target with extended functions for dealing with building weak spot targets */
|
||||
class WeakSpotTarget : public Target
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* @brief Propagates a BuildingWeakSpot target's info to the target
|
||||
*
|
||||
* (If the optional arguments are not provided, then no aimbot calculations are made)
|
||||
*
|
||||
* @param Target - The target to update
|
||||
* @param WeakSpot - The target's building weak spot
|
||||
* @param MainCamera - The local player's camera (optional)
|
||||
* @param AimbotCamera - The aimbot camera (optional) (used for silent aim)
|
||||
* @param FPSScale - The scale to apply to the smoothing (optional)
|
||||
*/
|
||||
static void UpdateTargetInfo(Target& Target, SDK::ABuildingWeakSpot* WeakSpot, const Actors::Caches::CameraCache& MainCamera = Actors::Caches::CameraCache(), const Actors::Caches::CameraCache& AimbotCamera = Actors::Caches::CameraCache(), const float FPSScale = 0.f);
|
||||
};
|
||||
}
|
||||
/* Represents a building weak spot target, inherits from Target with extended functions for dealing with building weak spot targets */
|
||||
class WeakSpotTarget : public Target {
|
||||
public:
|
||||
/*
|
||||
* @brief Propagates a BuildingWeakSpot target's info to the target
|
||||
*
|
||||
* (If the optional arguments are not provided, then no aimbot calculations are made)
|
||||
*
|
||||
* @param Target - The target to update
|
||||
* @param WeakSpot - The target's building weak spot
|
||||
* @param MainCamera - The local player's camera (optional)
|
||||
* @param AimbotCamera - The aimbot camera (optional) (used for silent aim)
|
||||
* @param FPSScale - The scale to apply to the smoothing (optional)
|
||||
*/
|
||||
static void UpdateTargetInfo(Target& Target, SDK::ABuildingWeakSpot* WeakSpot, const Actors::Caches::CameraCache& MainCamera = Actors::Caches::CameraCache(), const Actors::Caches::CameraCache& AimbotCamera = Actors::Caches::CameraCache(), const float FPSScale = 0.f);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -3,29 +3,23 @@
|
||||
#include "../../../Configs/Config.h"
|
||||
#include "../../Actors/ActorCache.h"
|
||||
|
||||
void Features::Exploits::Player::Tick(SDK::AFortPlayerPawnAthena* FortPawn, SDK::AFortPlayerController* Controller)
|
||||
{
|
||||
if (Config::Exploits::Player::ADSWhileNotOnGround)
|
||||
{
|
||||
FortPawn->SetbADSWhileNotOnGround(true, &Config::Exploits::Player::ADSWhileNotOnGround);
|
||||
}
|
||||
void Features::Exploits::Player::Tick(SDK::AFortPlayerPawnAthena* FortPawn, SDK::AFortPlayerController* Controller) {
|
||||
if (Config::Exploits::Player::ADSWhileNotOnGround) {
|
||||
FortPawn->SetbADSWhileNotOnGround(true, &Config::Exploits::Player::ADSWhileNotOnGround);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Player::DoublePump)
|
||||
{
|
||||
FortPawn->CurrentWeapon()->SetbIgnoreTryToFireSlotCooldownRestriction(true, &Config::Exploits::Player::DoublePump);
|
||||
}
|
||||
if (Config::Exploits::Player::DoublePump) {
|
||||
FortPawn->CurrentWeapon()->SetbIgnoreTryToFireSlotCooldownRestriction(true, &Config::Exploits::Player::DoublePump);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Player::ZiplineFly)
|
||||
{
|
||||
FortPawn->ZiplineState()->SetbIsZiplining(true);
|
||||
}
|
||||
if (Config::Exploits::Player::ZiplineFly) {
|
||||
FortPawn->ZiplineState()->SetbIsZiplining(true);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Player::EditEnemyBuilds)
|
||||
{
|
||||
SDK::ABuildingActor* TargetedBuilding = Controller->TargetedBuilding();
|
||||
if (TargetedBuilding)
|
||||
{
|
||||
TargetedBuilding->SetTeamIndex(Actors::LocalPawnCache.TeamIndex, &Config::Exploits::Player::EditEnemyBuilds);
|
||||
}
|
||||
}
|
||||
if (Config::Exploits::Player::EditEnemyBuilds) {
|
||||
SDK::ABuildingActor* TargetedBuilding = Controller->TargetedBuilding();
|
||||
if (TargetedBuilding) {
|
||||
TargetedBuilding->SetTeamIndex(Actors::LocalPawnCache.TeamIndex, &Config::Exploits::Player::EditEnemyBuilds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
#pragma once
|
||||
#include "../../SDK/Classes/FortniteGame_Classes.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Exploits
|
||||
{
|
||||
namespace Player
|
||||
{
|
||||
void Tick(SDK::AFortPlayerPawnAthena* FortPawn, SDK::AFortPlayerController* Controller);
|
||||
}
|
||||
}
|
||||
namespace Features {
|
||||
namespace Exploits {
|
||||
namespace Player {
|
||||
void Tick(SDK::AFortPlayerPawnAthena* FortPawn, SDK::AFortPlayerController* Controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,44 +9,36 @@
|
||||
|
||||
#include "../../Input/Input.h"
|
||||
|
||||
void Features::Exploits::Vehicle::Tick(SDK::AFortPlayerPawnAthena* FortPawn)
|
||||
{
|
||||
SDK::AFortAthenaVehicle* Vehicle = FortPawn->GetVehicle();
|
||||
void Features::Exploits::Vehicle::Tick(SDK::AFortPlayerPawnAthena* FortPawn) {
|
||||
SDK::AFortAthenaVehicle* Vehicle = FortPawn->GetVehicle();
|
||||
|
||||
if (SDK::IsValidPointer(Vehicle))
|
||||
{
|
||||
VehicleLastTick = Vehicle;
|
||||
if (SDK::IsValidPointer(Vehicle)) {
|
||||
VehicleLastTick = Vehicle;
|
||||
|
||||
if (Config::Exploits::Vehicle::InfiniteBoost)
|
||||
{
|
||||
if (Vehicle->IsA(SDK::AFortAthenaAntelopeVehicle::StaticClass()))
|
||||
{
|
||||
SDK::AFortAthenaAntelopeVehicle* Antelope = SDK::Cast<SDK::AFortAthenaAntelopeVehicle, true>(Vehicle);
|
||||
if (Config::Exploits::Vehicle::InfiniteBoost) {
|
||||
if (Vehicle->IsA(SDK::AFortAthenaAntelopeVehicle::StaticClass())) {
|
||||
SDK::AFortAthenaAntelopeVehicle* Antelope = SDK::Cast<SDK::AFortAthenaAntelopeVehicle, true>(Vehicle);
|
||||
|
||||
Antelope->FortAntelopeVehicleConfigs()->SetBoostAccumulationRate(FLT_MAX, &Config::Exploits::Vehicle::InfiniteBoost);
|
||||
Antelope->FortAntelopeVehicleConfigs()->SetBoostExpenseRate(0.f, &Config::Exploits::Vehicle::InfiniteBoost);
|
||||
}
|
||||
Antelope->FortAntelopeVehicleConfigs()->SetBoostAccumulationRate(FLT_MAX, &Config::Exploits::Vehicle::InfiniteBoost);
|
||||
Antelope->FortAntelopeVehicleConfigs()->SetBoostExpenseRate(0.f, &Config::Exploits::Vehicle::InfiniteBoost);
|
||||
}
|
||||
|
||||
if (Vehicle->IsA(SDK::AFortAthenaJackalVehicle::StaticClass()))
|
||||
{
|
||||
SDK::AFortAthenaJackalVehicle* Jackal = SDK::Cast<SDK::AFortAthenaJackalVehicle, true>(Vehicle);
|
||||
if (Vehicle->IsA(SDK::AFortAthenaJackalVehicle::StaticClass())) {
|
||||
SDK::AFortAthenaJackalVehicle* Jackal = SDK::Cast<SDK::AFortAthenaJackalVehicle, true>(Vehicle);
|
||||
|
||||
for (int i = 0; i < Jackal->BoostTimers().Num(); i++)
|
||||
{
|
||||
Jackal->BoostTimers()[i].SetCharge(1.0f);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < Jackal->BoostTimers().Num(); i++) {
|
||||
Jackal->BoostTimers()[i].SetCharge(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass()))
|
||||
{
|
||||
SDK::AFortAthenaDoghouseVehicle* Doghouse = SDK::Cast<SDK::AFortAthenaDoghouseVehicle, true>(Vehicle);
|
||||
if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass())) {
|
||||
SDK::AFortAthenaDoghouseVehicle* Doghouse = SDK::Cast<SDK::AFortAthenaDoghouseVehicle, true>(Vehicle);
|
||||
|
||||
Doghouse->BoostAction()->SetCharge(1.0f);
|
||||
}
|
||||
}
|
||||
Doghouse->BoostAction()->SetCharge(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Exploits::Vehicle::Fly)
|
||||
{
|
||||
if (Config::Exploits::Vehicle::Fly) {
|
||||
float MoveForwardBackward = 0.0f;
|
||||
float MoveLeftRight = 0.0f;
|
||||
float MoveUpDown = 0.0f;
|
||||
@@ -58,73 +50,63 @@ void Features::Exploits::Vehicle::Tick(SDK::AFortPlayerPawnAthena* FortPawn)
|
||||
if (Input::IsKeyDown(Input::KeyName::SpaceBar)) MoveUpDown += 1.0f;
|
||||
if (Input::IsKeyDown(Input::KeyName::LeftShift)) MoveUpDown -= 1.0f;
|
||||
|
||||
SDK::FRotator CameraRotation = Actors::MainCamera.Rotation;
|
||||
SDK::FVector ForwardVector = SDK::FVector();
|
||||
SDK::FRotator CameraRotation = Actors::MainCamera.Rotation;
|
||||
SDK::FVector ForwardVector = SDK::FVector();
|
||||
|
||||
// Tilting in the air is disabled for planes, it causes many issues
|
||||
if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass()) || Config::Exploits::Vehicle::NoTilting)
|
||||
{
|
||||
SDK::FRotator AdjustedCameraRotation = Actors::MainCamera.Rotation;
|
||||
AdjustedCameraRotation.Pitch = 0.f;
|
||||
// Tilting in the air is disabled for planes, it causes many issues
|
||||
if (Vehicle->IsA(SDK::AFortAthenaDoghouseVehicle::StaticClass()) || Config::Exploits::Vehicle::NoTilting) {
|
||||
SDK::FRotator AdjustedCameraRotation = Actors::MainCamera.Rotation;
|
||||
AdjustedCameraRotation.Pitch = 0.f;
|
||||
|
||||
ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(AdjustedCameraRotation);
|
||||
ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(AdjustedCameraRotation);
|
||||
|
||||
ForwardVector.Z = 0.f;
|
||||
CameraRotation.Pitch = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(Actors::MainCamera.Rotation);
|
||||
}
|
||||
ForwardVector.Z = 0.f;
|
||||
CameraRotation.Pitch = 0.f;
|
||||
}
|
||||
else {
|
||||
ForwardVector = SDK::UKismetMathLibrary::GetForwardVector(Actors::MainCamera.Rotation);
|
||||
}
|
||||
|
||||
SDK::FVector MovementDirection = ForwardVector * MoveForwardBackward +
|
||||
SDK::UKismetMathLibrary::GetRightVector(Actors::MainCamera.Rotation) * MoveLeftRight +
|
||||
SDK::UKismetMathLibrary::GetRightVector(Actors::MainCamera.Rotation) * MoveLeftRight +
|
||||
SDK::FVector(0, 0, 1) * MoveUpDown;
|
||||
|
||||
// Adjust MovementDirection for 60 FPS (so speed doesn't depend on FPS)
|
||||
MovementDirection = MovementDirection / Actors::FPSScale;
|
||||
// Adjust MovementDirection for 60 FPS (so speed doesn't depend on FPS)
|
||||
MovementDirection = MovementDirection / Actors::FPSScale;
|
||||
|
||||
SDK::FVector NewLocation = Vehicle->RootComponent()->RelativeLocation() + (MovementDirection * Config::Exploits::Vehicle::FlySpeed);
|
||||
SDK::FVector NewLocation = Vehicle->RootComponent()->RelativeLocation() + (MovementDirection * Config::Exploits::Vehicle::FlySpeed);
|
||||
|
||||
if (MovementDirection != SDK::FVector())
|
||||
{
|
||||
Vehicle->K2_TeleportTo(NewLocation, CameraRotation);
|
||||
if (MovementDirection != SDK::FVector()) {
|
||||
Vehicle->K2_TeleportTo(NewLocation, CameraRotation);
|
||||
|
||||
if (Config::Exploits::Vehicle::FlyThroughWalls)
|
||||
{
|
||||
WasNoCollisionLastTick = true;
|
||||
Vehicle->SetActorEnableCollision(false); // ADD AUTO REVERT TO THIS
|
||||
}
|
||||
else
|
||||
{
|
||||
Vehicle->SetActorEnableCollision(true); // ADD AUTO REVERT TO THIS
|
||||
}
|
||||
if (Config::Exploits::Vehicle::FlyThroughWalls) {
|
||||
WasNoCollisionLastTick = true;
|
||||
Vehicle->SetActorEnableCollision(false); // ADD AUTO REVERT TO THIS
|
||||
}
|
||||
else {
|
||||
Vehicle->SetActorEnableCollision(true); // ADD AUTO REVERT TO THIS
|
||||
}
|
||||
|
||||
// If FreezeInAir is off, only freeze the vehicle when it's flying
|
||||
if (Config::Exploits::Vehicle::FreezeInAir == false)
|
||||
{
|
||||
Vehicle->RootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Vehicle->K2_SetActorRotation(CameraRotation, true);
|
||||
}
|
||||
// If FreezeInAir is off, only freeze the vehicle when it's flying
|
||||
if (Config::Exploits::Vehicle::FreezeInAir == false) {
|
||||
Vehicle->RootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName());
|
||||
}
|
||||
}
|
||||
else {
|
||||
Vehicle->K2_SetActorRotation(CameraRotation, true);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Vehicle::FreezeInAir)
|
||||
{
|
||||
Vehicle->RootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (VehicleLastTick)
|
||||
{
|
||||
if (WasNoCollisionLastTick)
|
||||
{
|
||||
VehicleLastTick->SetActorEnableCollision(true);
|
||||
WasNoCollisionLastTick = false;
|
||||
if (Config::Exploits::Vehicle::FreezeInAir) {
|
||||
Vehicle->RootComponent()->SetPhysicsLinearVelocity(SDK::FVector(0, 0, 0), false, SDK::FName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (VehicleLastTick) {
|
||||
if (WasNoCollisionLastTick) {
|
||||
VehicleLastTick->SetActorEnableCollision(true);
|
||||
WasNoCollisionLastTick = false;
|
||||
}
|
||||
|
||||
VehicleLastTick = nullptr;
|
||||
}
|
||||
VehicleLastTick = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,13 @@
|
||||
|
||||
// credits to tiva for nothing
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Exploits
|
||||
{
|
||||
namespace Vehicle
|
||||
{
|
||||
void Tick(SDK::AFortPlayerPawnAthena* FortPawn);
|
||||
namespace Features {
|
||||
namespace Exploits {
|
||||
namespace Vehicle {
|
||||
void Tick(SDK::AFortPlayerPawnAthena* FortPawn);
|
||||
|
||||
inline bool WasNoCollisionLastTick = false;
|
||||
inline SDK::AFortAthenaVehicle* VehicleLastTick = nullptr;
|
||||
}
|
||||
}
|
||||
inline bool WasNoCollisionLastTick = false;
|
||||
inline SDK::AFortAthenaVehicle* VehicleLastTick = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,84 +6,68 @@
|
||||
|
||||
#include "../../SDK/SDKInitializer.h"
|
||||
|
||||
void Features::Exploits::Weapon::Tick(SDK::AFortWeapon* Weapon)
|
||||
{
|
||||
if (Weapon)
|
||||
{
|
||||
// We have to init here because we need a valid AFortWeapon to get the VFT
|
||||
if (SDK::Cached::VFT::GetWeaponStats == 0x0)
|
||||
{
|
||||
SDKInitializer::InitGetWeaponStatsIndex(Weapon);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrentWeapon != Weapon || CurrentWeapon == nullptr || CurrentWeaponStats == nullptr)
|
||||
{
|
||||
CurrentWeapon = Weapon;
|
||||
CurrentWeaponStats = Weapon->WeaponStats();
|
||||
}
|
||||
void Features::Exploits::Weapon::Tick(SDK::AFortWeapon* Weapon) {
|
||||
if (Weapon) {
|
||||
// We have to init here because we need a valid AFortWeapon to get the VFT
|
||||
if (SDK::Cached::VFT::GetWeaponStats == 0x0) {
|
||||
SDKInitializer::InitGetWeaponStatsIndex(Weapon);
|
||||
}
|
||||
else {
|
||||
if (CurrentWeapon != Weapon || CurrentWeapon == nullptr || CurrentWeaponStats == nullptr) {
|
||||
CurrentWeapon = Weapon;
|
||||
CurrentWeaponStats = Weapon->WeaponStats();
|
||||
}
|
||||
|
||||
if (CurrentWeaponStats)
|
||||
{
|
||||
if (Weapon->IsPickaxe())
|
||||
{
|
||||
SDK::FFortMeleeWeaponStats* MeleeWeaponStats = (SDK::FFortMeleeWeaponStats*)CurrentWeaponStats;
|
||||
if (Config::Exploits::Pickaxe::FastPickaxe)
|
||||
{
|
||||
MeleeWeaponStats->SetSwingPlaySpeed(Config::Exploits::Pickaxe::SpeedMultiplier, &Config::Exploits::Pickaxe::FastPickaxe);
|
||||
}
|
||||
}
|
||||
else if (Weapon->IsA(SDK::AFortWeaponRanged::StaticClass()))
|
||||
{
|
||||
SDK::FFortRangedWeaponStats* RangedWeaponStats = (SDK::FFortRangedWeaponStats*)CurrentWeaponStats;
|
||||
if (CurrentWeaponStats) {
|
||||
if (Weapon->IsPickaxe()) {
|
||||
SDK::FFortMeleeWeaponStats* MeleeWeaponStats = (SDK::FFortMeleeWeaponStats*)CurrentWeaponStats;
|
||||
if (Config::Exploits::Pickaxe::FastPickaxe) {
|
||||
MeleeWeaponStats->SetSwingPlaySpeed(Config::Exploits::Pickaxe::SpeedMultiplier, &Config::Exploits::Pickaxe::FastPickaxe);
|
||||
}
|
||||
}
|
||||
else if (Weapon->IsA(SDK::AFortWeaponRanged::StaticClass())) {
|
||||
SDK::FFortRangedWeaponStats* RangedWeaponStats = (SDK::FFortRangedWeaponStats*)CurrentWeaponStats;
|
||||
|
||||
if (Config::Exploits::Weapon::NoSpread)
|
||||
{
|
||||
// you definetly dont need to do all of these, but yeah
|
||||
RangedWeaponStats->SetSpread(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetSpreadDownsights(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetStandingStillSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaCrouchingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaJumpingFallingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaSprintingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetMinSpeedForSpreadMultiplier(FLT_MAX, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetMaxSpeedForSpreadMultiplier(FLT_MAX, &Config::Exploits::Weapon::NoSpread);
|
||||
}
|
||||
if (Config::Exploits::Weapon::NoSpread) {
|
||||
// you definetly dont need to do all of these, but yeah
|
||||
RangedWeaponStats->SetSpread(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetSpreadDownsights(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetStandingStillSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaCrouchingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaJumpingFallingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetAthenaSprintingSpreadMultiplier(0.f, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetMinSpeedForSpreadMultiplier(FLT_MAX, &Config::Exploits::Weapon::NoSpread);
|
||||
RangedWeaponStats->SetMaxSpeedForSpreadMultiplier(FLT_MAX, &Config::Exploits::Weapon::NoSpread);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Weapon::NoReload)
|
||||
{
|
||||
RangedWeaponStats->SetReloadTime(0.f, &Config::Exploits::Weapon::NoReload);
|
||||
}
|
||||
if (Config::Exploits::Weapon::NoReload) {
|
||||
RangedWeaponStats->SetReloadTime(0.f, &Config::Exploits::Weapon::NoReload);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Weapon::NoRecoil)
|
||||
{
|
||||
RangedWeaponStats->SetRecoilVert(0.f, &Config::Exploits::Weapon::NoRecoil);
|
||||
RangedWeaponStats->SetRecoilHoriz(0.f, &Config::Exploits::Weapon::NoRecoil);
|
||||
}
|
||||
if (Config::Exploits::Weapon::NoRecoil) {
|
||||
RangedWeaponStats->SetRecoilVert(0.f, &Config::Exploits::Weapon::NoRecoil);
|
||||
RangedWeaponStats->SetRecoilHoriz(0.f, &Config::Exploits::Weapon::NoRecoil);
|
||||
}
|
||||
|
||||
if (Config::Exploits::Weapon::RapidFire)
|
||||
{
|
||||
if (SDK::Cached::Offsets::FortWeapon::LastFireTimeVerified != 0x0)
|
||||
{
|
||||
float LastFireTime = Weapon->LastFireTime();
|
||||
float LastFireTimeVerified = Weapon->LastFireTimeVerified();
|
||||
if (Config::Exploits::Weapon::RapidFire) {
|
||||
if (SDK::Cached::Offsets::FortWeapon::LastFireTimeVerified != 0x0) {
|
||||
float LastFireTime = Weapon->LastFireTime();
|
||||
float LastFireTimeVerified = Weapon->LastFireTimeVerified();
|
||||
|
||||
Weapon->SetLastFireTime(LastFireTime + LastFireTimeVerified - 0.3f);
|
||||
}
|
||||
else
|
||||
{
|
||||
float LastFireTime = Weapon->LastFireTime();
|
||||
Weapon->SetLastFireTime(LastFireTime + LastFireTimeVerified - 0.3f);
|
||||
}
|
||||
else {
|
||||
float LastFireTime = Weapon->LastFireTime();
|
||||
|
||||
Weapon->SetLastFireTime(LastFireTime - 0.3f);
|
||||
}
|
||||
}
|
||||
Weapon->SetLastFireTime(LastFireTime - 0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Exploits::Weapon::UseDamageMultiplier)
|
||||
{
|
||||
RangedWeaponStats->SetBulletsPerCartridge(Config::Exploits::Weapon::DamageMultiplier, &Config::Exploits::Weapon::UseDamageMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Config::Exploits::Weapon::UseDamageMultiplier) {
|
||||
RangedWeaponStats->SetBulletsPerCartridge(Config::Exploits::Weapon::DamageMultiplier, &Config::Exploits::Weapon::UseDamageMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
#pragma once
|
||||
#include "../../SDK/Classes/FortniteGame_Classes.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Exploits
|
||||
{
|
||||
namespace Weapon
|
||||
{
|
||||
void Tick(SDK::AFortWeapon* Weapon);
|
||||
namespace Features {
|
||||
namespace Exploits {
|
||||
namespace Weapon {
|
||||
void Tick(SDK::AFortWeapon* Weapon);
|
||||
|
||||
inline SDK::AFortWeapon* CurrentWeapon = nullptr;
|
||||
inline SDK::FFortBaseWeaponStats* CurrentWeaponStats = nullptr;
|
||||
}
|
||||
}
|
||||
inline SDK::AFortWeapon* CurrentWeapon = nullptr;
|
||||
inline SDK::FFortBaseWeaponStats* CurrentWeaponStats = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "Visuals/Chams.h"
|
||||
|
||||
void Features::RevertAll()
|
||||
{
|
||||
void Features::RevertAll() {
|
||||
AutoRevertFeatures.clear();
|
||||
|
||||
// Revert all features
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include "../SDK/SDK.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
class IAutoRevertFeature
|
||||
{
|
||||
namespace Features {
|
||||
class IAutoRevertFeature {
|
||||
public:
|
||||
virtual ~IAutoRevertFeature() = default;
|
||||
|
||||
@@ -17,44 +15,35 @@ namespace Features
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class AutoRevertFeature : public IAutoRevertFeature
|
||||
{
|
||||
class AutoRevertFeature : public IAutoRevertFeature {
|
||||
private:
|
||||
T* Address;
|
||||
T OriginalValue;
|
||||
bool* Enabled;
|
||||
public:
|
||||
AutoRevertFeature(T* Address, bool* Enabled) : Address(Address), Enabled(Enabled)
|
||||
{
|
||||
if (SDK::IsValidPointer(Address) && SDK::IsValidPointer(Enabled))
|
||||
{
|
||||
AutoRevertFeature(T* Address, bool* Enabled) : Address(Address), Enabled(Enabled) {
|
||||
if (SDK::IsValidPointer(Address) && SDK::IsValidPointer(Enabled)) {
|
||||
OriginalValue = *Address;
|
||||
}
|
||||
}
|
||||
|
||||
~AutoRevertFeature() override
|
||||
{
|
||||
~AutoRevertFeature() override {
|
||||
if (SDK::IsValidPointer(Address)) *Address = OriginalValue;
|
||||
}
|
||||
|
||||
bool IsDuplicate(void* Address, bool* Enabled, uint8_t BitMask) const override
|
||||
{
|
||||
bool IsDuplicate(void* Address, bool* Enabled, uint8_t BitMask) const override {
|
||||
return (this->Address == Address) && (this->Enabled == Enabled);
|
||||
}
|
||||
|
||||
bool Tick() override
|
||||
{
|
||||
if (SDK::IsValidPointer(Address) && SDK::IsValidPointer(Enabled))
|
||||
{
|
||||
if (*Enabled == false)
|
||||
{
|
||||
bool Tick() override {
|
||||
if (SDK::IsValidPointer(Address) && SDK::IsValidPointer(Enabled)) {
|
||||
if (*Enabled == false) {
|
||||
*Address = OriginalValue;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -62,54 +51,42 @@ namespace Features
|
||||
}
|
||||
};
|
||||
|
||||
class AutoRevertBitFeature : public IAutoRevertFeature
|
||||
{
|
||||
class AutoRevertBitFeature : public IAutoRevertFeature {
|
||||
private:
|
||||
uint8_t* Address;
|
||||
uint8_t BitMask;
|
||||
bool OriginalValue;
|
||||
bool* Enabled;
|
||||
public:
|
||||
AutoRevertBitFeature(uint8_t* Address, uint8_t BitMask, bool* Enabled) : Address(Address), BitMask(BitMask), Enabled(Enabled)
|
||||
{
|
||||
if (Address && Enabled)
|
||||
{
|
||||
AutoRevertBitFeature(uint8_t* Address, uint8_t BitMask, bool* Enabled) : Address(Address), BitMask(BitMask), Enabled(Enabled) {
|
||||
if (Address && Enabled) {
|
||||
OriginalValue = *Address & BitMask;
|
||||
}
|
||||
}
|
||||
|
||||
~AutoRevertBitFeature() override
|
||||
{
|
||||
if (Address && Enabled && !*Enabled)
|
||||
{
|
||||
if (OriginalValue)
|
||||
{
|
||||
~AutoRevertBitFeature() override {
|
||||
if (Address && Enabled && !*Enabled) {
|
||||
if (OriginalValue) {
|
||||
*Address |= BitMask; // Set the bit
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*Address &= ~BitMask; // Clear the bit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsDuplicate(void* Address, bool* Enabled, uint8_t BitMask) const override
|
||||
{
|
||||
bool IsDuplicate(void* Address, bool* Enabled, uint8_t BitMask) const override {
|
||||
return (this->Address == Address) && (this->Enabled == Enabled) && (this->BitMask == BitMask);
|
||||
}
|
||||
|
||||
bool Tick() override
|
||||
{
|
||||
if (Address && Enabled)
|
||||
{
|
||||
if (*Enabled == false)
|
||||
{
|
||||
bool Tick() override {
|
||||
if (Address && Enabled) {
|
||||
if (*Enabled == false) {
|
||||
*Address = OriginalValue ? *Address | BitMask : *Address & ~BitMask;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,15 +97,12 @@ namespace Features
|
||||
inline std::vector<std::unique_ptr<IAutoRevertFeature>> AutoRevertFeatures;
|
||||
|
||||
template <typename T>
|
||||
inline void CreateAutoRevertFeature(T* Address, bool* Enabled)
|
||||
{
|
||||
inline void CreateAutoRevertFeature(T* Address, bool* Enabled) {
|
||||
auto Feature = std::make_unique<AutoRevertFeature<T>>(Address, Enabled);
|
||||
|
||||
// Check that there isn't already a feature with the same Address and Enabled
|
||||
for (const auto& ExistingFeature : AutoRevertFeatures)
|
||||
{
|
||||
if (ExistingFeature->IsDuplicate(Address, Enabled, 0))
|
||||
{
|
||||
for (const auto& ExistingFeature : AutoRevertFeatures) {
|
||||
if (ExistingFeature->IsDuplicate(Address, Enabled, 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -136,15 +110,12 @@ namespace Features
|
||||
AutoRevertFeatures.push_back(std::move(Feature));
|
||||
}
|
||||
|
||||
inline void CreateAutoRevertBitFeature(uint8_t* Address, uint8_t BitPosition, bool* Enabled)
|
||||
{
|
||||
inline void CreateAutoRevertBitFeature(uint8_t* Address, uint8_t BitPosition, bool* Enabled) {
|
||||
auto Feature = std::make_unique<AutoRevertBitFeature>(Address, BitPosition, Enabled);
|
||||
|
||||
// Check that there isn't already a feature with the same Address and Enabled
|
||||
for (const auto& ExistingFeature : AutoRevertFeatures)
|
||||
{
|
||||
if (ExistingFeature->IsDuplicate(Address, Enabled, BitPosition))
|
||||
{
|
||||
for (const auto& ExistingFeature : AutoRevertFeatures) {
|
||||
if (ExistingFeature->IsDuplicate(Address, Enabled, BitPosition)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -152,17 +123,13 @@ namespace Features
|
||||
AutoRevertFeatures.push_back(std::move(Feature));
|
||||
}
|
||||
|
||||
inline void Tick()
|
||||
{
|
||||
inline void Tick() {
|
||||
auto it = AutoRevertFeatures.begin();
|
||||
while (it != AutoRevertFeatures.end())
|
||||
{
|
||||
if ((*it)->Tick() == false)
|
||||
{
|
||||
while (it != AutoRevertFeatures.end()) {
|
||||
if ((*it)->Tick() == false) {
|
||||
it = AutoRevertFeatures.erase(it); // Remove the feature if Tick returns false
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -172,24 +139,19 @@ namespace Features
|
||||
|
||||
|
||||
|
||||
namespace Aimbot
|
||||
{
|
||||
class Target;
|
||||
}
|
||||
namespace Aimbot {
|
||||
class Target;
|
||||
}
|
||||
|
||||
namespace Exploits
|
||||
{
|
||||
namespace Vehicle
|
||||
{
|
||||
namespace Exploits {
|
||||
namespace Vehicle {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace FortPawnHelper
|
||||
{
|
||||
namespace Bone
|
||||
{
|
||||
namespace FortPawnHelper {
|
||||
namespace Bone {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +1,47 @@
|
||||
#include "Bone.h"
|
||||
|
||||
#include "../../../Utilities/Logger.h"
|
||||
#include "../../../Utilities/Math.h"
|
||||
#include "../../../Utilities/Logger.h"
|
||||
|
||||
#include "../../Game.h"
|
||||
|
||||
Features::FortPawnHelper::Bone::BoneID Features::FortPawnHelper::Bone::FindClosestBoneBetweenTwo(const SDK::FVector2D& BonePosition1, const SDK::FVector2D& BonePosition2, const BoneID BoneID1, const BoneID BoneID2)
|
||||
{
|
||||
Features::FortPawnHelper::Bone::BoneID Features::FortPawnHelper::Bone::FindClosestBoneBetweenTwo(SDK::FVector2D BonePosition1, SDK::FVector2D BonePosition2, BoneID BoneID1, BoneID BoneID2) {
|
||||
float Bone1Distance = Math::GetDistance2D(BonePosition1.X, BonePosition1.Y, (float)Game::ScreenCenterX, (float)Game::ScreenCenterY);
|
||||
float Bone2Distance = Math::GetDistance2D(BonePosition2.X, BonePosition2.Y, (float)Game::ScreenCenterX, (float)Game::ScreenCenterY);
|
||||
|
||||
if (Bone1Distance < Bone2Distance) return BoneID1;
|
||||
else return BoneID2;
|
||||
}
|
||||
Features::FortPawnHelper::Bone::BoneID Features::FortPawnHelper::Bone::FindBestBone(const BoneID TargetBone, Actors::Caches::FortPawnCache& FortPawnCache, const bool VisibleCheck)
|
||||
{
|
||||
if (FortPawnCache.BoneVisibilityStates.size() < BONEID_MAX || FortPawnCache.BonePositions2D.size() < BONEID_MAX)
|
||||
{
|
||||
Features::FortPawnHelper::Bone::BoneID Features::FortPawnHelper::Bone::FindBestBone(BoneID TargetBone, Actors::Caches::FortPawnCache& FortPawnCache, bool VisibleCheck) {
|
||||
if (FortPawnCache.BoneVisibilityStates.size() < BONEID_MAX || FortPawnCache.BonePositions2D.size() < BONEID_MAX) {
|
||||
return None;
|
||||
}
|
||||
|
||||
for (auto& BonePair : BoneHierarchyOrder)
|
||||
{
|
||||
for (auto& BonePair : BoneHierarchyOrder) {
|
||||
BoneID LeftBone = BonePair.first;
|
||||
BoneID RightBone = BonePair.second;
|
||||
|
||||
if (FortPawnCache.BoneVisibilityStates[LeftBone] && FortPawnCache.BoneVisibilityStates[RightBone])
|
||||
{
|
||||
if (FortPawnCache.BoneVisibilityStates[LeftBone] && FortPawnCache.BoneVisibilityStates[RightBone]) {
|
||||
return FindClosestBoneBetweenTwo(FortPawnCache.BonePositions2D[LeftBone], FortPawnCache.BonePositions2D[RightBone], LeftBone, RightBone);
|
||||
}
|
||||
|
||||
if (FortPawnCache.BoneVisibilityStates[LeftBone])
|
||||
{
|
||||
if (FortPawnCache.BoneVisibilityStates[LeftBone]) {
|
||||
return LeftBone;
|
||||
}
|
||||
else if (FortPawnCache.BoneVisibilityStates[RightBone])
|
||||
{
|
||||
else if (FortPawnCache.BoneVisibilityStates[RightBone]) {
|
||||
return RightBone;
|
||||
}
|
||||
}
|
||||
|
||||
if (VisibleCheck == false)
|
||||
{
|
||||
return TargetBone;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VisibleCheck == false) {
|
||||
return TargetBone;
|
||||
}
|
||||
else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
SDK::FName Features::FortPawnHelper::Bone::GetBoneName(const BoneID BoneID)
|
||||
{
|
||||
switch (BoneID)
|
||||
{
|
||||
SDK::FName Features::FortPawnHelper::Bone::GetBoneName(BoneID BoneID) {
|
||||
switch (BoneID) {
|
||||
case Head: return Names.Head;
|
||||
case Neck: return Names.Neck;
|
||||
case LeftShoulder: return Names.LeftShoulder;
|
||||
@@ -76,8 +65,7 @@ SDK::FName Features::FortPawnHelper::Bone::GetBoneName(const BoneID BoneID)
|
||||
|
||||
return Names.None;
|
||||
}
|
||||
void Features::FortPawnHelper::Bone::Init()
|
||||
{
|
||||
void Features::FortPawnHelper::Bone::Init() {
|
||||
DEBUG_LOG(LOG_OFFSET, skCrypt("Initializing bone names..."));
|
||||
|
||||
// Init Names
|
||||
|
||||
@@ -5,16 +5,12 @@
|
||||
|
||||
#include "../../Actors/ActorCache.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace FortPawnHelper
|
||||
{
|
||||
namespace Features {
|
||||
namespace FortPawnHelper {
|
||||
/* Stores the BoneID enum and is used in aimbot to calculate target bone */
|
||||
namespace Bone
|
||||
{
|
||||
namespace Bone {
|
||||
/* Represents the bone names of a FortPawn */
|
||||
struct BoneNames
|
||||
{
|
||||
struct BoneNames {
|
||||
SDK::FName Head;
|
||||
SDK::FName Neck;
|
||||
|
||||
@@ -45,8 +41,7 @@ namespace Features
|
||||
inline BoneNames Names;
|
||||
|
||||
/* Represents the bone IDs of a FortPawn (THE ORDER OF THE ENUM AFFECTS VARIOUS FUNCTIONS, AVOID CHANGING ORDER) */
|
||||
enum BoneID_ : uint8_t
|
||||
{
|
||||
enum BoneID_ : uint8_t {
|
||||
Head = 1, // "head"
|
||||
Neck = 2, // "neck_01"
|
||||
|
||||
@@ -124,16 +119,16 @@ namespace Features
|
||||
* @param BoneID1 - The ID of the first bone
|
||||
* @param BoneID2 - The ID of the second bone
|
||||
*/
|
||||
BoneID FindClosestBoneBetweenTwo(const SDK::FVector2D& BonePosition1, const SDK::FVector2D& BonePosition2, const BoneID BoneID1, const BoneID BoneID2);
|
||||
BoneID FindClosestBoneBetweenTwo(SDK::FVector2D BonePosition1, SDK::FVector2D BonePosition2, BoneID BoneID1, BoneID BoneID2);
|
||||
|
||||
/*
|
||||
* @brief Find the best bone to aim at based on the bone hierarchy and visibilities
|
||||
*
|
||||
* @param TargetBone - The optimal bone to aim at
|
||||
* @param FortPawnCache - The pawn cache of the target
|
||||
* @param VisibleCheck - If true,
|
||||
* @param VisibleCheck - If true,
|
||||
*/
|
||||
BoneID FindBestBone(const BoneID TargetBone, Actors::Caches::FortPawnCache& FortPawnCache, const bool VisibleCheck);
|
||||
BoneID FindBestBone(BoneID TargetBone, Actors::Caches::FortPawnCache& FortPawnCache, bool VisibleCheck);
|
||||
|
||||
/*
|
||||
* @brief Get a cached bone FName from BoneID
|
||||
@@ -142,7 +137,7 @@ namespace Features
|
||||
*
|
||||
* @return The FName of the bone
|
||||
*/
|
||||
SDK::FName GetBoneName(const BoneID BoneID);
|
||||
SDK::FName GetBoneName(BoneID BoneID);
|
||||
|
||||
/* Initiate bone FNames for GetSocketLocation */
|
||||
void Init();
|
||||
|
||||
@@ -4,101 +4,82 @@
|
||||
|
||||
#include "../../../Utilities/Math.h"
|
||||
|
||||
bool Features::FortPawnHelper::PopulateBones(Actors::Caches::FortPawnCache& FortPawnCache)
|
||||
{
|
||||
// Resize the bone register to avoid out of range errors
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
bool Features::FortPawnHelper::PopulateBones(Actors::Caches::FortPawnCache& FortPawnCache) {
|
||||
// Resize the bone register to avoid out of range errors
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
|
||||
bool FoundBoneOnScreen = false;
|
||||
bool FoundBoneOnScreen = false;
|
||||
|
||||
for (int i = Bone::Head; i < Bone::BONEID_MAX; i++)
|
||||
{
|
||||
FortPawnCache.BonePositions3D[i] = FortPawnCache.Mesh->GetBonePosition(i);
|
||||
for (int i = Bone::Head; i < Bone::BONEID_MAX; i++) {
|
||||
FortPawnCache.BonePositions3D[i] = FortPawnCache.Mesh->GetBonePosition(i);
|
||||
|
||||
if (i == Bone::Head)
|
||||
{
|
||||
if (FortPawnCache.BonePositions3D[Bone::Head] == SDK::FVector(0, 0, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (i == Bone::Head) {
|
||||
if (FortPawnCache.BonePositions3D[Bone::Head] == SDK::FVector(0, 0, 0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == Bone::Chest)
|
||||
{
|
||||
FortPawnCache.BonePositions3D[Bone::Chest] = (FortPawnCache.BonePositions3D[Bone::ChestLeft] + FortPawnCache.BonePositions3D[Bone::ChestRight]) / 2;
|
||||
}
|
||||
if (i == Bone::Chest) {
|
||||
FortPawnCache.BonePositions3D[Bone::Chest] = (FortPawnCache.BonePositions3D[Bone::ChestLeft] + FortPawnCache.BonePositions3D[Bone::ChestRight]) / 2;
|
||||
}
|
||||
|
||||
// To avoid W2Sing players that aren't on the screen
|
||||
if (i <= 5 || FoundBoneOnScreen)
|
||||
{
|
||||
FortPawnCache.BonePositions2D[i] = SDK::Project(FortPawnCache.BonePositions3D[i]);
|
||||
// To avoid W2Sing players that aren't on the screen
|
||||
if (i <= 5 || FoundBoneOnScreen) {
|
||||
FortPawnCache.BonePositions2D[i] = SDK::Project(FortPawnCache.BonePositions3D[i]);
|
||||
|
||||
if (Math::IsOnScreen(FortPawnCache.BonePositions2D[i]))
|
||||
{
|
||||
FoundBoneOnScreen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Math::IsOnScreen(FortPawnCache.BonePositions2D[i])) {
|
||||
FoundBoneOnScreen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FoundBoneOnScreen;
|
||||
return FoundBoneOnScreen;
|
||||
}
|
||||
void Features::FortPawnHelper::PopulateVisibilities(Actors::Caches::FortPawnCache& FortPawnCache)
|
||||
{
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
void Features::FortPawnHelper::PopulateVisibilities(Actors::Caches::FortPawnCache& FortPawnCache) {
|
||||
FortPawnCache.BonePositions3D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BonePositions2D.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
FortPawnCache.BoneVisibilityStates.resize(Features::FortPawnHelper::Bone::BONEID_MAX);
|
||||
|
||||
SDK::APawn* LocalPawn = SDK::GetLocalPawn();
|
||||
|
||||
for (int i = Bone::Head; i < Bone::BONEID_MAX; i++)
|
||||
{
|
||||
FortPawnCache.BoneVisibilityStates[i] = true;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Head] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Head], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Chest] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Chest], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftShoulder] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftShoulder], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightShoulder] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightShoulder], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftElbow] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftElbow], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightElbow] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightElbow], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftHand] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftHand], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightHand] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightHand], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftLeg] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftLeg], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightLeg] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightLeg], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftKnee] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftKnee], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightKnee] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightKnee], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftFoot] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftFoot], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightFoot] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightFoot], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Pelvis] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Pelvis], FortPawnCache.FortPawn, LocalPawn);
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Head] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Head], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Chest] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Chest], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftShoulder] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftShoulder], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightShoulder] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightShoulder], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftElbow] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftElbow], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightElbow] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightElbow], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftHand] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftHand], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightHand] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightHand], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftLeg] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftLeg], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightLeg] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightLeg], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftKnee] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftKnee], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightKnee] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightKnee], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::LeftFoot] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::LeftFoot], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::RightFoot] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::RightFoot], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
FortPawnCache.BoneVisibilityStates[Bone::Pelvis] = SDK::IsPositionVisible(FortPawnCache.FortPawn, FortPawnCache.BonePositions3D[Bone::Pelvis], FortPawnCache.FortPawn, SDK::GetLocalPawn());
|
||||
}
|
||||
void Features::FortPawnHelper::PopulateBoundCorners(Actors::Caches::FortPawnCache& FortPawnCache, SDK::FVector2D& TopLeft, SDK::FVector2D& BottomRight)
|
||||
{
|
||||
TopLeft = SDK::FVector2D(FLT_MAX, FLT_MAX);
|
||||
BottomRight = SDK::FVector2D(-FLT_MAX, -FLT_MAX);
|
||||
void Features::FortPawnHelper::PopulateBoundCorners(Actors::Caches::FortPawnCache& FortPawnCache, SDK::FVector2D& TopLeft, SDK::FVector2D& BottomRight) {
|
||||
TopLeft = SDK::FVector2D(FLT_MAX, FLT_MAX);
|
||||
BottomRight = SDK::FVector2D(-FLT_MAX, -FLT_MAX);
|
||||
|
||||
for (int i = Bone::Head; i < Bone::BONEID_MAX; i++)
|
||||
{
|
||||
TopLeft.X = min(TopLeft.X, FortPawnCache.BonePositions2D[i].X);
|
||||
TopLeft.Y = min(TopLeft.Y, FortPawnCache.BonePositions2D[i].Y);
|
||||
for (int i = Bone::Head; i < Bone::BONEID_MAX; i++) {
|
||||
TopLeft.X = min(TopLeft.X, FortPawnCache.BonePositions2D[i].X);
|
||||
TopLeft.Y = min(TopLeft.Y, FortPawnCache.BonePositions2D[i].Y);
|
||||
|
||||
BottomRight.X = max(BottomRight.X, FortPawnCache.BonePositions2D[i].X);
|
||||
BottomRight.Y = max(BottomRight.Y, FortPawnCache.BonePositions2D[i].Y);
|
||||
}
|
||||
BottomRight.X = max(BottomRight.X, FortPawnCache.BonePositions2D[i].X);
|
||||
BottomRight.Y = max(BottomRight.Y, FortPawnCache.BonePositions2D[i].Y);
|
||||
}
|
||||
|
||||
// Adjust the bounding box to make it more visually appealing
|
||||
float BoxSizeMultiplier = Math::CalculateInterpolatedValue(FortPawnCache.DistanceFromLocalPawn, 100.f, 1.0f, 4.0f);
|
||||
// Adjust the bounding box to make it more visually appealing
|
||||
float BoxSizeMultiplier = Math::CalculateInterpolatedValue(FortPawnCache.DistanceFromLocalPawn, 100.f, 1.0f, 4.0f);
|
||||
|
||||
// Increase the size of the bounding box by a percentage of the original size. This is to make the bounding box more visually appealing.
|
||||
float LeftRightOffset = (BottomRight.X - TopLeft.X) * (0.36f * BoxSizeMultiplier);
|
||||
float TopBottomOffset = (BottomRight.Y - TopLeft.Y) * (0.14f * BoxSizeMultiplier);
|
||||
// Increase the size of the bounding box by a percentage of the original size. This is to make the bounding box more visually appealing.
|
||||
float LeftRightOffset = (BottomRight.X - TopLeft.X) * (0.36f * BoxSizeMultiplier);
|
||||
float TopBottomOffset = (BottomRight.Y - TopLeft.Y) * (0.14f * BoxSizeMultiplier);
|
||||
|
||||
TopLeft.X -= LeftRightOffset;
|
||||
TopLeft.Y -= TopBottomOffset;
|
||||
TopLeft.X -= LeftRightOffset;
|
||||
TopLeft.Y -= TopBottomOffset;
|
||||
|
||||
BottomRight.X += LeftRightOffset;
|
||||
BottomRight.Y += TopBottomOffset;
|
||||
BottomRight.X += LeftRightOffset;
|
||||
BottomRight.Y += TopBottomOffset;
|
||||
}
|
||||
@@ -1,31 +1,29 @@
|
||||
#pragma once
|
||||
#include "../../Actors/ActorCache.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace FortPawnHelper
|
||||
{
|
||||
/*
|
||||
* @brief Poplate all bone positions used in the skeleton
|
||||
*
|
||||
* @param FortPawn The FortPawn to populate bones
|
||||
*/
|
||||
bool PopulateBones(Actors::Caches::FortPawnCache& FortPawnCache);
|
||||
namespace Features {
|
||||
namespace FortPawnHelper {
|
||||
/*
|
||||
* @brief Poplate all bone positions used in the skeleton
|
||||
*
|
||||
* @param FortPawn The FortPawn to populate bones
|
||||
*/
|
||||
bool PopulateBones(Actors::Caches::FortPawnCache& FortPawnCache);
|
||||
|
||||
/*
|
||||
* @brief Poplate all bone visibilities used in the skeleton
|
||||
*
|
||||
* @param FortPawn The FortPawn to populate visibilities
|
||||
*/
|
||||
void PopulateVisibilities(Actors::Caches::FortPawnCache& FortPawnCache);
|
||||
/*
|
||||
* @brief Poplate all bone visibilities used in the skeleton
|
||||
*
|
||||
* @param FortPawn The FortPawn to populate visibilities
|
||||
*/
|
||||
void PopulateVisibilities(Actors::Caches::FortPawnCache& FortPawnCache);
|
||||
|
||||
/*
|
||||
* @brief Populate the bound corners of the pawn
|
||||
*
|
||||
* @param FortPawnCache The FortPawn to populate the bound corners of
|
||||
* @param BottomLeft The bottom left corner of the pawn
|
||||
* @param TopRight The top right corner of the pawn
|
||||
*/
|
||||
void PopulateBoundCorners(Actors::Caches::FortPawnCache& FortPawnCache, SDK::FVector2D& BottomLeft, SDK::FVector2D& TopRight);
|
||||
};
|
||||
/*
|
||||
* @brief Populate the bound corners of the pawn
|
||||
*
|
||||
* @param FortPawnCache The FortPawn to populate the bound corners of
|
||||
* @param BottomLeft The bottom left corner of the pawn
|
||||
* @param TopRight The top right corner of the pawn
|
||||
*/
|
||||
void PopulateBoundCorners(Actors::Caches::FortPawnCache& FortPawnCache, SDK::FVector2D& BottomLeft, SDK::FVector2D& TopRight);
|
||||
};
|
||||
}
|
||||
@@ -5,181 +5,148 @@
|
||||
Features::Visuals::ChamManagerFortPawn* Features::Visuals::ChamManagerFortPawn::Manager = nullptr;
|
||||
Features::Visuals::ChamManagerFortPickup* Features::Visuals::ChamManagerFortPickup::Manager = nullptr;
|
||||
|
||||
void Features::Visuals::ChamManager::RevertAll()
|
||||
{
|
||||
for (auto& Actor : ChamActorsCache)
|
||||
{
|
||||
RemoveChams(Actor.first);
|
||||
}
|
||||
void Features::Visuals::ChamManager::RevertAll() {
|
||||
for (auto& Actor : ChamActorsCache) {
|
||||
RemoveChams(Actor.first);
|
||||
}
|
||||
|
||||
ChamActorsCache.clear();
|
||||
ChamActorsCache.clear();
|
||||
}
|
||||
|
||||
void Features::Visuals::ChamManager::UpdateDynamicMaterialSettings()
|
||||
{
|
||||
// Set the colors
|
||||
SDK::FLinearColor Color = SDK::FLinearColor(ChamSettings.Color[0], ChamSettings.Color[1], ChamSettings.Color[2], 1.f);
|
||||
for (auto& ColorParameter : MaterialColorParameters)
|
||||
{
|
||||
GetDynamicMaterial()->SetVectorParameterValue(ColorParameter, Color);
|
||||
}
|
||||
void Features::Visuals::ChamManager::UpdateDynamicMaterialSettings() {
|
||||
// Set the colors
|
||||
SDK::FLinearColor Color = SDK::FLinearColor(ChamSettings.Color[0], ChamSettings.Color[1], ChamSettings.Color[2], 1.f);
|
||||
for (auto& ColorParameter : MaterialColorParameters) {
|
||||
GetDynamicMaterial()->SetVectorParameterValue(ColorParameter, Color);
|
||||
}
|
||||
|
||||
// Set the emissive brightness
|
||||
float EmissiveIntensity = ChamSettings.EmissiveIntensity;
|
||||
for (auto& EmissiveParameter : MaterialEmissiveParameters)
|
||||
{
|
||||
GetDynamicMaterial()->SetScalarParameterValue(EmissiveParameter, EmissiveIntensity);
|
||||
}
|
||||
// Set the emissive brightness
|
||||
float EmissiveIntensity = ChamSettings.EmissiveIntensity;
|
||||
for (auto& EmissiveParameter : MaterialEmissiveParameters) {
|
||||
GetDynamicMaterial()->SetScalarParameterValue(EmissiveParameter, EmissiveIntensity);
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Visuals::ChamManager::UpdateMaterialSettings()
|
||||
{
|
||||
GetMaterial()->SetbDisableDepthTest(ChamSettings.ThroughWalls ? true : false, &ChamSettings.Enabled);
|
||||
GetMaterial()->SetBlendMode(SDK::EBlendMode::BLEND_Additive, &ChamSettings.Enabled);
|
||||
GetMaterial()->SetWireFrame(ChamSettings.Wireframe, &ChamSettings.Enabled);
|
||||
void Features::Visuals::ChamManager::UpdateMaterialSettings() {
|
||||
GetMaterial()->SetbDisableDepthTest(ChamSettings.ThroughWalls ? true : false, &ChamSettings.Enabled);
|
||||
GetMaterial()->SetBlendMode(SDK::EBlendMode::BLEND_Additive, &ChamSettings.Enabled);
|
||||
GetMaterial()->SetWireFrame(ChamSettings.Wireframe, &ChamSettings.Enabled);
|
||||
}
|
||||
|
||||
void Features::Visuals::ChamManager::Tick(SDK::AActor* Actor)
|
||||
{
|
||||
// Update the material settings every tick if chams are enabled (they often get reverted by the game)
|
||||
if (ChamSettings.Enabled)
|
||||
{
|
||||
UpdateMaterialSettings();
|
||||
}
|
||||
void Features::Visuals::ChamManager::Tick(SDK::AActor* Actor) {
|
||||
// Update the material settings every tick if chams are enabled (they often get reverted by the game)
|
||||
if (ChamSettings.Enabled) {
|
||||
UpdateMaterialSettings();
|
||||
}
|
||||
|
||||
bool ActorInList = ChamActorsCache.find(Actor) != ChamActorsCache.end();
|
||||
bool ActorInList = ChamActorsCache.find(Actor) != ChamActorsCache.end();
|
||||
|
||||
if (ShouldApplyChams(Actor))
|
||||
{
|
||||
if (ActorInList == false)
|
||||
{
|
||||
// Apply the chams
|
||||
if (ApplyChams(Actor, GetDynamicMaterial()))
|
||||
{
|
||||
ChamActorsCache[Actor] = std::make_unique<ChamActor>(Actor, Game::CurrentTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Re-apply the chams if the delay has passed
|
||||
auto& ChamActor = ChamActorsCache[Actor];
|
||||
if (Game::CurrentTime - ChamActor->LastApplyTime > std::chrono::seconds(ReapplyChamsDelay))
|
||||
{
|
||||
if (ApplyChams(Actor, GetDynamicMaterial()))
|
||||
{
|
||||
ChamActor->LastApplyTime = Game::CurrentTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ActorInList)
|
||||
{
|
||||
// If the pawn is not valid, remove it and the chams
|
||||
RemoveChams(Actor);
|
||||
ChamActorsCache.erase(Actor);
|
||||
}
|
||||
if (ShouldApplyChams(Actor)) {
|
||||
if (ActorInList == false) {
|
||||
// Apply the chams
|
||||
if (ApplyChams(Actor, GetDynamicMaterial())) {
|
||||
ChamActorsCache[Actor] = std::make_unique<ChamActor>(Actor, Game::CurrentTime);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Re-apply the chams if the delay has passed
|
||||
auto& ChamActor = ChamActorsCache[Actor];
|
||||
if (Game::CurrentTime - ChamActor->LastApplyTime > std::chrono::seconds(ReapplyChamsDelay)) {
|
||||
if (ApplyChams(Actor, GetDynamicMaterial())) {
|
||||
ChamActor->LastApplyTime = Game::CurrentTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ActorInList) {
|
||||
// If the pawn is not valid, remove it and the chams
|
||||
RemoveChams(Actor);
|
||||
ChamActorsCache.erase(Actor);
|
||||
}
|
||||
}
|
||||
|
||||
void Features::Visuals::ChamManager::Init(const std::vector<SDK::FName> MaterialColorParameters, const std::vector<SDK::FName> MaterialEmissiveParameters, const std::string MaterialName)
|
||||
{
|
||||
// Initialize the FName's
|
||||
this->MaterialColorParameters = MaterialColorParameters;
|
||||
this->MaterialEmissiveParameters = MaterialEmissiveParameters;
|
||||
void Features::Visuals::ChamManager::Init(std::vector<SDK::FName> MaterialColorParameters, std::vector<SDK::FName> MaterialEmissiveParameters, std::string MaterialName) {
|
||||
// Initialize the FName's
|
||||
this->MaterialColorParameters = MaterialColorParameters;
|
||||
this->MaterialEmissiveParameters = MaterialEmissiveParameters;
|
||||
|
||||
// Set the material name
|
||||
this->MaterialName = MaterialName;
|
||||
// Set the material name
|
||||
this->MaterialName = MaterialName;
|
||||
|
||||
// Mark the ChamManager as initiated
|
||||
Initiated = true;
|
||||
// Mark the ChamManager as initiated
|
||||
Initiated = true;
|
||||
}
|
||||
|
||||
bool Features::Visuals::ChamManager::ShouldApplyChams(SDK::AActor* Actor)
|
||||
{
|
||||
if (SDK::IsValidPointer(Actor) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool Features::Visuals::ChamManager::ShouldApplyChams(SDK::AActor* Actor) {
|
||||
if (SDK::IsValidPointer(Actor) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ChamSettings.Enabled == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ChamSettings.Enabled == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ShouldApplyChamsCustom(Actor) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ShouldApplyChamsCustom(Actor) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Features::Visuals::ChamManager::ApplyChams(SDK::AActor* Actor, SDK::UMaterialInstanceDynamic* DynamicMaterial, const bool SendingNullptrMaterial)
|
||||
{
|
||||
// You can send a nullptr material to revert materials
|
||||
if (SendingNullptrMaterial == false && IsDynamicMaterialValid(DynamicMaterial) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool Features::Visuals::ChamManager::ApplyChams(SDK::AActor* Actor, SDK::UMaterialInstanceDynamic* DynamicMaterial, bool SendingNullptrMaterial) {
|
||||
// You can send a nullptr material to revert materials
|
||||
if (SendingNullptrMaterial == false && IsDynamicMaterialValid(DynamicMaterial) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes = GetActorMeshes(Actor);
|
||||
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes = GetActorMeshes(Actor);
|
||||
for (auto Mesh : ActorMeshes) {
|
||||
if (SDK::IsValidPointer(Mesh) == false) continue;
|
||||
SDK::TArray<SDK::UMaterialInterface*> Materials = Mesh->GetMaterials();
|
||||
|
||||
for (auto Mesh : ActorMeshes)
|
||||
{
|
||||
if (SDK::IsValidPointer(Mesh) == false) continue;
|
||||
SDK::TArray<SDK::UMaterialInterface*> Materials = Mesh->GetMaterials();
|
||||
for (int i = 0; i < Materials.Num(); i++) {
|
||||
if (Materials.IsValidIndex(i) == false) continue;
|
||||
|
||||
for (int i = 0; i < Materials.Num(); i++)
|
||||
{
|
||||
if (Materials.IsValidIndex(i) == false) continue;
|
||||
if (SendingNullptrMaterial == true || IsDynamicMaterialValid(DynamicMaterial)) {
|
||||
Mesh->SetMaterial(i, DynamicMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SendingNullptrMaterial == true || IsDynamicMaterialValid(DynamicMaterial))
|
||||
{
|
||||
Mesh->SetMaterial(i, DynamicMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Features::Visuals::ChamManager::RemoveChams(SDK::AActor* Actor)
|
||||
{
|
||||
ApplyChams(Actor, nullptr, true);
|
||||
void Features::Visuals::ChamManager::RemoveChams(SDK::AActor* Actor) {
|
||||
ApplyChams(Actor, nullptr, true);
|
||||
}
|
||||
|
||||
bool Features::Visuals::ChamManager::IsDynamicMaterialValid(SDK::UMaterialInstanceDynamic* DynamicMaterial)
|
||||
{
|
||||
// This handles the case of the dynamic material being a dangling pointer
|
||||
bool Features::Visuals::ChamManager::IsDynamicMaterialValid(SDK::UMaterialInstanceDynamic* DynamicMaterial) {
|
||||
if (SDK::IsValidPointer(DynamicMaterial) == false
|
||||
|| SDK::IsValidPointer(DynamicMaterial->Class) == false
|
||||
|| DynamicMaterial->IsA(SDK::UMaterialInstanceDynamic::StaticClass()) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SDK::IsValidPointer(DynamicMaterial) == false
|
||||
|| SDK::IsValidPointer(DynamicMaterial->Class) == false
|
||||
|| DynamicMaterial->IsA(SDK::UMaterialInstanceDynamic::StaticClass()) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
SDK::UMaterial* Features::Visuals::ChamManager::GetMaterial()
|
||||
{
|
||||
if (!ChamsMaterial)
|
||||
ChamsMaterial = SDK::UObject::FindObject<SDK::UMaterial>(MaterialName);
|
||||
SDK::UMaterial* Features::Visuals::ChamManager::GetMaterial() {
|
||||
if (!ChamsMaterial)
|
||||
ChamsMaterial = SDK::UObject::FindObject<SDK::UMaterial>(MaterialName);
|
||||
|
||||
return ChamsMaterial;
|
||||
return ChamsMaterial;
|
||||
}
|
||||
|
||||
SDK::UMaterialInstanceDynamic* Features::Visuals::ChamManager::GetDynamicMaterial()
|
||||
{
|
||||
// When switching levels, the dynamic material can sometimes become invalid. So we have to do this to re-init the material
|
||||
if (IsDynamicMaterialValid(ChamsMaterialInstance) == false)
|
||||
{
|
||||
// Create a new dynamic material instance
|
||||
ChamsMaterialInstance = SDK::UKismetMaterialLibrary::CreateDynamicMaterialInstance(SDK::GetWorld(), GetMaterial(), SDK::FName());
|
||||
SDK::UMaterialInstanceDynamic* Features::Visuals::ChamManager::GetDynamicMaterial() {
|
||||
// When switching levels, the dynamic material can sometimes become invalid. So we have to do this to re-init the material
|
||||
if (IsDynamicMaterialValid(ChamsMaterialInstance) == false) {
|
||||
// Create a new dynamic material instance
|
||||
ChamsMaterialInstance = SDK::UKismetMaterialLibrary::CreateDynamicMaterialInstance(SDK::GetWorld(), GetMaterial(), SDK::FName());
|
||||
|
||||
// Update the material settings (since we made a new material)
|
||||
UpdateDynamicMaterialSettings();
|
||||
}
|
||||
// Update the material settings (since we made a new material)
|
||||
UpdateDynamicMaterialSettings();
|
||||
}
|
||||
|
||||
return ChamsMaterialInstance;
|
||||
return ChamsMaterialInstance;
|
||||
}
|
||||
@@ -1,24 +1,20 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "../../SDK/Classes/Engine_Classes.h"
|
||||
|
||||
#include "../../../Configs/ConfigTypes.h"
|
||||
|
||||
namespace Features
|
||||
{
|
||||
namespace Visuals
|
||||
{
|
||||
namespace Features {
|
||||
namespace Visuals {
|
||||
/** @brief Manager class for chams (applying, updating and removing) */
|
||||
class ChamManager
|
||||
{
|
||||
class ChamManager {
|
||||
protected:
|
||||
/** @brief Struct to hold actor and last update time */
|
||||
struct ChamActor
|
||||
{
|
||||
struct ChamActor {
|
||||
SDK::AActor* Actor;
|
||||
std::chrono::time_point<std::chrono::steady_clock> LastApplyTime;
|
||||
|
||||
@@ -45,7 +41,7 @@ namespace Features
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor for ChamManager
|
||||
*
|
||||
*
|
||||
* @param ChamSettings Reference to base chams settings
|
||||
*/
|
||||
ChamManager(ConfigTypes::BaseChamsSettings& ChamSettings) : Initiated(false), ChamSettings(ChamSettings) {}
|
||||
@@ -61,67 +57,67 @@ namespace Features
|
||||
|
||||
/**
|
||||
* @brief Tick function for processing each actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*/
|
||||
virtual void Tick(SDK::AActor* Actor);
|
||||
|
||||
/**
|
||||
* @brief Initialize the chams
|
||||
*
|
||||
*
|
||||
* @param ColorParameters Vector of color parameters
|
||||
* @param EmissiveParameters Vector of emissive parameters
|
||||
* @param MaterialName Name of the material
|
||||
*/
|
||||
virtual void Init(const std::vector<SDK::FName> MaterialColorParameters, const std::vector<SDK::FName> MaterialEmissiveParameters, const std::string MaterialName);
|
||||
virtual void Init(std::vector<SDK::FName> MaterialColorParameters, std::vector<SDK::FName> MaterialEmissiveParameters, std::string MaterialName);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Check if chams should be applied to the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return True if chams should be applied, false otherwise
|
||||
*/
|
||||
bool ShouldApplyChams(SDK::AActor* Actor);
|
||||
|
||||
/**
|
||||
* @brief Apply chams to the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
* @param Material Pointer to the material
|
||||
* @param SendingNullptrMaterial Flag indicating if sending nullptr material
|
||||
*
|
||||
*
|
||||
* @return True if chams applied successfully, false otherwise
|
||||
*/
|
||||
bool ApplyChams(SDK::AActor* Actor, SDK::UMaterialInstanceDynamic* Material, const bool SendingNullptrMaterial = false);
|
||||
bool ApplyChams(SDK::AActor* Actor, SDK::UMaterialInstanceDynamic* Material, bool SendingNullptrMaterial = false);
|
||||
|
||||
/**
|
||||
* @brief Remove chams from the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*/
|
||||
void RemoveChams(SDK::AActor* Actor);
|
||||
|
||||
/**
|
||||
* @brief Check if dynamic material is valid
|
||||
*
|
||||
*
|
||||
* @param DynamicMaterial Pointer to the dynamic material
|
||||
*
|
||||
*
|
||||
* @return True if dynamic material is valid, false otherwise
|
||||
*/
|
||||
bool IsDynamicMaterialValid(SDK::UMaterialInstanceDynamic* DynamicMaterial);
|
||||
|
||||
/**
|
||||
* @brief Get the material
|
||||
*
|
||||
*
|
||||
* @return Pointer to the material
|
||||
*/
|
||||
SDK::UMaterial* GetMaterial();
|
||||
|
||||
/**
|
||||
* @brief Get the dynamic material
|
||||
*
|
||||
*
|
||||
* @return Pointer to the dynamic material
|
||||
*/
|
||||
SDK::UMaterialInstanceDynamic* GetDynamicMaterial();
|
||||
@@ -129,26 +125,25 @@ namespace Features
|
||||
private:
|
||||
/**
|
||||
* @brief Custom function to determine if chams should be applied to the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return True if chams should be applied, false otherwise
|
||||
*/
|
||||
virtual bool ShouldApplyChamsCustom(SDK::AActor* Actor) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get the mesh components of the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return Vector of mesh components
|
||||
*/
|
||||
virtual std::vector<SDK::UMeshComponent*> GetActorMeshes(SDK::AActor* Actor) = 0;
|
||||
};
|
||||
|
||||
/** @brief Manager class for chams (applying, updating and removing) for AFortPawns */
|
||||
class ChamManagerFortPawn : public ChamManager
|
||||
{
|
||||
class ChamManagerFortPawn : public ChamManager {
|
||||
public:
|
||||
/** @brief Pointer to the manager class for AFortPawns */
|
||||
static ChamManagerFortPawn* Manager;
|
||||
@@ -156,7 +151,7 @@ namespace Features
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor for ChamManagerFortPawn
|
||||
*
|
||||
*
|
||||
* @param ChamSettings Reference to base chams settings
|
||||
*/
|
||||
ChamManagerFortPawn(ConfigTypes::BaseChamsSettings& ChamSettings) : ChamManager(ChamSettings) {}
|
||||
@@ -164,26 +159,25 @@ namespace Features
|
||||
private:
|
||||
/**
|
||||
* @brief Get the mesh components of the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return Vector of mesh components
|
||||
*/
|
||||
std::vector<SDK::UMeshComponent*> GetActorMeshes(SDK::AActor* Actor) override;
|
||||
|
||||
/**
|
||||
* @brief Custom function to determine if chams should be applied to the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return True if chams should be applied, false otherwise
|
||||
*/
|
||||
bool ShouldApplyChamsCustom(SDK::AActor* Actor) override;
|
||||
};
|
||||
|
||||
/** @brief Manager class for chams (applying, updating and removing) for AFortPickups */
|
||||
class ChamManagerFortPickup : public ChamManager
|
||||
{
|
||||
class ChamManagerFortPickup : public ChamManager {
|
||||
public:
|
||||
/** @brief Pointer to the manager class for AFortPawns */
|
||||
static ChamManagerFortPickup* Manager;
|
||||
@@ -191,7 +185,7 @@ namespace Features
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor for ChamManagerFortPickup
|
||||
*
|
||||
*
|
||||
* @param ChamSettings Reference to pickup chams settings
|
||||
*/
|
||||
ChamManagerFortPickup(ConfigTypes::PickupChamsSettings& ChamSettings) : ChamManager(ChamSettings) {}
|
||||
@@ -199,18 +193,18 @@ namespace Features
|
||||
private:
|
||||
/**
|
||||
* @brief Get the mesh components of the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return Vector of mesh components
|
||||
*/
|
||||
std::vector<SDK::UMeshComponent*> GetActorMeshes(SDK::AActor* Actor) override;
|
||||
|
||||
/**
|
||||
* @brief Custom function to determine if chams should be applied to the actor
|
||||
*
|
||||
*
|
||||
* @param Actor Pointer to the actor
|
||||
*
|
||||
*
|
||||
* @return True if chams should be applied, false otherwise
|
||||
*/
|
||||
bool ShouldApplyChamsCustom(SDK::AActor* Actor) override;
|
||||
|
||||
@@ -2,28 +2,23 @@
|
||||
|
||||
#include "../../SDK/Classes/FortniteGame_Classes.h"
|
||||
|
||||
std::vector<SDK::UMeshComponent*> Features::Visuals::ChamManagerFortPawn::GetActorMeshes(SDK::AActor* Actor)
|
||||
{
|
||||
std::vector<SDK::USkeletalMeshComponentBudgeted*> CharacterParts = SDK::Cast<SDK::AFortPlayerPawn>(Actor)->GetCharacterPartSkeletalMeshComponents();
|
||||
std::vector<SDK::UMeshComponent*> Features::Visuals::ChamManagerFortPawn::GetActorMeshes(SDK::AActor* Actor) {
|
||||
std::vector<SDK::USkeletalMeshComponentBudgeted*> CharacterParts = SDK::Cast<SDK::AFortPlayerPawn>(Actor)->GetCharacterPartSkeletalMeshComponents();
|
||||
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes;
|
||||
for (SDK::USkeletalMeshComponentBudgeted* Part : CharacterParts)
|
||||
{
|
||||
if (SDK::IsValidPointer(Part))
|
||||
{
|
||||
ActorMeshes.push_back(Part);
|
||||
}
|
||||
}
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes;
|
||||
for (SDK::USkeletalMeshComponentBudgeted* Part : CharacterParts) {
|
||||
if (SDK::IsValidPointer(Part)) {
|
||||
ActorMeshes.push_back(Part);
|
||||
}
|
||||
}
|
||||
|
||||
return ActorMeshes;
|
||||
return ActorMeshes;
|
||||
}
|
||||
|
||||
bool Features::Visuals::ChamManagerFortPawn::ShouldApplyChamsCustom(SDK::AActor* Actor)
|
||||
{
|
||||
if (ChamSettings.ShowLocal == false && (Actor == SDK::GetLocalPawn()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool Features::Visuals::ChamManagerFortPawn::ShouldApplyChamsCustom(SDK::AActor* Actor) {
|
||||
if (ChamSettings.ShowLocal == false && (Actor == SDK::GetLocalPawn())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
@@ -2,32 +2,27 @@
|
||||
|
||||
#include "../../SDK/Classes/FortniteGame_Classes.h"
|
||||
|
||||
std::vector<SDK::UMeshComponent*> Features::Visuals::ChamManagerFortPickup::GetActorMeshes(SDK::AActor* Actor)
|
||||
{
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes;
|
||||
std::vector<SDK::UMeshComponent*> Features::Visuals::ChamManagerFortPickup::GetActorMeshes(SDK::AActor* Actor) {
|
||||
std::vector<SDK::UMeshComponent*> ActorMeshes;
|
||||
|
||||
SDK::AFortPickup* Pickup = SDK::Cast<SDK::AFortPickup>(Actor);
|
||||
SDK::USkeletalMeshComponent* Skeletal_Mesh_Pickup = SDK::Cast<SDK::AB_Pickups_Parent_C>(Pickup->PickupEffectBlueprint().Get())->Skeletal_Mesh_Pickup();
|
||||
SDK::UStaticMeshComponent* Static_Mesh_Pickup = SDK::Cast<SDK::AB_Pickups_Parent_C>(Pickup->PickupEffectBlueprint().Get())->Static_Mesh_Pickup();
|
||||
SDK::AFortPickup* Pickup = SDK::Cast<SDK::AFortPickup>(Actor);
|
||||
SDK::USkeletalMeshComponent* Skeletal_Mesh_Pickup = SDK::Cast<SDK::AB_Pickups_Parent_C>(Pickup->PickupEffectBlueprint().Get())->Skeletal_Mesh_Pickup();
|
||||
SDK::UStaticMeshComponent* Static_Mesh_Pickup = SDK::Cast<SDK::AB_Pickups_Parent_C>(Pickup->PickupEffectBlueprint().Get())->Static_Mesh_Pickup();
|
||||
|
||||
if (SDK::IsValidPointer(Skeletal_Mesh_Pickup)) {
|
||||
ActorMeshes.push_back(Skeletal_Mesh_Pickup);
|
||||
}
|
||||
if (SDK::IsValidPointer(Static_Mesh_Pickup)) {
|
||||
ActorMeshes.push_back(Static_Mesh_Pickup);
|
||||
}
|
||||
|
||||
if (SDK::IsValidPointer(Skeletal_Mesh_Pickup))
|
||||
{
|
||||
ActorMeshes.push_back(Skeletal_Mesh_Pickup);
|
||||
}
|
||||
if (SDK::IsValidPointer(Static_Mesh_Pickup))
|
||||
{
|
||||
ActorMeshes.push_back(Static_Mesh_Pickup);
|
||||
}
|
||||
|
||||
return ActorMeshes;
|
||||
return ActorMeshes;
|
||||
}
|
||||
|
||||
bool Features::Visuals::ChamManagerFortPickup::ShouldApplyChamsCustom(SDK::AActor* Actor)
|
||||
{
|
||||
if ((uint8)SDK::Cast<SDK::AFortPickup>(Actor)->PickupEffectBlueprint()->ItemDefinition()->Tier() < (uint8)reinterpret_cast<ConfigTypes::PickupChamsSettings&>(ChamSettings).MinimumTier)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool Features::Visuals::ChamManagerFortPickup::ShouldApplyChamsCustom(SDK::AActor* Actor) {
|
||||
if ((uint8)SDK::Cast<SDK::AFortPickup>(Actor)->PickupEffectBlueprint()->ItemDefinition()->Tier() < (uint8)reinterpret_cast<ConfigTypes::PickupChamsSettings&>(ChamSettings).MinimumTier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
+539
-613
File diff suppressed because it is too large
Load Diff
@@ -11,298 +11,278 @@
|
||||
#include "../../Hooks/Hooks.h"
|
||||
#endif // _IMGUI
|
||||
|
||||
SDK::FVector2D Input::GetMousePosition()
|
||||
{
|
||||
if (Mouse.FrameUpdated != Game::CurrentFrame)
|
||||
{
|
||||
Mouse.FrameUpdated = Game::CurrentFrame;
|
||||
SDK::FVector2D Input::GetMousePosition() {
|
||||
if (Mouse.FrameUpdated != Game::CurrentFrame) {
|
||||
Mouse.FrameUpdated = Game::CurrentFrame;
|
||||
|
||||
float LocationX = 0.f;
|
||||
float LocationY = 0.f;
|
||||
float LocationX = 0.f;
|
||||
float LocationY = 0.f;
|
||||
|
||||
if (SDK::GetLocalController()->GetMousePosition(&LocationX, &LocationY))
|
||||
{
|
||||
Mouse.Position = SDK::FVector2D(LocationX, LocationY);
|
||||
}
|
||||
}
|
||||
if (SDK::GetLocalController()->GetMousePosition(&LocationX, &LocationY)) {
|
||||
Mouse.Position = SDK::FVector2D(LocationX, LocationY);
|
||||
}
|
||||
}
|
||||
|
||||
return Mouse.Position;
|
||||
return Mouse.Position;
|
||||
}
|
||||
|
||||
bool Input::IsKeyDown(const KeyName Key)
|
||||
{
|
||||
auto& KeyData = Keys[Key];
|
||||
bool Input::IsKeyDown(KeyName Key) {
|
||||
auto& KeyData = Keys[Key];
|
||||
|
||||
if (KeyData.IsDown.FrameUpdated != Game::CurrentFrame)
|
||||
{
|
||||
KeyData.IsDown.FrameUpdated = Game::CurrentFrame;
|
||||
if (KeyData.IsDown.FrameUpdated != Game::CurrentFrame) {
|
||||
KeyData.IsDown.FrameUpdated = Game::CurrentFrame;
|
||||
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
|
||||
KeyData.IsDown.Value = SDK::GetLocalController()->IsInputKeyDown(FKey);
|
||||
}
|
||||
KeyData.IsDown.Value = SDK::GetLocalController()->IsInputKeyDown(FKey);
|
||||
}
|
||||
|
||||
return KeyData.IsDown.Value;
|
||||
return KeyData.IsDown.Value;
|
||||
}
|
||||
bool Input::WasKeyJustReleased(const KeyName Key)
|
||||
{
|
||||
auto& KeyData = Keys[Key];
|
||||
bool Input::WasKeyJustReleased(KeyName Key) {
|
||||
auto& KeyData = Keys[Key];
|
||||
|
||||
if (KeyData.WasJustReleased.FrameUpdated != Game::CurrentFrame)
|
||||
{
|
||||
KeyData.WasJustReleased.FrameUpdated = Game::CurrentFrame;
|
||||
if (KeyData.WasJustReleased.FrameUpdated != Game::CurrentFrame) {
|
||||
KeyData.WasJustReleased.FrameUpdated = Game::CurrentFrame;
|
||||
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
|
||||
KeyData.WasJustReleased.Value = SDK::GetLocalController()->WasInputKeyJustReleased(FKey);
|
||||
}
|
||||
KeyData.WasJustReleased.Value = SDK::GetLocalController()->WasInputKeyJustReleased(FKey);
|
||||
}
|
||||
|
||||
return KeyData.WasJustReleased.Value;
|
||||
return KeyData.WasJustReleased.Value;
|
||||
}
|
||||
bool Input::WasKeyJustPressed(const KeyName Key)
|
||||
{
|
||||
auto& KeyData = Keys[Key];
|
||||
bool Input::WasKeyJustPressed(KeyName Key) {
|
||||
auto& KeyData = Keys[Key];
|
||||
|
||||
if (KeyData.WasJustPressed.FrameUpdated != Game::CurrentFrame)
|
||||
{
|
||||
KeyData.WasJustPressed.FrameUpdated = Game::CurrentFrame;
|
||||
if (KeyData.WasJustPressed.FrameUpdated != Game::CurrentFrame) {
|
||||
KeyData.WasJustPressed.FrameUpdated = Game::CurrentFrame;
|
||||
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
SDK::FKey FKey{};
|
||||
FKey.KeyName = KeyData.FName;
|
||||
|
||||
KeyData.WasJustPressed.Value = SDK::GetLocalController()->WasInputKeyJustPressed(FKey);
|
||||
}
|
||||
KeyData.WasJustPressed.Value = SDK::GetLocalController()->WasInputKeyJustPressed(FKey);
|
||||
}
|
||||
|
||||
return KeyData.WasJustPressed.Value;
|
||||
return KeyData.WasJustPressed.Value;
|
||||
}
|
||||
|
||||
std::vector<Input::KeyName> Input::GetAllDownKeys()
|
||||
{
|
||||
std::vector<Input::KeyName> KeysDown{};
|
||||
std::vector<Input::KeyName> Input::GetAllDownKeys() {
|
||||
std::vector<Input::KeyName> KeysDown{};
|
||||
|
||||
for (auto& Key : Keys)
|
||||
{
|
||||
if (IsKeyDown(Key.first))
|
||||
{
|
||||
KeysDown.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
for (auto& Key : Keys) {
|
||||
if (IsKeyDown(Key.first)) {
|
||||
KeysDown.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
|
||||
return KeysDown;
|
||||
return KeysDown;
|
||||
}
|
||||
std::vector<Input::KeyName> Input::GetAllJustReleasedKeys()
|
||||
{
|
||||
std::vector<Input::KeyName> KeysJustReleased{};
|
||||
std::vector<Input::KeyName> Input::GetAllJustReleasedKeys() {
|
||||
std::vector<Input::KeyName> KeysJustReleased{};
|
||||
|
||||
for (auto& Key : Keys)
|
||||
{
|
||||
if (WasKeyJustReleased(Key.first))
|
||||
{
|
||||
KeysJustReleased.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
for (auto& Key : Keys) {
|
||||
if (WasKeyJustReleased(Key.first)) {
|
||||
KeysJustReleased.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
|
||||
return KeysJustReleased;
|
||||
return KeysJustReleased;
|
||||
}
|
||||
std::vector<Input::KeyName> Input::GetAllJustPressedKeys()
|
||||
{
|
||||
std::vector<Input::KeyName> KeysJustPressed{};
|
||||
std::vector<Input::KeyName> Input::GetAllJustPressedKeys() {
|
||||
std::vector<Input::KeyName> KeysJustPressed{};
|
||||
|
||||
for (auto& Key : Keys)
|
||||
{
|
||||
if (WasKeyJustPressed(Key.first))
|
||||
{
|
||||
KeysJustPressed.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
for (auto& Key : Keys) {
|
||||
if (WasKeyJustPressed(Key.first)) {
|
||||
KeysJustPressed.push_back(Key.first);
|
||||
}
|
||||
}
|
||||
|
||||
return KeysJustPressed;
|
||||
return KeysJustPressed;
|
||||
}
|
||||
|
||||
std::string Input::GetKeyNameString(const Input::KeyName Key)
|
||||
{
|
||||
return Keys[Key].Name;
|
||||
std::string Input::GetKeyNameString(Input::KeyName Key) {
|
||||
return Keys[Key].Name;
|
||||
}
|
||||
|
||||
void Input::Init()
|
||||
{
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Initializing input system...")));
|
||||
void Input::Init() {
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Initializing input system...")));
|
||||
|
||||
// Init KeyNames
|
||||
{
|
||||
Keys[KeyName::NONE].FName = SDK::FName(skCrypt(L"NONE"));
|
||||
// Init KeyNames
|
||||
{
|
||||
Keys[KeyName::NONE].FName = SDK::FName(skCrypt(L"NONE"));
|
||||
|
||||
Keys[KeyName::AnyKey].FName = SDK::FName(skCrypt(L"AnyKey"));
|
||||
Keys[KeyName::AnyKey].FName = SDK::FName(skCrypt(L"AnyKey"));
|
||||
|
||||
Keys[KeyName::MouseX].FName = SDK::FName(skCrypt(L"MouseX"));
|
||||
Keys[KeyName::MouseY].FName = SDK::FName(skCrypt(L"MouseY"));
|
||||
Keys[KeyName::MouseScrollUp].FName = SDK::FName(skCrypt(L"MouseScrollUp"));
|
||||
Keys[KeyName::MouseScrollDown].FName = SDK::FName(skCrypt(L"MouseScrollDown"));
|
||||
Keys[KeyName::LeftMouseButton].FName = SDK::FName(skCrypt(L"LeftMouseButton"));
|
||||
Keys[KeyName::RightMouseButton].FName = SDK::FName(skCrypt(L"RightMouseButton"));
|
||||
Keys[KeyName::MiddleMouseButton].FName = SDK::FName(skCrypt(L"MiddleMouseButton"));
|
||||
Keys[KeyName::ThumbMouseButton].FName = SDK::FName(skCrypt(L"ThumbMouseButton"));
|
||||
Keys[KeyName::ThumbMouseButton2].FName = SDK::FName(skCrypt(L"ThumbMouseButton2"));
|
||||
Keys[KeyName::MouseX].FName = SDK::FName(skCrypt(L"MouseX"));
|
||||
Keys[KeyName::MouseY].FName = SDK::FName(skCrypt(L"MouseY"));
|
||||
Keys[KeyName::MouseScrollUp].FName = SDK::FName(skCrypt(L"MouseScrollUp"));
|
||||
Keys[KeyName::MouseScrollDown].FName = SDK::FName(skCrypt(L"MouseScrollDown"));
|
||||
Keys[KeyName::LeftMouseButton].FName = SDK::FName(skCrypt(L"LeftMouseButton"));
|
||||
Keys[KeyName::RightMouseButton].FName = SDK::FName(skCrypt(L"RightMouseButton"));
|
||||
Keys[KeyName::MiddleMouseButton].FName = SDK::FName(skCrypt(L"MiddleMouseButton"));
|
||||
Keys[KeyName::ThumbMouseButton].FName = SDK::FName(skCrypt(L"ThumbMouseButton"));
|
||||
Keys[KeyName::ThumbMouseButton2].FName = SDK::FName(skCrypt(L"ThumbMouseButton2"));
|
||||
|
||||
Keys[KeyName::BackSpace].FName = SDK::FName(skCrypt(L"BackSpace"));
|
||||
Keys[KeyName::Tab].FName = SDK::FName(skCrypt(L"Tab"));
|
||||
Keys[KeyName::Enter].FName = SDK::FName(skCrypt(L"Enter"));
|
||||
Keys[KeyName::Pause].FName = SDK::FName(skCrypt(L"Pause"));
|
||||
Keys[KeyName::CapsLock].FName = SDK::FName(skCrypt(L"CapsLock"));
|
||||
Keys[KeyName::Escape].FName = SDK::FName(skCrypt(L"Escape"));
|
||||
Keys[KeyName::SpaceBar].FName = SDK::FName(skCrypt(L"SpaceBar"));
|
||||
Keys[KeyName::PageUp].FName = SDK::FName(skCrypt(L"PageUp"));
|
||||
Keys[KeyName::PageDown].FName = SDK::FName(skCrypt(L"PageDown"));
|
||||
Keys[KeyName::End].FName = SDK::FName(skCrypt(L"End"));
|
||||
Keys[KeyName::Home].FName = SDK::FName(skCrypt(L"Home"));
|
||||
Keys[KeyName::BackSpace].FName = SDK::FName(skCrypt(L"BackSpace"));
|
||||
Keys[KeyName::Tab].FName = SDK::FName(skCrypt(L"Tab"));
|
||||
Keys[KeyName::Enter].FName = SDK::FName(skCrypt(L"Enter"));
|
||||
Keys[KeyName::Pause].FName = SDK::FName(skCrypt(L"Pause"));
|
||||
Keys[KeyName::CapsLock].FName = SDK::FName(skCrypt(L"CapsLock"));
|
||||
Keys[KeyName::Escape].FName = SDK::FName(skCrypt(L"Escape"));
|
||||
Keys[KeyName::SpaceBar].FName = SDK::FName(skCrypt(L"SpaceBar"));
|
||||
Keys[KeyName::PageUp].FName = SDK::FName(skCrypt(L"PageUp"));
|
||||
Keys[KeyName::PageDown].FName = SDK::FName(skCrypt(L"PageDown"));
|
||||
Keys[KeyName::End].FName = SDK::FName(skCrypt(L"End"));
|
||||
Keys[KeyName::Home].FName = SDK::FName(skCrypt(L"Home"));
|
||||
|
||||
Keys[KeyName::Left].FName = SDK::FName(skCrypt(L"Left"));
|
||||
Keys[KeyName::Up].FName = SDK::FName(skCrypt(L"Up"));
|
||||
Keys[KeyName::Right].FName = SDK::FName(skCrypt(L"Right"));
|
||||
Keys[KeyName::Down].FName = SDK::FName(skCrypt(L"Down"));
|
||||
Keys[KeyName::Left].FName = SDK::FName(skCrypt(L"Left"));
|
||||
Keys[KeyName::Up].FName = SDK::FName(skCrypt(L"Up"));
|
||||
Keys[KeyName::Right].FName = SDK::FName(skCrypt(L"Right"));
|
||||
Keys[KeyName::Down].FName = SDK::FName(skCrypt(L"Down"));
|
||||
|
||||
Keys[KeyName::Insert].FName = SDK::FName(skCrypt(L"Insert"));
|
||||
Keys[KeyName::Delete].FName = SDK::FName(skCrypt(L"Delete"));
|
||||
Keys[KeyName::Insert].FName = SDK::FName(skCrypt(L"Insert"));
|
||||
Keys[KeyName::Delete].FName = SDK::FName(skCrypt(L"Delete"));
|
||||
|
||||
Keys[KeyName::Zero].FName = SDK::FName(skCrypt(L"Zero"));
|
||||
Keys[KeyName::One].FName = SDK::FName(skCrypt(L"One"));
|
||||
Keys[KeyName::Two].FName = SDK::FName(skCrypt(L"Two"));
|
||||
Keys[KeyName::Three].FName = SDK::FName(skCrypt(L"Three"));
|
||||
Keys[KeyName::Four].FName = SDK::FName(skCrypt(L"Four"));
|
||||
Keys[KeyName::Five].FName = SDK::FName(skCrypt(L"Five"));
|
||||
Keys[KeyName::Six].FName = SDK::FName(skCrypt(L"Six"));
|
||||
Keys[KeyName::Seven].FName = SDK::FName(skCrypt(L"Seven"));
|
||||
Keys[KeyName::Eight].FName = SDK::FName(skCrypt(L"Eight"));
|
||||
Keys[KeyName::Nine].FName = SDK::FName(skCrypt(L"Nine"));
|
||||
Keys[KeyName::Zero].FName = SDK::FName(skCrypt(L"Zero"));
|
||||
Keys[KeyName::One].FName = SDK::FName(skCrypt(L"One"));
|
||||
Keys[KeyName::Two].FName = SDK::FName(skCrypt(L"Two"));
|
||||
Keys[KeyName::Three].FName = SDK::FName(skCrypt(L"Three"));
|
||||
Keys[KeyName::Four].FName = SDK::FName(skCrypt(L"Four"));
|
||||
Keys[KeyName::Five].FName = SDK::FName(skCrypt(L"Five"));
|
||||
Keys[KeyName::Six].FName = SDK::FName(skCrypt(L"Six"));
|
||||
Keys[KeyName::Seven].FName = SDK::FName(skCrypt(L"Seven"));
|
||||
Keys[KeyName::Eight].FName = SDK::FName(skCrypt(L"Eight"));
|
||||
Keys[KeyName::Nine].FName = SDK::FName(skCrypt(L"Nine"));
|
||||
|
||||
Keys[KeyName::A].FName = SDK::FName(skCrypt(L"A"));
|
||||
Keys[KeyName::B].FName = SDK::FName(skCrypt(L"B"));
|
||||
Keys[KeyName::C].FName = SDK::FName(skCrypt(L"C"));
|
||||
Keys[KeyName::D].FName = SDK::FName(skCrypt(L"D"));
|
||||
Keys[KeyName::E].FName = SDK::FName(skCrypt(L"E"));
|
||||
Keys[KeyName::F].FName = SDK::FName(skCrypt(L"F"));
|
||||
Keys[KeyName::G].FName = SDK::FName(skCrypt(L"G"));
|
||||
Keys[KeyName::H].FName = SDK::FName(skCrypt(L"H"));
|
||||
Keys[KeyName::I].FName = SDK::FName(skCrypt(L"I"));
|
||||
Keys[KeyName::J].FName = SDK::FName(skCrypt(L"J"));
|
||||
Keys[KeyName::K].FName = SDK::FName(skCrypt(L"K"));
|
||||
Keys[KeyName::L].FName = SDK::FName(skCrypt(L"L"));
|
||||
Keys[KeyName::M].FName = SDK::FName(skCrypt(L"M"));
|
||||
Keys[KeyName::N].FName = SDK::FName(skCrypt(L"N"));
|
||||
Keys[KeyName::O].FName = SDK::FName(skCrypt(L"O"));
|
||||
Keys[KeyName::P].FName = SDK::FName(skCrypt(L"P"));
|
||||
Keys[KeyName::Q].FName = SDK::FName(skCrypt(L"Q"));
|
||||
Keys[KeyName::R].FName = SDK::FName(skCrypt(L"R"));
|
||||
Keys[KeyName::S].FName = SDK::FName(skCrypt(L"S"));
|
||||
Keys[KeyName::T].FName = SDK::FName(skCrypt(L"T"));
|
||||
Keys[KeyName::U].FName = SDK::FName(skCrypt(L"U"));
|
||||
Keys[KeyName::V].FName = SDK::FName(skCrypt(L"V"));
|
||||
Keys[KeyName::W].FName = SDK::FName(skCrypt(L"W"));
|
||||
Keys[KeyName::X].FName = SDK::FName(skCrypt(L"X"));
|
||||
Keys[KeyName::Y].FName = SDK::FName(skCrypt(L"Y"));
|
||||
Keys[KeyName::Z].FName = SDK::FName(skCrypt(L"Z"));
|
||||
Keys[KeyName::A].FName = SDK::FName(skCrypt(L"A"));
|
||||
Keys[KeyName::B].FName = SDK::FName(skCrypt(L"B"));
|
||||
Keys[KeyName::C].FName = SDK::FName(skCrypt(L"C"));
|
||||
Keys[KeyName::D].FName = SDK::FName(skCrypt(L"D"));
|
||||
Keys[KeyName::E].FName = SDK::FName(skCrypt(L"E"));
|
||||
Keys[KeyName::F].FName = SDK::FName(skCrypt(L"F"));
|
||||
Keys[KeyName::G].FName = SDK::FName(skCrypt(L"G"));
|
||||
Keys[KeyName::H].FName = SDK::FName(skCrypt(L"H"));
|
||||
Keys[KeyName::I].FName = SDK::FName(skCrypt(L"I"));
|
||||
Keys[KeyName::J].FName = SDK::FName(skCrypt(L"J"));
|
||||
Keys[KeyName::K].FName = SDK::FName(skCrypt(L"K"));
|
||||
Keys[KeyName::L].FName = SDK::FName(skCrypt(L"L"));
|
||||
Keys[KeyName::M].FName = SDK::FName(skCrypt(L"M"));
|
||||
Keys[KeyName::N].FName = SDK::FName(skCrypt(L"N"));
|
||||
Keys[KeyName::O].FName = SDK::FName(skCrypt(L"O"));
|
||||
Keys[KeyName::P].FName = SDK::FName(skCrypt(L"P"));
|
||||
Keys[KeyName::Q].FName = SDK::FName(skCrypt(L"Q"));
|
||||
Keys[KeyName::R].FName = SDK::FName(skCrypt(L"R"));
|
||||
Keys[KeyName::S].FName = SDK::FName(skCrypt(L"S"));
|
||||
Keys[KeyName::T].FName = SDK::FName(skCrypt(L"T"));
|
||||
Keys[KeyName::U].FName = SDK::FName(skCrypt(L"U"));
|
||||
Keys[KeyName::V].FName = SDK::FName(skCrypt(L"V"));
|
||||
Keys[KeyName::W].FName = SDK::FName(skCrypt(L"W"));
|
||||
Keys[KeyName::X].FName = SDK::FName(skCrypt(L"X"));
|
||||
Keys[KeyName::Y].FName = SDK::FName(skCrypt(L"Y"));
|
||||
Keys[KeyName::Z].FName = SDK::FName(skCrypt(L"Z"));
|
||||
|
||||
Keys[KeyName::NumPadZero].FName = SDK::FName(skCrypt(L"NumPadZero"));
|
||||
Keys[KeyName::NumPadOne].FName = SDK::FName(skCrypt(L"NumPadOne"));
|
||||
Keys[KeyName::NumPadTwo].FName = SDK::FName(skCrypt(L"NumPadTwo"));
|
||||
Keys[KeyName::NumPadThree].FName = SDK::FName(skCrypt(L"NumPadThree"));
|
||||
Keys[KeyName::NumPadFour].FName = SDK::FName(skCrypt(L"NumPadFour"));
|
||||
Keys[KeyName::NumPadFive].FName = SDK::FName(skCrypt(L"NumPadFive"));
|
||||
Keys[KeyName::NumPadSix].FName = SDK::FName(skCrypt(L"NumPadSix"));
|
||||
Keys[KeyName::NumPadSeven].FName = SDK::FName(skCrypt(L"NumPadSeven"));
|
||||
Keys[KeyName::NumPadEight].FName = SDK::FName(skCrypt(L"NumPadEight"));
|
||||
Keys[KeyName::NumPadNine].FName = SDK::FName(skCrypt(L"NumPadNine"));
|
||||
Keys[KeyName::NumPadZero].FName = SDK::FName(skCrypt(L"NumPadZero"));
|
||||
Keys[KeyName::NumPadOne].FName = SDK::FName(skCrypt(L"NumPadOne"));
|
||||
Keys[KeyName::NumPadTwo].FName = SDK::FName(skCrypt(L"NumPadTwo"));
|
||||
Keys[KeyName::NumPadThree].FName = SDK::FName(skCrypt(L"NumPadThree"));
|
||||
Keys[KeyName::NumPadFour].FName = SDK::FName(skCrypt(L"NumPadFour"));
|
||||
Keys[KeyName::NumPadFive].FName = SDK::FName(skCrypt(L"NumPadFive"));
|
||||
Keys[KeyName::NumPadSix].FName = SDK::FName(skCrypt(L"NumPadSix"));
|
||||
Keys[KeyName::NumPadSeven].FName = SDK::FName(skCrypt(L"NumPadSeven"));
|
||||
Keys[KeyName::NumPadEight].FName = SDK::FName(skCrypt(L"NumPadEight"));
|
||||
Keys[KeyName::NumPadNine].FName = SDK::FName(skCrypt(L"NumPadNine"));
|
||||
|
||||
Keys[KeyName::Multiply].FName = SDK::FName(skCrypt(L"Multiply"));
|
||||
Keys[KeyName::Add].FName = SDK::FName(skCrypt(L"Add"));
|
||||
Keys[KeyName::Subtract].FName = SDK::FName(skCrypt(L"Subtract"));
|
||||
Keys[KeyName::Decimal].FName = SDK::FName(skCrypt(L"Decimal"));
|
||||
Keys[KeyName::Divide].FName = SDK::FName(skCrypt(L"Divide"));
|
||||
Keys[KeyName::Multiply].FName = SDK::FName(skCrypt(L"Multiply"));
|
||||
Keys[KeyName::Add].FName = SDK::FName(skCrypt(L"Add"));
|
||||
Keys[KeyName::Subtract].FName = SDK::FName(skCrypt(L"Subtract"));
|
||||
Keys[KeyName::Decimal].FName = SDK::FName(skCrypt(L"Decimal"));
|
||||
Keys[KeyName::Divide].FName = SDK::FName(skCrypt(L"Divide"));
|
||||
|
||||
Keys[KeyName::F1].FName = SDK::FName(skCrypt(L"F1"));
|
||||
Keys[KeyName::F2].FName = SDK::FName(skCrypt(L"F2"));
|
||||
Keys[KeyName::F3].FName = SDK::FName(skCrypt(L"F3"));
|
||||
Keys[KeyName::F4].FName = SDK::FName(skCrypt(L"F4"));
|
||||
Keys[KeyName::F5].FName = SDK::FName(skCrypt(L"F5"));
|
||||
Keys[KeyName::F6].FName = SDK::FName(skCrypt(L"F6"));
|
||||
Keys[KeyName::F7].FName = SDK::FName(skCrypt(L"F7"));
|
||||
Keys[KeyName::F8].FName = SDK::FName(skCrypt(L"F8"));
|
||||
Keys[KeyName::F9].FName = SDK::FName(skCrypt(L"F9"));
|
||||
Keys[KeyName::F10].FName = SDK::FName(skCrypt(L"F10"));
|
||||
Keys[KeyName::F11].FName = SDK::FName(skCrypt(L"F11"));
|
||||
Keys[KeyName::F12].FName = SDK::FName(skCrypt(L"F12"));
|
||||
Keys[KeyName::F1].FName = SDK::FName(skCrypt(L"F1"));
|
||||
Keys[KeyName::F2].FName = SDK::FName(skCrypt(L"F2"));
|
||||
Keys[KeyName::F3].FName = SDK::FName(skCrypt(L"F3"));
|
||||
Keys[KeyName::F4].FName = SDK::FName(skCrypt(L"F4"));
|
||||
Keys[KeyName::F5].FName = SDK::FName(skCrypt(L"F5"));
|
||||
Keys[KeyName::F6].FName = SDK::FName(skCrypt(L"F6"));
|
||||
Keys[KeyName::F7].FName = SDK::FName(skCrypt(L"F7"));
|
||||
Keys[KeyName::F8].FName = SDK::FName(skCrypt(L"F8"));
|
||||
Keys[KeyName::F9].FName = SDK::FName(skCrypt(L"F9"));
|
||||
Keys[KeyName::F10].FName = SDK::FName(skCrypt(L"F10"));
|
||||
Keys[KeyName::F11].FName = SDK::FName(skCrypt(L"F11"));
|
||||
Keys[KeyName::F12].FName = SDK::FName(skCrypt(L"F12"));
|
||||
|
||||
Keys[KeyName::NumLock].FName = SDK::FName(skCrypt(L"NumLock"));
|
||||
Keys[KeyName::ScrollLock].FName = SDK::FName(skCrypt(L"ScrollLock"));
|
||||
Keys[KeyName::LeftShift].FName = SDK::FName(skCrypt(L"LeftShift"));
|
||||
Keys[KeyName::RightShift].FName = SDK::FName(skCrypt(L"RightShift"));
|
||||
Keys[KeyName::LeftControl].FName = SDK::FName(skCrypt(L"LeftControl"));
|
||||
Keys[KeyName::RightControl].FName = SDK::FName(skCrypt(L"RightControl"));
|
||||
Keys[KeyName::LeftAlt].FName = SDK::FName(skCrypt(L"LeftAlt"));
|
||||
Keys[KeyName::RightAlt].FName = SDK::FName(skCrypt(L"RightAlt"));
|
||||
Keys[KeyName::LeftCommand].FName = SDK::FName(skCrypt(L"LeftCommand"));
|
||||
Keys[KeyName::RightCommand].FName = SDK::FName(skCrypt(L"RightCommand"));
|
||||
Keys[KeyName::Semicolon].FName = SDK::FName(skCrypt(L"Semicolon"));
|
||||
Keys[KeyName::Equals].FName = SDK::FName(skCrypt(L"Equals"));
|
||||
Keys[KeyName::Comma].FName = SDK::FName(skCrypt(L"Comma"));
|
||||
Keys[KeyName::Underscore].FName = SDK::FName(skCrypt(L"Underscore"));
|
||||
Keys[KeyName::Period].FName = SDK::FName(skCrypt(L"Period"));
|
||||
Keys[KeyName::Slash].FName = SDK::FName(skCrypt(L"Slash"));
|
||||
Keys[KeyName::Tilde].FName = SDK::FName(skCrypt(L"Tilde"));
|
||||
Keys[KeyName::LeftBracket].FName = SDK::FName(skCrypt(L"LeftBracket"));
|
||||
Keys[KeyName::Backslash].FName = SDK::FName(skCrypt(L"Backslash"));
|
||||
Keys[KeyName::RightBracket].FName = SDK::FName(skCrypt(L"RightBracket"));
|
||||
Keys[KeyName::Quote].FName = SDK::FName(skCrypt(L"Quote"));
|
||||
Keys[KeyName::Asterix].FName = SDK::FName(skCrypt(L"Asterix"));
|
||||
Keys[KeyName::Ampersand].FName = SDK::FName(skCrypt(L"Ampersand"));
|
||||
Keys[KeyName::Caret].FName = SDK::FName(skCrypt(L"Caret"));
|
||||
Keys[KeyName::Dollar].FName = SDK::FName(skCrypt(L"Dollar"));
|
||||
Keys[KeyName::Exclamation].FName = SDK::FName(skCrypt(L"Exclamation"));
|
||||
Keys[KeyName::Colon].FName = SDK::FName(skCrypt(L"Colon"));
|
||||
Keys[KeyName::NumLock].FName = SDK::FName(skCrypt(L"NumLock"));
|
||||
Keys[KeyName::ScrollLock].FName = SDK::FName(skCrypt(L"ScrollLock"));
|
||||
Keys[KeyName::LeftShift].FName = SDK::FName(skCrypt(L"LeftShift"));
|
||||
Keys[KeyName::RightShift].FName = SDK::FName(skCrypt(L"RightShift"));
|
||||
Keys[KeyName::LeftControl].FName = SDK::FName(skCrypt(L"LeftControl"));
|
||||
Keys[KeyName::RightControl].FName = SDK::FName(skCrypt(L"RightControl"));
|
||||
Keys[KeyName::LeftAlt].FName = SDK::FName(skCrypt(L"LeftAlt"));
|
||||
Keys[KeyName::RightAlt].FName = SDK::FName(skCrypt(L"RightAlt"));
|
||||
Keys[KeyName::LeftCommand].FName = SDK::FName(skCrypt(L"LeftCommand"));
|
||||
Keys[KeyName::RightCommand].FName = SDK::FName(skCrypt(L"RightCommand"));
|
||||
Keys[KeyName::Semicolon].FName = SDK::FName(skCrypt(L"Semicolon"));
|
||||
Keys[KeyName::Equals].FName = SDK::FName(skCrypt(L"Equals"));
|
||||
Keys[KeyName::Comma].FName = SDK::FName(skCrypt(L"Comma"));
|
||||
Keys[KeyName::Underscore].FName = SDK::FName(skCrypt(L"Underscore"));
|
||||
Keys[KeyName::Period].FName = SDK::FName(skCrypt(L"Period"));
|
||||
Keys[KeyName::Slash].FName = SDK::FName(skCrypt(L"Slash"));
|
||||
Keys[KeyName::Tilde].FName = SDK::FName(skCrypt(L"Tilde"));
|
||||
Keys[KeyName::LeftBracket].FName = SDK::FName(skCrypt(L"LeftBracket"));
|
||||
Keys[KeyName::Backslash].FName = SDK::FName(skCrypt(L"Backslash"));
|
||||
Keys[KeyName::RightBracket].FName = SDK::FName(skCrypt(L"RightBracket"));
|
||||
Keys[KeyName::Quote].FName = SDK::FName(skCrypt(L"Quote"));
|
||||
Keys[KeyName::Asterix].FName = SDK::FName(skCrypt(L"Asterix"));
|
||||
Keys[KeyName::Ampersand].FName = SDK::FName(skCrypt(L"Ampersand"));
|
||||
Keys[KeyName::Caret].FName = SDK::FName(skCrypt(L"Caret"));
|
||||
Keys[KeyName::Dollar].FName = SDK::FName(skCrypt(L"Dollar"));
|
||||
Keys[KeyName::Exclamation].FName = SDK::FName(skCrypt(L"Exclamation"));
|
||||
Keys[KeyName::Colon].FName = SDK::FName(skCrypt(L"Colon"));
|
||||
|
||||
Keys[KeyName::A_AccentGrave].FName = SDK::FName(skCrypt(L"A_AccentGrave"));
|
||||
Keys[KeyName::E_AccentGrave].FName = SDK::FName(skCrypt(L"E_AccentGrave"));
|
||||
Keys[KeyName::E_AccentAigu].FName = SDK::FName(skCrypt(L"E_AccentAigu"));
|
||||
Keys[KeyName::C_Cedille].FName = SDK::FName(skCrypt(L"C_Cedille"));
|
||||
Keys[KeyName::A_AccentGrave].FName = SDK::FName(skCrypt(L"A_AccentGrave"));
|
||||
Keys[KeyName::E_AccentGrave].FName = SDK::FName(skCrypt(L"E_AccentGrave"));
|
||||
Keys[KeyName::E_AccentAigu].FName = SDK::FName(skCrypt(L"E_AccentAigu"));
|
||||
Keys[KeyName::C_Cedille].FName = SDK::FName(skCrypt(L"C_Cedille"));
|
||||
|
||||
Keys[KeyName::Section].FName = SDK::FName(skCrypt(L"Section"));
|
||||
Keys[KeyName::Section].FName = SDK::FName(skCrypt(L"Section"));
|
||||
|
||||
Keys[KeyName::Gamepad_LeftX].FName = SDK::FName(skCrypt(L"Gamepad_LeftX"));
|
||||
Keys[KeyName::Gamepad_LeftY].FName = SDK::FName(skCrypt(L"Gamepad_LeftY"));
|
||||
Keys[KeyName::Gamepad_RightX].FName = SDK::FName(skCrypt(L"Gamepad_RightX"));
|
||||
Keys[KeyName::Gamepad_RightY].FName = SDK::FName(skCrypt(L"Gamepad_RightY"));
|
||||
Keys[KeyName::Gamepad_LeftTriggerAxis].FName = SDK::FName(skCrypt(L"Gamepad_LeftTriggerAxis"));
|
||||
Keys[KeyName::Gamepad_RightTriggerAxis].FName = SDK::FName(skCrypt(L"Gamepad_RightTriggerAxis"));
|
||||
Keys[KeyName::Gamepad_LeftThumbstick].FName = SDK::FName(skCrypt(L"Gamepad_LeftThumbstick"));
|
||||
Keys[KeyName::Gamepad_RightThumbstick].FName = SDK::FName(skCrypt(L"Gamepad_RightThumbstick"));
|
||||
Keys[KeyName::Gamepad_Special_Left].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left"));
|
||||
Keys[KeyName::Gamepad_Special_Left_X].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left_X"));
|
||||
Keys[KeyName::Gamepad_Special_Left_Y].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left_Y"));
|
||||
Keys[KeyName::Gamepad_Special_Right].FName = SDK::FName(skCrypt(L"Gamepad_Special_Right"));
|
||||
Keys[KeyName::Gamepad_LeftX].FName = SDK::FName(skCrypt(L"Gamepad_LeftX"));
|
||||
Keys[KeyName::Gamepad_LeftY].FName = SDK::FName(skCrypt(L"Gamepad_LeftY"));
|
||||
Keys[KeyName::Gamepad_RightX].FName = SDK::FName(skCrypt(L"Gamepad_RightX"));
|
||||
Keys[KeyName::Gamepad_RightY].FName = SDK::FName(skCrypt(L"Gamepad_RightY"));
|
||||
Keys[KeyName::Gamepad_LeftTriggerAxis].FName = SDK::FName(skCrypt(L"Gamepad_LeftTriggerAxis"));
|
||||
Keys[KeyName::Gamepad_RightTriggerAxis].FName = SDK::FName(skCrypt(L"Gamepad_RightTriggerAxis"));
|
||||
Keys[KeyName::Gamepad_LeftThumbstick].FName = SDK::FName(skCrypt(L"Gamepad_LeftThumbstick"));
|
||||
Keys[KeyName::Gamepad_RightThumbstick].FName = SDK::FName(skCrypt(L"Gamepad_RightThumbstick"));
|
||||
Keys[KeyName::Gamepad_Special_Left].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left"));
|
||||
Keys[KeyName::Gamepad_Special_Left_X].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left_X"));
|
||||
Keys[KeyName::Gamepad_Special_Left_Y].FName = SDK::FName(skCrypt(L"Gamepad_Special_Left_Y"));
|
||||
Keys[KeyName::Gamepad_Special_Right].FName = SDK::FName(skCrypt(L"Gamepad_Special_Right"));
|
||||
|
||||
Keys[KeyName::Gamepad_FaceButton_Bottom].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Bottom"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Right].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Right"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Left].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Left"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Top].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Top"));
|
||||
Keys[KeyName::Gamepad_LeftShoulder].FName = SDK::FName(skCrypt(L"Gamepad_LeftShoulder"));
|
||||
Keys[KeyName::Gamepad_RightShoulder].FName = SDK::FName(skCrypt(L"Gamepad_RightShoulder"));
|
||||
Keys[KeyName::Gamepad_LeftTrigger].FName = SDK::FName(skCrypt(L"Gamepad_LeftTrigger"));
|
||||
Keys[KeyName::Gamepad_RightTrigger].FName = SDK::FName(skCrypt(L"Gamepad_RightTrigger"));
|
||||
Keys[KeyName::Gamepad_DPad_Up].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Up"));
|
||||
Keys[KeyName::Gamepad_DPad_Down].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Down"));
|
||||
Keys[KeyName::Gamepad_DPad_Right].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Right"));
|
||||
Keys[KeyName::Gamepad_DPad_Left].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Left"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Up].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Up"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Down].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Down"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Right].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Right"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Left].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Left"));
|
||||
Keys[KeyName::Gamepad_RightStick_Up].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Up"));
|
||||
Keys[KeyName::Gamepad_RightStick_Down].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Down"));
|
||||
Keys[KeyName::Gamepad_RightStick_Right].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Right"));
|
||||
Keys[KeyName::Gamepad_RightStick_Left].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Left"));
|
||||
}
|
||||
Keys[KeyName::Gamepad_FaceButton_Bottom].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Bottom"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Right].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Right"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Left].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Left"));
|
||||
Keys[KeyName::Gamepad_FaceButton_Top].FName = SDK::FName(skCrypt(L"Gamepad_FaceButton_Top"));
|
||||
Keys[KeyName::Gamepad_LeftShoulder].FName = SDK::FName(skCrypt(L"Gamepad_LeftShoulder"));
|
||||
Keys[KeyName::Gamepad_RightShoulder].FName = SDK::FName(skCrypt(L"Gamepad_RightShoulder"));
|
||||
Keys[KeyName::Gamepad_LeftTrigger].FName = SDK::FName(skCrypt(L"Gamepad_LeftTrigger"));
|
||||
Keys[KeyName::Gamepad_RightTrigger].FName = SDK::FName(skCrypt(L"Gamepad_RightTrigger"));
|
||||
Keys[KeyName::Gamepad_DPad_Up].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Up"));
|
||||
Keys[KeyName::Gamepad_DPad_Down].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Down"));
|
||||
Keys[KeyName::Gamepad_DPad_Right].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Right"));
|
||||
Keys[KeyName::Gamepad_DPad_Left].FName = SDK::FName(skCrypt(L"Gamepad_DPad_Left"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Up].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Up"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Down].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Down"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Right].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Right"));
|
||||
Keys[KeyName::Gamepad_LeftStick_Left].FName = SDK::FName(skCrypt(L"Gamepad_LeftStick_Left"));
|
||||
Keys[KeyName::Gamepad_RightStick_Up].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Up"));
|
||||
Keys[KeyName::Gamepad_RightStick_Down].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Down"));
|
||||
Keys[KeyName::Gamepad_RightStick_Right].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Right"));
|
||||
Keys[KeyName::Gamepad_RightStick_Left].FName = SDK::FName(skCrypt(L"Gamepad_RightStick_Left"));
|
||||
}
|
||||
|
||||
DEBUG_LOG(LOG_OFFSET, skCrypt("Input system initialized!"));
|
||||
DEBUG_LOG(LOG_OFFSET, skCrypt("Input system initialized!"));
|
||||
}
|
||||
@@ -3,448 +3,442 @@
|
||||
|
||||
#include "../SDK/Classes/Basic.h"
|
||||
|
||||
namespace Input
|
||||
{
|
||||
/* Enum for easy key usage */
|
||||
enum class KeyName
|
||||
{
|
||||
NONE,
|
||||
namespace Input {
|
||||
/* Enum for easy key usage */
|
||||
enum class KeyName {
|
||||
NONE,
|
||||
|
||||
AnyKey,
|
||||
MouseX,
|
||||
MouseY,
|
||||
MouseScrollUp,
|
||||
MouseScrollDown,
|
||||
LeftMouseButton,
|
||||
RightMouseButton,
|
||||
MiddleMouseButton,
|
||||
ThumbMouseButton,
|
||||
ThumbMouseButton2,
|
||||
BackSpace,
|
||||
Tab,
|
||||
Enter,
|
||||
Pause,
|
||||
CapsLock,
|
||||
Escape,
|
||||
SpaceBar,
|
||||
PageUp,
|
||||
PageDown,
|
||||
End,
|
||||
Home,
|
||||
Left,
|
||||
Up,
|
||||
Right,
|
||||
Down,
|
||||
Insert,
|
||||
Delete,
|
||||
Zero,
|
||||
One,
|
||||
Two,
|
||||
Three,
|
||||
Four,
|
||||
Five,
|
||||
Six,
|
||||
Seven,
|
||||
Eight,
|
||||
Nine,
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
D,
|
||||
E,
|
||||
F,
|
||||
G,
|
||||
H,
|
||||
I,
|
||||
J,
|
||||
K,
|
||||
L,
|
||||
M,
|
||||
N,
|
||||
O,
|
||||
P,
|
||||
Q,
|
||||
R,
|
||||
S,
|
||||
T,
|
||||
U,
|
||||
V,
|
||||
W,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
NumPadZero,
|
||||
NumPadOne,
|
||||
NumPadTwo,
|
||||
NumPadThree,
|
||||
NumPadFour,
|
||||
NumPadFive,
|
||||
NumPadSix,
|
||||
NumPadSeven,
|
||||
NumPadEight,
|
||||
NumPadNine,
|
||||
Multiply,
|
||||
Add,
|
||||
Subtract,
|
||||
Decimal,
|
||||
Divide,
|
||||
F1,
|
||||
F2,
|
||||
F3,
|
||||
F4,
|
||||
F5,
|
||||
F6,
|
||||
F7,
|
||||
F8,
|
||||
F9,
|
||||
F10,
|
||||
F11,
|
||||
F12,
|
||||
NumLock,
|
||||
ScrollLock,
|
||||
LeftShift,
|
||||
RightShift,
|
||||
LeftControl,
|
||||
RightControl,
|
||||
LeftAlt,
|
||||
RightAlt,
|
||||
LeftCommand,
|
||||
RightCommand,
|
||||
Semicolon,
|
||||
Equals,
|
||||
Comma,
|
||||
Underscore,
|
||||
Period,
|
||||
Slash,
|
||||
Tilde,
|
||||
LeftBracket,
|
||||
Backslash,
|
||||
RightBracket,
|
||||
Quote,
|
||||
Asterix,
|
||||
Ampersand,
|
||||
Caret,
|
||||
Dollar,
|
||||
Exclamation,
|
||||
Colon,
|
||||
A_AccentGrave,
|
||||
E_AccentGrave,
|
||||
E_AccentAigu,
|
||||
C_Cedille,
|
||||
Section,
|
||||
Gamepad_LeftX,
|
||||
Gamepad_LeftY,
|
||||
Gamepad_RightX,
|
||||
Gamepad_RightY,
|
||||
Gamepad_LeftTriggerAxis,
|
||||
Gamepad_RightTriggerAxis,
|
||||
Gamepad_LeftThumbstick,
|
||||
Gamepad_RightThumbstick,
|
||||
Gamepad_Special_Left,
|
||||
Gamepad_Special_Left_X,
|
||||
Gamepad_Special_Left_Y,
|
||||
Gamepad_Special_Right,
|
||||
Gamepad_FaceButton_Bottom,
|
||||
Gamepad_FaceButton_Right,
|
||||
Gamepad_FaceButton_Left,
|
||||
Gamepad_FaceButton_Top,
|
||||
Gamepad_LeftShoulder,
|
||||
Gamepad_RightShoulder,
|
||||
Gamepad_LeftTrigger,
|
||||
Gamepad_RightTrigger,
|
||||
Gamepad_DPad_Up,
|
||||
Gamepad_DPad_Down,
|
||||
Gamepad_DPad_Left,
|
||||
Gamepad_DPad_Right,
|
||||
Gamepad_LeftStick_Up,
|
||||
Gamepad_LeftStick_Down,
|
||||
Gamepad_LeftStick_Left,
|
||||
Gamepad_LeftStick_Right,
|
||||
Gamepad_RightStick_Up,
|
||||
Gamepad_RightStick_Down,
|
||||
Gamepad_RightStick_Left,
|
||||
Gamepad_RightStick_Right,
|
||||
AnyKey,
|
||||
MouseX,
|
||||
MouseY,
|
||||
MouseScrollUp,
|
||||
MouseScrollDown,
|
||||
LeftMouseButton,
|
||||
RightMouseButton,
|
||||
MiddleMouseButton,
|
||||
ThumbMouseButton,
|
||||
ThumbMouseButton2,
|
||||
BackSpace,
|
||||
Tab,
|
||||
Enter,
|
||||
Pause,
|
||||
CapsLock,
|
||||
Escape,
|
||||
SpaceBar,
|
||||
PageUp,
|
||||
PageDown,
|
||||
End,
|
||||
Home,
|
||||
Left,
|
||||
Up,
|
||||
Right,
|
||||
Down,
|
||||
Insert,
|
||||
Delete,
|
||||
Zero,
|
||||
One,
|
||||
Two,
|
||||
Three,
|
||||
Four,
|
||||
Five,
|
||||
Six,
|
||||
Seven,
|
||||
Eight,
|
||||
Nine,
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
D,
|
||||
E,
|
||||
F,
|
||||
G,
|
||||
H,
|
||||
I,
|
||||
J,
|
||||
K,
|
||||
L,
|
||||
M,
|
||||
N,
|
||||
O,
|
||||
P,
|
||||
Q,
|
||||
R,
|
||||
S,
|
||||
T,
|
||||
U,
|
||||
V,
|
||||
W,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
NumPadZero,
|
||||
NumPadOne,
|
||||
NumPadTwo,
|
||||
NumPadThree,
|
||||
NumPadFour,
|
||||
NumPadFive,
|
||||
NumPadSix,
|
||||
NumPadSeven,
|
||||
NumPadEight,
|
||||
NumPadNine,
|
||||
Multiply,
|
||||
Add,
|
||||
Subtract,
|
||||
Decimal,
|
||||
Divide,
|
||||
F1,
|
||||
F2,
|
||||
F3,
|
||||
F4,
|
||||
F5,
|
||||
F6,
|
||||
F7,
|
||||
F8,
|
||||
F9,
|
||||
F10,
|
||||
F11,
|
||||
F12,
|
||||
NumLock,
|
||||
ScrollLock,
|
||||
LeftShift,
|
||||
RightShift,
|
||||
LeftControl,
|
||||
RightControl,
|
||||
LeftAlt,
|
||||
RightAlt,
|
||||
LeftCommand,
|
||||
RightCommand,
|
||||
Semicolon,
|
||||
Equals,
|
||||
Comma,
|
||||
Underscore,
|
||||
Period,
|
||||
Slash,
|
||||
Tilde,
|
||||
LeftBracket,
|
||||
Backslash,
|
||||
RightBracket,
|
||||
Quote,
|
||||
Asterix,
|
||||
Ampersand,
|
||||
Caret,
|
||||
Dollar,
|
||||
Exclamation,
|
||||
Colon,
|
||||
A_AccentGrave,
|
||||
E_AccentGrave,
|
||||
E_AccentAigu,
|
||||
C_Cedille,
|
||||
Section,
|
||||
Gamepad_LeftX,
|
||||
Gamepad_LeftY,
|
||||
Gamepad_RightX,
|
||||
Gamepad_RightY,
|
||||
Gamepad_LeftTriggerAxis,
|
||||
Gamepad_RightTriggerAxis,
|
||||
Gamepad_LeftThumbstick,
|
||||
Gamepad_RightThumbstick,
|
||||
Gamepad_Special_Left,
|
||||
Gamepad_Special_Left_X,
|
||||
Gamepad_Special_Left_Y,
|
||||
Gamepad_Special_Right,
|
||||
Gamepad_FaceButton_Bottom,
|
||||
Gamepad_FaceButton_Right,
|
||||
Gamepad_FaceButton_Left,
|
||||
Gamepad_FaceButton_Top,
|
||||
Gamepad_LeftShoulder,
|
||||
Gamepad_RightShoulder,
|
||||
Gamepad_LeftTrigger,
|
||||
Gamepad_RightTrigger,
|
||||
Gamepad_DPad_Up,
|
||||
Gamepad_DPad_Down,
|
||||
Gamepad_DPad_Left,
|
||||
Gamepad_DPad_Right,
|
||||
Gamepad_LeftStick_Up,
|
||||
Gamepad_LeftStick_Down,
|
||||
Gamepad_LeftStick_Left,
|
||||
Gamepad_LeftStick_Right,
|
||||
Gamepad_RightStick_Up,
|
||||
Gamepad_RightStick_Down,
|
||||
Gamepad_RightStick_Left,
|
||||
Gamepad_RightStick_Right,
|
||||
|
||||
KEYNAME_MAX
|
||||
};
|
||||
KEYNAME_MAX
|
||||
};
|
||||
|
||||
/* Info on key names */
|
||||
struct KeyMapInfo
|
||||
{
|
||||
std::string Name;
|
||||
SDK::FName FName;
|
||||
Input::KeyName KeyName;
|
||||
};
|
||||
/* Info on key names */
|
||||
struct KeyMapInfo {
|
||||
std::string Name;
|
||||
SDK::FName FName;
|
||||
Input::KeyName KeyName;
|
||||
};
|
||||
|
||||
/* Cache info on keystates to avoid multiple checks per frame */
|
||||
struct KeyInfoCache
|
||||
{
|
||||
bool Value = false;
|
||||
uint64 FrameUpdated = 0;
|
||||
};
|
||||
/* Cache info on keystates to avoid multiple checks per frame */
|
||||
struct KeyInfoCache {
|
||||
bool Value = false;
|
||||
uint64 FrameUpdated = 0;
|
||||
};
|
||||
|
||||
/* Cache info on mouse position to avoid multiple checks per frame */
|
||||
struct MouseCache
|
||||
{
|
||||
SDK::FVector2D Position;
|
||||
uint64 FrameUpdated = 0;
|
||||
};
|
||||
/* Cache info on mouse position to avoid multiple checks per frame */
|
||||
struct MouseCache {
|
||||
SDK::FVector2D Position;
|
||||
uint64 FrameUpdated = 0;
|
||||
};
|
||||
|
||||
/* Cache info on key name, states etc */
|
||||
struct KeyData
|
||||
{
|
||||
int VKCode;
|
||||
KeyName KeyName;
|
||||
/* Cache info on key name, states etc */
|
||||
struct KeyData {
|
||||
int VKCode;
|
||||
KeyName KeyName;
|
||||
|
||||
SDK::FName FName;
|
||||
std::string Name;
|
||||
SDK::FName FName;
|
||||
std::string Name;
|
||||
|
||||
KeyInfoCache IsDown{};
|
||||
KeyInfoCache WasJustReleased{};
|
||||
KeyInfoCache WasJustPressed{};
|
||||
KeyInfoCache IsDown{};
|
||||
KeyInfoCache WasJustReleased{};
|
||||
KeyInfoCache WasJustPressed{};
|
||||
|
||||
|
||||
|
||||
// Default constructor
|
||||
KeyData() : VKCode(0), KeyName(Input::KeyName::NONE), FName(), Name() {}
|
||||
// Default constructor
|
||||
KeyData() : VKCode(0), KeyName(Input::KeyName::NONE), FName(), Name() {}
|
||||
|
||||
// Constructor with SDK::FName and std::string arguments
|
||||
KeyData(const int VKCode, const Input::KeyName KeyName, const SDK::FName& FName, const const char* Name) : VKCode(VKCode), KeyName(KeyName), FName(FName), Name(Name) {}
|
||||
};
|
||||
// Constructor with SDK::FName and std::string arguments
|
||||
KeyData(int VKCode, Input::KeyName KeyName, SDK::FName FName, const char* Name) : VKCode(VKCode), KeyName(KeyName), FName(FName), Name(Name) {}
|
||||
};
|
||||
|
||||
inline std::unordered_map<KeyName, KeyData> Keys = {
|
||||
{ Input::KeyName::NONE, {0x0, Input::KeyName::NONE, SDK::FName(), skCrypt("None") } },
|
||||
inline std::unordered_map<KeyName, KeyData> Keys = {
|
||||
{ Input::KeyName::NONE, {0x0, Input::KeyName::NONE, SDK::FName(), skCrypt("None") } },
|
||||
|
||||
{ Input::KeyName::AnyKey, { 0x0, Input::KeyName::AnyKey, SDK::FName(), skCrypt("Any Key") } },
|
||||
{ Input::KeyName::AnyKey, { 0x0, Input::KeyName::AnyKey, SDK::FName(), skCrypt("Any Key") } },
|
||||
|
||||
{ Input::KeyName::MouseX, { 0x0, Input::KeyName::MouseX, SDK::FName(), skCrypt("Mouse X") } },
|
||||
{ Input::KeyName::MouseY, { 0x0, Input::KeyName::MouseY, SDK::FName(), skCrypt("Mouse Y") } },
|
||||
{ Input::KeyName::MouseScrollUp, { 0x0, Input::KeyName::MouseScrollUp, SDK::FName(), skCrypt("Scroll Up") } },
|
||||
{ Input::KeyName::MouseScrollDown, { 0x0, Input::KeyName::MouseScrollDown, SDK::FName(), skCrypt("Scroll Down") } },
|
||||
{ Input::KeyName::LeftMouseButton, { VK_LBUTTON, Input::KeyName::LeftMouseButton, SDK::FName(), skCrypt("LMB") } },
|
||||
{ Input::KeyName::RightMouseButton, { VK_RBUTTON, Input::KeyName::RightMouseButton, SDK::FName(), skCrypt("RMB") } },
|
||||
{ Input::KeyName::MiddleMouseButton, { VK_MBUTTON, Input::KeyName::RightMouseButton,SDK::FName(), skCrypt("MMB") } },
|
||||
{ Input::KeyName::ThumbMouseButton, { VK_XBUTTON1, Input::KeyName::ThumbMouseButton, SDK::FName(), skCrypt("Thumb MB") } },
|
||||
{ Input::KeyName::ThumbMouseButton2, { VK_XBUTTON2, Input::KeyName::ThumbMouseButton, SDK::FName(), skCrypt("Thumb MB2") } },
|
||||
{ Input::KeyName::MouseX, { 0x0, Input::KeyName::MouseX, SDK::FName(), skCrypt("Mouse X") } },
|
||||
{ Input::KeyName::MouseY, { 0x0, Input::KeyName::MouseY, SDK::FName(), skCrypt("Mouse Y") } },
|
||||
{ Input::KeyName::MouseScrollUp, { 0x0, Input::KeyName::MouseScrollUp, SDK::FName(), skCrypt("Scroll Up") } },
|
||||
{ Input::KeyName::MouseScrollDown, { 0x0, Input::KeyName::MouseScrollDown, SDK::FName(), skCrypt("Scroll Down") } },
|
||||
{ Input::KeyName::LeftMouseButton, { VK_LBUTTON, Input::KeyName::LeftMouseButton, SDK::FName(), skCrypt("LMB") } },
|
||||
{ Input::KeyName::RightMouseButton, { VK_RBUTTON, Input::KeyName::RightMouseButton, SDK::FName(), skCrypt("RMB") } },
|
||||
{ Input::KeyName::MiddleMouseButton, { VK_MBUTTON, Input::KeyName::RightMouseButton,SDK::FName(), skCrypt("MMB") } },
|
||||
{ Input::KeyName::ThumbMouseButton, { VK_XBUTTON1, Input::KeyName::ThumbMouseButton, SDK::FName(), skCrypt("Thumb MB") } },
|
||||
{ Input::KeyName::ThumbMouseButton2, { VK_XBUTTON2, Input::KeyName::ThumbMouseButton, SDK::FName(), skCrypt("Thumb MB2") } },
|
||||
|
||||
{ Input::KeyName::BackSpace, { VK_BACK, Input::KeyName::BackSpace, SDK::FName(), skCrypt("BackSpace") } },
|
||||
{ Input::KeyName::Tab, { VK_TAB, Input::KeyName::BackSpace, SDK::FName(), skCrypt("Tab") } },
|
||||
{ Input::KeyName::Enter, { VK_RETURN, Input::KeyName::Enter, SDK::FName(), skCrypt("Enter") } },
|
||||
{ Input::KeyName::Pause, { VK_PAUSE, Input::KeyName::Pause, SDK::FName(), skCrypt("Pause") } },
|
||||
{ Input::KeyName::CapsLock, { VK_CAPITAL, Input::KeyName::CapsLock, SDK::FName(), skCrypt("CapsLock") } },
|
||||
{ Input::KeyName::Escape, { VK_ESCAPE, Input::KeyName::Escape, SDK::FName(), skCrypt("Escape") } },
|
||||
{ Input::KeyName::SpaceBar, { VK_SPACE, Input::KeyName::SpaceBar, SDK::FName(), skCrypt("Space") } },
|
||||
{ Input::KeyName::PageUp, { VK_PRIOR, Input::KeyName::SpaceBar, SDK::FName(), skCrypt("PageUp") } },
|
||||
{ Input::KeyName::PageDown, { VK_NEXT, Input::KeyName::PageDown, SDK::FName(), skCrypt("PageDown") } },
|
||||
{ Input::KeyName::End, { VK_END, Input::KeyName::End, SDK::FName(), skCrypt("End") } },
|
||||
{ Input::KeyName::Home, { VK_HOME, Input::KeyName::Home, SDK::FName(), skCrypt("Home") } },
|
||||
{ Input::KeyName::BackSpace, { VK_BACK, Input::KeyName::BackSpace, SDK::FName(), skCrypt("BackSpace") } },
|
||||
{ Input::KeyName::Tab, { VK_TAB, Input::KeyName::BackSpace, SDK::FName(), skCrypt("Tab") } },
|
||||
{ Input::KeyName::Enter, { VK_RETURN, Input::KeyName::Enter, SDK::FName(), skCrypt("Enter") } },
|
||||
{ Input::KeyName::Pause, { VK_PAUSE, Input::KeyName::Pause, SDK::FName(), skCrypt("Pause") } },
|
||||
{ Input::KeyName::CapsLock, { VK_CAPITAL, Input::KeyName::CapsLock, SDK::FName(), skCrypt("CapsLock") } },
|
||||
{ Input::KeyName::Escape, { VK_ESCAPE, Input::KeyName::Escape, SDK::FName(), skCrypt("Escape") } },
|
||||
{ Input::KeyName::SpaceBar, { VK_SPACE, Input::KeyName::SpaceBar, SDK::FName(), skCrypt("Space") } },
|
||||
{ Input::KeyName::PageUp, { VK_PRIOR, Input::KeyName::SpaceBar, SDK::FName(), skCrypt("PageUp") } },
|
||||
{ Input::KeyName::PageDown, { VK_NEXT, Input::KeyName::PageDown, SDK::FName(), skCrypt("PageDown") } },
|
||||
{ Input::KeyName::End, { VK_END, Input::KeyName::End, SDK::FName(), skCrypt("End") } },
|
||||
{ Input::KeyName::Home, { VK_HOME, Input::KeyName::Home, SDK::FName(), skCrypt("Home") } },
|
||||
|
||||
{ Input::KeyName::Left, { VK_LEFT, Input::KeyName::Left, SDK::FName(), skCrypt("Left Arrow") } },
|
||||
{ Input::KeyName::Up, { VK_UP, Input::KeyName::Up, SDK::FName(), skCrypt("Up Arrow") } },
|
||||
{ Input::KeyName::Right, { VK_RIGHT, Input::KeyName::Right, SDK::FName(), skCrypt("Right Arrow") } },
|
||||
{ Input::KeyName::Down, { VK_DOWN, Input::KeyName::Down, SDK::FName(), skCrypt("Down Arrow") } },
|
||||
{ Input::KeyName::Left, { VK_LEFT, Input::KeyName::Left, SDK::FName(), skCrypt("Left Arrow") } },
|
||||
{ Input::KeyName::Up, { VK_UP, Input::KeyName::Up, SDK::FName(), skCrypt("Up Arrow") } },
|
||||
{ Input::KeyName::Right, { VK_RIGHT, Input::KeyName::Right, SDK::FName(), skCrypt("Right Arrow") } },
|
||||
{ Input::KeyName::Down, { VK_DOWN, Input::KeyName::Down, SDK::FName(), skCrypt("Down Arrow") } },
|
||||
|
||||
{ Input::KeyName::Insert, { VK_INSERT, Input::KeyName::Insert, SDK::FName(), skCrypt("Insert") } },
|
||||
{ Input::KeyName::Delete, { VK_DELETE, Input::KeyName::Delete, SDK::FName(), skCrypt("Delete") } },
|
||||
{ Input::KeyName::Insert, { VK_INSERT, Input::KeyName::Insert, SDK::FName(), skCrypt("Insert") } },
|
||||
{ Input::KeyName::Delete, { VK_DELETE, Input::KeyName::Delete, SDK::FName(), skCrypt("Delete") } },
|
||||
|
||||
{ Input::KeyName::Zero, { '0', Input::KeyName::Zero, SDK::FName(), skCrypt("0") } },
|
||||
{ Input::KeyName::One, { '1', Input::KeyName::One, SDK::FName(), skCrypt("1") } },
|
||||
{ Input::KeyName::Two, { '2', Input::KeyName::Two, SDK::FName(), skCrypt("2") } },
|
||||
{ Input::KeyName::Three, { '3', Input::KeyName::Three, SDK::FName(), skCrypt("3") } },
|
||||
{ Input::KeyName::Four, { '4', Input::KeyName::Four, SDK::FName(), skCrypt("4") } },
|
||||
{ Input::KeyName::Five, { '5', Input::KeyName::Five, SDK::FName(), skCrypt("5") } },
|
||||
{ Input::KeyName::Six, { '6', Input::KeyName::Six, SDK::FName(), skCrypt("6") } },
|
||||
{ Input::KeyName::Seven, { '7', Input::KeyName::Seven, SDK::FName(), skCrypt("7") } },
|
||||
{ Input::KeyName::Eight, { '8', Input::KeyName::Eight, SDK::FName(), skCrypt("8") } },
|
||||
{ Input::KeyName::Nine, { '9', Input::KeyName::Nine, SDK::FName(), skCrypt("9") } },
|
||||
{ Input::KeyName::Zero, { '0', Input::KeyName::Zero, SDK::FName(), skCrypt("0") } },
|
||||
{ Input::KeyName::One, { '1', Input::KeyName::One, SDK::FName(), skCrypt("1") } },
|
||||
{ Input::KeyName::Two, { '2', Input::KeyName::Two, SDK::FName(), skCrypt("2") } },
|
||||
{ Input::KeyName::Three, { '3', Input::KeyName::Three, SDK::FName(), skCrypt("3") } },
|
||||
{ Input::KeyName::Four, { '4', Input::KeyName::Four, SDK::FName(), skCrypt("4") } },
|
||||
{ Input::KeyName::Five, { '5', Input::KeyName::Five, SDK::FName(), skCrypt("5") } },
|
||||
{ Input::KeyName::Six, { '6', Input::KeyName::Six, SDK::FName(), skCrypt("6") } },
|
||||
{ Input::KeyName::Seven, { '7', Input::KeyName::Seven, SDK::FName(), skCrypt("7") } },
|
||||
{ Input::KeyName::Eight, { '8', Input::KeyName::Eight, SDK::FName(), skCrypt("8") } },
|
||||
{ Input::KeyName::Nine, { '9', Input::KeyName::Nine, SDK::FName(), skCrypt("9") } },
|
||||
|
||||
{ Input::KeyName::A, { 'A', Input::KeyName::A, SDK::FName(), skCrypt("A") } },
|
||||
{ Input::KeyName::B, { 'B', Input::KeyName::B, SDK::FName(), skCrypt("B") } },
|
||||
{ Input::KeyName::C, { 'C', Input::KeyName::C, SDK::FName(), skCrypt("C") } },
|
||||
{ Input::KeyName::D, { 'D', Input::KeyName::D, SDK::FName(), skCrypt("D") } },
|
||||
{ Input::KeyName::E, { 'E', Input::KeyName::E, SDK::FName(), skCrypt("E") } },
|
||||
{ Input::KeyName::F, { 'F', Input::KeyName::F, SDK::FName(), skCrypt("F") } },
|
||||
{ Input::KeyName::G, { 'G', Input::KeyName::G, SDK::FName(), skCrypt("G") } },
|
||||
{ Input::KeyName::H, { 'H', Input::KeyName::H, SDK::FName(), skCrypt("H") } },
|
||||
{ Input::KeyName::I, { 'I', Input::KeyName::I, SDK::FName(), skCrypt("I") } },
|
||||
{ Input::KeyName::J, { 'J', Input::KeyName::J, SDK::FName(), skCrypt("J") } },
|
||||
{ Input::KeyName::K, { 'K', Input::KeyName::K, SDK::FName(), skCrypt("K") } },
|
||||
{ Input::KeyName::L, { 'L', Input::KeyName::L, SDK::FName(), skCrypt("L") } },
|
||||
{ Input::KeyName::M, { 'M', Input::KeyName::M, SDK::FName(), skCrypt("M") } },
|
||||
{ Input::KeyName::N, { 'N', Input::KeyName::N, SDK::FName(), skCrypt("N") } },
|
||||
{ Input::KeyName::O, { 'O', Input::KeyName::O, SDK::FName(), skCrypt("O") } },
|
||||
{ Input::KeyName::P, { 'P', Input::KeyName::P, SDK::FName(), skCrypt("P") } },
|
||||
{ Input::KeyName::Q, { 'Q', Input::KeyName::Q, SDK::FName(), skCrypt("Q") } },
|
||||
{ Input::KeyName::R, { 'R', Input::KeyName::R, SDK::FName(), skCrypt("R") } },
|
||||
{ Input::KeyName::S, { 'S', Input::KeyName::S, SDK::FName(), skCrypt("S") } },
|
||||
{ Input::KeyName::T, { 'T', Input::KeyName::T, SDK::FName(), skCrypt("T") } },
|
||||
{ Input::KeyName::U, { 'U', Input::KeyName::U, SDK::FName(), skCrypt("U") } },
|
||||
{ Input::KeyName::V, { 'V', Input::KeyName::V, SDK::FName(), skCrypt("V") } },
|
||||
{ Input::KeyName::W, { 'W', Input::KeyName::W, SDK::FName(), skCrypt("W") } },
|
||||
{ Input::KeyName::X, { 'X', Input::KeyName::X, SDK::FName(), skCrypt("X") } },
|
||||
{ Input::KeyName::Y, { 'Y', Input::KeyName::Y, SDK::FName(), skCrypt("Y") } },
|
||||
{ Input::KeyName::Z, { 'Z', Input::KeyName::Z, SDK::FName(), skCrypt("Z") } },
|
||||
{ Input::KeyName::A, { 'A', Input::KeyName::A, SDK::FName(), skCrypt("A") } },
|
||||
{ Input::KeyName::B, { 'B', Input::KeyName::B, SDK::FName(), skCrypt("B") } },
|
||||
{ Input::KeyName::C, { 'C', Input::KeyName::C, SDK::FName(), skCrypt("C") } },
|
||||
{ Input::KeyName::D, { 'D', Input::KeyName::D, SDK::FName(), skCrypt("D") } },
|
||||
{ Input::KeyName::E, { 'E', Input::KeyName::E, SDK::FName(), skCrypt("E") } },
|
||||
{ Input::KeyName::F, { 'F', Input::KeyName::F, SDK::FName(), skCrypt("F") } },
|
||||
{ Input::KeyName::G, { 'G', Input::KeyName::G, SDK::FName(), skCrypt("G") } },
|
||||
{ Input::KeyName::H, { 'H', Input::KeyName::H, SDK::FName(), skCrypt("H") } },
|
||||
{ Input::KeyName::I, { 'I', Input::KeyName::I, SDK::FName(), skCrypt("I") } },
|
||||
{ Input::KeyName::J, { 'J', Input::KeyName::J, SDK::FName(), skCrypt("J") } },
|
||||
{ Input::KeyName::K, { 'K', Input::KeyName::K, SDK::FName(), skCrypt("K") } },
|
||||
{ Input::KeyName::L, { 'L', Input::KeyName::L, SDK::FName(), skCrypt("L") } },
|
||||
{ Input::KeyName::M, { 'M', Input::KeyName::M, SDK::FName(), skCrypt("M") } },
|
||||
{ Input::KeyName::N, { 'N', Input::KeyName::N, SDK::FName(), skCrypt("N") } },
|
||||
{ Input::KeyName::O, { 'O', Input::KeyName::O, SDK::FName(), skCrypt("O") } },
|
||||
{ Input::KeyName::P, { 'P', Input::KeyName::P, SDK::FName(), skCrypt("P") } },
|
||||
{ Input::KeyName::Q, { 'Q', Input::KeyName::Q, SDK::FName(), skCrypt("Q") } },
|
||||
{ Input::KeyName::R, { 'R', Input::KeyName::R, SDK::FName(), skCrypt("R") } },
|
||||
{ Input::KeyName::S, { 'S', Input::KeyName::S, SDK::FName(), skCrypt("S") } },
|
||||
{ Input::KeyName::T, { 'T', Input::KeyName::T, SDK::FName(), skCrypt("T") } },
|
||||
{ Input::KeyName::U, { 'U', Input::KeyName::U, SDK::FName(), skCrypt("U") } },
|
||||
{ Input::KeyName::V, { 'V', Input::KeyName::V, SDK::FName(), skCrypt("V") } },
|
||||
{ Input::KeyName::W, { 'W', Input::KeyName::W, SDK::FName(), skCrypt("W") } },
|
||||
{ Input::KeyName::X, { 'X', Input::KeyName::X, SDK::FName(), skCrypt("X") } },
|
||||
{ Input::KeyName::Y, { 'Y', Input::KeyName::Y, SDK::FName(), skCrypt("Y") } },
|
||||
{ Input::KeyName::Z, { 'Z', Input::KeyName::Z, SDK::FName(), skCrypt("Z") } },
|
||||
|
||||
{ Input::KeyName::NumPadZero, { VK_NUMPAD0, Input::KeyName::NumPadZero, SDK::FName(), skCrypt("NumPad 0") } },
|
||||
{ Input::KeyName::NumPadOne, { VK_NUMPAD1, Input::KeyName::NumPadOne, SDK::FName(), skCrypt("NumPad 1") } },
|
||||
{ Input::KeyName::NumPadTwo, { VK_NUMPAD2, Input::KeyName::NumPadTwo, SDK::FName(), skCrypt("NumPad 2") } },
|
||||
{ Input::KeyName::NumPadThree, { VK_NUMPAD3, Input::KeyName::NumPadThree, SDK::FName(), skCrypt("NumPad 3") } },
|
||||
{ Input::KeyName::NumPadFour, { VK_NUMPAD4, Input::KeyName::NumPadFour, SDK::FName(), skCrypt("NumPad 4") } },
|
||||
{ Input::KeyName::NumPadFive, { VK_NUMPAD5, Input::KeyName::NumPadFive, SDK::FName(), skCrypt("NumPad 5") } },
|
||||
{ Input::KeyName::NumPadSix, { VK_NUMPAD6, Input::KeyName::NumPadSix, SDK::FName(), skCrypt("NumPad 6") } },
|
||||
{ Input::KeyName::NumPadSeven, { VK_NUMPAD7, Input::KeyName::NumPadSeven, SDK::FName(), skCrypt("NumPad 7") } },
|
||||
{ Input::KeyName::NumPadEight, { VK_NUMPAD8, Input::KeyName::NumPadEight, SDK::FName(), skCrypt("NumPad 8") } },
|
||||
{ Input::KeyName::NumPadNine, { VK_NUMPAD9, Input::KeyName::NumPadNine, SDK::FName(), skCrypt("NumPad 9") } },
|
||||
{ Input::KeyName::NumPadZero, { VK_NUMPAD0, Input::KeyName::NumPadZero, SDK::FName(), skCrypt("NumPad 0") } },
|
||||
{ Input::KeyName::NumPadOne, { VK_NUMPAD1, Input::KeyName::NumPadOne, SDK::FName(), skCrypt("NumPad 1") } },
|
||||
{ Input::KeyName::NumPadTwo, { VK_NUMPAD2, Input::KeyName::NumPadTwo, SDK::FName(), skCrypt("NumPad 2") } },
|
||||
{ Input::KeyName::NumPadThree, { VK_NUMPAD3, Input::KeyName::NumPadThree, SDK::FName(), skCrypt("NumPad 3") } },
|
||||
{ Input::KeyName::NumPadFour, { VK_NUMPAD4, Input::KeyName::NumPadFour, SDK::FName(), skCrypt("NumPad 4") } },
|
||||
{ Input::KeyName::NumPadFive, { VK_NUMPAD5, Input::KeyName::NumPadFive, SDK::FName(), skCrypt("NumPad 5") } },
|
||||
{ Input::KeyName::NumPadSix, { VK_NUMPAD6, Input::KeyName::NumPadSix, SDK::FName(), skCrypt("NumPad 6") } },
|
||||
{ Input::KeyName::NumPadSeven, { VK_NUMPAD7, Input::KeyName::NumPadSeven, SDK::FName(), skCrypt("NumPad 7") } },
|
||||
{ Input::KeyName::NumPadEight, { VK_NUMPAD8, Input::KeyName::NumPadEight, SDK::FName(), skCrypt("NumPad 8") } },
|
||||
{ Input::KeyName::NumPadNine, { VK_NUMPAD9, Input::KeyName::NumPadNine, SDK::FName(), skCrypt("NumPad 9") } },
|
||||
|
||||
{ Input::KeyName::Multiply, { VK_MULTIPLY, Input::KeyName::Multiply, SDK::FName(), skCrypt("Multiply") } },
|
||||
{ Input::KeyName::Add, { VK_ADD, Input::KeyName::Add, SDK::FName(), skCrypt("Add") } },
|
||||
{ Input::KeyName::Subtract, { VK_SUBTRACT, Input::KeyName::Subtract, SDK::FName(), skCrypt("Subtract") } },
|
||||
{ Input::KeyName::Decimal, { VK_DECIMAL, Input::KeyName::Decimal, SDK::FName(), skCrypt("Decimal") } },
|
||||
{ Input::KeyName::Divide, { VK_DIVIDE, Input::KeyName::Divide, SDK::FName(), skCrypt("Divide") } },
|
||||
{ Input::KeyName::Multiply, { VK_MULTIPLY, Input::KeyName::Multiply, SDK::FName(), skCrypt("Multiply") } },
|
||||
{ Input::KeyName::Add, { VK_ADD, Input::KeyName::Add, SDK::FName(), skCrypt("Add") } },
|
||||
{ Input::KeyName::Subtract, { VK_SUBTRACT, Input::KeyName::Subtract, SDK::FName(), skCrypt("Subtract") } },
|
||||
{ Input::KeyName::Decimal, { VK_DECIMAL, Input::KeyName::Decimal, SDK::FName(), skCrypt("Decimal") } },
|
||||
{ Input::KeyName::Divide, { VK_DIVIDE, Input::KeyName::Divide, SDK::FName(), skCrypt("Divide") } },
|
||||
|
||||
{ Input::KeyName::F1, { VK_F1, Input::KeyName::F1, SDK::FName(), skCrypt("F1") } },
|
||||
{ Input::KeyName::F2, { VK_F2, Input::KeyName::F2, SDK::FName(), skCrypt("F2") } },
|
||||
{ Input::KeyName::F3, { VK_F3, Input::KeyName::F3, SDK::FName(), skCrypt("F3") } },
|
||||
{ Input::KeyName::F4, { VK_F4, Input::KeyName::F4, SDK::FName(), skCrypt("F4") } },
|
||||
{ Input::KeyName::F5, { VK_F5, Input::KeyName::F5, SDK::FName(), skCrypt("F5") } },
|
||||
{ Input::KeyName::F6, { VK_F6, Input::KeyName::F6, SDK::FName(), skCrypt("F6") } },
|
||||
{ Input::KeyName::F7, { VK_F7, Input::KeyName::F7, SDK::FName(), skCrypt("F7") } },
|
||||
{ Input::KeyName::F8, { VK_F8, Input::KeyName::F8, SDK::FName(), skCrypt("F8") } },
|
||||
{ Input::KeyName::F9, { VK_F9, Input::KeyName::F9, SDK::FName(), skCrypt("F9") } },
|
||||
{ Input::KeyName::F10, { VK_F10, Input::KeyName::F10, SDK::FName(), skCrypt("F10") } },
|
||||
{ Input::KeyName::F11, { VK_F11, Input::KeyName::F11, SDK::FName(), skCrypt("F11") } },
|
||||
{ Input::KeyName::F12, { VK_F12, Input::KeyName::F12, SDK::FName(), skCrypt("F12") } },
|
||||
{ Input::KeyName::F1, { VK_F1, Input::KeyName::F1, SDK::FName(), skCrypt("F1") } },
|
||||
{ Input::KeyName::F2, { VK_F2, Input::KeyName::F2, SDK::FName(), skCrypt("F2") } },
|
||||
{ Input::KeyName::F3, { VK_F3, Input::KeyName::F3, SDK::FName(), skCrypt("F3") } },
|
||||
{ Input::KeyName::F4, { VK_F4, Input::KeyName::F4, SDK::FName(), skCrypt("F4") } },
|
||||
{ Input::KeyName::F5, { VK_F5, Input::KeyName::F5, SDK::FName(), skCrypt("F5") } },
|
||||
{ Input::KeyName::F6, { VK_F6, Input::KeyName::F6, SDK::FName(), skCrypt("F6") } },
|
||||
{ Input::KeyName::F7, { VK_F7, Input::KeyName::F7, SDK::FName(), skCrypt("F7") } },
|
||||
{ Input::KeyName::F8, { VK_F8, Input::KeyName::F8, SDK::FName(), skCrypt("F8") } },
|
||||
{ Input::KeyName::F9, { VK_F9, Input::KeyName::F9, SDK::FName(), skCrypt("F9") } },
|
||||
{ Input::KeyName::F10, { VK_F10, Input::KeyName::F10, SDK::FName(), skCrypt("F10") } },
|
||||
{ Input::KeyName::F11, { VK_F11, Input::KeyName::F11, SDK::FName(), skCrypt("F11") } },
|
||||
{ Input::KeyName::F12, { VK_F12, Input::KeyName::F12, SDK::FName(), skCrypt("F12") } },
|
||||
|
||||
{ Input::KeyName::NumLock, { 0x0, Input::KeyName::NumLock, SDK::FName(), skCrypt("NumLock") } },
|
||||
{ Input::KeyName::ScrollLock, { 0x0, Input::KeyName::ScrollLock, SDK::FName(), skCrypt("ScrollLock") } },
|
||||
{ Input::KeyName::LeftShift, { 0x0, Input::KeyName::LeftShift, SDK::FName(), skCrypt("Left Shift") } },
|
||||
{ Input::KeyName::RightShift, { 0x0, Input::KeyName::RightShift, SDK::FName(), skCrypt("Right Shift") } },
|
||||
{ Input::KeyName::LeftControl, { 0x0, Input::KeyName::LeftControl, SDK::FName(), skCrypt("Left Control") } },
|
||||
{ Input::KeyName::RightControl, { 0x0, Input::KeyName::RightControl, SDK::FName(), skCrypt("Right Control") } },
|
||||
{ Input::KeyName::LeftAlt, { 0x0, Input::KeyName::LeftAlt, SDK::FName(), skCrypt("Left Alt") } },
|
||||
{ Input::KeyName::RightAlt, { 0x0, Input::KeyName::RightAlt, SDK::FName(), skCrypt("Right Alt") } },
|
||||
{ Input::KeyName::LeftCommand, { 0x0, Input::KeyName::LeftCommand, SDK::FName(), skCrypt("Left Command") } },
|
||||
{ Input::KeyName::RightCommand, { 0x0, Input::KeyName::RightCommand, SDK::FName(), skCrypt("Right Command") } },
|
||||
{ Input::KeyName::NumLock, { 0x0, Input::KeyName::NumLock, SDK::FName(), skCrypt("NumLock") } },
|
||||
{ Input::KeyName::ScrollLock, { 0x0, Input::KeyName::ScrollLock, SDK::FName(), skCrypt("ScrollLock") } },
|
||||
{ Input::KeyName::LeftShift, { 0x0, Input::KeyName::LeftShift, SDK::FName(), skCrypt("Left Shift") } },
|
||||
{ Input::KeyName::RightShift, { 0x0, Input::KeyName::RightShift, SDK::FName(), skCrypt("Right Shift") } },
|
||||
{ Input::KeyName::LeftControl, { 0x0, Input::KeyName::LeftControl, SDK::FName(), skCrypt("Left Control") } },
|
||||
{ Input::KeyName::RightControl, { 0x0, Input::KeyName::RightControl, SDK::FName(), skCrypt("Right Control") } },
|
||||
{ Input::KeyName::LeftAlt, { 0x0, Input::KeyName::LeftAlt, SDK::FName(), skCrypt("Left Alt") } },
|
||||
{ Input::KeyName::RightAlt, { 0x0, Input::KeyName::RightAlt, SDK::FName(), skCrypt("Right Alt") } },
|
||||
{ Input::KeyName::LeftCommand, { 0x0, Input::KeyName::LeftCommand, SDK::FName(), skCrypt("Left Command") } },
|
||||
{ Input::KeyName::RightCommand, { 0x0, Input::KeyName::RightCommand, SDK::FName(), skCrypt("Right Command") } },
|
||||
|
||||
{ Input::KeyName::Semicolon, { 0x0, Input::KeyName::Semicolon, SDK::FName(), skCrypt("Semicolon") } },
|
||||
{ Input::KeyName::Equals, { 0x0, Input::KeyName::Equals, SDK::FName(), skCrypt("Equals") } },
|
||||
{ Input::KeyName::Comma, { 0x0, Input::KeyName::Comma, SDK::FName(), skCrypt("Comma") } },
|
||||
{ Input::KeyName::Underscore, { 0x0, Input::KeyName::Underscore, SDK::FName(), skCrypt("Underscore") } },
|
||||
{ Input::KeyName::Period, { 0x0, Input::KeyName::Period, SDK::FName(), skCrypt("Period") } },
|
||||
{ Input::KeyName::Slash, { 0x0, Input::KeyName::Slash, SDK::FName(), skCrypt("Slash") } },
|
||||
{ Input::KeyName::Tilde, { 0x0, Input::KeyName::Tilde, SDK::FName(), skCrypt("Tilde") } },
|
||||
{ Input::KeyName::LeftBracket, { 0x0, Input::KeyName::LeftBracket, SDK::FName(), skCrypt("Left Bracket") } },
|
||||
{ Input::KeyName::Backslash, { 0x0, Input::KeyName::Backslash, SDK::FName(), skCrypt("Backslash") } },
|
||||
{ Input::KeyName::RightBracket, { 0x0, Input::KeyName::RightBracket, SDK::FName(), skCrypt("Right Bracket") } },
|
||||
{ Input::KeyName::Quote, { 0x0, Input::KeyName::Quote, SDK::FName(), skCrypt("Quote") } },
|
||||
{ Input::KeyName::Asterix, { 0x0, Input::KeyName::Asterix, SDK::FName(), skCrypt("Asterix") } },
|
||||
{ Input::KeyName::Ampersand, { 0x0, Input::KeyName::Ampersand, SDK::FName(), skCrypt("Ampersand") } },
|
||||
{ Input::KeyName::Caret, { 0x0, Input::KeyName::Caret, SDK::FName(), skCrypt("Caret") } },
|
||||
{ Input::KeyName::Dollar, { 0x0, Input::KeyName::Dollar, SDK::FName(), skCrypt("Dollar") } },
|
||||
{ Input::KeyName::Exclamation, { 0x0, Input::KeyName::Exclamation, SDK::FName(), skCrypt("Exclamation") } },
|
||||
{ Input::KeyName::Colon, { 0x0, Input::KeyName::Colon, SDK::FName(), skCrypt("Colon") } },
|
||||
{ Input::KeyName::Semicolon, { 0x0, Input::KeyName::Semicolon, SDK::FName(), skCrypt("Semicolon") } },
|
||||
{ Input::KeyName::Equals, { 0x0, Input::KeyName::Equals, SDK::FName(), skCrypt("Equals") } },
|
||||
{ Input::KeyName::Comma, { 0x0, Input::KeyName::Comma, SDK::FName(), skCrypt("Comma") } },
|
||||
{ Input::KeyName::Underscore, { 0x0, Input::KeyName::Underscore, SDK::FName(), skCrypt("Underscore") } },
|
||||
{ Input::KeyName::Period, { 0x0, Input::KeyName::Period, SDK::FName(), skCrypt("Period") } },
|
||||
{ Input::KeyName::Slash, { 0x0, Input::KeyName::Slash, SDK::FName(), skCrypt("Slash") } },
|
||||
{ Input::KeyName::Tilde, { 0x0, Input::KeyName::Tilde, SDK::FName(), skCrypt("Tilde") } },
|
||||
{ Input::KeyName::LeftBracket, { 0x0, Input::KeyName::LeftBracket, SDK::FName(), skCrypt("Left Bracket") } },
|
||||
{ Input::KeyName::Backslash, { 0x0, Input::KeyName::Backslash, SDK::FName(), skCrypt("Backslash") } },
|
||||
{ Input::KeyName::RightBracket, { 0x0, Input::KeyName::RightBracket, SDK::FName(), skCrypt("Right Bracket") } },
|
||||
{ Input::KeyName::Quote, { 0x0, Input::KeyName::Quote, SDK::FName(), skCrypt("Quote") } },
|
||||
{ Input::KeyName::Asterix, { 0x0, Input::KeyName::Asterix, SDK::FName(), skCrypt("Asterix") } },
|
||||
{ Input::KeyName::Ampersand, { 0x0, Input::KeyName::Ampersand, SDK::FName(), skCrypt("Ampersand") } },
|
||||
{ Input::KeyName::Caret, { 0x0, Input::KeyName::Caret, SDK::FName(), skCrypt("Caret") } },
|
||||
{ Input::KeyName::Dollar, { 0x0, Input::KeyName::Dollar, SDK::FName(), skCrypt("Dollar") } },
|
||||
{ Input::KeyName::Exclamation, { 0x0, Input::KeyName::Exclamation, SDK::FName(), skCrypt("Exclamation") } },
|
||||
{ Input::KeyName::Colon, { 0x0, Input::KeyName::Colon, SDK::FName(), skCrypt("Colon") } },
|
||||
|
||||
{ Input::KeyName::A_AccentGrave, { 0x0, Input::KeyName::A_AccentGrave, SDK::FName(), skCrypt("A Accent Grave") } },
|
||||
{ Input::KeyName::E_AccentGrave, { 0x0, Input::KeyName::E_AccentGrave, SDK::FName(), skCrypt("E Accent Grave") } },
|
||||
{ Input::KeyName::E_AccentAigu, { 0x0, Input::KeyName::E_AccentAigu, SDK::FName(), skCrypt("E Accent Aigu") } },
|
||||
{ Input::KeyName::C_Cedille, { 0x0, Input::KeyName::C_Cedille, SDK::FName(), skCrypt("C Cedille") } },
|
||||
{ Input::KeyName::A_AccentGrave, { 0x0, Input::KeyName::A_AccentGrave, SDK::FName(), skCrypt("A Accent Grave") } },
|
||||
{ Input::KeyName::E_AccentGrave, { 0x0, Input::KeyName::E_AccentGrave, SDK::FName(), skCrypt("E Accent Grave") } },
|
||||
{ Input::KeyName::E_AccentAigu, { 0x0, Input::KeyName::E_AccentAigu, SDK::FName(), skCrypt("E Accent Aigu") } },
|
||||
{ Input::KeyName::C_Cedille, { 0x0, Input::KeyName::C_Cedille, SDK::FName(), skCrypt("C Cedille") } },
|
||||
|
||||
{ Input::KeyName::Section, { 0x0, Input::KeyName::Section, SDK::FName(), skCrypt("Section") } },
|
||||
{ Input::KeyName::Section, { 0x0, Input::KeyName::Section, SDK::FName(), skCrypt("Section") } },
|
||||
|
||||
{ Input::KeyName::Gamepad_LeftX, { 0x0, Input::KeyName::Gamepad_LeftX, SDK::FName(), skCrypt("Gamepad Left X") } },
|
||||
{ Input::KeyName::Gamepad_LeftY, { 0x0, Input::KeyName::Gamepad_LeftY, SDK::FName(), skCrypt("Gamepad Left Y") } },
|
||||
{ Input::KeyName::Gamepad_RightX, { 0x0, Input::KeyName::Gamepad_RightX, SDK::FName(), skCrypt("Gamepad Right X") } },
|
||||
{ Input::KeyName::Gamepad_RightY, { 0x0, Input::KeyName::Gamepad_RightY, SDK::FName(), skCrypt("Gamepad Right Y") } },
|
||||
{ Input::KeyName::Gamepad_LeftTriggerAxis, { 0x0, Input::KeyName::Gamepad_LeftTriggerAxis, SDK::FName(), skCrypt("Gamepad Left Trigger Axis") } },
|
||||
{ Input::KeyName::Gamepad_RightTriggerAxis, { 0x0, Input::KeyName::Gamepad_RightTriggerAxis, SDK::FName(), skCrypt("Gamepad Right Trigger Axis") } },
|
||||
{ Input::KeyName::Gamepad_LeftThumbstick, { 0x0, Input::KeyName::Gamepad_LeftThumbstick, SDK::FName(), skCrypt("Gamepad Left Thumbstick") } },
|
||||
{ Input::KeyName::Gamepad_RightThumbstick, { 0x0, Input::KeyName::Gamepad_RightThumbstick, SDK::FName(), skCrypt("Gamepad Right Thumbstick") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left, { 0x0, Input::KeyName::Gamepad_Special_Left, SDK::FName(), skCrypt("Gamepad Special Left") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left_X, { 0x0, Input::KeyName::Gamepad_Special_Left_X, SDK::FName(), skCrypt("Gamepad Special Left X") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left_Y, { 0x0, Input::KeyName::Gamepad_Special_Left_Y, SDK::FName(), skCrypt("Gamepad Special Left Y") } },
|
||||
{ Input::KeyName::Gamepad_Special_Right, { 0x0, Input::KeyName::Gamepad_Special_Right, SDK::FName(), skCrypt("Gamepad Special Right") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Bottom, { 0x0, Input::KeyName::Gamepad_FaceButton_Bottom, SDK::FName(), skCrypt("Gamepad Face Button Bottom") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Right, { 0x0, Input::KeyName::Gamepad_FaceButton_Right, SDK::FName(), skCrypt("Gamepad Face Button Right") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Left, { 0x0, Input::KeyName::Gamepad_FaceButton_Left, SDK::FName(), skCrypt("Gamepad Face Button Left") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Top, { 0x0, Input::KeyName::Gamepad_FaceButton_Top, SDK::FName(), skCrypt("Gamepad Face Button Top") } },
|
||||
{ Input::KeyName::Gamepad_LeftShoulder, { 0x0, Input::KeyName::Gamepad_LeftShoulder, SDK::FName(), skCrypt("Gamepad Left Shoulder") } },
|
||||
{ Input::KeyName::Gamepad_RightShoulder, { 0x0, Input::KeyName::Gamepad_RightShoulder, SDK::FName(), skCrypt("Gamepad Right Shoulder") } },
|
||||
{ Input::KeyName::Gamepad_LeftTrigger, { 0x0, Input::KeyName::Gamepad_LeftTrigger, SDK::FName(), skCrypt("Gamepad Left Trigger") } },
|
||||
{ Input::KeyName::Gamepad_RightTrigger, { 0x0, Input::KeyName::Gamepad_RightTrigger, SDK::FName(), skCrypt("Gamepad Right Trigger") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Up, { 0x0, Input::KeyName::Gamepad_DPad_Up, SDK::FName(), skCrypt("Gamepad DPad Up") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Down, { 0x0, Input::KeyName::Gamepad_DPad_Down, SDK::FName(), skCrypt("Gamepad DPad Down") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Left, { 0x0, Input::KeyName::Gamepad_DPad_Left, SDK::FName(), skCrypt("Gamepad DPad Left") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Right, { 0x0, Input::KeyName::Gamepad_DPad_Right, SDK::FName(), skCrypt("Gamepad DPad Right") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Up, { 0x0, Input::KeyName::Gamepad_LeftStick_Up, SDK::FName(), skCrypt("Gamepad Leftstick Up") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Down, { 0x0, Input::KeyName::Gamepad_LeftStick_Down, SDK::FName(), skCrypt("Gamepad Leftstick Down") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Left, { 0x0, Input::KeyName::Gamepad_LeftStick_Left, SDK::FName(), skCrypt("Gamepad Leftstick Left") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Right, { 0x0, Input::KeyName::Gamepad_LeftStick_Right, SDK::FName(), skCrypt("Gamepad Leftstick Right") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Up, { 0x0, Input::KeyName::Gamepad_RightStick_Up, SDK::FName(), skCrypt("Gamepad Rightstick Up") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Down, { 0x0, Input::KeyName::Gamepad_RightStick_Down, SDK::FName(), skCrypt("Gamepad Rightstick Down") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Left, { 0x0, Input::KeyName::Gamepad_RightStick_Left, SDK::FName(), skCrypt("Gamepad Rightstick Left") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Right, { 0x0, Input::KeyName::Gamepad_RightStick_Right, SDK::FName(), skCrypt("Gamepad Rightstick Right") } },
|
||||
};
|
||||
inline MouseCache Mouse;
|
||||
{ Input::KeyName::Gamepad_LeftX, { 0x0, Input::KeyName::Gamepad_LeftX, SDK::FName(), skCrypt("Gamepad Left X") } },
|
||||
{ Input::KeyName::Gamepad_LeftY, { 0x0, Input::KeyName::Gamepad_LeftY, SDK::FName(), skCrypt("Gamepad Left Y") } },
|
||||
{ Input::KeyName::Gamepad_RightX, { 0x0, Input::KeyName::Gamepad_RightX, SDK::FName(), skCrypt("Gamepad Right X") } },
|
||||
{ Input::KeyName::Gamepad_RightY, { 0x0, Input::KeyName::Gamepad_RightY, SDK::FName(), skCrypt("Gamepad Right Y") } },
|
||||
{ Input::KeyName::Gamepad_LeftTriggerAxis, { 0x0, Input::KeyName::Gamepad_LeftTriggerAxis, SDK::FName(), skCrypt("Gamepad Left Trigger Axis") } },
|
||||
{ Input::KeyName::Gamepad_RightTriggerAxis, { 0x0, Input::KeyName::Gamepad_RightTriggerAxis, SDK::FName(), skCrypt("Gamepad Right Trigger Axis") } },
|
||||
{ Input::KeyName::Gamepad_LeftThumbstick, { 0x0, Input::KeyName::Gamepad_LeftThumbstick, SDK::FName(), skCrypt("Gamepad Left Thumbstick") } },
|
||||
{ Input::KeyName::Gamepad_RightThumbstick, { 0x0, Input::KeyName::Gamepad_RightThumbstick, SDK::FName(), skCrypt("Gamepad Right Thumbstick") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left, { 0x0, Input::KeyName::Gamepad_Special_Left, SDK::FName(), skCrypt("Gamepad Special Left") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left_X, { 0x0, Input::KeyName::Gamepad_Special_Left_X, SDK::FName(), skCrypt("Gamepad Special Left X") } },
|
||||
{ Input::KeyName::Gamepad_Special_Left_Y, { 0x0, Input::KeyName::Gamepad_Special_Left_Y, SDK::FName(), skCrypt("Gamepad Special Left Y") } },
|
||||
{ Input::KeyName::Gamepad_Special_Right, { 0x0, Input::KeyName::Gamepad_Special_Right, SDK::FName(), skCrypt("Gamepad Special Right") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Bottom, { 0x0, Input::KeyName::Gamepad_FaceButton_Bottom, SDK::FName(), skCrypt("Gamepad Face Button Bottom") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Right, { 0x0, Input::KeyName::Gamepad_FaceButton_Right, SDK::FName(), skCrypt("Gamepad Face Button Right") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Left, { 0x0, Input::KeyName::Gamepad_FaceButton_Left, SDK::FName(), skCrypt("Gamepad Face Button Left") } },
|
||||
{ Input::KeyName::Gamepad_FaceButton_Top, { 0x0, Input::KeyName::Gamepad_FaceButton_Top, SDK::FName(), skCrypt("Gamepad Face Button Top") } },
|
||||
{ Input::KeyName::Gamepad_LeftShoulder, { 0x0, Input::KeyName::Gamepad_LeftShoulder, SDK::FName(), skCrypt("Gamepad Left Shoulder") } },
|
||||
{ Input::KeyName::Gamepad_RightShoulder, { 0x0, Input::KeyName::Gamepad_RightShoulder, SDK::FName(), skCrypt("Gamepad Right Shoulder") } },
|
||||
{ Input::KeyName::Gamepad_LeftTrigger, { 0x0, Input::KeyName::Gamepad_LeftTrigger, SDK::FName(), skCrypt("Gamepad Left Trigger") } },
|
||||
{ Input::KeyName::Gamepad_RightTrigger, { 0x0, Input::KeyName::Gamepad_RightTrigger, SDK::FName(), skCrypt("Gamepad Right Trigger") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Up, { 0x0, Input::KeyName::Gamepad_DPad_Up, SDK::FName(), skCrypt("Gamepad DPad Up") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Down, { 0x0, Input::KeyName::Gamepad_DPad_Down, SDK::FName(), skCrypt("Gamepad DPad Down") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Left, { 0x0, Input::KeyName::Gamepad_DPad_Left, SDK::FName(), skCrypt("Gamepad DPad Left") } },
|
||||
{ Input::KeyName::Gamepad_DPad_Right, { 0x0, Input::KeyName::Gamepad_DPad_Right, SDK::FName(), skCrypt("Gamepad DPad Right") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Up, { 0x0, Input::KeyName::Gamepad_LeftStick_Up, SDK::FName(), skCrypt("Gamepad Leftstick Up") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Down, { 0x0, Input::KeyName::Gamepad_LeftStick_Down, SDK::FName(), skCrypt("Gamepad Leftstick Down") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Left, { 0x0, Input::KeyName::Gamepad_LeftStick_Left, SDK::FName(), skCrypt("Gamepad Leftstick Left") } },
|
||||
{ Input::KeyName::Gamepad_LeftStick_Right, { 0x0, Input::KeyName::Gamepad_LeftStick_Right, SDK::FName(), skCrypt("Gamepad Leftstick Right") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Up, { 0x0, Input::KeyName::Gamepad_RightStick_Up, SDK::FName(), skCrypt("Gamepad Rightstick Up") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Down, { 0x0, Input::KeyName::Gamepad_RightStick_Down, SDK::FName(), skCrypt("Gamepad Rightstick Down") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Left, { 0x0, Input::KeyName::Gamepad_RightStick_Left, SDK::FName(), skCrypt("Gamepad Rightstick Left") } },
|
||||
{ Input::KeyName::Gamepad_RightStick_Right, { 0x0, Input::KeyName::Gamepad_RightStick_Right, SDK::FName(), skCrypt("Gamepad Rightstick Right") } },
|
||||
};
|
||||
inline MouseCache Mouse;
|
||||
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
SDK::FVector2D GetMousePosition();
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
SDK::FVector2D GetMousePosition();
|
||||
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool IsKeyDown(const KeyName Key);
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool WasKeyJustReleased(const KeyName Key);
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool WasKeyJustPressed(const KeyName Key);
|
||||
/*
|
||||
* @brief Get all the keys that are currently down
|
||||
*
|
||||
* @return A vector of all the keys that are currently down
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllDownKeys();
|
||||
/*
|
||||
* @brief Get all the keys that were just released
|
||||
*
|
||||
* @return A vector of all the keys that were just released
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllJustReleasedKeys();
|
||||
/*
|
||||
* @brief Get all the keys that were just pressed
|
||||
*
|
||||
* @return A vector of all the keys that were just pressed
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllJustPressedKeys();
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool IsKeyDown(KeyName Key);
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool WasKeyJustReleased(KeyName Key);
|
||||
/*
|
||||
* @brief Get the mouse position
|
||||
*
|
||||
* @param MousePosition - The mouse position
|
||||
*
|
||||
* @return Returns - The mouse position
|
||||
*/
|
||||
bool WasKeyJustPressed(KeyName Key);
|
||||
/*
|
||||
* @brief Get all the keys that are currently down
|
||||
*
|
||||
* @return A vector of all the keys that are currently down
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllDownKeys();
|
||||
/*
|
||||
* @brief Get all the keys that were just released
|
||||
*
|
||||
* @return A vector of all the keys that were just released
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllJustReleasedKeys();
|
||||
/*
|
||||
* @brief Get all the keys that were just pressed
|
||||
*
|
||||
* @return A vector of all the keys that were just pressed
|
||||
*/
|
||||
std::vector<Input::KeyName> GetAllJustPressedKeys();
|
||||
|
||||
/*
|
||||
* @brief Get the key name as a string from a key
|
||||
*
|
||||
* @param Key - The key to get the name of
|
||||
*
|
||||
* @return The name of the key
|
||||
*/
|
||||
std::string GetKeyNameString(const Input::KeyName Key);
|
||||
/*
|
||||
* @brief Get the key name as a string from a key
|
||||
*
|
||||
* @param Key - The key to get the name of
|
||||
*
|
||||
* @return The name of the key
|
||||
*/
|
||||
std::string GetKeyNameString(Input::KeyName Key);
|
||||
|
||||
/* Init the input cache system */
|
||||
void Init();
|
||||
/* Init the input cache system */
|
||||
void Init();
|
||||
};
|
||||
@@ -3,42 +3,41 @@
|
||||
|
||||
#include "../../../Utilities/Math.h"
|
||||
|
||||
bool SDK::FVector::Normalize(float Tolerance)
|
||||
{
|
||||
const float SquareSum = X * X + Y * Y + Z * Z;
|
||||
if (SquareSum > Tolerance)
|
||||
{
|
||||
const float Scale = Math::InvSqrt(SquareSum);
|
||||
X *= Scale; Y *= Scale; Z *= Scale;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
bool SDK::FVector::Normalize(float Tolerance) {
|
||||
const float SquareSum = X * X + Y * Y + Z * Z;
|
||||
if (SquareSum > Tolerance)
|
||||
{
|
||||
const float Scale = Math::InvSqrt(SquareSum);
|
||||
X *= Scale; Y *= Scale; Z *= Scale;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class SDK::UObject* SDK::FWeakObjectPtr::Get() const
|
||||
{
|
||||
return SDK::UObject::ObjectArray.GetByIndex(ObjectIndex);
|
||||
return SDK::UObject::ObjectArray.GetByIndex(ObjectIndex);
|
||||
}
|
||||
|
||||
class SDK::UObject* SDK::FWeakObjectPtr::operator->() const
|
||||
{
|
||||
return SDK::UObject::ObjectArray.GetByIndex(ObjectIndex);
|
||||
return SDK::UObject::ObjectArray.GetByIndex(ObjectIndex);
|
||||
}
|
||||
|
||||
bool SDK::FWeakObjectPtr::operator==(const FWeakObjectPtr& Other) const
|
||||
{
|
||||
return ObjectIndex == Other.ObjectIndex;
|
||||
return ObjectIndex == Other.ObjectIndex;
|
||||
}
|
||||
bool SDK::FWeakObjectPtr::operator!=(const FWeakObjectPtr& Other) const
|
||||
{
|
||||
return ObjectIndex != Other.ObjectIndex;
|
||||
return ObjectIndex != Other.ObjectIndex;
|
||||
}
|
||||
|
||||
bool SDK::FWeakObjectPtr::operator==(const class UObject* Other) const
|
||||
{
|
||||
return ObjectIndex == Other->Index;
|
||||
return ObjectIndex == Other->Index;
|
||||
}
|
||||
bool SDK::FWeakObjectPtr::operator!=(const class UObject* Other) const
|
||||
{
|
||||
return ObjectIndex != Other->Index;
|
||||
return ObjectIndex != Other->Index;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,317 +14,297 @@ typedef unsigned __int16 uint16;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
struct FunctionSearch
|
||||
{
|
||||
SDK::FName ClassName; // The name of the class
|
||||
SDK::FName FunctionName; // The name of the function
|
||||
void** Function; // A pointer to save the function address to
|
||||
struct FunctionSearch {
|
||||
SDK::FName ClassName; // The name of the class
|
||||
SDK::FName FunctionName; // The name of the function
|
||||
void** Function; // A pointer to save the function address to
|
||||
|
||||
bool operator==(const FunctionSearch& rhs)
|
||||
{
|
||||
return ClassName == rhs.ClassName
|
||||
&& FunctionName == rhs.FunctionName
|
||||
&& Function == rhs.Function;
|
||||
}
|
||||
bool operator==(const FunctionSearch& rhs) {
|
||||
return ClassName == rhs.ClassName
|
||||
&& FunctionName == rhs.FunctionName
|
||||
&& Function == rhs.Function;
|
||||
}
|
||||
};
|
||||
struct OffsetSearch
|
||||
{
|
||||
SDK::FName ClassName; // The name of the class
|
||||
SDK::FName PropertyName; // The name of the property
|
||||
uintptr_t* Offset; // A pointer to save the offset to
|
||||
uintptr_t* Mask; // A pointer to save the bitfield mask to
|
||||
struct OffsetSearch {
|
||||
SDK::FName ClassName; // The name of the class
|
||||
SDK::FName PropertyName; // The name of the property
|
||||
uintptr_t* Offset; // A pointer to save the offset to
|
||||
uintptr_t* Mask; // A pointer to save the bitfield mask to
|
||||
|
||||
bool operator==(const OffsetSearch& rhs)
|
||||
{
|
||||
return ClassName == rhs.ClassName
|
||||
&& PropertyName == rhs.PropertyName
|
||||
&& Offset == rhs.Offset
|
||||
&& Mask == rhs.Mask;
|
||||
}
|
||||
bool operator==(const OffsetSearch& rhs) {
|
||||
return ClassName == rhs.ClassName
|
||||
&& PropertyName == rhs.PropertyName
|
||||
&& Offset == rhs.Offset
|
||||
&& Mask == rhs.Mask;
|
||||
}
|
||||
};
|
||||
|
||||
namespace SDK
|
||||
{
|
||||
// Forward Declarations
|
||||
namespace SDK {
|
||||
// Forward Declarations
|
||||
|
||||
class UObject;
|
||||
class FField;
|
||||
class FProperty;
|
||||
class UStruct;
|
||||
class UProperty;
|
||||
class UClass;
|
||||
class UObject;
|
||||
class FField;
|
||||
class FProperty;
|
||||
class UStruct;
|
||||
class UProperty;
|
||||
class UClass;
|
||||
|
||||
|
||||
|
||||
class UObject
|
||||
{
|
||||
public:
|
||||
static TUObjectArray ObjectArray;
|
||||
void** Vft; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Flags; // (0x08[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Index; // (0x0C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
class UClass* Class; // (0x10[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
class FName Name; // (0x18[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
class UObject* Outer; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
class UObject
|
||||
{
|
||||
public:
|
||||
static TUObjectArray ObjectArray;
|
||||
void** Vft; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Flags; // (0x08[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Index; // (0x0C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
class UClass* Class; // (0x10[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
class FName Name; // (0x18[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
class UObject* Outer; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
|
||||
void ProcessEvent(void* fn, void* parms);
|
||||
void ProcessEvent(void* fn, void* parms);
|
||||
|
||||
bool IsDefaultObject() const
|
||||
{
|
||||
return (Flags & 0x10) == 0x10;
|
||||
}
|
||||
bool IsDefaultObject() const
|
||||
{
|
||||
return (Flags & 0x10) == 0x10;
|
||||
}
|
||||
|
||||
bool HasTypeFlag(EClassCastFlags TypeFlag) const;
|
||||
bool HasTypeFlag(EClassCastFlags TypeFlag) const;
|
||||
|
||||
std::string GetName() const;
|
||||
std::string GetFullName() const;
|
||||
std::string GetName() const;
|
||||
std::string GetFullName() const;
|
||||
|
||||
|
||||
static uint32_t GetPropertyOffset(UProperty* Property);
|
||||
static uint32_t GetPropertyOffset(FField* Field, std::string PropertyName);
|
||||
static uint32_t GetPropertyOffset(UProperty* Property);
|
||||
static uint32_t GetPropertyOffset(FField* Field, std::string PropertyName);
|
||||
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObject(const std::string& FullName, EClassCastFlags RequiredType = EClassCastFlags::None)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObject(const std::string& FullName, EClassCastFlags RequiredType = EClassCastFlags::None)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
|
||||
if (!Object)
|
||||
continue;
|
||||
if (!Object)
|
||||
continue;
|
||||
|
||||
if (Object->HasTypeFlag(RequiredType) && Object->GetFullName() == FullName)
|
||||
{
|
||||
return static_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
if (Object->HasTypeFlag(RequiredType) && Object->GetFullName() == FullName)
|
||||
{
|
||||
return static_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObjectFast(const std::string& Name, EClassCastFlags RequiredType = EClassCastFlags::None)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObjectFast(const std::string& Name, EClassCastFlags RequiredType = EClassCastFlags::None)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
|
||||
if (!Object)
|
||||
continue;
|
||||
if (!Object)
|
||||
continue;
|
||||
|
||||
if (Object->HasTypeFlag(RequiredType) && Object->GetName() == Name)
|
||||
{
|
||||
return static_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
if (Object->HasTypeFlag(RequiredType) && Object->GetName() == Name)
|
||||
{
|
||||
return static_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObjectFastInOuter(std::string Name, std::string Outer)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
template<typename UEType = UObject>
|
||||
static UEType* FindObjectFastInOuter(std::string Name, std::string Outer)
|
||||
{
|
||||
for (int i = 0; i < ObjectArray.Num(); ++i)
|
||||
{
|
||||
UObject* Object = ObjectArray.GetByIndex(i);
|
||||
|
||||
if (!Object)
|
||||
continue;
|
||||
if (!Object)
|
||||
continue;
|
||||
|
||||
if (Object->GetName() == Name && Object->Outer->GetName() == Outer)
|
||||
{
|
||||
return reinterpret_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
if (Object->GetName() == Name && Object->Outer->GetName() == Outer)
|
||||
{
|
||||
return reinterpret_cast<UEType*>(Object);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
static class UClass* FindClass(const std::string& ClassFullName)
|
||||
{
|
||||
return FindObject<class UClass>(ClassFullName, EClassCastFlags::Class);
|
||||
}
|
||||
static class UClass* FindClass(const std::string& ClassFullName)
|
||||
{
|
||||
return FindObject<class UClass>(ClassFullName, EClassCastFlags::Class);
|
||||
}
|
||||
|
||||
static class UClass* FindClassFast(const std::string& ClassName)
|
||||
{
|
||||
return FindObjectFast<class UClass>(ClassName, EClassCastFlags::Class);
|
||||
}
|
||||
static class UClass* FindClassFast(const std::string& ClassName)
|
||||
{
|
||||
return FindObjectFast<class UClass>(ClassName, EClassCastFlags::Class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void SetupObjects(std::vector<FunctionSearch>& Functions, std::vector<OffsetSearch>& Offsets);
|
||||
static void SetupObjects(std::vector<FunctionSearch>& Functions, std::vector<OffsetSearch>& Offsets);
|
||||
|
||||
|
||||
bool IsA(class UClass* Clss) const;
|
||||
};
|
||||
bool IsA(class UClass* Clss) const;
|
||||
};
|
||||
|
||||
template <typename T, bool ForceCast = false>
|
||||
static inline T* Cast(UObject* Object)
|
||||
{
|
||||
if (ForceCast || (IsValidPointer(Object) && Object->IsA(T::StaticClass())))
|
||||
{
|
||||
return (T*)Object;
|
||||
}
|
||||
template <typename T, bool ForceCast = false>
|
||||
static inline T* Cast(UObject* Object) {
|
||||
if (ForceCast || (IsValidPointer(Object) && Object->IsA(T::StaticClass()))) {
|
||||
return (T*)Object;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 0x1)
|
||||
#pragma pack(push, 0x1)
|
||||
#endif
|
||||
class FFieldClass
|
||||
{
|
||||
public:
|
||||
FName Name; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
uint64 Id; // (0x08[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
EClassCastFlags CastFlags; // (0x10[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 ClassFlags; // (0x18[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 Pad_74C3[0x4]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
FFieldClass* SuperClass; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
class FFieldClass
|
||||
{
|
||||
public:
|
||||
FName Name; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
uint64 Id; // (0x08[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
EClassCastFlags CastFlags; // (0x10[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 ClassFlags; // (0x18[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 Pad_74C3[0x4]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
FFieldClass* SuperClass; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 0x1)
|
||||
#pragma pack(push, 0x1)
|
||||
#endif
|
||||
class FField
|
||||
{
|
||||
public:
|
||||
void* Vft; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
FFieldClass* Class; // (0x08[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
char Owner[0x10]; // (0x10[0x10]) NOT AUTO-GENERATED PROPERTY
|
||||
FField* Next; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
FName Name; // (0x28[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Flags; // (0x30[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
class FField
|
||||
{
|
||||
public:
|
||||
void* Vft; // (0x00[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
FFieldClass* Class; // (0x08[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
char Owner[0x10]; // (0x10[0x10]) NOT AUTO-GENERATED PROPERTY
|
||||
FField* Next; // (0x20[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
FName Name; // (0x28[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
int32 Flags; // (0x30[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
|
||||
bool HasTypeFlag(EClassCastFlags TypeFlag) const;
|
||||
};
|
||||
bool HasTypeFlag(EClassCastFlags TypeFlag) const;
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 0x1)
|
||||
#pragma pack(push, 0x1)
|
||||
#endif
|
||||
class FProperty : public FField
|
||||
{
|
||||
public:
|
||||
uint8 Pad_74C4[0x8]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
int32 ElementSize; // (0x3C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
uint64 PropertyFlags; // (0x40[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 Pad_74C5[0x4]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
int32 Offset; // (0x4C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
class FProperty : public FField
|
||||
{
|
||||
public:
|
||||
uint8 Pad_74C4[0x8]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
int32 ElementSize; // (0x3C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
uint64 PropertyFlags; // (0x40[0x08]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 Pad_74C5[0x4]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
int32 Offset; // (0x4C[0x04]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 0x1)
|
||||
#pragma pack(push, 0x1)
|
||||
#endif
|
||||
class FBoolProperty : public FProperty
|
||||
{
|
||||
public:
|
||||
uint8 Pad_74C7[0x28]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
uint8 FieldSize; // (0x78[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 ByteOffset; // (0x79[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 ByteMask; // (0x7A[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 FieldMask; // (0x7B[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
class FBoolProperty : public FProperty
|
||||
{
|
||||
public:
|
||||
uint8 Pad_74C7[0x28]; // Fixing Size After Last (Predefined) Property [ Dumper-7 ]
|
||||
uint8 FieldSize; // (0x78[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 ByteOffset; // (0x79[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 ByteMask; // (0x7A[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
uint8 FieldMask; // (0x7B[0x01]) NOT AUTO-GENERATED PROPERTY
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
class UField : public UObject
|
||||
{
|
||||
public:
|
||||
static uint32 NextOffset;
|
||||
class UField : public UObject {
|
||||
public:
|
||||
static uint32 NextOffset;
|
||||
|
||||
class UField* Next()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UField*)(*(uintptr_t*)((uintptr_t)this + NextOffset));
|
||||
}
|
||||
};
|
||||
class UField* Next() {
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UField*)(*(uintptr_t*)((uintptr_t)this + NextOffset));
|
||||
}
|
||||
};
|
||||
|
||||
class UStruct : public UObject
|
||||
{
|
||||
public:
|
||||
static uint32 SuperOffset;
|
||||
static uint32 ChildPropertiesOffset;
|
||||
static uint32 ChildrenOffset;
|
||||
class UStruct : public UObject {
|
||||
public:
|
||||
static uint32 SuperOffset;
|
||||
static uint32 ChildPropertiesOffset;
|
||||
static uint32 ChildrenOffset;
|
||||
|
||||
class UStruct* Super()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UStruct*)(*(uintptr_t*)((uintptr_t)this + SuperOffset));
|
||||
}
|
||||
class UStruct* Super() {
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UStruct*)(*(uintptr_t*)((uintptr_t)this + SuperOffset));
|
||||
}
|
||||
|
||||
class UField* Children()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UField*)(*(uintptr_t*)((uintptr_t)this + ChildrenOffset));
|
||||
}
|
||||
class UField* Children() {
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UField*)(*(uintptr_t*)((uintptr_t)this + ChildrenOffset));
|
||||
}
|
||||
|
||||
class FField* ChildProperties()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (FField*)(*(uintptr_t*)((uintptr_t)this + ChildPropertiesOffset));
|
||||
}
|
||||
};
|
||||
class FField* ChildProperties() {
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (FField*)(*(uintptr_t*)((uintptr_t)this + ChildPropertiesOffset));
|
||||
}
|
||||
};
|
||||
|
||||
class UProperty : public UObject
|
||||
{
|
||||
public:
|
||||
static uint32 OffsetOffset;
|
||||
class UProperty : public UObject
|
||||
{
|
||||
public:
|
||||
static uint32 OffsetOffset;
|
||||
|
||||
int32 Offset()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return 0;
|
||||
return *(int32*)((uintptr_t)this + OffsetOffset);
|
||||
}
|
||||
};
|
||||
int32 Offset() {
|
||||
if (SDK::IsValidPointer(this) == false) return 0;
|
||||
return *(int32*)((uintptr_t)this + OffsetOffset);
|
||||
}
|
||||
};
|
||||
|
||||
class UBoolProperty : public UProperty
|
||||
{
|
||||
public:
|
||||
static uint32 ByteMaskOffset;
|
||||
class UBoolProperty : public UProperty {
|
||||
public:
|
||||
static uint32 ByteMaskOffset;
|
||||
|
||||
uint8 ByteMask()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return 0;
|
||||
return *(uint8*)((uintptr_t)this + ByteMaskOffset);
|
||||
}
|
||||
};
|
||||
uint8 ByteMask() {
|
||||
if (SDK::IsValidPointer(this) == false) return 0;
|
||||
return *(uint8*)((uintptr_t)this + ByteMaskOffset);
|
||||
}
|
||||
};
|
||||
|
||||
class UClass : public UStruct
|
||||
{
|
||||
public:
|
||||
static uint32 CastFlagsOffset;
|
||||
static uint32 DefaultObjectOffset;
|
||||
class UClass : public UStruct {
|
||||
public:
|
||||
static uint32 CastFlagsOffset;
|
||||
static uint32 DefaultObjectOffset;
|
||||
|
||||
enum class EClassCastFlags CastFlags()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return EClassCastFlags::None;
|
||||
return *(EClassCastFlags*)((uintptr_t)this + CastFlagsOffset);
|
||||
}
|
||||
enum class EClassCastFlags CastFlags() {
|
||||
if (SDK::IsValidPointer(this) == false) return EClassCastFlags::None;
|
||||
return *(EClassCastFlags*)((uintptr_t)this + CastFlagsOffset);
|
||||
}
|
||||
|
||||
class UObject* DefaultObject()
|
||||
{
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UObject*)(*(uintptr_t*)((uintptr_t)this + DefaultObjectOffset));
|
||||
}
|
||||
};
|
||||
class UObject* DefaultObject() {
|
||||
if (SDK::IsValidPointer(this) == false) return nullptr;
|
||||
return (UObject*)(*(uintptr_t*)((uintptr_t)this + DefaultObjectOffset));
|
||||
}
|
||||
};
|
||||
|
||||
class UFunction : public UStruct
|
||||
{
|
||||
public:
|
||||
static uint32 FunctionFlagsOffset;
|
||||
};
|
||||
class UFunction : public UStruct {
|
||||
public:
|
||||
static uint32 FunctionFlagsOffset;
|
||||
};
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -416,8 +416,6 @@ namespace SDK {
|
||||
void Fire();
|
||||
|
||||
void CompleteBuildingEditInteraction();
|
||||
|
||||
void ServerAttemptInteract(class AActor* ReceivingActor, class UPrimitiveComponent* InteractComponent, enum class ETInteractionType InteractType, class UObject* OptionalObjectData);
|
||||
};
|
||||
class UFortLocalPlayer : public ULocalPlayer {
|
||||
public:
|
||||
|
||||
@@ -284,25 +284,6 @@ void SDK::AFortPlayerController::CompleteBuildingEditInteraction() {
|
||||
CompleteBuildingEditInteraction1(this);
|
||||
}
|
||||
|
||||
void SDK::AFortPlayerController::ServerAttemptInteract(class AActor* ReceivingActor, class UPrimitiveComponent* InteractComponent, enum class ETInteractionType InteractType, class UObject* OptionalObjectData) {
|
||||
if (SDK::IsValidPointer(this) == false || SDK::Cached::Functions::CompleteBuildingEditInteraction == 0x0) return;
|
||||
|
||||
struct {
|
||||
class AActor* ReceivingActor;
|
||||
class UPrimitiveComponent* InteractComponent;
|
||||
enum class ETInteractionType InteractType;
|
||||
uint8 Pad_19CE[0x7];
|
||||
class UObject* OptionalObjectData;
|
||||
} params_ServerAttemptInteract{};
|
||||
|
||||
params_ServerAttemptInteract.ReceivingActor = ReceivingActor;
|
||||
params_ServerAttemptInteract.InteractComponent = InteractComponent;
|
||||
params_ServerAttemptInteract.InteractType = InteractType;
|
||||
params_ServerAttemptInteract.OptionalObjectData = OptionalObjectData;
|
||||
|
||||
this->ProcessEvent(SDK::Cached::Functions::FortPlayerController::ServerAttemptInteract, ¶ms_ServerAttemptInteract);
|
||||
}
|
||||
|
||||
SDK::UClass* SDK::UFortLocalPlayer::StaticClass() {
|
||||
static class UClass* Clss = nullptr;
|
||||
|
||||
|
||||
@@ -240,15 +240,4 @@ namespace SDK {
|
||||
NumItemTierValues = 11,
|
||||
EFortItemTier_MAX = 12,
|
||||
};
|
||||
|
||||
enum class ETInteractionType : uint8
|
||||
{
|
||||
IT_NoInteraction = 0,
|
||||
IT_Simple = 1,
|
||||
IT_LongPress = 2,
|
||||
IT_BuildingEdit = 3,
|
||||
IT_BuildingImprovement = 4,
|
||||
IT_TrapPlacement = 5,
|
||||
IT_MAX = 6,
|
||||
};
|
||||
}
|
||||
+247
-266
@@ -10,331 +10,312 @@
|
||||
#include "Classes/CoreUObject_classes.h"
|
||||
#include "Classes/Engine_classes.h"
|
||||
|
||||
#include "../Input/Input.h"
|
||||
#include "../Features/FortPawnHelper/Bone.h"
|
||||
#include "../Features/Visuals/Chams.h"
|
||||
#include "../Input/Input.h"
|
||||
|
||||
#include "../../Configs/Config.h"
|
||||
#include "../../Hooks/Hooks.h"
|
||||
|
||||
void SDK::Init()
|
||||
{
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Initializing SDK... (")) + std::to_string(GetBaseAddress()) + std::string(skCrypt(" - ")) + std::to_string((uint64_t)CurrentModule) + std::string(skCrypt(")")));
|
||||
void SDK::Init() {
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Initializing SDK... (")) + std::to_string(GetBaseAddress()) + std::string(skCrypt(" - ")) + std::to_string((uint64_t)CurrentModule) + std::string(skCrypt(")")));
|
||||
|
||||
// Init Offsets, Functions, and VFT Indexes
|
||||
{
|
||||
// Init GObjects
|
||||
SDKInitializer::InitGObjects();
|
||||
// Init Offsets, Functions, and VFT Indexes
|
||||
{
|
||||
// Init GObjects
|
||||
SDKInitializer::InitGObjects();
|
||||
|
||||
// Init Functions
|
||||
SDKInitializer::InitAppendString();
|
||||
SDKInitializer::InitFNameConstructor();
|
||||
SDKInitializer::InitLineTraceSingle();
|
||||
SDKInitializer::InitRaycastMulti();
|
||||
SDKInitializer::InitFire();
|
||||
// Init Functions
|
||||
SDKInitializer::InitAppendString();
|
||||
SDKInitializer::InitFNameConstructor();
|
||||
SDKInitializer::InitLineTraceSingle();
|
||||
SDKInitializer::InitRaycastMulti();
|
||||
SDKInitializer::InitFire();
|
||||
|
||||
// Init Class Offsets
|
||||
SDK::UProperty::OffsetOffset = 0x44; // Doesn't change (as far as I know)
|
||||
SDK::UBoolProperty::ByteMaskOffset = 0x72; // Doesn't change (as far as I know)
|
||||
SDK::UClass::DefaultObjectOffset = SDKInitializer::FindDefaultObjectOffset();
|
||||
SDK::UClass::CastFlagsOffset = SDKInitializer::FindCastFlagsOffset();
|
||||
SDK::UStruct::SuperOffset = SDKInitializer::FindSuperOffset();
|
||||
SDK::UStruct::ChildPropertiesOffset = SDKInitializer::FindChildPropertiesOffset();
|
||||
SDK::UStruct::ChildrenOffset = SDKInitializer::FindChildrenOffset();
|
||||
SDK::UField::NextOffset = SDKInitializer::FindUFieldNextOffset();
|
||||
SDK::UFunction::FunctionFlagsOffset = SDKInitializer::FindFunctionFlagsOffset();
|
||||
// Init Class Offsets
|
||||
SDK::UProperty::OffsetOffset = 0x44; // Doesn't change (as far as I know)
|
||||
SDK::UBoolProperty::ByteMaskOffset = 0x72; // Doesn't change (as far as I know)
|
||||
SDK::UClass::DefaultObjectOffset = SDKInitializer::FindDefaultObjectOffset();
|
||||
SDK::UClass::CastFlagsOffset = SDKInitializer::FindCastFlagsOffset();
|
||||
SDK::UStruct::SuperOffset = SDKInitializer::FindSuperOffset();
|
||||
SDK::UStruct::ChildPropertiesOffset = SDKInitializer::FindChildPropertiesOffset();
|
||||
SDK::UStruct::ChildrenOffset = SDKInitializer::FindChildrenOffset();
|
||||
SDK::UField::NextOffset = SDKInitializer::FindUFieldNextOffset();
|
||||
SDK::UFunction::FunctionFlagsOffset = SDKInitializer::FindFunctionFlagsOffset();
|
||||
|
||||
// Init VFT Indexes
|
||||
SDKInitializer::InitPEIndex();
|
||||
// Init VFT Indexes
|
||||
SDKInitializer::InitPEIndex();
|
||||
|
||||
// Check Game Version
|
||||
{
|
||||
SDK::Cached::Functions::KismetSystemLibrary::GetEngineVersion = SDK::UObject::FindObjectFast(std::string(skCrypt("GetEngineVersion")));
|
||||
// Check Game Version
|
||||
{
|
||||
SDK::Cached::Functions::KismetSystemLibrary::GetEngineVersion = SDK::UObject::FindObjectFast(std::string(skCrypt("GetEngineVersion")));
|
||||
|
||||
#if SEASON_20_PLUS
|
||||
if (GetGameVersion() < 20.00)
|
||||
{
|
||||
THROW_ERROR(
|
||||
std::string(skCrypt("Unsupported game version! (")) +
|
||||
std::to_string(GetGameVersion()) +
|
||||
std::string(skCrypt(")\nSeason 20 and onward are the only seasons supported with \"USE_DOUBLES\"!\n\nDisable \"USE_DOUBLES\" in \"Globals.h\" to play on earlier builds")),
|
||||
true);
|
||||
}
|
||||
if (GetGameVersion() < 20.00) {
|
||||
THROW_ERROR(
|
||||
std::string(skCrypt("Unsupported game version! (")) +
|
||||
std::to_string(GetGameVersion()) +
|
||||
std::string(skCrypt(")\nSeason 20 and onward are the only seasons supported with \"USE_DOUBLES\"!\n\nDisable \"USE_DOUBLES\" in \"Globals.h\" to play on earlier builds")),
|
||||
true);
|
||||
}
|
||||
#else
|
||||
if (GetGameVersion() < 3.00 || GetGameVersion() >= 20.00)
|
||||
{
|
||||
THROW_ERROR(
|
||||
std::string(skCrypt("Unsupported game version! (")) +
|
||||
std::to_string(GetGameVersion()) +
|
||||
std::string(skCrypt(")\nSeason 3 to Season 19 are the only seasons supported without \"USE_DOUBLES\"\n\Enable \"USE_DOUBLES\" in \"Globals.h\" to play on later builds")),
|
||||
true);
|
||||
}
|
||||
if (GetGameVersion() < 3.00 || GetGameVersion() >= 20.00) {
|
||||
THROW_ERROR(
|
||||
std::string(skCrypt("Unsupported game version! (")) +
|
||||
std::to_string(GetGameVersion()) +
|
||||
std::string(skCrypt(")\nSeason 3 to Season 19 are the only seasons supported without \"USE_DOUBLES\"\n\Enable \"USE_DOUBLES\" in \"Globals.h\" to play on later builds")),
|
||||
true);
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Game Version: ")) + std::to_string(GetGameVersion()));
|
||||
}
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("Game Version: ")) + std::to_string(GetGameVersion()));
|
||||
}
|
||||
|
||||
// Init functions for EditOnRelease (only for game versions before EditOnRelease)
|
||||
if (SDK::GetGameVersion() < 11.00)
|
||||
{
|
||||
SDKInitializer::InitEditSelectRelease();
|
||||
SDKInitializer::InitCompleteBuildingEditInteraction();
|
||||
}
|
||||
// Init functions for EditOnRelease (only for game versions before EditOnRelease)
|
||||
if (SDK::GetGameVersion() < 11.00) {
|
||||
SDKInitializer::InitEditSelectRelease();
|
||||
SDKInitializer::InitCompleteBuildingEditInteraction();
|
||||
}
|
||||
|
||||
// Init functions for DisablePreEdits (only for game versions before DisablePreEdits)
|
||||
if (SDK::GetGameVersion() < 15.20)
|
||||
{
|
||||
SDKInitializer::InitPerformBuildingEditInteraction();
|
||||
}
|
||||
// Init functions for DisablePreEdits (only for game versions before DisablePreEdits)
|
||||
if (SDK::GetGameVersion() < 15.20) {
|
||||
SDKInitializer::InitPerformBuildingEditInteraction();
|
||||
}
|
||||
|
||||
// Init CalculateShot function offset (requires game version)
|
||||
SDKInitializer::InitCalculateShot();
|
||||
// Init CalculateShot function offset (requires game version)
|
||||
SDKInitializer::InitCalculateShot();
|
||||
|
||||
// Continue initiating VFT Indexes
|
||||
SDKInitializer::InitDTIndex();
|
||||
SDKInitializer::InitGVIndex();
|
||||
SDKInitializer::InitGPVIndex();
|
||||
}
|
||||
// Continue initiating VFT Indexes
|
||||
SDKInitializer::InitDTIndex();
|
||||
SDKInitializer::InitGVIndex();
|
||||
SDKInitializer::InitGPVIndex();
|
||||
}
|
||||
|
||||
// Init Cached Objects
|
||||
{
|
||||
std::vector<FunctionSearch> Functions{
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawLine")), &SDK::Cached::Functions::Canvas::K2_DrawLine },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawText")), &SDK::Cached::Functions::Canvas::K2_DrawText },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_TextSize")), &SDK::Cached::Functions::Canvas::K2_TextSize },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_Project")), &SDK::Cached::Functions::Canvas::K2_Project },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawBox")), &SDK::Cached::Functions::Canvas::K2_DrawBox },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"GameplayStatics")), SDK::FName(skCrypt(L"GetAllActorsOfClass")), &SDK::Cached::Functions::GameplayStatics::GetAllActorsOfClass },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetCameraLocation")), &SDK::Cached::Functions::PlayerCameraManager::GetCameraLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetCameraRotation")), &SDK::Cached::Functions::PlayerCameraManager::GetCameraRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetFOVAngle")), &SDK::Cached::Functions::PlayerCameraManager::GetFOVAngle },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"IsInputKeyDown")), &SDK::Cached::Functions::PlayerController::IsInputKeyDown },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"WasInputKeyJustReleased")), &SDK::Cached::Functions::PlayerController::WasInputKeyJustReleased },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"WasInputKeyJustPressed")), &SDK::Cached::Functions::PlayerController::WasInputKeyJustPressed },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"GetMousePosition")), &SDK::Cached::Functions::PlayerController::GetMousePosition },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AddYawInput")), &SDK::Cached::Functions::PlayerController::AddYawInput },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AddPitchInput")), &SDK::Cached::Functions::PlayerController::AddPitchInput },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Controller")), SDK::FName(skCrypt(L"ClientSetRotation")), &SDK::Cached::Functions::PlayerController::ClientSetRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Controller")), SDK::FName(skCrypt(L"SetControlRotation")), &SDK::Cached::Functions::PlayerController::SetControlRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetSystemLibrary")), SDK::FName(skCrypt(L"LineTraceSingle")), &SDK::Cached::Functions::KismetSystemLibrary::LineTraceSingle },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMaterialLibrary")), SDK::FName(skCrypt(L"CreateDynamicMaterialInstance")),&SDK::Cached::Functions::KismetMaterialLibrary::CreateDynamicMaterialInstance},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"FindLookAtRotation")), &SDK::Cached::Functions::KismetMathLibrary::FindLookAtRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"GetForwardVector")), &SDK::Cached::Functions::KismetMathLibrary::GetForwardVector },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"GetRightVector")), &SDK::Cached::Functions::KismetMathLibrary::GetRightVector },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"FMod")), &SDK::Cached::Functions::KismetMathLibrary::FMod },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerState")), SDK::FName(skCrypt(L"GetPlayerName")), &SDK::Cached::Functions::PlayerState::GetPlayerName },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"SkinnedMeshComponent")), SDK::FName(skCrypt(L"GetBoneName")), &SDK::Cached::Functions::SkinnedMeshComponent::GetBoneName },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"SceneComponent")), SDK::FName(skCrypt(L"GetSocketLocation")), &SDK::Cached::Functions::SkinnedMeshComponent::GetSocketLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_TeleportTo")), &SDK::Cached::Functions::Actor::K2_TeleportTo },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_SetActorRotation")), &SDK::Cached::Functions::Actor::K2_SetActorRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_SetActorLocation")), &SDK::Cached::Functions::Actor::K2_SetActorLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"SetActorEnableCollision")), &SDK::Cached::Functions::Actor::SetActorEnableCollision },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"SetPhysicsLinearVelocity")), &SDK::Cached::Functions::SceneComponent::SetPhysicsLinearVelocity },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"CreateDynamicMaterialInstance")),&SDK::Cached::Functions::SceneComponent::CreateDynamicMaterialInstance},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Pawn")), SDK::FName(skCrypt(L"GetMovementComponent")), &SDK::Cached::Functions::Pawn::GetMovementComponent },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MovementComponent")), SDK::FName(skCrypt(L"StopMovementImmediately")), &SDK::Cached::Functions::MovementComponent::StopMovementImmediately },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"IsProjectileWeapon")), &SDK::Cached::Functions::FortWeapon::IsProjectileWeapon },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"GetProjectileSpeed")), &SDK::Cached::Functions::FortWeapon::GetProjectileSpeed },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"GetBulletsPerClip")), &SDK::Cached::Functions::FortWeapon::GetBulletsPerClip },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"ServerHandlePickup")), &SDK::Cached::Functions::FortPlayerPawn::ServerHandlePickup },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MeshComponent")), SDK::FName(skCrypt(L"GetMaterials")), &SDK::Cached::Functions::MeshComponent::GetMaterials },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"SetMaterial")), &SDK::Cached::Functions::PrimitiveComponent::SetMaterial },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInstanceDynamic")),SDK::FName(skCrypt(L"SetVectorParameterValue")), &SDK::Cached::Functions::MaterialInstanceDynamic::SetVectorParameterValue},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInstanceDynamic")),SDK::FName(skCrypt(L"SetScalarParameterValue")), &SDK::Cached::Functions::MaterialInstanceDynamic::SetScalarParameterValue},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInterface")), SDK::FName(skCrypt(L"GetBaseMaterial")), &SDK::Cached::Functions::MaterialInterface::GetBaseMaterial },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"ServerAttemptInteract")), &SDK::Cached::Functions::FortPlayerController::ServerAttemptInteract },
|
||||
};
|
||||
std::vector<OffsetSearch> Offsets{
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameViewportClient")), SDK::FName(skCrypt(L"GameInstance")), &SDK::Cached::Offsets::GameViewportClient::GameInstance, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Engine")), SDK::FName(skCrypt(L"GameViewport")), &SDK::Cached::Offsets::Engine::GameViewport, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Engine")), SDK::FName(skCrypt(L"WireframeMaterial")), &SDK::Cached::Offsets::Engine::WireframeMaterial, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameViewportClient")), SDK::FName(skCrypt(L"World")), &SDK::Cached::Offsets::GameViewportClient::World, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameInstance")), SDK::FName(skCrypt(L"LocalPlayers")), &SDK::Cached::Offsets::GameInstance::LocalPlayers, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Player")), SDK::FName(skCrypt(L"PlayerController")), &SDK::Cached::Offsets::Player::PlayerController, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AcknowledgedPawn")), &SDK::Cached::Offsets::PlayerController::AcknowledgedPawn, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"PlayerCameraManager")), &SDK::Cached::Offsets::PlayerController::PlayerCameraManager, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"InputYawScale")), &SDK::Cached::Offsets::PlayerController::InputYawScale, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"InputPitchScale")), &SDK::Cached::Offsets::PlayerController::InputPitchScale, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"FortPlayerStateZone")), SDK::FName(skCrypt(L"SpectatingTarget")), &SDK::Cached::Offsets::FortPlayerStateZone::SpectatingTarget, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"HUD")), SDK::FName(skCrypt(L"DebugCanvas")), &SDK::Cached::Offsets::HUD::Canvas, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Pawn")), SDK::FName(skCrypt(L"PlayerState")), &SDK::Cached::Offsets::Pawn::PlayerState, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Character")), SDK::FName(skCrypt(L"Mesh")), &SDK::Cached::Offsets::Character::Mesh, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Font")), SDK::FName(skCrypt(L"LegacyFontSize")), &SDK::Cached::Offsets::Font::LegacyFontSize, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"SkinnedMeshComponent")), SDK::FName(skCrypt(L"SkeletalMesh")), &SDK::Cached::Offsets::SkeletalMeshComponent::SkeletalMesh, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"SkeletalMesh")), SDK::FName(skCrypt(L"Materials")), &SDK::Cached::Offsets::SkeletalMesh::Materials, nullptr },
|
||||
// Init Cached Objects
|
||||
{
|
||||
std::vector<FunctionSearch> Functions{
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawLine")), &SDK::Cached::Functions::Canvas::K2_DrawLine },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawText")), &SDK::Cached::Functions::Canvas::K2_DrawText },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_TextSize")), &SDK::Cached::Functions::Canvas::K2_TextSize },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_Project")), &SDK::Cached::Functions::Canvas::K2_Project },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"K2_DrawBox")), &SDK::Cached::Functions::Canvas::K2_DrawBox },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"GameplayStatics")), SDK::FName(skCrypt(L"GetAllActorsOfClass")), &SDK::Cached::Functions::GameplayStatics::GetAllActorsOfClass },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetCameraLocation")), &SDK::Cached::Functions::PlayerCameraManager::GetCameraLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetCameraRotation")), &SDK::Cached::Functions::PlayerCameraManager::GetCameraRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerCameraManager")), SDK::FName(skCrypt(L"GetFOVAngle")), &SDK::Cached::Functions::PlayerCameraManager::GetFOVAngle },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"IsInputKeyDown")), &SDK::Cached::Functions::PlayerController::IsInputKeyDown },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"WasInputKeyJustReleased")), &SDK::Cached::Functions::PlayerController::WasInputKeyJustReleased },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"WasInputKeyJustPressed")), &SDK::Cached::Functions::PlayerController::WasInputKeyJustPressed },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"GetMousePosition")), &SDK::Cached::Functions::PlayerController::GetMousePosition },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AddYawInput")), &SDK::Cached::Functions::PlayerController::AddYawInput },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AddPitchInput")), &SDK::Cached::Functions::PlayerController::AddPitchInput },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Controller")), SDK::FName(skCrypt(L"ClientSetRotation")), &SDK::Cached::Functions::PlayerController::ClientSetRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Controller")), SDK::FName(skCrypt(L"SetControlRotation")), &SDK::Cached::Functions::PlayerController::SetControlRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetSystemLibrary")), SDK::FName(skCrypt(L"LineTraceSingle")), &SDK::Cached::Functions::KismetSystemLibrary::LineTraceSingle },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMaterialLibrary")), SDK::FName(skCrypt(L"CreateDynamicMaterialInstance")),&SDK::Cached::Functions::KismetMaterialLibrary::CreateDynamicMaterialInstance},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"FindLookAtRotation")), &SDK::Cached::Functions::KismetMathLibrary::FindLookAtRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"GetForwardVector")), &SDK::Cached::Functions::KismetMathLibrary::GetForwardVector },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"GetRightVector")), &SDK::Cached::Functions::KismetMathLibrary::GetRightVector },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"KismetMathLibrary")), SDK::FName(skCrypt(L"FMod")), &SDK::Cached::Functions::KismetMathLibrary::FMod },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PlayerState")), SDK::FName(skCrypt(L"GetPlayerName")), &SDK::Cached::Functions::PlayerState::GetPlayerName },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"SkinnedMeshComponent")), SDK::FName(skCrypt(L"GetBoneName")), &SDK::Cached::Functions::SkinnedMeshComponent::GetBoneName },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"SceneComponent")), SDK::FName(skCrypt(L"GetSocketLocation")), &SDK::Cached::Functions::SkinnedMeshComponent::GetSocketLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_TeleportTo")), &SDK::Cached::Functions::Actor::K2_TeleportTo },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_SetActorRotation")), &SDK::Cached::Functions::Actor::K2_SetActorRotation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"K2_SetActorLocation")), &SDK::Cached::Functions::Actor::K2_SetActorLocation },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"SetActorEnableCollision")), &SDK::Cached::Functions::Actor::SetActorEnableCollision },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"SetPhysicsLinearVelocity")), &SDK::Cached::Functions::SceneComponent::SetPhysicsLinearVelocity },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"CreateDynamicMaterialInstance")),&SDK::Cached::Functions::SceneComponent::CreateDynamicMaterialInstance},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"Pawn")), SDK::FName(skCrypt(L"GetMovementComponent")), &SDK::Cached::Functions::Pawn::GetMovementComponent },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MovementComponent")), SDK::FName(skCrypt(L"StopMovementImmediately")), &SDK::Cached::Functions::MovementComponent::StopMovementImmediately },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"IsProjectileWeapon")), &SDK::Cached::Functions::FortWeapon::IsProjectileWeapon },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"GetProjectileSpeed")), &SDK::Cached::Functions::FortWeapon::GetProjectileSpeed },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"GetBulletsPerClip")), &SDK::Cached::Functions::FortWeapon::GetBulletsPerClip },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"ServerHandlePickup")), &SDK::Cached::Functions::FortPlayerPawn::ServerHandlePickup },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MeshComponent")), SDK::FName(skCrypt(L"GetMaterials")), &SDK::Cached::Functions::MeshComponent::GetMaterials },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"PrimitiveComponent")), SDK::FName(skCrypt(L"SetMaterial")), &SDK::Cached::Functions::PrimitiveComponent::SetMaterial },
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInstanceDynamic")),SDK::FName(skCrypt(L"SetVectorParameterValue")), &SDK::Cached::Functions::MaterialInstanceDynamic::SetVectorParameterValue},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInstanceDynamic")),SDK::FName(skCrypt(L"SetScalarParameterValue")), &SDK::Cached::Functions::MaterialInstanceDynamic::SetScalarParameterValue},
|
||||
FunctionSearch { SDK::FName(skCrypt(L"MaterialInterface")), SDK::FName(skCrypt(L"GetBaseMaterial")), &SDK::Cached::Functions::MaterialInterface::GetBaseMaterial },
|
||||
};
|
||||
std::vector<OffsetSearch> Offsets{
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameViewportClient")), SDK::FName(skCrypt(L"GameInstance")), &SDK::Cached::Offsets::GameViewportClient::GameInstance, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Engine")), SDK::FName(skCrypt(L"GameViewport")), &SDK::Cached::Offsets::Engine::GameViewport, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Engine")), SDK::FName(skCrypt(L"WireframeMaterial")), &SDK::Cached::Offsets::Engine::WireframeMaterial, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameViewportClient")), SDK::FName(skCrypt(L"World")), &SDK::Cached::Offsets::GameViewportClient::World, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"GameInstance")), SDK::FName(skCrypt(L"LocalPlayers")), &SDK::Cached::Offsets::GameInstance::LocalPlayers, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Player")), SDK::FName(skCrypt(L"PlayerController")), &SDK::Cached::Offsets::Player::PlayerController, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"AcknowledgedPawn")), &SDK::Cached::Offsets::PlayerController::AcknowledgedPawn, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"PlayerCameraManager")), &SDK::Cached::Offsets::PlayerController::PlayerCameraManager, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"InputYawScale")), &SDK::Cached::Offsets::PlayerController::InputYawScale, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"PlayerController")), SDK::FName(skCrypt(L"InputPitchScale")), &SDK::Cached::Offsets::PlayerController::InputPitchScale, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"FortPlayerStateZone")), SDK::FName(skCrypt(L"SpectatingTarget")), &SDK::Cached::Offsets::FortPlayerStateZone::SpectatingTarget, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"HUD")), SDK::FName(skCrypt(L"DebugCanvas")), &SDK::Cached::Offsets::HUD::Canvas, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Pawn")), SDK::FName(skCrypt(L"PlayerState")), &SDK::Cached::Offsets::Pawn::PlayerState, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Character")), SDK::FName(skCrypt(L"Mesh")), &SDK::Cached::Offsets::Character::Mesh, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Font")), SDK::FName(skCrypt(L"LegacyFontSize")), &SDK::Cached::Offsets::Font::LegacyFontSize, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"SkinnedMeshComponent")), SDK::FName(skCrypt(L"SkeletalMesh")), &SDK::Cached::Offsets::SkeletalMeshComponent::SkeletalMesh, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"SkeletalMesh")), SDK::FName(skCrypt(L"Materials")), &SDK::Cached::Offsets::SkeletalMesh::Materials, nullptr },
|
||||
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"bDisableDepthTest")), &SDK::Cached::Offsets::Material::bDisableDepthTest, &SDK::Cached::Masks::Material::bDisableDepthTest },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"BlendMode")), &SDK::Cached::Offsets::Material::BlendMode, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"Wireframe")), &SDK::Cached::Offsets::Material::Wireframe, &SDK::Cached::Masks::Material::Wireframe },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"bDisableDepthTest")), &SDK::Cached::Offsets::Material::bDisableDepthTest, &SDK::Cached::Masks::Material::bDisableDepthTest },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"BlendMode")), &SDK::Cached::Offsets::Material::BlendMode, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"Material")), SDK::FName(skCrypt(L"Wireframe")), &SDK::Cached::Offsets::Material::Wireframe, &SDK::Cached::Masks::Material::Wireframe },
|
||||
|
||||
OffsetSearch { SDK::FName(skCrypt(L"HitResult")), SDK::FName(skCrypt(L"TraceStart")), &SDK::Cached::Offsets::HitResult::TraceStart, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"HitResult")), SDK::FName(skCrypt(L"Distance")), &SDK::Cached::Offsets::HitResult::Distance, nullptr },
|
||||
OffsetSearch { SDK::FName(skCrypt(L"HitResult")), SDK::FName(skCrypt(L"TraceStart")), &SDK::Cached::Offsets::HitResult::TraceStart, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"HitResult")), SDK::FName(skCrypt(L"Distance")), &SDK::Cached::Offsets::HitResult::Distance, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"World")), SDK::FName(skCrypt(L"GameState")), &SDK::Cached::Offsets::World::GameState, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"World")), SDK::FName(skCrypt(L"GameState")), &SDK::Cached::Offsets::World::GameState, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickup")), SDK::FName(skCrypt(L"PrimaryPickupItemEntry")), &SDK::Cached::Offsets::FortPickup::PrimaryPickupItemEntry, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickup")), SDK::FName(skCrypt(L"PickupEffectBlueprint")), &SDK::Cached::Offsets::FortPickup::PickupEffectBlueprint, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemDefinition")), SDK::FName(skCrypt(L"DisplayName")), &SDK::Cached::Offsets::FortItemDefinition::DisplayName, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemDefinition")), SDK::FName(skCrypt(L"Tier")), &SDK::Cached::Offsets::FortItemDefinition::Tier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"RootComponent")), &SDK::Cached::Offsets::Actor::RootComponent, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"Role")), &SDK::Cached::Offsets::Actor::Role, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"InstanceComponents")), &SDK::Cached::Offsets::Actor::InstanceComponents, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"BlueprintCreatedComponents")), &SDK::Cached::Offsets::Actor::BlueprintCreatedComponents, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"SceneComponent")), SDK::FName(skCrypt(L"RelativeLocation")), &SDK::Cached::Offsets::SceneComponent::RelativeLocation, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"ActorComponent")), SDK::FName(skCrypt(L"ComponentTags")), &SDK::Cached::Offsets::ActorComponent::ComponentTags, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"SizeX")), &SDK::Cached::Offsets::Canvas::SizeX, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"SizeY")), &SDK::Cached::Offsets::Canvas::SizeY, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPawn")), SDK::FName(skCrypt(L"CurrentWeapon")), &SDK::Cached::Offsets::FortPawn::CurrentWeapon, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPawn")), SDK::FName(skCrypt(L"bIsDying")), &SDK::Cached::Offsets::FortPawn::bIsDying, &SDK::Cached::Masks::FortPawn::bIsDying },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"VehicleStateLocal")), &SDK::Cached::Offsets::FortPlayerPawn::VehicleStateLocal, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"CharacterPartSkeletalMeshComponents")),&SDK::Cached::Offsets::FortPlayerPawn::CharacterPartSkeletalMeshComponents,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawnAthena")), SDK::FName(skCrypt(L"bADSWhileNotOnGround")), &SDK::Cached::Offsets::FortPlayerPawnAthena::bADSWhileNotOnGround,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"WeaponData")), &SDK::Cached::Offsets::FortWeapon::WeaponData, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"LastFireTime")), &SDK::Cached::Offsets::FortWeapon::LastFireTime, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"bIgnoreTryToFireSlotCooldownRestriction")), &SDK::Cached::Offsets::FortWeapon::bIgnoreTryToFireSlotCooldownRestriction, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"AmmoCount")), &SDK::Cached::Offsets::FortWeapon::AmmoCount, nullptr },
|
||||
//OffsetSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"AllWeaponMeshes")), &SDK::Cached::Offsets::FortWeapon::AllWeaponMeshes, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickup")), SDK::FName(skCrypt(L"PrimaryPickupItemEntry")), &SDK::Cached::Offsets::FortPickup::PrimaryPickupItemEntry, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickup")), SDK::FName(skCrypt(L"PickupEffectBlueprint")), &SDK::Cached::Offsets::FortPickup::PickupEffectBlueprint, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemDefinition")), SDK::FName(skCrypt(L"DisplayName")), &SDK::Cached::Offsets::FortItemDefinition::DisplayName, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemDefinition")), SDK::FName(skCrypt(L"Tier")), &SDK::Cached::Offsets::FortItemDefinition::Tier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"RootComponent")), &SDK::Cached::Offsets::Actor::RootComponent, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"Role")), &SDK::Cached::Offsets::Actor::Role, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"InstanceComponents")), &SDK::Cached::Offsets::Actor::InstanceComponents, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Actor")), SDK::FName(skCrypt(L"BlueprintCreatedComponents")), &SDK::Cached::Offsets::Actor::BlueprintCreatedComponents, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"SceneComponent")), SDK::FName(skCrypt(L"RelativeLocation")), &SDK::Cached::Offsets::SceneComponent::RelativeLocation, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"ActorComponent")), SDK::FName(skCrypt(L"ComponentTags")), &SDK::Cached::Offsets::ActorComponent::ComponentTags, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"SizeX")), &SDK::Cached::Offsets::Canvas::SizeX, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"Canvas")), SDK::FName(skCrypt(L"SizeY")), &SDK::Cached::Offsets::Canvas::SizeY, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPawn")), SDK::FName(skCrypt(L"CurrentWeapon")), &SDK::Cached::Offsets::FortPawn::CurrentWeapon, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPawn")), SDK::FName(skCrypt(L"bIsDying")), &SDK::Cached::Offsets::FortPawn::bIsDying, &SDK::Cached::Masks::FortPawn::bIsDying },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"VehicleStateLocal")), &SDK::Cached::Offsets::FortPlayerPawn::VehicleStateLocal, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"CharacterPartSkeletalMeshComponents")),&SDK::Cached::Offsets::FortPlayerPawn::CharacterPartSkeletalMeshComponents,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawnAthena")), SDK::FName(skCrypt(L"bADSWhileNotOnGround")), &SDK::Cached::Offsets::FortPlayerPawnAthena::bADSWhileNotOnGround,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"WeaponData")), &SDK::Cached::Offsets::FortWeapon::WeaponData, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"LastFireTime")), &SDK::Cached::Offsets::FortWeapon::LastFireTime, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"bIgnoreTryToFireSlotCooldownRestriction")), &SDK::Cached::Offsets::FortWeapon::bIgnoreTryToFireSlotCooldownRestriction, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"AmmoCount")), &SDK::Cached::Offsets::FortWeapon::AmmoCount, nullptr },
|
||||
//OffsetSearch { SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"AllWeaponMeshes")), &SDK::Cached::Offsets::FortWeapon::AllWeaponMeshes, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"bBuildFree")), &SDK::Cached::Offsets::FortPlayerController::bBuildFree, &SDK::Cached::Masks::FortPlayerController::bBuildFree },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"bInfiniteAmmo")), &SDK::Cached::Offsets::FortPlayerController::bInfiniteAmmo, &SDK::Cached::Masks::FortPlayerController::bInfiniteAmmo },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"TargetedBuilding")), &SDK::Cached::Offsets::FortPlayerController::TargetedBuilding, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"bBuildFree")), &SDK::Cached::Offsets::FortPlayerController::bBuildFree, &SDK::Cached::Masks::FortPlayerController::bBuildFree },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"bInfiniteAmmo")), &SDK::Cached::Offsets::FortPlayerController::bInfiniteAmmo, &SDK::Cached::Masks::FortPlayerController::bInfiniteAmmo },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerController")), SDK::FName(skCrypt(L"TargetedBuilding")), &SDK::Cached::Offsets::FortPlayerController::TargetedBuilding, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerStateAthena")), SDK::FName(skCrypt(L"TeamIndex")), &SDK::Cached::Offsets::FortPlayerStateAthena::TeamIndex, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerStateAthena")), SDK::FName(skCrypt(L"TeamIndex")), &SDK::Cached::Offsets::FortPlayerStateAthena::TeamIndex, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemEntry")), SDK::FName(skCrypt(L"ItemDefinition")), &SDK::Cached::Offsets::FortItemEntry::ItemDefinition, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"MinimalViewInfo")), SDK::FName(skCrypt(L"Location")), &SDK::Cached::Offsets::MinimalViewInfo::Location, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"MinimalViewInfo")), SDK::FName(skCrypt(L"Rotation")), &SDK::Cached::Offsets::MinimalViewInfo::Rotation, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortItemEntry")), SDK::FName(skCrypt(L"ItemDefinition")), &SDK::Cached::Offsets::FortItemEntry::ItemDefinition, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"MinimalViewInfo")), SDK::FName(skCrypt(L"Location")), &SDK::Cached::Offsets::MinimalViewInfo::Location, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"MinimalViewInfo")), SDK::FName(skCrypt(L"Rotation")), &SDK::Cached::Offsets::MinimalViewInfo::Rotation, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"B_Pickups_Parent_C")), SDK::FName(skCrypt(L"Static_Mesh_Pickup")), &SDK::Cached::Offsets::AB_Pickups_Parent_C::Static_Mesh_Pickup, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"B_Pickups_Parent_C")), SDK::FName(skCrypt(L"Skeletal_Mesh_Pickup")), &SDK::Cached::Offsets::AB_Pickups_Parent_C::Skeletal_Mesh_Pickup,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickupEffect")), SDK::FName(skCrypt(L"ItemDefinition")), &SDK::Cached::Offsets::FortPickupEffect::ItemDefinition, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"B_Pickups_Parent_C")), SDK::FName(skCrypt(L"Static_Mesh_Pickup")), &SDK::Cached::Offsets::AB_Pickups_Parent_C::Static_Mesh_Pickup, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"B_Pickups_Parent_C")), SDK::FName(skCrypt(L"Skeletal_Mesh_Pickup")), &SDK::Cached::Offsets::AB_Pickups_Parent_C::Skeletal_Mesh_Pickup,nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortPickupEffect")), SDK::FName(skCrypt(L"ItemDefinition")), &SDK::Cached::Offsets::FortPickupEffect::ItemDefinition, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortMeleeWeaponStats")), SDK::FName(skCrypt(L"SwingPlaySpeed")), &SDK::Cached::Offsets::FortMeleeWeaponStats::SwingPlaySpeed, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortMeleeWeaponStats")), SDK::FName(skCrypt(L"SwingPlaySpeed")), &SDK::Cached::Offsets::FortMeleeWeaponStats::SwingPlaySpeed, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"Spread")), &SDK::Cached::Offsets::FortRangedWeaponStats::Spread, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"SpreadDownsights")), &SDK::Cached::Offsets::FortRangedWeaponStats::SpreadDownsights, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"StandingStillSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::StandingStillSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaCrouchingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaCrouchingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaJumpingFallingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaJumpingFallingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaSprintingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaSprintingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"MinSpeedForSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::MinSpeedForSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"MaxSpeedForSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::MaxSpeedForSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"RecoilVert")), &SDK::Cached::Offsets::FortRangedWeaponStats::RecoilVert, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"RecoilHoriz")), &SDK::Cached::Offsets::FortRangedWeaponStats::RecoilHoriz, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"BulletsPerCartridge")), &SDK::Cached::Offsets::FortRangedWeaponStats::BulletsPerCartridge, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"Spread")), &SDK::Cached::Offsets::FortRangedWeaponStats::Spread, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"SpreadDownsights")), &SDK::Cached::Offsets::FortRangedWeaponStats::SpreadDownsights, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"StandingStillSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::StandingStillSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaCrouchingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaCrouchingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaJumpingFallingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaJumpingFallingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"AthenaSprintingSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::AthenaSprintingSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"MinSpeedForSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::MinSpeedForSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"MaxSpeedForSpreadMultiplier")), &SDK::Cached::Offsets::FortRangedWeaponStats::MaxSpeedForSpreadMultiplier, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"RecoilVert")), &SDK::Cached::Offsets::FortRangedWeaponStats::RecoilVert, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"RecoilHoriz")), &SDK::Cached::Offsets::FortRangedWeaponStats::RecoilHoriz, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortRangedWeaponStats")), SDK::FName(skCrypt(L"BulletsPerCartridge")), &SDK::Cached::Offsets::FortRangedWeaponStats::BulletsPerCartridge, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortBaseWeaponStats")), SDK::FName(skCrypt(L"ReloadTime")), &SDK::Cached::Offsets::FortRangedWeaponStats::ReloadTime, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"FortBaseWeaponStats")), SDK::FName(skCrypt(L"ReloadTime")), &SDK::Cached::Offsets::FortRangedWeaponStats::ReloadTime, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"VehiclePawnState")), SDK::FName(skCrypt(L"Vehicle")), &SDK::Cached::Offsets::VehiclePawnState::Vehicle, nullptr },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"VehiclePawnState")), SDK::FName(skCrypt(L"Vehicle")), &SDK::Cached::Offsets::VehiclePawnState::Vehicle, nullptr },
|
||||
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bHit")), &SDK::Cached::Offsets::BuildingWeakSpot::bHit, &SDK::Cached::Masks::BuildingWeakSpot::bHit },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bFadeOut")), &SDK::Cached::Offsets::BuildingWeakSpot::bFadeOut, &SDK::Cached::Masks::BuildingWeakSpot::bFadeOut },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bActive")), &SDK::Cached::Offsets::BuildingWeakSpot::bActive, &SDK::Cached::Masks::BuildingWeakSpot::bActive },
|
||||
};
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bHit")), &SDK::Cached::Offsets::BuildingWeakSpot::bHit, &SDK::Cached::Masks::BuildingWeakSpot::bHit },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bFadeOut")), &SDK::Cached::Offsets::BuildingWeakSpot::bFadeOut, &SDK::Cached::Masks::BuildingWeakSpot::bFadeOut },
|
||||
OffsetSearch{ SDK::FName(skCrypt(L"BuildingWeakSpot")), SDK::FName(skCrypt(L"bActive")), &SDK::Cached::Offsets::BuildingWeakSpot::bActive, &SDK::Cached::Masks::BuildingWeakSpot::bActive },
|
||||
};
|
||||
|
||||
if (SDK::GetGameVersion() >= 6.00)
|
||||
{
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"ChargeRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::ChargeRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"ActiveExpenseRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::ActiveExpenseRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"PassiveExpenseRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::PassiveExpenseRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"Charge")), &SDK::Cached::Offsets::FortRechargingActionTimer::Charge, nullptr });
|
||||
if (SDK::GetGameVersion() >= 6.00) {
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"ChargeRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::ChargeRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"ActiveExpenseRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::ActiveExpenseRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"PassiveExpenseRate")), &SDK::Cached::Offsets::FortRechargingActionTimer::PassiveExpenseRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortRechargingActionTimer")), SDK::FName(skCrypt(L"Charge")), &SDK::Cached::Offsets::FortRechargingActionTimer::Charge, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), SDK::FName(skCrypt(L"BoostAccumulationRate")), &SDK::Cached::Offsets::FortAntelopeVehicleConfigs::BoostAccumulationRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), SDK::FName(skCrypt(L"BoostExpenseRate")), &SDK::Cached::Offsets::FortAntelopeVehicleConfigs::BoostExpenseRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), SDK::FName(skCrypt(L"BoostAccumulationRate")), &SDK::Cached::Offsets::FortAntelopeVehicleConfigs::BoostAccumulationRate, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), SDK::FName(skCrypt(L"BoostExpenseRate")), &SDK::Cached::Offsets::FortAntelopeVehicleConfigs::BoostExpenseRate, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaAntelopeVehicle")), SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), &SDK::Cached::Offsets::FortAthenaAntelopeVehicle::FortAntelopeVehicleConfigs, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaAntelopeVehicle")), SDK::FName(skCrypt(L"FortAntelopeVehicleConfigs")), &SDK::Cached::Offsets::FortAthenaAntelopeVehicle::FortAntelopeVehicleConfigs, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaJackalVehicle")), SDK::FName(skCrypt(L"BoostTimers")), &SDK::Cached::Offsets::FortAthenaJackalVehicle::BoostTimers, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaJackalVehicle")), SDK::FName(skCrypt(L"BoostTimers")), &SDK::Cached::Offsets::FortAthenaJackalVehicle::BoostTimers, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortGameStateAthena")), SDK::FName(skCrypt(L"DefaultGliderRedeployCanRedeploy")), &SDK::Cached::Offsets::FortGameStateAthena::DefaultGliderRedeployCanRedeploy, nullptr });
|
||||
}
|
||||
if (SDK::GetGameVersion() >= 7.00)
|
||||
{
|
||||
// Bit of a hacky way to do it since its not 100% accurate if its using the enum for teams or the direct value, but they both have the same type so it doesn't matter
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"BuildingActor")), SDK::FName(skCrypt(L"TeamIndex")), &SDK::Cached::Offsets::BuildingActor::TeamIndex, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortGameStateAthena")), SDK::FName(skCrypt(L"DefaultGliderRedeployCanRedeploy")), &SDK::Cached::Offsets::FortGameStateAthena::DefaultGliderRedeployCanRedeploy, nullptr });
|
||||
}
|
||||
if (SDK::GetGameVersion() >= 7.00) {
|
||||
// Bit of a hacky way to do it since its not 100% accurate if its using the enum for teams or the direct value, but they both have the same type so it doesn't matter
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"BuildingActor")), SDK::FName(skCrypt(L"TeamIndex")), &SDK::Cached::Offsets::BuildingActor::TeamIndex, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaDoghouseVehicle")), SDK::FName(skCrypt(L"BoostAction")), &SDK::Cached::Offsets::FortAthenaDoghouseVehicle::BoostAction, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortAthenaDoghouseVehicle")), SDK::FName(skCrypt(L"BoostAction")), &SDK::Cached::Offsets::FortAthenaDoghouseVehicle::BoostAction, nullptr });
|
||||
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"ZiplinePawnState")), SDK::FName(skCrypt(L"bIsZiplining")), &SDK::Cached::Offsets::ZiplinePawnState::bIsZiplining, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"ZiplineState")), &SDK::Cached::Offsets::FortPlayerPawn::ZiplineState, nullptr });
|
||||
}
|
||||
else
|
||||
{
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"BuildingActor")), SDK::FName(skCrypt(L"Team")), &SDK::Cached::Offsets::BuildingActor::TeamIndex, nullptr });
|
||||
}
|
||||
if (SDK::GetGameVersion() >= 10.00)
|
||||
{
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"LastFireTimeVerified")), &SDK::Cached::Offsets::FortWeapon::LastFireTimeVerified, nullptr });
|
||||
}
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"ZiplinePawnState")), SDK::FName(skCrypt(L"bIsZiplining")), &SDK::Cached::Offsets::ZiplinePawnState::bIsZiplining, nullptr });
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortPlayerPawn")), SDK::FName(skCrypt(L"ZiplineState")), &SDK::Cached::Offsets::FortPlayerPawn::ZiplineState, nullptr });
|
||||
}
|
||||
else {
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"BuildingActor")), SDK::FName(skCrypt(L"Team")), &SDK::Cached::Offsets::BuildingActor::TeamIndex, nullptr });
|
||||
}
|
||||
if (SDK::GetGameVersion() >= 10.00) {
|
||||
Offsets.push_back(OffsetSearch{ SDK::FName(skCrypt(L"FortWeapon")), SDK::FName(skCrypt(L"LastFireTimeVerified")), &SDK::Cached::Offsets::FortWeapon::LastFireTimeVerified, nullptr });
|
||||
}
|
||||
|
||||
SDK::UObject::SetupObjects(Functions, Offsets);
|
||||
}
|
||||
SDK::UObject::SetupObjects(Functions, Offsets);
|
||||
}
|
||||
|
||||
// Init Features
|
||||
{
|
||||
Input::Init();
|
||||
Features::FortPawnHelper::Bone::Init();
|
||||
// Init Features
|
||||
{
|
||||
Input::Init();
|
||||
Features::FortPawnHelper::Bone::Init();
|
||||
|
||||
Features::Visuals::ChamManagerFortPawn::Manager = new Features::Visuals::ChamManagerFortPawn(Config::Visuals::Players::PawnChamSettings);
|
||||
Features::Visuals::ChamManagerFortPickup::Manager = new Features::Visuals::ChamManagerFortPickup(Config::Visuals::Weapons::PickupChamSettings);
|
||||
Features::Visuals::ChamManagerFortPawn::Manager = new Features::Visuals::ChamManagerFortPawn(Config::Visuals::Players::PawnChamSettings);
|
||||
Features::Visuals::ChamManagerFortPickup::Manager = new Features::Visuals::ChamManagerFortPickup(Config::Visuals::Weapons::PickupChamSettings);
|
||||
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Init({ SDK::FName(skCrypt(L"WireFrameParameterHighlight")), SDK::FName(skCrypt(L"WireFrameFadeOffColor")), SDK::FName(skCrypt(L"Top Color")), SDK::FName(skCrypt(L"Bottom Color")) }, { SDK::FName(skCrypt(L"Emissive Modulation")) }, std::string(skCrypt("Material RezIn_Master.RezIn_Master")));
|
||||
Features::Visuals::ChamManagerFortPickup::Manager->Init({ SDK::FName(skCrypt(L"S Color1")), SDK::FName(skCrypt(L"S Color2")) }, { SDK::FName(skCrypt(L"Dissolve Pattern Emissive Brightness")), SDK::FName(skCrypt(L"Gradient Pass Emissive A")) }, std::string(skCrypt("Material CharacterShield_DimMak.CharacterShield_DimMak")));
|
||||
}
|
||||
Features::Visuals::ChamManagerFortPawn::Manager->Init({ SDK::FName(skCrypt(L"WireFrameParameterHighlight")), SDK::FName(skCrypt(L"WireFrameFadeOffColor")), SDK::FName(skCrypt(L"Top Color")), SDK::FName(skCrypt(L"Bottom Color")) }, { SDK::FName(skCrypt(L"Emissive Modulation")) }, std::string(skCrypt("Material RezIn_Master.RezIn_Master")));
|
||||
Features::Visuals::ChamManagerFortPickup::Manager->Init({ SDK::FName(skCrypt(L"S Color1")), SDK::FName(skCrypt(L"S Color2")) }, { SDK::FName(skCrypt(L"Dissolve Pattern Emissive Brightness")), SDK::FName(skCrypt(L"Gradient Pass Emissive A")) }, std::string(skCrypt("Material CharacterShield_DimMak.CharacterShield_DimMak")));
|
||||
}
|
||||
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("SDK Initialized!")));
|
||||
DEBUG_LOG(LOG_OFFSET, std::string(skCrypt("SDK Initialized!")));
|
||||
|
||||
#if OBJECT_DUMP
|
||||
for (int i = 0; i < SDK::UObject::ObjectArray.Num(); i++)
|
||||
{
|
||||
SDK::UObject* Object = SDK::UObject::ObjectArray.GetByIndex(i);
|
||||
if (Object == nullptr) continue;
|
||||
for (int i = 0; i < SDK::UObject::ObjectArray.Num(); i++) {
|
||||
SDK::UObject* Object = SDK::UObject::ObjectArray.GetByIndex(i);
|
||||
if (Object == nullptr) continue;
|
||||
|
||||
DEBUG_LOG(std::string(skCrypt("[")) + std::to_string(i) + std::string(skCrypt("] ")) + Object->GetFullName());
|
||||
}
|
||||
DEBUG_LOG(std::string(skCrypt("[")) + std::to_string(i) + std::string(skCrypt("] ")) + Object->GetFullName());
|
||||
}
|
||||
#endif
|
||||
#if NAME_DUMP
|
||||
// this is a bit bad as it will eventually crash, due to the fact we loop until INT_MAX
|
||||
for (int i = 0; i < INT_MAX; i++)
|
||||
{
|
||||
SDK::FName Name;
|
||||
Name.ComparisonIndex = i;
|
||||
Name.Number = 0;
|
||||
// this is a bit bad as it will eventually crash, due to the fact we loop until INT_MAX
|
||||
for (int i = 0; i < INT_MAX; i++) {
|
||||
SDK::FName Name;
|
||||
Name.ComparisonIndex = i;
|
||||
Name.Number = 0;
|
||||
|
||||
DEBUG_LOG(std::string(skCrypt("[")) + std::to_string(i) + std::string(skCrypt("] ")) + Name.GetRawString());
|
||||
}
|
||||
DEBUG_LOG(std::string(skCrypt("[")) + std::to_string(i) + std::string(skCrypt("] ")) + Name.GetRawString());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SDK::IsValidPointer(void* Address)
|
||||
{
|
||||
if (!Address)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool SDK::IsValidPointer(void* Address) {
|
||||
if (!Address) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if USING_SEH
|
||||
__try
|
||||
{
|
||||
volatile auto value = *static_cast<char*>(Address);
|
||||
(void)value;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
__try {
|
||||
volatile auto value = *static_cast<char*>(Address);
|
||||
(void)value;
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
// IMPROVVE THIS!!! IsBadWritePtr is a very bad and obsolete win api func
|
||||
if (LI_FN(IsBadReadPtr).safe_cached()(Address, 8))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// IMPROVVE THIS!!! IsBadWritePtr is a very bad and obsolete win api func
|
||||
if (LI_FN(IsBadReadPtr).safe_cached()(Address, 8)) {
|
||||
return false;
|
||||
}
|
||||
#endif // USING_SEH
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
uintptr_t SDK::GetBaseAddress()
|
||||
{
|
||||
return *(uintptr_t*)(__readgsqword(0x60) + 0x10);
|
||||
uintptr_t SDK::GetBaseAddress() {
|
||||
return *(uintptr_t*)(__readgsqword(0x60) + 0x10);
|
||||
}
|
||||
+378
-456
@@ -1,460 +1,382 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
|
||||
namespace SDK
|
||||
{
|
||||
namespace Cached
|
||||
{
|
||||
inline bool UsingCalculateShot = false;
|
||||
|
||||
namespace VFT
|
||||
{
|
||||
inline uintptr_t DrawTransition;
|
||||
inline uintptr_t ProcessEvent;
|
||||
inline uintptr_t GetPlayerViewpoint;
|
||||
inline uintptr_t GetViewpoint;
|
||||
inline uintptr_t GetWeaponStats;
|
||||
}
|
||||
|
||||
namespace Offsets
|
||||
{
|
||||
namespace World
|
||||
{
|
||||
inline uintptr_t GameState = -0x1;
|
||||
}
|
||||
|
||||
namespace Canvas
|
||||
{
|
||||
inline uintptr_t SizeX = -0x1;
|
||||
inline uintptr_t SizeY = -0x1;
|
||||
}
|
||||
|
||||
namespace Character
|
||||
{
|
||||
inline uintptr_t Mesh = -0x1;
|
||||
}
|
||||
|
||||
namespace Pawn
|
||||
{
|
||||
inline uintptr_t PlayerState = -0x1;
|
||||
}
|
||||
|
||||
namespace Material
|
||||
{
|
||||
inline uintptr_t bDisableDepthTest = -0x1;
|
||||
inline uintptr_t BlendMode = -0x1;
|
||||
inline uintptr_t Wireframe = -0x1;
|
||||
}
|
||||
|
||||
namespace SkeletalMeshComponent
|
||||
{
|
||||
inline uintptr_t SkeletalMesh = -0x1;
|
||||
}
|
||||
|
||||
namespace SkeletalMesh
|
||||
{
|
||||
inline uintptr_t Materials = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPawn
|
||||
{
|
||||
inline uintptr_t bIsDying = -0x1;
|
||||
inline uintptr_t CurrentWeapon = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawn
|
||||
{
|
||||
inline uintptr_t VehicleStateLocal = -0x1;
|
||||
inline uintptr_t ZiplineState = -0x1;
|
||||
inline uintptr_t CharacterPartSkeletalMeshComponents = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawnAthena
|
||||
{
|
||||
inline uintptr_t bADSWhileNotOnGround = -0x1;
|
||||
}
|
||||
|
||||
namespace Font
|
||||
{
|
||||
inline uintptr_t LegacyFontSize = -0x1;
|
||||
}
|
||||
|
||||
namespace Engine
|
||||
{
|
||||
inline uintptr_t GameViewport = -0x1;
|
||||
inline uintptr_t WireframeMaterial = -0x1;
|
||||
}
|
||||
|
||||
namespace GameViewportClient
|
||||
{
|
||||
inline uintptr_t World = -0x1;
|
||||
inline uintptr_t GameInstance = -0x1; // DO NOT DELETE! Required for getting PostRender VFT index
|
||||
}
|
||||
|
||||
namespace GameInstance
|
||||
{
|
||||
inline uintptr_t LocalPlayers = -0x1;
|
||||
}
|
||||
|
||||
namespace Player
|
||||
{
|
||||
inline uintptr_t PlayerController = -0x1;
|
||||
}
|
||||
|
||||
namespace PlayerController
|
||||
{
|
||||
inline uintptr_t AcknowledgedPawn = -0x1;
|
||||
inline uintptr_t PlayerCameraManager = -0x1;
|
||||
inline uintptr_t InputYawScale = -0x1;
|
||||
inline uintptr_t InputPitchScale = -0x1;
|
||||
}
|
||||
|
||||
namespace HUD
|
||||
{
|
||||
inline uintptr_t Canvas = -0x1;
|
||||
}
|
||||
|
||||
namespace HitResult
|
||||
{
|
||||
inline uintptr_t TraceStart = -0x1;
|
||||
inline uintptr_t Distance = -0x1;
|
||||
}
|
||||
|
||||
namespace FortItemEntry
|
||||
{
|
||||
inline uintptr_t ItemDefinition = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPickup
|
||||
{
|
||||
inline uintptr_t PrimaryPickupItemEntry = -0x1;
|
||||
inline uintptr_t PickupEffectBlueprint = -0x1;
|
||||
}
|
||||
|
||||
namespace AB_Pickups_Parent_C
|
||||
{
|
||||
inline uintptr_t Static_Mesh_Pickup = -0x1;
|
||||
inline uintptr_t Skeletal_Mesh_Pickup = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPickupEffect
|
||||
{
|
||||
inline uintptr_t ItemDefinition = -0x1;
|
||||
}
|
||||
|
||||
namespace FortWeapon
|
||||
{
|
||||
inline uintptr_t WeaponData = -0x1;
|
||||
|
||||
inline uintptr_t LastFireTime = -0x1;
|
||||
inline uintptr_t LastFireTimeVerified = -0x1;
|
||||
|
||||
inline uintptr_t bIgnoreTryToFireSlotCooldownRestriction = -0x1;
|
||||
|
||||
inline uintptr_t AmmoCount = -0x1;
|
||||
|
||||
inline uintptr_t AllWeaponMeshes = -0x1;
|
||||
}
|
||||
|
||||
namespace FortItemDefinition
|
||||
{
|
||||
inline uintptr_t DisplayName = -0x1;
|
||||
inline uintptr_t Tier = -0x1;
|
||||
}
|
||||
|
||||
namespace Actor
|
||||
{
|
||||
inline uintptr_t RootComponent = -0x1;
|
||||
inline uintptr_t Role = -0x1;
|
||||
inline uintptr_t InstanceComponents = -0x1;
|
||||
inline uintptr_t BlueprintCreatedComponents = -0x1;
|
||||
}
|
||||
|
||||
namespace ActorComponent
|
||||
{
|
||||
inline uintptr_t ComponentTags = -0x1;
|
||||
}
|
||||
|
||||
namespace SceneComponent
|
||||
{
|
||||
inline uintptr_t RelativeLocation = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerStateAthena
|
||||
{
|
||||
inline uintptr_t TeamIndex = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingWeakSpot
|
||||
{
|
||||
inline uintptr_t bHit = -0x1;
|
||||
inline uintptr_t bFadeOut = -0x1;
|
||||
inline uintptr_t bActive = -0x1;
|
||||
}
|
||||
|
||||
namespace MinimalViewInfo
|
||||
{
|
||||
inline uintptr_t Location = -0x1;
|
||||
inline uintptr_t Rotation = -0x1;
|
||||
}
|
||||
|
||||
namespace FortMeleeWeaponStats
|
||||
{
|
||||
inline uintptr_t SwingPlaySpeed = -0x1;
|
||||
}
|
||||
|
||||
namespace FortRangedWeaponStats
|
||||
{
|
||||
inline uintptr_t Spread = -0x1;
|
||||
inline uintptr_t SpreadDownsights = -0x1;
|
||||
inline uintptr_t StandingStillSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaCrouchingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaJumpingFallingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaSprintingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t MinSpeedForSpreadMultiplier = -0x1;
|
||||
inline uintptr_t MaxSpeedForSpreadMultiplier = -0x1;
|
||||
|
||||
inline uintptr_t BulletsPerCartridge = -0x1;
|
||||
inline uintptr_t ReloadTime = -0x1;
|
||||
inline uintptr_t RecoilVert = -0x1;
|
||||
inline uintptr_t RecoilHoriz = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaAntelopeVehicle
|
||||
{
|
||||
inline uintptr_t FortAntelopeVehicleConfigs = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaJackalVehicle
|
||||
{
|
||||
inline uintptr_t BoostTimers = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaDoghouseVehicle
|
||||
{
|
||||
inline uintptr_t BoostAction = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAntelopeVehicleConfigs
|
||||
{
|
||||
inline uintptr_t BoostAccumulationRate = -0x1;
|
||||
inline uintptr_t BoostExpenseRate = -0x1;
|
||||
}
|
||||
|
||||
namespace VehiclePawnState
|
||||
{
|
||||
inline uintptr_t Vehicle = -0x1;
|
||||
}
|
||||
|
||||
namespace FortRechargingActionTimer
|
||||
{
|
||||
inline uintptr_t ChargeRate = -0x1;
|
||||
inline uintptr_t ActiveExpenseRate = -0x1;
|
||||
inline uintptr_t PassiveExpenseRate = -0x1;
|
||||
inline uintptr_t Charge = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingActor
|
||||
{
|
||||
inline uintptr_t TeamIndex = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerController
|
||||
{
|
||||
inline uintptr_t bBuildFree = -0x1;
|
||||
inline uintptr_t bInfiniteAmmo = -0x1;
|
||||
inline uintptr_t TargetedBuilding = -0x1;
|
||||
}
|
||||
|
||||
namespace FortGameStateAthena
|
||||
{
|
||||
inline uintptr_t DefaultGliderRedeployCanRedeploy = -0x1;
|
||||
}
|
||||
|
||||
namespace ZiplinePawnState
|
||||
{
|
||||
inline uintptr_t bIsZiplining = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerStateZone
|
||||
{
|
||||
inline uintptr_t SpectatingTarget = -0x1;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Functions
|
||||
{
|
||||
namespace FortPlayerController
|
||||
{
|
||||
inline void* ServerAttemptInteract = nullptr;
|
||||
}
|
||||
|
||||
namespace SceneComponent
|
||||
{
|
||||
inline void* SetPhysicsLinearVelocity = nullptr;
|
||||
inline void* CreateDynamicMaterialInstance = nullptr;
|
||||
}
|
||||
|
||||
namespace PrimitiveComponent
|
||||
{
|
||||
inline void* SetMaterial = nullptr;
|
||||
}
|
||||
|
||||
namespace MeshComponent
|
||||
{
|
||||
inline void* GetMaterials = nullptr;
|
||||
}
|
||||
|
||||
namespace Actor
|
||||
{
|
||||
inline void* K2_TeleportTo = nullptr;
|
||||
inline void* K2_SetActorRotation = nullptr;
|
||||
inline void* K2_SetActorLocation = nullptr;
|
||||
inline void* SetActorEnableCollision = nullptr;
|
||||
}
|
||||
|
||||
namespace Pawn
|
||||
{
|
||||
inline void* GetMovementComponent = nullptr;
|
||||
}
|
||||
|
||||
namespace MovementComponent
|
||||
{
|
||||
inline void* StopMovementImmediately = nullptr;
|
||||
}
|
||||
|
||||
namespace Canvas
|
||||
{
|
||||
inline void* K2_DrawLine = nullptr;
|
||||
inline void* K2_DrawText = nullptr;
|
||||
inline void* K2_TextSize = nullptr;
|
||||
inline void* K2_Project = nullptr;
|
||||
inline void* K2_DrawBox = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetSystemLibrary
|
||||
{
|
||||
inline void* GetEngineVersion = nullptr;
|
||||
inline void* LineTraceSingle = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetMaterialLibrary
|
||||
{
|
||||
inline void* CreateDynamicMaterialInstance = nullptr;
|
||||
}
|
||||
|
||||
namespace MaterialInstanceDynamic
|
||||
{
|
||||
inline void* SetVectorParameterValue = nullptr;
|
||||
inline void* SetScalarParameterValue = nullptr;
|
||||
}
|
||||
|
||||
namespace MaterialInterface
|
||||
{
|
||||
inline void* GetBaseMaterial = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetMathLibrary
|
||||
{
|
||||
inline void* FindLookAtRotation = nullptr;
|
||||
inline void* GetForwardVector = nullptr;
|
||||
inline void* GetRightVector = nullptr;
|
||||
inline void* FMod = nullptr;
|
||||
}
|
||||
|
||||
namespace GameplayStatics
|
||||
{
|
||||
inline void* GetAllActorsOfClass = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerCameraManager
|
||||
{
|
||||
inline void* GetCameraLocation = nullptr;
|
||||
inline void* GetCameraRotation = nullptr;
|
||||
inline void* GetFOVAngle = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerController
|
||||
{
|
||||
inline void* WasInputKeyJustReleased = nullptr;
|
||||
inline void* WasInputKeyJustPressed = nullptr;
|
||||
inline void* IsInputKeyDown = nullptr;
|
||||
inline void* ClientSetRotation = nullptr;
|
||||
inline void* SetControlRotation = nullptr;
|
||||
inline void* GetMousePosition = nullptr;
|
||||
inline void* AddYawInput = nullptr;
|
||||
inline void* AddPitchInput = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerState
|
||||
{
|
||||
inline void* GetPlayerName = nullptr;
|
||||
}
|
||||
|
||||
namespace SkinnedMeshComponent
|
||||
{
|
||||
inline void* GetBoneName = nullptr;
|
||||
inline void* GetSocketLocation = nullptr;
|
||||
}
|
||||
|
||||
namespace FortWeapon
|
||||
{
|
||||
inline void* IsProjectileWeapon = nullptr;
|
||||
inline void* GetProjectileSpeed = nullptr;
|
||||
inline void* GetBulletsPerClip = nullptr;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawn
|
||||
{
|
||||
inline void* ServerHandlePickup = nullptr;
|
||||
}
|
||||
|
||||
namespace BuildingActor
|
||||
{
|
||||
inline void* SetTeam = nullptr;
|
||||
}
|
||||
|
||||
inline uintptr_t AppendString = 0x0;
|
||||
inline uintptr_t FNameConstructor = 0x0;
|
||||
inline uintptr_t LineTraceSingle = 0x0;
|
||||
inline uintptr_t CalculateShot = 0x0;
|
||||
inline uintptr_t RaycastMulti = 0x0;
|
||||
inline uintptr_t Fire = 0x0;
|
||||
inline uintptr_t EditSelectRelease = 0x0;
|
||||
inline uintptr_t CompleteBuildingEditInteraction = 0x0;
|
||||
inline uintptr_t PerformBuildingEditInteraction = 0x0;
|
||||
}
|
||||
|
||||
namespace Masks
|
||||
{
|
||||
namespace FortPawn
|
||||
{
|
||||
inline uintptr_t bIsDying = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerController
|
||||
{
|
||||
inline uintptr_t bBuildFree = -0x1;
|
||||
inline uintptr_t bInfiniteAmmo = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingWeakSpot
|
||||
{
|
||||
inline uintptr_t bHit = -0x1;
|
||||
inline uintptr_t bFadeOut = -0x1;
|
||||
inline uintptr_t bActive = -0x1;
|
||||
}
|
||||
|
||||
namespace Material
|
||||
{
|
||||
inline uintptr_t bDisableDepthTest = -0x1;
|
||||
inline uintptr_t Wireframe = -0x1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsValidPointer(void* Address);
|
||||
uintptr_t GetBaseAddress();
|
||||
|
||||
void Init();
|
||||
namespace SDK {
|
||||
namespace Cached {
|
||||
inline bool UsingCalculateShot = false;
|
||||
|
||||
namespace VFT {
|
||||
inline uintptr_t DrawTransition;
|
||||
inline uintptr_t ProcessEvent;
|
||||
inline uintptr_t GetPlayerViewpoint;
|
||||
inline uintptr_t GetViewpoint;
|
||||
inline uintptr_t GetWeaponStats;
|
||||
}
|
||||
|
||||
namespace Offsets {
|
||||
namespace World {
|
||||
inline uintptr_t GameState = -0x1;
|
||||
}
|
||||
|
||||
namespace Canvas {
|
||||
inline uintptr_t SizeX = -0x1;
|
||||
inline uintptr_t SizeY = -0x1;
|
||||
}
|
||||
|
||||
namespace Character {
|
||||
inline uintptr_t Mesh = -0x1;
|
||||
}
|
||||
|
||||
namespace Pawn {
|
||||
inline uintptr_t PlayerState = -0x1;
|
||||
}
|
||||
|
||||
namespace Material {
|
||||
inline uintptr_t bDisableDepthTest = -0x1;
|
||||
inline uintptr_t BlendMode = -0x1;
|
||||
inline uintptr_t Wireframe = -0x1;
|
||||
}
|
||||
|
||||
namespace SkeletalMeshComponent {
|
||||
inline uintptr_t SkeletalMesh = -0x1;
|
||||
}
|
||||
|
||||
namespace SkeletalMesh {
|
||||
inline uintptr_t Materials = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPawn {
|
||||
inline uintptr_t bIsDying = -0x1;
|
||||
inline uintptr_t CurrentWeapon = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawn {
|
||||
inline uintptr_t VehicleStateLocal = -0x1;
|
||||
inline uintptr_t ZiplineState = -0x1;
|
||||
inline uintptr_t CharacterPartSkeletalMeshComponents = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawnAthena {
|
||||
inline uintptr_t bADSWhileNotOnGround = -0x1;
|
||||
}
|
||||
|
||||
namespace Font {
|
||||
inline uintptr_t LegacyFontSize = -0x1;
|
||||
}
|
||||
|
||||
namespace Engine {
|
||||
inline uintptr_t GameViewport = -0x1;
|
||||
inline uintptr_t WireframeMaterial = -0x1;
|
||||
}
|
||||
|
||||
namespace GameViewportClient {
|
||||
inline uintptr_t World = -0x1;
|
||||
inline uintptr_t GameInstance = -0x1; // DO NOT DELETE! Required for getting PostRender VFT index
|
||||
}
|
||||
|
||||
namespace GameInstance {
|
||||
inline uintptr_t LocalPlayers = -0x1;
|
||||
}
|
||||
|
||||
namespace Player {
|
||||
inline uintptr_t PlayerController = -0x1;
|
||||
}
|
||||
|
||||
namespace PlayerController {
|
||||
inline uintptr_t AcknowledgedPawn = -0x1;
|
||||
inline uintptr_t PlayerCameraManager = -0x1;
|
||||
inline uintptr_t InputYawScale = -0x1;
|
||||
inline uintptr_t InputPitchScale = -0x1;
|
||||
}
|
||||
|
||||
namespace HUD {
|
||||
inline uintptr_t Canvas = -0x1;
|
||||
}
|
||||
|
||||
namespace HitResult {
|
||||
inline uintptr_t TraceStart = -0x1;
|
||||
inline uintptr_t Distance = -0x1;
|
||||
}
|
||||
|
||||
namespace FortItemEntry {
|
||||
inline uintptr_t ItemDefinition = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPickup {
|
||||
inline uintptr_t PrimaryPickupItemEntry = -0x1;
|
||||
inline uintptr_t PickupEffectBlueprint = -0x1;
|
||||
}
|
||||
|
||||
namespace AB_Pickups_Parent_C {
|
||||
inline uintptr_t Static_Mesh_Pickup = -0x1;
|
||||
inline uintptr_t Skeletal_Mesh_Pickup = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPickupEffect {
|
||||
inline uintptr_t ItemDefinition = -0x1;
|
||||
}
|
||||
|
||||
namespace FortWeapon {
|
||||
inline uintptr_t WeaponData = -0x1;
|
||||
|
||||
inline uintptr_t LastFireTime = -0x1;
|
||||
inline uintptr_t LastFireTimeVerified = -0x1;
|
||||
|
||||
inline uintptr_t bIgnoreTryToFireSlotCooldownRestriction = -0x1;
|
||||
|
||||
inline uintptr_t AmmoCount = -0x1;
|
||||
|
||||
inline uintptr_t AllWeaponMeshes = -0x1;
|
||||
}
|
||||
|
||||
namespace FortItemDefinition {
|
||||
inline uintptr_t DisplayName = -0x1;
|
||||
inline uintptr_t Tier = -0x1;
|
||||
}
|
||||
|
||||
namespace Actor {
|
||||
inline uintptr_t RootComponent = -0x1;
|
||||
inline uintptr_t Role = -0x1;
|
||||
inline uintptr_t InstanceComponents = -0x1;
|
||||
inline uintptr_t BlueprintCreatedComponents = -0x1;
|
||||
}
|
||||
|
||||
namespace ActorComponent {
|
||||
inline uintptr_t ComponentTags = -0x1;
|
||||
}
|
||||
|
||||
namespace SceneComponent {
|
||||
inline uintptr_t RelativeLocation = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerStateAthena {
|
||||
inline uintptr_t TeamIndex = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingWeakSpot {
|
||||
inline uintptr_t bHit = -0x1;
|
||||
inline uintptr_t bFadeOut = -0x1;
|
||||
inline uintptr_t bActive = -0x1;
|
||||
}
|
||||
|
||||
namespace MinimalViewInfo {
|
||||
inline uintptr_t Location = -0x1;
|
||||
inline uintptr_t Rotation = -0x1;
|
||||
}
|
||||
|
||||
namespace FortMeleeWeaponStats {
|
||||
inline uintptr_t SwingPlaySpeed = -0x1;
|
||||
}
|
||||
|
||||
namespace FortRangedWeaponStats {
|
||||
inline uintptr_t Spread = -0x1;
|
||||
inline uintptr_t SpreadDownsights = -0x1;
|
||||
inline uintptr_t StandingStillSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaCrouchingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaJumpingFallingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t AthenaSprintingSpreadMultiplier = -0x1;
|
||||
inline uintptr_t MinSpeedForSpreadMultiplier = -0x1;
|
||||
inline uintptr_t MaxSpeedForSpreadMultiplier = -0x1;
|
||||
|
||||
inline uintptr_t BulletsPerCartridge = -0x1;
|
||||
inline uintptr_t ReloadTime = -0x1;
|
||||
inline uintptr_t RecoilVert = -0x1;
|
||||
inline uintptr_t RecoilHoriz = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaAntelopeVehicle {
|
||||
inline uintptr_t FortAntelopeVehicleConfigs = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaJackalVehicle {
|
||||
inline uintptr_t BoostTimers = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAthenaDoghouseVehicle {
|
||||
inline uintptr_t BoostAction = -0x1;
|
||||
}
|
||||
|
||||
namespace FortAntelopeVehicleConfigs {
|
||||
inline uintptr_t BoostAccumulationRate = -0x1;
|
||||
inline uintptr_t BoostExpenseRate = -0x1;
|
||||
}
|
||||
|
||||
namespace VehiclePawnState {
|
||||
inline uintptr_t Vehicle = -0x1;
|
||||
}
|
||||
|
||||
namespace FortRechargingActionTimer {
|
||||
inline uintptr_t ChargeRate = -0x1;
|
||||
inline uintptr_t ActiveExpenseRate = -0x1;
|
||||
inline uintptr_t PassiveExpenseRate = -0x1;
|
||||
inline uintptr_t Charge = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingActor {
|
||||
inline uintptr_t TeamIndex = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerController {
|
||||
inline uintptr_t bBuildFree = -0x1;
|
||||
inline uintptr_t bInfiniteAmmo = -0x1;
|
||||
inline uintptr_t TargetedBuilding = -0x1;
|
||||
}
|
||||
|
||||
namespace FortGameStateAthena {
|
||||
inline uintptr_t DefaultGliderRedeployCanRedeploy = -0x1;
|
||||
}
|
||||
|
||||
namespace ZiplinePawnState {
|
||||
inline uintptr_t bIsZiplining = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerStateZone {
|
||||
inline uintptr_t SpectatingTarget = -0x1;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Functions {
|
||||
namespace SceneComponent {
|
||||
inline void* SetPhysicsLinearVelocity = nullptr;
|
||||
inline void* CreateDynamicMaterialInstance = nullptr;
|
||||
}
|
||||
|
||||
namespace PrimitiveComponent {
|
||||
inline void* SetMaterial = nullptr;
|
||||
}
|
||||
|
||||
namespace MeshComponent {
|
||||
inline void* GetMaterials = nullptr;
|
||||
}
|
||||
|
||||
namespace Actor {
|
||||
inline void* K2_TeleportTo = nullptr;
|
||||
inline void* K2_SetActorRotation = nullptr;
|
||||
inline void* K2_SetActorLocation = nullptr;
|
||||
inline void* SetActorEnableCollision = nullptr;
|
||||
}
|
||||
|
||||
namespace Pawn {
|
||||
inline void* GetMovementComponent = nullptr;
|
||||
}
|
||||
|
||||
namespace MovementComponent {
|
||||
inline void* StopMovementImmediately = nullptr;
|
||||
}
|
||||
|
||||
namespace Canvas {
|
||||
inline void* K2_DrawLine = nullptr;
|
||||
inline void* K2_DrawText = nullptr;
|
||||
inline void* K2_TextSize = nullptr;
|
||||
inline void* K2_Project = nullptr;
|
||||
inline void* K2_DrawBox = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetSystemLibrary {
|
||||
inline void* GetEngineVersion = nullptr;
|
||||
inline void* LineTraceSingle = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetMaterialLibrary {
|
||||
inline void* CreateDynamicMaterialInstance = nullptr;
|
||||
}
|
||||
|
||||
namespace MaterialInstanceDynamic {
|
||||
inline void* SetVectorParameterValue = nullptr;
|
||||
inline void* SetScalarParameterValue = nullptr;
|
||||
}
|
||||
|
||||
namespace MaterialInterface {
|
||||
inline void* GetBaseMaterial = nullptr;
|
||||
}
|
||||
|
||||
namespace KismetMathLibrary {
|
||||
inline void* FindLookAtRotation = nullptr;
|
||||
inline void* GetForwardVector = nullptr;
|
||||
inline void* GetRightVector = nullptr;
|
||||
inline void* FMod = nullptr;
|
||||
}
|
||||
|
||||
namespace GameplayStatics {
|
||||
inline void* GetAllActorsOfClass = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerCameraManager {
|
||||
inline void* GetCameraLocation = nullptr;
|
||||
inline void* GetCameraRotation = nullptr;
|
||||
inline void* GetFOVAngle = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerController {
|
||||
inline void* WasInputKeyJustReleased = nullptr;
|
||||
inline void* WasInputKeyJustPressed = nullptr;
|
||||
inline void* IsInputKeyDown = nullptr;
|
||||
inline void* ClientSetRotation = nullptr;
|
||||
inline void* SetControlRotation = nullptr;
|
||||
inline void* GetMousePosition = nullptr;
|
||||
inline void* AddYawInput = nullptr;
|
||||
inline void* AddPitchInput = nullptr;
|
||||
}
|
||||
|
||||
namespace PlayerState {
|
||||
inline void* GetPlayerName = nullptr;
|
||||
}
|
||||
|
||||
namespace SkinnedMeshComponent {
|
||||
inline void* GetBoneName = nullptr;
|
||||
inline void* GetSocketLocation = nullptr;
|
||||
}
|
||||
|
||||
namespace FortWeapon {
|
||||
inline void* IsProjectileWeapon = nullptr;
|
||||
inline void* GetProjectileSpeed = nullptr;
|
||||
inline void* GetBulletsPerClip = nullptr;
|
||||
}
|
||||
|
||||
namespace FortPlayerPawn {
|
||||
inline void* ServerHandlePickup = nullptr;
|
||||
}
|
||||
|
||||
namespace BuildingActor {
|
||||
inline void* SetTeam = nullptr;
|
||||
}
|
||||
|
||||
inline uintptr_t AppendString = 0x0;
|
||||
inline uintptr_t FNameConstructor = 0x0;
|
||||
inline uintptr_t LineTraceSingle = 0x0;
|
||||
inline uintptr_t CalculateShot = 0x0;
|
||||
inline uintptr_t RaycastMulti = 0x0;
|
||||
inline uintptr_t Fire = 0x0;
|
||||
inline uintptr_t EditSelectRelease = 0x0;
|
||||
inline uintptr_t CompleteBuildingEditInteraction = 0x0;
|
||||
inline uintptr_t PerformBuildingEditInteraction = 0x0;
|
||||
}
|
||||
|
||||
namespace Masks {
|
||||
namespace FortPawn {
|
||||
inline uintptr_t bIsDying = -0x1;
|
||||
}
|
||||
|
||||
namespace FortPlayerController {
|
||||
inline uintptr_t bBuildFree = -0x1;
|
||||
inline uintptr_t bInfiniteAmmo = -0x1;
|
||||
}
|
||||
|
||||
namespace BuildingWeakSpot {
|
||||
inline uintptr_t bHit = -0x1;
|
||||
inline uintptr_t bFadeOut = -0x1;
|
||||
inline uintptr_t bActive = -0x1;
|
||||
}
|
||||
|
||||
namespace Material {
|
||||
inline uintptr_t bDisableDepthTest = -0x1;
|
||||
inline uintptr_t Wireframe = -0x1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsValidPointer(void* Address);
|
||||
uintptr_t GetBaseAddress();
|
||||
|
||||
void Init();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,232 +9,220 @@
|
||||
#include "../../Utilities/Memory.h"
|
||||
|
||||
/* This class is used to initialize the SDK by updating the offsets and VFT indicies */
|
||||
class SDKInitializer
|
||||
{
|
||||
class SDKInitializer {
|
||||
private:
|
||||
/* Cached address for "EditModeInputComponent0" string (to avoid searching multiple times) */
|
||||
static uintptr_t EditModeInputComponent0;
|
||||
/* Cached address for "EditModeInputComponent0" string (to avoid searching multiple times) */
|
||||
static uintptr_t EditModeInputComponent0;
|
||||
|
||||
private:
|
||||
/*
|
||||
* @brief Finds the first wildcard (question mark) in a given pattern.
|
||||
*
|
||||
* @param Pattern - The pattern to search for wildcard (narrow character)
|
||||
* @return Returns - the index the wildcard was found divided by 3 (2 characters for byte, 1 for space)
|
||||
*/
|
||||
static const int FindFirstWildCard(const char* Pattern)
|
||||
{
|
||||
int Position = 0;
|
||||
const char* CurrentChar = Pattern;
|
||||
/*
|
||||
* @brief Finds the first wildcard (question mark) in a given pattern.
|
||||
*
|
||||
* @param Pattern - The pattern to search for wildcard (narrow character)
|
||||
* @return Returns - the index the wildcard was found divided by 3 (2 characters for byte, 1 for space)
|
||||
*/
|
||||
static const int FindFirstWildCard(const char* Pattern) {
|
||||
int Position = 0;
|
||||
const char* CurrentChar = Pattern;
|
||||
|
||||
while (*CurrentChar != '\0')
|
||||
{
|
||||
if (*CurrentChar == '?')
|
||||
{
|
||||
// divide by 3 to account for the 2 characters for one byte + 1 character for one space
|
||||
return Position / 3;
|
||||
}
|
||||
while (*CurrentChar != '\0') {
|
||||
if (*CurrentChar == '?') {
|
||||
// divide by 3 to account for the 2 characters for one byte + 1 character for one space
|
||||
return Position / 3;
|
||||
}
|
||||
|
||||
++CurrentChar;
|
||||
++Position;
|
||||
}
|
||||
++CurrentChar;
|
||||
++Position;
|
||||
}
|
||||
|
||||
THROW_ERROR(std::string(skCrypt("Failed to extract first wildcard!")), true);
|
||||
return 0;
|
||||
}
|
||||
THROW_ERROR(std::string(skCrypt("Failed to extract first wildcard!")), true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Initializes a VFT (Virtual Function Table) index using a search string and ranged pattern scanning
|
||||
*
|
||||
* @param VFTName - The name of the VFT
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (wide character) used to find the address
|
||||
* @param VFTIndex - Reference to the variable that will store the found VFT index
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitVFTIndex(const char* VFTName, std::vector<const char*> PossibleSigs, const wchar_t* SearchString, uintptr_t& VFTIndex, const int SearchRange, const int SearchBytesBehind = 0x0);
|
||||
/*
|
||||
* @brief Initializes a VFT (Virtual Function Table) index using a search string and ranged pattern scanning
|
||||
*
|
||||
* @param VFTName - The name of the VFT
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (wide character) used to find the address
|
||||
* @param VFTIndex - Reference to the variable that will store the found VFT index
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitVFTIndex(const char* VFTName, std::vector<const char*> PossibleSigs, const wchar_t* SearchString, uintptr_t& VFTIndex, int SearchRange, int SearchBytesBehind = 0x0);
|
||||
|
||||
/*
|
||||
* @brief Initializes a Function offset using a search string and ranged pattern scanning (Overload 1)
|
||||
*
|
||||
* @param FunctionName - The name of the function
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (wide character) used to find the address
|
||||
* @param FunctionOffset - Reference to the variable that will store the found function offset
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitFunctionOffset(const char* FunctionName, std::vector<const char*> PossibleSigs, const wchar_t* SearchString, uintptr_t& FunctionOffset, const int SearchRange = 0x600, const int SearchBytesBehind = 0x0);
|
||||
/*
|
||||
* @brief Initializes a Function offset using a search string and ranged pattern scanning (Overload 1)
|
||||
*
|
||||
* @param FunctionName - The name of the function
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (wide character) used to find the address
|
||||
* @param FunctionOffset - Reference to the variable that will store the found function offset
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitFunctionOffset(const char* FunctionName, std::vector<const char*> PossibleSigs, const wchar_t* SearchString, uintptr_t& FunctionOffset, int SearchRange = 0x600, int SearchBytesBehind = 0x0);
|
||||
|
||||
/*
|
||||
* @brief Initializes a Function offset using a search string and ranged pattern scanning (Overload 2)
|
||||
*
|
||||
* @param FunctionName - The name of the function
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (narrow character) used to find the address
|
||||
* @param FunctionOffset - Reference to the variable that will store the found function offset
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitFunctionOffset(const char* FunctionName, std::vector<const char*> PossibleSigs, const char* SearchString, uintptr_t& FunctionOffset, const int SearchRange = 0x600, const int SearchBytesBehind = 0x0);
|
||||
/*
|
||||
* @brief Initializes a Function offset using a search string and ranged pattern scanning (Overload 2)
|
||||
*
|
||||
* @param FunctionName - The name of the function
|
||||
* @param PossibleSigs - A vector of possible signatures for pattern scanning
|
||||
* @param SearchString - The search string (narrow character) used to find the address
|
||||
* @param FunctionOffset - Reference to the variable that will store the found function offset
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
* @param SearchBytesBehind - The amount of bytes behind the search string to start scanning
|
||||
*/
|
||||
static void InitFunctionOffset(const char* FunctionName, std::vector<const char*> PossibleSigs, const char* SearchString, uintptr_t& FunctionOffset, int SearchRange = 0x600, int SearchBytesBehind = 0x0);
|
||||
|
||||
/*
|
||||
* @brief Walks a VFT (Virtual Function Table) searching for a specific function
|
||||
*
|
||||
* @param TargetFunctionName - The name of the function to search for
|
||||
* @param VFT - The VFT to walk
|
||||
* @param SearchFunction - The search function used to find the address
|
||||
* @param VFTIndex - Reference to the variable that will store the found VFT index
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
*/
|
||||
static void WalkVFT(const char* TargetFunctionName, void** VFT, const void* TargetFunction, uintptr_t& VFTIndex, const int SearchRange);
|
||||
/*
|
||||
* @brief Walks a VFT (Virtual Function Table) searching for a specific function
|
||||
*
|
||||
* @param TargetFunctionName - The name of the function to search for
|
||||
* @param VFT - The VFT to walk
|
||||
* @param SearchFunction - The search function used to find the address
|
||||
* @param VFTIndex - Reference to the variable that will store the found VFT index
|
||||
* @param SearchRange - The range of bytes to search for the pattern
|
||||
*/
|
||||
static void WalkVFT(const char* TargetFunctionName, void** VFT, void* TargetFunction, uintptr_t& VFTIndex, int SearchRange);
|
||||
|
||||
public:
|
||||
/* Update the GObject offset (for finding UObjects) */
|
||||
static void InitGObjects();
|
||||
/* Update the GObject offset (for finding UObjects) */
|
||||
static void InitGObjects();
|
||||
|
||||
/* Update the AppendString function offset (for converting FNames to strings) */
|
||||
static void InitAppendString();
|
||||
/* Update the AppendString function offset (for converting FNames to strings) */
|
||||
static void InitAppendString();
|
||||
|
||||
/* Update the FNameConstructor function offset (for creating FNames) */
|
||||
static void InitFNameConstructor();
|
||||
/* Update the FNameConstructor function offset (for creating FNames) */
|
||||
static void InitFNameConstructor();
|
||||
|
||||
/* Update the LineTraceSingle function offset (for visible check) */
|
||||
static void InitLineTraceSingle();
|
||||
/* Update the LineTraceSingle function offset (for visible check) */
|
||||
static void InitLineTraceSingle();
|
||||
|
||||
/* Update the CalculateShot function offset (for bullet tp) */
|
||||
static void InitCalculateShot();
|
||||
/* Update the CalculateShot function offset (for bullet tp) */
|
||||
static void InitCalculateShot();
|
||||
|
||||
/* Update the RaycastMulti functino offset (for bullet tp v2) */
|
||||
static void InitRaycastMulti();
|
||||
/* Update the RaycastMulti functino offset (for bullet tp v2) */
|
||||
static void InitRaycastMulti();
|
||||
|
||||
/* Update the Fire function offset (for trigger bot) */
|
||||
static void InitFire();
|
||||
/* Update the Fire function offset (for trigger bot) */
|
||||
static void InitFire();
|
||||
|
||||
/* Update the EditSelectRelease function offset (for edit on release) */
|
||||
static void InitEditSelectRelease();
|
||||
/* Update the EditSelectRelease function offset (for edit on release) */
|
||||
static void InitEditSelectRelease();
|
||||
|
||||
/* Update the CompleteBuildingEditInteraction function offset (for edit on release) */
|
||||
static void InitCompleteBuildingEditInteraction();
|
||||
/* Update the CompleteBuildingEditInteraction function offset (for edit on release) */
|
||||
static void InitCompleteBuildingEditInteraction();
|
||||
|
||||
/* Update the PerformBuildingEditInteraction function offset (for disable pre-edits) */
|
||||
static void InitPerformBuildingEditInteraction();
|
||||
/* Update the PerformBuildingEditInteraction function offset (for disable pre-edits) */
|
||||
static void InitPerformBuildingEditInteraction();
|
||||
|
||||
|
||||
|
||||
/* Update the DrawTransition VFT index (for engine rendering, and on ImGui builds for caching draw data) */
|
||||
static void InitDTIndex();
|
||||
/* Update the DrawTransition VFT index (for engine rendering, and on ImGui builds for caching draw data) */
|
||||
static void InitDTIndex();
|
||||
|
||||
/* Update the PostRender VFT index (for calling UFunctions) */
|
||||
static void InitPEIndex();
|
||||
/* Update the PostRender VFT index (for calling UFunctions) */
|
||||
static void InitPEIndex();
|
||||
|
||||
/* Update the GetPlayerViewpoint VFT index (for SilentAim) */
|
||||
static void InitGPVIndex();
|
||||
/* Update the GetPlayerViewpoint VFT index (for SilentAim) */
|
||||
static void InitGPVIndex();
|
||||
|
||||
/* Update the GetViewpoint VFT index (for SilentAim) */
|
||||
static void InitGVIndex();
|
||||
/* Update the GetViewpoint VFT index (for SilentAim) */
|
||||
static void InitGVIndex();
|
||||
|
||||
/*
|
||||
* @brief Update the GetWeaponStats VFT index (for some weapon exploits)
|
||||
*
|
||||
* @param WeaponObject - The weapon actor to get the VFT index from
|
||||
*/
|
||||
static void InitGetWeaponStatsIndex(const SDK::UObject* WeaponActor);
|
||||
/*
|
||||
* @brief Update the GetWeaponStats VFT index (for some weapon exploits)
|
||||
*
|
||||
* @param WeaponObject - The weapon actor to get the VFT index from
|
||||
*/
|
||||
static void InitGetWeaponStatsIndex(const SDK::UObject* WeaponActor);
|
||||
|
||||
|
||||
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindCastFlagsOffset()
|
||||
{
|
||||
std::vector<std::pair<void*, SDK::EClassCastFlags>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Actor"))), SDK::EClassCastFlags::Actor},
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Class"))), SDK::EClassCastFlags::Field | SDK::EClassCastFlags::Struct | SDK::EClassCastFlags::Class }
|
||||
};
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindDefaultObjectOffset()
|
||||
{
|
||||
std::vector<std::pair<void*, void*>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Object"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Default__Object"))) },
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Field"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Default__Field"))) }
|
||||
};
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindSuperOffset()
|
||||
{
|
||||
std::vector<std::pair<void*, void*>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Struct"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Field"))) },
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Class"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Struct"))) }
|
||||
};
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindCastFlagsOffset() {
|
||||
std::vector<std::pair<void*, SDK::EClassCastFlags>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Actor"))), SDK::EClassCastFlags::Actor},
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Class"))), SDK::EClassCastFlags::Field | SDK::EClassCastFlags::Struct | SDK::EClassCastFlags::Class }
|
||||
};
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindDefaultObjectOffset() {
|
||||
std::vector<std::pair<void*, void*>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Object"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Default__Object"))) },
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Field"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Default__Field"))) }
|
||||
};
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindSuperOffset() {
|
||||
std::vector<std::pair<void*, void*>> infos = {
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Struct"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Field"))) },
|
||||
{ SDK::UObject::FindObjectFast(std::string(skCrypt("Class"))), SDK::UObject::FindObjectFast(std::string(skCrypt("Struct"))) }
|
||||
};
|
||||
|
||||
// Thanks to the ue4 dev who decided UStruct should be spelled Ustruct
|
||||
if (infos[0].first == nullptr)
|
||||
{
|
||||
infos[0].first = infos[1].second = SDK::UObject::FindObjectFast(std::string(skCrypt("struct")));
|
||||
}
|
||||
// Thanks to the ue4 dev who decided UStruct should be spelled Ustruct
|
||||
if (infos[0].first == nullptr) {
|
||||
infos[0].first = infos[1].second = SDK::UObject::FindObjectFast(std::string(skCrypt("struct")));
|
||||
}
|
||||
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindChildPropertiesOffset()
|
||||
{
|
||||
uint8* ObjA = (uint8*)SDK::UObject::FindObjectFast(std::string(skCrypt("Color")));
|
||||
uint8* ObjB = (uint8*)SDK::UObject::FindObjectFast(std::string(skCrypt("Guid")));
|
||||
return Memory::FindOffset(infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindChildPropertiesOffset() {
|
||||
uint8* ObjA = (uint8*)SDK::UObject::FindObjectFast(std::string(skCrypt("Color")));
|
||||
uint8* ObjB = (uint8*)SDK::UObject::FindObjectFast(std::string(skCrypt("Guid")));
|
||||
|
||||
return Memory::GetValidPointerOffset(ObjA, ObjB, SDK::UStruct::SuperOffset + (sizeof(void*) * 2), 0x80);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindFunctionFlagsOffset()
|
||||
{
|
||||
std::vector<std::pair<void*, SDK::EFunctionFlags>> Infos;
|
||||
return Memory::GetValidPointerOffset(ObjA, ObjB, SDK::UStruct::SuperOffset + (sizeof(void*) * 2), 0x80);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindFunctionFlagsOffset() {
|
||||
std::vector<std::pair<void*, SDK::EFunctionFlags>> Infos;
|
||||
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("WasInputKeyJustPressed"))), SDK::EFunctionFlags::Final | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public | SDK::EFunctionFlags::BlueprintCallable | SDK::EFunctionFlags::BlueprintPure | SDK::EFunctionFlags::Const });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("ToggleSpeaking"))), SDK::EFunctionFlags::Exec | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("SwitchLevel"))), SDK::EFunctionFlags::Exec | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("WasInputKeyJustPressed"))), SDK::EFunctionFlags::Final | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public | SDK::EFunctionFlags::BlueprintCallable | SDK::EFunctionFlags::BlueprintPure | SDK::EFunctionFlags::Const });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("ToggleSpeaking"))), SDK::EFunctionFlags::Exec | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("SwitchLevel"))), SDK::EFunctionFlags::Exec | SDK::EFunctionFlags::Native | SDK::EFunctionFlags::Public });
|
||||
|
||||
int32 Ret = Memory::FindOffset(Infos);
|
||||
int32 Ret = Memory::FindOffset(Infos);
|
||||
|
||||
if (Ret == 0x28)
|
||||
{
|
||||
for (auto& [_, Flags] : Infos)
|
||||
Flags = Flags | SDK::EFunctionFlags::RequiredAPI;
|
||||
}
|
||||
if (Ret == 0x28)
|
||||
{
|
||||
for (auto& [_, Flags] : Infos)
|
||||
Flags = Flags | SDK::EFunctionFlags::RequiredAPI;
|
||||
}
|
||||
|
||||
return Memory::FindOffset(Infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindChildrenOffset()
|
||||
{
|
||||
std::vector<std::pair<void*, void*>> Infos;
|
||||
return Memory::FindOffset(Infos);
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindChildrenOffset() {
|
||||
std::vector<std::pair<void*, void*>> Infos;
|
||||
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("PlayerController"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("WasInputKeyJustReleased")), std::string(skCrypt("PlayerController"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Controller"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("UnPossess")), std::string(skCrypt("Controller"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("PlayerController"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("WasInputKeyJustReleased")), std::string(skCrypt("PlayerController"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Controller"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("UnPossess")), std::string(skCrypt("Controller"))) });
|
||||
|
||||
uint32 Ret = Memory::FindOffset(Infos);
|
||||
uint32 Ret = Memory::FindOffset(Infos);
|
||||
|
||||
if (Ret == 0x28)
|
||||
{
|
||||
Infos.clear();
|
||||
if (Ret == 0x28)
|
||||
{
|
||||
Infos.clear();
|
||||
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector4"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector4"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector2D"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector2D"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Guid"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("A")), std::string(skCrypt("Guid"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector4"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector4"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Vector2D"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("X")), std::string(skCrypt("Vector2D"))) });
|
||||
Infos.push_back({ SDK::UObject::FindObjectFast(std::string(skCrypt("Guid"))), SDK::UObject::FindObjectFastInOuter(std::string(skCrypt("A")), std::string(skCrypt("Guid"))) });
|
||||
|
||||
return Memory::FindOffset(Infos);
|
||||
}
|
||||
return Memory::FindOffset(Infos);
|
||||
}
|
||||
|
||||
return Ret;
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindUFieldNextOffset()
|
||||
{
|
||||
uint8_t* KismetSystemLibraryChild = reinterpret_cast<uint8_t*>(SDK::UObject::FindObjectFast<SDK::UStruct>(std::string(skCrypt("KismetSystemLibrary")))->Children());
|
||||
uint8_t* KismetStringLibraryChild = reinterpret_cast<uint8_t*>(SDK::UObject::FindObjectFast<SDK::UStruct>(std::string(skCrypt("KismetStringLibrary")))->Children());
|
||||
return Ret;
|
||||
}
|
||||
// CREDITS TO: Dumper-7
|
||||
static uint32 FindUFieldNextOffset() {
|
||||
uint8_t* KismetSystemLibraryChild = reinterpret_cast<uint8_t*>(SDK::UObject::FindObjectFast<SDK::UStruct>(std::string(skCrypt("KismetSystemLibrary")))->Children());
|
||||
uint8_t* KismetStringLibraryChild = reinterpret_cast<uint8_t*>(SDK::UObject::FindObjectFast<SDK::UStruct>(std::string(skCrypt("KismetStringLibrary")))->Children());
|
||||
|
||||
return Memory::GetValidPointerOffset(KismetSystemLibraryChild, KismetStringLibraryChild, 0x20 + 0x08, 0x48);
|
||||
}
|
||||
return Memory::GetValidPointerOffset(KismetSystemLibraryChild, KismetStringLibraryChild, 0x20 + 0x08, 0x48);
|
||||
}
|
||||
};
|
||||
@@ -11,7 +11,7 @@
|
||||
/*
|
||||
* Enable USING_SEH (recommended)
|
||||
* Disable LOAD_D3DCOMPILER_47 (recommended)
|
||||
*
|
||||
*
|
||||
* Properties -> C/C++ -> Code Generation -> Enable C++ Exceptions -> Yes (/EHsc) (recommended)
|
||||
* Properties -> C/C++ -> Code Generation -> Security Check -> Enable Security Check (/GS) (recommended)
|
||||
* Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded (/MT) (recommended)
|
||||
@@ -25,7 +25,7 @@
|
||||
* Disable INIT_THREAD (recommended)
|
||||
* Disable UNLOAD_THREAD (REQUIRED)
|
||||
* Enable LOAD_D3DCOMPILER_47 (REQUIRED if you don't map dependencies)
|
||||
*
|
||||
*
|
||||
* Properties -> C/C++ -> Code Generation -> Enable C++ Exceptions -> No (REQUIRED)
|
||||
* Properties -> C/C++ -> Code Generation -> Security Check -> Disable Security Check (/GS-) (REQUIRED)
|
||||
* Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded (/MT) (REQUIRED unless your injector handles and maps ApiSet dependencies)
|
||||
@@ -48,13 +48,13 @@
|
||||
|
||||
// Level of DEBUG_LOG to display
|
||||
#ifdef _DEBUG
|
||||
#define LOG_LEVEL LOG_ALL
|
||||
#define LOG_LEVEL LOG_ALL
|
||||
#else
|
||||
#define LOG_LEVEL LOG_ALL// No logs in release mode by default
|
||||
#define LOG_LEVEL LOG_NONE// No logs in release mode by default
|
||||
#endif // _DEBUG
|
||||
|
||||
// Only enable this if you are sure your injector supports SEH
|
||||
#define USING_SEH FALSE // Enables the use of SEH (Structured Exception Handler) for verifying if a pointer is valid
|
||||
#define USING_SEH TRUE // Enables the use of SEH (Structured Exception Handler) for verifying if a pointer is valid
|
||||
#define SEASON_20_PLUS FALSE // REQUIRED ON SEASON 20 AND FORWARD! Enables the use of doubles instead of floats on structures like FVector, FRotator etc. Changes a few other structures too
|
||||
|
||||
#define NAME_DUMP FALSE // Dumps all FNames to the log
|
||||
@@ -72,6 +72,6 @@ inline HMODULE CurrentModule = nullptr;// The current module handle
|
||||
|
||||
|
||||
// Compile-Time Asserts
|
||||
static_assert(LOG_LEVEL < LOG_LEVEL_MAX&& LOG_LEVEL >= LOG_NONE, "Invalid log level");
|
||||
static_assert(LOG_LEVEL < LOG_LEVEL_MAX && LOG_LEVEL >= LOG_NONE, "Invalid log level");
|
||||
|
||||
//static_assert(false, "Please read Globals.h and set the right configuration for you. If you are manual mapping, there are REQUIRED settings. DOUBLE CLICK ME AND REMOVE ME!");
|
||||
static_assert(false, "Please read Globals.h and set the right configuration for you. If you are manual mapping, there are REQUIRED settings. DOUBLE CLICK ME AND REMOVE ME!");
|
||||
@@ -5,76 +5,66 @@
|
||||
|
||||
#include "../../Drawing/Drawing.h"
|
||||
|
||||
#include "../../Utilities/Error.h"
|
||||
#include "../../Utilities/Logger.h"
|
||||
#include "../../Utilities/Math.h"
|
||||
#include "../../Utilities/Error.h"
|
||||
#include "../../Utilities/RaaxAssert.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
void Hooks::DrawTransition::DrawTransition(uintptr_t this_, uintptr_t Canvas)
|
||||
{
|
||||
void Hooks::DrawTransition::DrawTransition(uintptr_t this_, uintptr_t Canvas) {
|
||||
#ifdef _IMGUI
|
||||
if (Hooks::Present::Mutex.ShouldReturn())
|
||||
{
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
}
|
||||
if (Hooks::Present::Mutex.ShouldReturn()) {
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
}
|
||||
|
||||
ReturnLock Lock(&Hooks::Present::Mutex);
|
||||
ReturnLock Lock(&Hooks::Present::Mutex);
|
||||
#endif
|
||||
|
||||
if (Canvas == 0x0)
|
||||
{
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
}
|
||||
if (Canvas == 0x0) {
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
}
|
||||
|
||||
DEBUG_LOG(LOG_INFO, "-----------------------");
|
||||
DEBUG_LOG(LOG_INFO, SDK::GetEngine()->GetFullName());
|
||||
DEBUG_LOG(LOG_INFO, SDK::UEngine::GetDefaultObj()->GetFullName());
|
||||
DEBUG_LOG(LOG_INFO, SDK::UEngine::StaticClass()->GetFullName());
|
||||
DEBUG_LOG(LOG_INFO, "-----------------------");
|
||||
Game::CurrentFrame++;
|
||||
Game::CurrentTime = std::chrono::steady_clock::now();
|
||||
|
||||
Game::CurrentFrame++;
|
||||
Game::CurrentTime = std::chrono::steady_clock::now();
|
||||
Game::CurrentCanvas = Canvas;
|
||||
Game::ScreenWidth = reinterpret_cast<SDK::UCanvas*>(Canvas)->SizeX();
|
||||
Game::ScreenHeight = reinterpret_cast<SDK::UCanvas*>(Canvas)->SizeY();
|
||||
|
||||
Game::CurrentCanvas = Canvas;
|
||||
Game::ScreenWidth = reinterpret_cast<SDK::UCanvas*>(Canvas)->SizeX();
|
||||
Game::ScreenHeight = reinterpret_cast<SDK::UCanvas*>(Canvas)->SizeY();
|
||||
Game::ScreenCenterX = Game::ScreenWidth / 2.f;
|
||||
Game::ScreenCenterY = Game::ScreenHeight / 2.f;
|
||||
|
||||
Game::ScreenCenterX = Game::ScreenWidth / 2.f;
|
||||
Game::ScreenCenterY = Game::ScreenHeight / 2.f;
|
||||
// Clamp the FOV to fix target issues on extreme FOV's. This does make it inaccurate on FOV's above 120, but this doesn't really matter
|
||||
Game::PixelsPerDegree = Game::ScreenWidth / Math::RadiansToDegrees((2 * tan(0.5f * Math::DegreesToRadians(std::clamp(Actors::MainCamera.FOV, 0.f, 120.f)))));
|
||||
|
||||
// Clamp the FOV to fix target issues on extreme FOV's. This does make it inaccurate on FOV's above 120, but this doesn't really matter
|
||||
Game::PixelsPerDegree = Game::ScreenWidth / Math::RadiansToDegrees((2 * tan(0.5f * Math::DegreesToRadians(std::clamp(Actors::MainCamera.FOV, 0.f, 120.f)))));
|
||||
Hooks::Tick();
|
||||
|
||||
Hooks::Tick();
|
||||
Actors::Tick();
|
||||
Actors::UpdateCaches();
|
||||
|
||||
Actors::Tick();
|
||||
Actors::UpdateCaches();
|
||||
Features::Tick();
|
||||
|
||||
Features::Tick();
|
||||
|
||||
Game::DrawCallback();
|
||||
Game::DrawCallback();
|
||||
|
||||
#ifdef _IMGUI
|
||||
Drawing::SwapBuffers();
|
||||
Drawing::SwapBuffers();
|
||||
|
||||
if (RaaxDx::Initalized == false)
|
||||
{
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("Initiating DirectX hooks")));
|
||||
if (RaaxDx::Initalized == false) {
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("Initiating DirectX hooks")));
|
||||
|
||||
RaaxDx::Status InitStatus = RaaxDx::Init();
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("RaaxDx Init Status: ")) + std::to_string((int)InitStatus));
|
||||
RaaxAssert(InitStatus == RaaxDx::Status::Success, skCrypt("Failed to initiate DirectX hooks! ").decrypt() + std::to_string((int)InitStatus));
|
||||
RaaxDx::Status InitStatus = RaaxDx::Init();
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("RaaxDx Init Status: ")) + std::to_string((int)InitStatus));
|
||||
RaaxAssert(InitStatus == RaaxDx::Status::Success, skCrypt("Failed to initiate DirectX hooks! ").decrypt() + std::to_string((int)InitStatus));
|
||||
|
||||
RaaxDx::Status HookStatus = RaaxDx::Hook();
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("RaaxDx Hook Status: ")) + std::to_string((int)HookStatus));
|
||||
RaaxAssert(HookStatus == RaaxDx::Status::Success, skCrypt("Failed to create DirectX hooks! ").decrypt() + std::to_string((int)HookStatus));
|
||||
}
|
||||
RaaxDx::Status HookStatus = RaaxDx::Hook();
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("RaaxDx Hook Status: ")) + std::to_string((int)HookStatus));
|
||||
RaaxAssert(HookStatus == RaaxDx::Status::Success, skCrypt("Failed to create DirectX hooks! ").decrypt() + std::to_string((int)HookStatus));
|
||||
}
|
||||
#else
|
||||
Game::MenuCallback();
|
||||
Game::MenuCallback();
|
||||
#endif
|
||||
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
//return spoof_call<void>(PostRenderOriginal, this_, Canvas);
|
||||
return DrawTransitionOriginal(this_, Canvas);
|
||||
//return spoof_call<void>(PostRenderOriginal, this_, Canvas);
|
||||
}
|
||||
@@ -7,40 +7,37 @@
|
||||
#include "../../Utilities/Font.h"
|
||||
#include "../../Utilities/Logger.h"
|
||||
|
||||
HRESULT __stdcall Hooks::Present::Present(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
|
||||
{
|
||||
if (Mutex.ShouldReturn() || Hooks::WndProc::Mutex.ShouldReturn())
|
||||
{
|
||||
return PresentOriginal(pSwapChain, SyncInterval, Flags);
|
||||
}
|
||||
HRESULT __stdcall Hooks::Present::Present(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags) {
|
||||
if (Mutex.ShouldReturn() || Hooks::WndProc::Mutex.ShouldReturn()) {
|
||||
return PresentOriginal(pSwapChain, SyncInterval, Flags);
|
||||
}
|
||||
|
||||
// Lock mutex (will unlock when function scope ends)
|
||||
ReturnLock Lock(&Mutex);
|
||||
ReturnLock Lock2(&Hooks::WndProc::Mutex);
|
||||
// Lock mutex (will unlock when function returns)
|
||||
ReturnLock Lock(&Mutex);
|
||||
ReturnLock Lock2(&Hooks::WndProc::Mutex);
|
||||
|
||||
if (ImGuiBeenSetup == false)
|
||||
{
|
||||
RaaxDx::InitImGui(pSwapChain);
|
||||
if (ImGuiBeenSetup == false) {
|
||||
RaaxDx::InitImGui(pSwapChain);
|
||||
|
||||
Font = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(&RawFontData, sizeof(RawFontData), 16.f);
|
||||
LargeFont = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(&RawFontData, sizeof(RawFontData), 48.0f);
|
||||
Font = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(&RawFontData, sizeof(RawFontData), 16.f);
|
||||
LargeFont = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(&RawFontData, sizeof(RawFontData), 48.0f);
|
||||
|
||||
ImGuiBeenSetup = true;
|
||||
}
|
||||
ImGuiBeenSetup = true;
|
||||
}
|
||||
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
Drawing::RenderDrawingData();
|
||||
Game::MenuCallback();
|
||||
Drawing::RenderDrawingData();
|
||||
Game::MenuCallback();
|
||||
|
||||
ImGui::EndFrame();
|
||||
ImGui::EndFrame();
|
||||
|
||||
ImGui::Render();
|
||||
ImGui::Render();
|
||||
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(1, &RaaxDx::RenderTargetView, NULL);
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(1, &RaaxDx::RenderTargetView, NULL);
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
return PresentOriginal(pSwapChain, SyncInterval, Flags);
|
||||
return PresentOriginal(pSwapChain, SyncInterval, Flags);
|
||||
}
|
||||
@@ -1,38 +1,36 @@
|
||||
#include "../Hooks.h"
|
||||
|
||||
#include "../../Configs/Config.h"
|
||||
#include "../../Game/Game.h"
|
||||
#include "../../Configs/Config.h"
|
||||
#include "../../Utilities/Logger.h"
|
||||
|
||||
HRESULT __stdcall Hooks::ResizeBuffers::ResizeBuffers(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags)
|
||||
{
|
||||
if (RaaxDx::RenderTargetView)
|
||||
{
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(0, 0, 0);
|
||||
RaaxDx::RenderTargetView->Release();
|
||||
}
|
||||
HRESULT __stdcall Hooks::ResizeBuffers::ResizeBuffers(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags) {
|
||||
if (RaaxDx::RenderTargetView) {
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(0, 0, 0);
|
||||
RaaxDx::RenderTargetView->Release();
|
||||
}
|
||||
|
||||
HRESULT hr = ResizeBuffersOriginal(pThis, BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
HRESULT hr = ResizeBuffersOriginal(pThis, BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
|
||||
ID3D11Texture2D* pBuffer;
|
||||
pThis->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&pBuffer);
|
||||
// Perform error handling here!
|
||||
ID3D11Texture2D* pBuffer;
|
||||
pThis->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&pBuffer);
|
||||
// Perform error handling here!
|
||||
|
||||
RaaxDx::Device->CreateRenderTargetView(pBuffer, NULL, &RaaxDx::RenderTargetView);
|
||||
// Perform error handling here!
|
||||
pBuffer->Release();
|
||||
RaaxDx::Device->CreateRenderTargetView(pBuffer, NULL, &RaaxDx::RenderTargetView);
|
||||
// Perform error handling here!
|
||||
pBuffer->Release();
|
||||
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(1, &RaaxDx::RenderTargetView, NULL);
|
||||
RaaxDx::DeviceContext->OMSetRenderTargets(1, &RaaxDx::RenderTargetView, NULL);
|
||||
|
||||
// Set up the viewport.
|
||||
D3D11_VIEWPORT vp;
|
||||
vp.Width = Width;
|
||||
vp.Height = Height;
|
||||
vp.MinDepth = 0.0f;
|
||||
vp.MaxDepth = 1.0f;
|
||||
vp.TopLeftX = 0;
|
||||
vp.TopLeftY = 0;
|
||||
RaaxDx::DeviceContext->RSSetViewports(1, &vp);
|
||||
// Set up the viewport.
|
||||
D3D11_VIEWPORT vp;
|
||||
vp.Width = Width;
|
||||
vp.Height = Height;
|
||||
vp.MinDepth = 0.0f;
|
||||
vp.MaxDepth = 1.0f;
|
||||
vp.TopLeftX = 0;
|
||||
vp.TopLeftY = 0;
|
||||
RaaxDx::DeviceContext->RSSetViewports(1, &vp);
|
||||
|
||||
return hr;
|
||||
return hr;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "../Hooks.h"
|
||||
|
||||
bool Hooks::ShouldReplicateFunction::ShouldReplicateFunction(void* this_, SDK::AActor* Actor, void* Function) {
|
||||
//We return true in order to bypass the Games check of whether or not this Function should be proccesed by the server.
|
||||
//We hook this in order to call Functions normally not handled by the server with Invalid Paramaters in order to crash Server-Sided
|
||||
//Only hooked when the Server Crash button is pressed meaning it's safe to always return true
|
||||
return true;
|
||||
}
|
||||
@@ -4,25 +4,19 @@
|
||||
#include "../../Game/Game.h"
|
||||
#include "../../Utilities/Logger.h"
|
||||
|
||||
#include "../../Drawing/Drawing.h"
|
||||
#include "../../Utilities/RaaxAssert.h"
|
||||
|
||||
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
LRESULT __stdcall Hooks::WndProc::WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (Hooks::Present::ImGuiBeenSetup && Hooks::WndProc::Mutex.ShouldReturn() == false)
|
||||
{
|
||||
ReturnLock Lock(&Hooks::WndProc::Mutex);
|
||||
LRESULT __stdcall Hooks::WndProc::WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
if (Hooks::Present::ImGuiBeenSetup && Hooks::WndProc::Mutex.ShouldReturn() == false) {
|
||||
ReturnLock Lock(&Hooks::WndProc::Mutex);
|
||||
|
||||
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
|
||||
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
|
||||
|
||||
// If the menu is open, we don't want to send input to the game
|
||||
if (Game::MenuOpen)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If the menu is open, we don't want to send input to the game
|
||||
if (Game::MenuOpen) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return LI_FN(CallWindowProcA).safe_cached()(WndProcOriginal, hWnd, uMsg, wParam, lParam);
|
||||
return LI_FN(CallWindowProcA).safe_cached()(WndProcOriginal, hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
+93
-105
@@ -17,155 +17,143 @@
|
||||
|
||||
#include "../Utilities/ReturnMutex.h"
|
||||
|
||||
namespace Hooks
|
||||
{
|
||||
// Virtual Function Table Hook
|
||||
namespace Hooks {
|
||||
// Virtual Function Table Hook
|
||||
|
||||
class VFTHook
|
||||
{
|
||||
private:
|
||||
void** VFT; // The virtual function table
|
||||
uintptr_t VFTIndex; // The index of the virtual function
|
||||
void* Original; // The original function
|
||||
public:
|
||||
/*
|
||||
* @brief Hook a virtual function
|
||||
*
|
||||
* @param VFT The virtual function table
|
||||
* @param VFTIndex The index of the virtual function
|
||||
* @param Original The original function
|
||||
* @param Hook The hook function
|
||||
*/
|
||||
template <typename T>
|
||||
VFTHook(void** VFT, const uintptr_t VFTIndex, T& Original, void* Hook);
|
||||
class VFTHook {
|
||||
private:
|
||||
void** VFT; // The virtual function table
|
||||
uintptr_t VFTIndex; // The index of the virtual function
|
||||
void* Original; // The original function
|
||||
public:
|
||||
/*
|
||||
* @brief Hook a virtual function
|
||||
*
|
||||
* @param VFT The virtual function table
|
||||
* @param VFTIndex The index of the virtual function
|
||||
* @param Original The original function
|
||||
* @param Hook The hook function
|
||||
*/
|
||||
template <typename T>
|
||||
VFTHook(void** VFT, const uintptr_t VFTIndex, T& Original, void* Hook);
|
||||
|
||||
/*
|
||||
* @brief Revert the VFT hook back to the original function
|
||||
*/
|
||||
~VFTHook();
|
||||
};
|
||||
/*
|
||||
* @brief Revert the VFT hook back to the original function
|
||||
*/
|
||||
~VFTHook();
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Hooks
|
||||
// Hooks
|
||||
|
||||
#ifdef _IMGUI
|
||||
namespace Present
|
||||
{
|
||||
typedef HRESULT(__stdcall* oPresent) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
||||
inline oPresent PresentOriginal = nullptr;
|
||||
namespace Present {
|
||||
typedef HRESULT(__stdcall* oPresent) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
||||
inline oPresent PresentOriginal = nullptr;
|
||||
|
||||
HRESULT __stdcall Present(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
||||
HRESULT __stdcall Present(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
||||
|
||||
inline bool ImGuiBeenSetup = false;
|
||||
inline bool ImGuiBeenSetup = false;
|
||||
|
||||
inline ReturnMutex Mutex;
|
||||
inline ReturnMutex Mutex;
|
||||
|
||||
inline ImFont* Font;
|
||||
inline ImFont* LargeFont;
|
||||
}
|
||||
inline ImFont* Font;
|
||||
inline ImFont* LargeFont;
|
||||
}
|
||||
|
||||
namespace ResizeBuffers
|
||||
{
|
||||
using ResizeBuffersParams = HRESULT(*)(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);
|
||||
inline ResizeBuffersParams ResizeBuffersOriginal = nullptr;
|
||||
namespace ResizeBuffers {
|
||||
using ResizeBuffersParams = HRESULT(*)(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);
|
||||
inline ResizeBuffersParams ResizeBuffersOriginal = nullptr;
|
||||
|
||||
inline bool Resized = false;
|
||||
inline bool Resized = false;
|
||||
|
||||
HRESULT __stdcall ResizeBuffers(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);
|
||||
}
|
||||
HRESULT __stdcall ResizeBuffers(IDXGISwapChain* pThis, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);
|
||||
}
|
||||
|
||||
namespace WndProc
|
||||
{
|
||||
using WndProcParams = LRESULT(*)(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
inline WndProcParams WndProcOriginal = nullptr;
|
||||
namespace WndProc {
|
||||
using WndProcParams = LRESULT(*)(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
inline WndProcParams WndProcOriginal = nullptr;
|
||||
|
||||
inline ReturnMutex Mutex;
|
||||
inline ReturnMutex Mutex;
|
||||
|
||||
inline HWND Window;
|
||||
inline HWND Window;
|
||||
|
||||
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
}
|
||||
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
}
|
||||
#endif // _IMGUI
|
||||
|
||||
namespace DrawTransition
|
||||
{
|
||||
using DrawTransitionParams = void(*)(uintptr_t this_, uintptr_t Canvas);
|
||||
inline DrawTransitionParams DrawTransitionOriginal = nullptr;
|
||||
namespace DrawTransition {
|
||||
using DrawTransitionParams = void(*)(uintptr_t this_, uintptr_t Canvas);
|
||||
inline DrawTransitionParams DrawTransitionOriginal = nullptr;
|
||||
|
||||
void DrawTransition(uintptr_t this_, uintptr_t Canvas);
|
||||
void DrawTransition(uintptr_t this_, uintptr_t Canvas);
|
||||
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
|
||||
namespace CalculateShot
|
||||
{
|
||||
using CalcShotParams = SDK::FTransform* (*)(void**, uintptr_t, uintptr_t);
|
||||
inline CalcShotParams CalculateShotOriginal = nullptr;
|
||||
namespace CalculateShot {
|
||||
using CalcShotParams = SDK::FTransform* (*)(void**, uintptr_t, uintptr_t);
|
||||
inline CalcShotParams CalculateShotOriginal = nullptr;
|
||||
|
||||
SDK::FTransform* CalculateShot(void** arg0, uintptr_t arg1, uintptr_t arg2);
|
||||
SDK::FTransform* CalculateShot(void** arg0, uintptr_t arg1, uintptr_t arg2);
|
||||
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
|
||||
namespace RaycastMulti
|
||||
{
|
||||
using RaycastMultiParams = bool(*)(const SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::FVector Start, const SDK::FVector End, SDK::ECollisionChannel TraceChannel, const struct FCollisionQueryParams& Params, const struct FCollisionResponseParams& ResponseParams, const struct FCollisionObjectQueryParams& ObjectParams);
|
||||
inline RaycastMultiParams RaycastMultiOriginal = nullptr;
|
||||
namespace RaycastMulti {
|
||||
using RaycastMultiParams = bool(*)(const SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::FVector Start, const SDK::FVector End, SDK::ECollisionChannel TraceChannel, const struct FCollisionQueryParams& Params, const struct FCollisionResponseParams& ResponseParams, const struct FCollisionObjectQueryParams& ObjectParams);
|
||||
inline RaycastMultiParams RaycastMultiOriginal = nullptr;
|
||||
|
||||
bool RaycastMulti(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::FVector Start, const SDK::FVector End, SDK::ECollisionChannel TraceChannel, const struct FCollisionQueryParams& Params, const struct FCollisionResponseParams& ResponseParams, const struct FCollisionObjectQueryParams& ObjectParams);
|
||||
bool RaycastMulti(SDK::UWorld* World, SDK::TArray<SDK::FHitResult>& OutHits, const SDK::FVector Start, const SDK::FVector End, SDK::ECollisionChannel TraceChannel, const struct FCollisionQueryParams& Params, const struct FCollisionResponseParams& ResponseParams, const struct FCollisionObjectQueryParams& ObjectParams);
|
||||
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
|
||||
namespace GetPlayerViewpoint
|
||||
{
|
||||
using GetPlayerViewpointParams = void(*)(void* this_, SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
inline GetPlayerViewpointParams GetPlayerViewpointOriginal = nullptr;
|
||||
namespace GetPlayerViewpoint {
|
||||
using GetPlayerViewpointParams = void(*)(void* this_, SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
inline GetPlayerViewpointParams GetPlayerViewpointOriginal = nullptr;
|
||||
|
||||
void GetPlayerViewpoint(void* this_, SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
void GetPlayerViewpoint(void* this_, SDK::FVector* Location, SDK::FRotator* Rotation);
|
||||
|
||||
inline void* PlayerControllerHooked = nullptr;
|
||||
inline void* PlayerControllerHooked = nullptr;
|
||||
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
|
||||
namespace GetViewpoint
|
||||
{
|
||||
using GetViewpointParams = void(*)(void* this_, SDK::FMinimalViewInfo* OutViewInfo, SDK::EStereoscopicPass StereoPass);
|
||||
inline GetViewpointParams GetViewpointOriginal = nullptr;
|
||||
namespace GetViewpoint {
|
||||
using GetViewpointParams = void(*)(void* this_, SDK::FMinimalViewInfo* OutViewInfo, SDK::EStereoscopicPass StereoPass);
|
||||
inline GetViewpointParams GetViewpointOriginal = nullptr;
|
||||
|
||||
void GetViewpoint(void* this_, SDK::FMinimalViewInfo* OutViewInfo, SDK::EStereoscopicPass StereoPass);
|
||||
void GetViewpoint(void* this_, SDK::FMinimalViewInfo* OutViewInfo, SDK::EStereoscopicPass StereoPass);
|
||||
|
||||
inline void* LocalPlayerHooked = nullptr;
|
||||
inline void* LocalPlayerHooked = nullptr;
|
||||
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
inline Hooks::VFTHook* Hook = nullptr;
|
||||
}
|
||||
|
||||
namespace EditSelectRelease
|
||||
{
|
||||
using EditSelectReleaseParams = void(*)(void* this_);
|
||||
inline EditSelectReleaseParams EditSelectReleaseOriginal = nullptr;
|
||||
namespace EditSelectRelease {
|
||||
using EditSelectReleaseParams = void(*)(void* this_);
|
||||
inline EditSelectReleaseParams EditSelectReleaseOriginal = nullptr;
|
||||
|
||||
void EditSelectRelease(void* this_);
|
||||
void EditSelectRelease(void* this_);
|
||||
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
|
||||
namespace PerformBuildingEditInteraction
|
||||
{
|
||||
using PerformBuildingEditInteractionParams = void(*)(void* this_);
|
||||
inline PerformBuildingEditInteractionParams PerformBuildingEditInteractionOriginal = nullptr;
|
||||
namespace PerformBuildingEditInteraction {
|
||||
using PerformBuildingEditInteractionParams = void(*)(void* this_);
|
||||
inline PerformBuildingEditInteractionParams PerformBuildingEditInteractionOriginal = nullptr;
|
||||
|
||||
void PerformBuildingEditInteraction(void* this_);
|
||||
void PerformBuildingEditInteraction(void* this_);
|
||||
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
inline bool Hooked = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
// Functions
|
||||
|
||||
void Init();
|
||||
void Tick();
|
||||
void Init();
|
||||
void Tick();
|
||||
}
|
||||
@@ -10,211 +10,184 @@
|
||||
#include "../../External-Libs/minhook/include/MinHook.h"
|
||||
|
||||
// DX11
|
||||
#include "../../Globals.h"
|
||||
#include "../../Utilities/Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <dxgi.h>
|
||||
#include <d3d11.h>
|
||||
#include "../../Utilities/Logger.h"
|
||||
#include "../../Globals.h"
|
||||
|
||||
// DX12
|
||||
//#include <dxgi.h>
|
||||
//#include <d3d12.h>
|
||||
|
||||
RaaxDx::Status RaaxDx::Init()
|
||||
{
|
||||
if (Initalized)
|
||||
{
|
||||
return Status::AlreadyInitialized;
|
||||
}
|
||||
RaaxDx::Status RaaxDx::Init() {
|
||||
if (Initalized) {
|
||||
return Status::AlreadyInitialized;
|
||||
}
|
||||
|
||||
Initalized = true;
|
||||
Initalized = true;
|
||||
|
||||
// Detect DX Version
|
||||
HMODULE DXModule = NULL;
|
||||
// Detect DX Version
|
||||
HMODULE DXModule = NULL;
|
||||
|
||||
if (DXModule = LI_FN(GetModuleHandleA).safe()(skCrypt("d3d11.dll")); DXModule != NULL)
|
||||
{
|
||||
DXVersion = 11;
|
||||
}
|
||||
else if (DXModule = LI_FN(GetModuleHandleA).safe()(skCrypt("d3d12.dll")); DXModule != NULL)
|
||||
{
|
||||
DXVersion = 12;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Status::DxNotFound;
|
||||
}
|
||||
if (DXModule = LI_FN(GetModuleHandleA).safe()(skCrypt("d3d11.dll")); DXModule != NULL) {
|
||||
DXVersion = 11;
|
||||
}
|
||||
else if (DXModule = LI_FN(GetModuleHandleA).safe()(skCrypt("d3d12.dll")); DXModule != NULL) {
|
||||
DXVersion = 12;
|
||||
}
|
||||
else {
|
||||
return Status::DxNotFound;
|
||||
}
|
||||
|
||||
if (DXVersion == 11)
|
||||
{
|
||||
void* D3D11CreateDeviceAndSwapChain = LI_FN(GetProcAddress).safe()(DXModule, skCrypt("D3D11CreateDeviceAndSwapChain"));
|
||||
if (SDK::IsValidPointer(D3D11CreateDeviceAndSwapChain) == false)
|
||||
{
|
||||
return Status::DxFunctionNotFound;
|
||||
}
|
||||
if (DXVersion == 11) {
|
||||
void* D3D11CreateDeviceAndSwapChain = LI_FN(GetProcAddress).safe()(DXModule, skCrypt("D3D11CreateDeviceAndSwapChain"));
|
||||
if (SDK::IsValidPointer(D3D11CreateDeviceAndSwapChain) == false) {
|
||||
return Status::DxFunctionNotFound;
|
||||
}
|
||||
|
||||
// Create D3D11 Device and SwapChain
|
||||
D3D_FEATURE_LEVEL FeatureLevel = D3D_FEATURE_LEVEL_11_0;
|
||||
const D3D_FEATURE_LEVEL FeatureLevels[] = { D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_11_1 };
|
||||
// Create D3D11 Device and SwapChain
|
||||
D3D_FEATURE_LEVEL FeatureLevel = D3D_FEATURE_LEVEL_11_0;
|
||||
const D3D_FEATURE_LEVEL FeatureLevels[] = { D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_11_1 };
|
||||
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
ZeroMemory(&RefreshRate, sizeof(DXGI_RATIONAL));
|
||||
RefreshRate.Numerator = 60;
|
||||
RefreshRate.Denominator = 1;
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
ZeroMemory(&RefreshRate, sizeof(DXGI_RATIONAL));
|
||||
RefreshRate.Numerator = 60;
|
||||
RefreshRate.Denominator = 1;
|
||||
|
||||
DXGI_MODE_DESC BufferDesc;
|
||||
ZeroMemory(&BufferDesc, sizeof(DXGI_MODE_DESC));
|
||||
BufferDesc.Width = 100;
|
||||
BufferDesc.Height = 100;
|
||||
BufferDesc.RefreshRate = RefreshRate;
|
||||
BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
|
||||
BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
|
||||
DXGI_MODE_DESC BufferDesc;
|
||||
ZeroMemory(&BufferDesc, sizeof(DXGI_MODE_DESC));
|
||||
BufferDesc.Width = 100;
|
||||
BufferDesc.Height = 100;
|
||||
BufferDesc.RefreshRate = RefreshRate;
|
||||
BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
|
||||
BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
|
||||
|
||||
DXGI_SAMPLE_DESC SampleDesc;
|
||||
ZeroMemory(&SampleDesc, sizeof(DXGI_SAMPLE_DESC));
|
||||
SampleDesc.Count = 1;
|
||||
SampleDesc.Quality = 0;
|
||||
DXGI_SAMPLE_DESC SampleDesc;
|
||||
ZeroMemory(&SampleDesc, sizeof(DXGI_SAMPLE_DESC));
|
||||
SampleDesc.Count = 1;
|
||||
SampleDesc.Quality = 0;
|
||||
|
||||
DXGI_SWAP_CHAIN_DESC SwapChainDesc;
|
||||
ZeroMemory(&SwapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC));
|
||||
SwapChainDesc.BufferDesc = BufferDesc;
|
||||
SwapChainDesc.SampleDesc = SampleDesc;
|
||||
SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
SwapChainDesc.BufferCount = 1;
|
||||
SwapChainDesc.OutputWindow = GetForegroundWindow();
|
||||
SwapChainDesc.Windowed = 1;
|
||||
SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
|
||||
DXGI_SWAP_CHAIN_DESC SwapChainDesc;
|
||||
ZeroMemory(&SwapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC));
|
||||
SwapChainDesc.BufferDesc = BufferDesc;
|
||||
SwapChainDesc.SampleDesc = SampleDesc;
|
||||
SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
SwapChainDesc.BufferCount = 1;
|
||||
SwapChainDesc.OutputWindow = GetForegroundWindow();
|
||||
SwapChainDesc.Windowed = 1;
|
||||
SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
|
||||
|
||||
ID3D11Device* Device = nullptr;
|
||||
ID3D11DeviceContext* DeviceContext = nullptr;
|
||||
IDXGISwapChain* SwapChain = nullptr;
|
||||
ID3D11Device* Device = nullptr;
|
||||
ID3D11DeviceContext* DeviceContext = nullptr;
|
||||
IDXGISwapChain* SwapChain = nullptr;
|
||||
|
||||
HRESULT Result = ((HRESULT(*)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, const D3D_FEATURE_LEVEL*, UINT, UINT, const DXGI_SWAP_CHAIN_DESC*, IDXGISwapChain**, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**))D3D11CreateDeviceAndSwapChain)(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, FeatureLevels, 1, D3D11_SDK_VERSION, &SwapChainDesc, &SwapChain, &Device, &FeatureLevel, &DeviceContext);
|
||||
if (FAILED(Result))
|
||||
{
|
||||
return Status::CreateFailed;
|
||||
}
|
||||
HRESULT Result = ((HRESULT(*)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, const D3D_FEATURE_LEVEL*, UINT, UINT, const DXGI_SWAP_CHAIN_DESC*, IDXGISwapChain**, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**))D3D11CreateDeviceAndSwapChain)(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, FeatureLevels, 1, D3D11_SDK_VERSION, &SwapChainDesc, &SwapChain, &Device, &FeatureLevel, &DeviceContext);
|
||||
if (FAILED(Result)) {
|
||||
return Status::CreateFailed;
|
||||
}
|
||||
|
||||
// Create Method Table (blindly pasted from kiero hook tbh. no clue what all these magic numbers are supposed to be)
|
||||
VFT = (uint64_t*)calloc(205, sizeof(uint64_t));
|
||||
if (VFT == NULL)
|
||||
{
|
||||
return Status::MemoryError;
|
||||
}
|
||||
// Create Method Table (blindly pasted from kiero hook tbh. no clue what all these magic numbers are supposed to be)
|
||||
VFT = (uint64_t*)calloc(205, sizeof(uint64_t));
|
||||
if (VFT == NULL) {
|
||||
return Status::MemoryError;
|
||||
}
|
||||
|
||||
memcpy(VFT, *(uint64_t**)SwapChain, 18 * sizeof(uint64_t));
|
||||
memcpy(VFT + 18, *(uint64_t**)Device, 43 * sizeof(uint64_t));
|
||||
memcpy(VFT + 18 + 43, *(uint64_t**)DeviceContext, 144 * sizeof(uint64_t));
|
||||
memcpy(VFT, *(uint64_t**)SwapChain, 18 * sizeof(uint64_t));
|
||||
memcpy(VFT + 18, *(uint64_t**)Device, 43 * sizeof(uint64_t));
|
||||
memcpy(VFT + 18 + 43, *(uint64_t**)DeviceContext, 144 * sizeof(uint64_t));
|
||||
|
||||
MH_Initialize();
|
||||
MH_Initialize();
|
||||
|
||||
SwapChain->Release();
|
||||
Device->Release();
|
||||
DeviceContext->Release();
|
||||
SwapChain->Release();
|
||||
Device->Release();
|
||||
DeviceContext->Release();
|
||||
|
||||
Initalized = true;
|
||||
}
|
||||
else if (DXVersion == 12)
|
||||
{
|
||||
// TO-DO: Add DX12 Support
|
||||
return Status::DxNotSupported;
|
||||
}
|
||||
Initalized = true;
|
||||
}
|
||||
else if (DXVersion == 12) {
|
||||
// TO-DO: Add DX12 Support
|
||||
return Status::DxNotSupported;
|
||||
}
|
||||
|
||||
return Status::Success;
|
||||
return Status::Success;
|
||||
}
|
||||
RaaxDx::Status RaaxDx::Hook()
|
||||
{
|
||||
// Init MinHook
|
||||
MH_STATUS InitStats = MH_Initialize();
|
||||
if (InitStats != MH_OK && InitStats != MH_ERROR_ALREADY_INITIALIZED)
|
||||
{
|
||||
return Status::InitMH;
|
||||
}
|
||||
RaaxDx::Status RaaxDx::Hook() {
|
||||
// Init MinHook
|
||||
MH_STATUS InitStats = MH_Initialize();
|
||||
if (InitStats != MH_OK && InitStats != MH_ERROR_ALREADY_INITIALIZED) {
|
||||
return Status::InitMH;
|
||||
}
|
||||
|
||||
if (SDK::IsValidPointer(VFT) == false)
|
||||
{
|
||||
THROW_ERROR(std::string(skCrypt("VFT not initalized!")), true);
|
||||
}
|
||||
if (SDK::IsValidPointer(VFT) == false) {
|
||||
THROW_ERROR(std::string(skCrypt("VFT not initalized!")), true);
|
||||
}
|
||||
|
||||
// Hook Present
|
||||
if (Initalized)
|
||||
{
|
||||
if (MH_CreateHook((void*)VFT[8], &Hooks::Present::Present, (void**)&Hooks::Present::PresentOriginal) != MH_OK || MH_EnableHook((void*)VFT[8]) != MH_OK)
|
||||
{
|
||||
return Status::UnknownError;
|
||||
}
|
||||
// Hook Present
|
||||
if (Initalized) {
|
||||
if (MH_CreateHook((void*)VFT[8], &Hooks::Present::Present, (void**)&Hooks::Present::PresentOriginal) != MH_OK || MH_EnableHook((void*)VFT[8]) != MH_OK) {
|
||||
return Status::UnknownError;
|
||||
}
|
||||
|
||||
if (MH_CreateHook((void*)VFT[13], &Hooks::ResizeBuffers::ResizeBuffers, (void**)&Hooks::ResizeBuffers::ResizeBuffersOriginal) != MH_OK || MH_EnableHook((void*)VFT[13]) != MH_OK)
|
||||
{
|
||||
return Status::UnknownError;
|
||||
}
|
||||
if (MH_CreateHook((void*)VFT[13], &Hooks::ResizeBuffers::ResizeBuffers, (void**)&Hooks::ResizeBuffers::ResizeBuffersOriginal) != MH_OK || MH_EnableHook((void*)VFT[13]) != MH_OK) {
|
||||
return Status::UnknownError;
|
||||
}
|
||||
|
||||
return Status::Success;
|
||||
}
|
||||
return Status::Success;
|
||||
}
|
||||
|
||||
// If not initalized, throw error
|
||||
THROW_ERROR(std::string(skCrypt("RaaxDx not initalized")), false);
|
||||
// If not initalized, throw error
|
||||
THROW_ERROR(std::string(skCrypt("RaaxDx not initalized")), false);
|
||||
}
|
||||
void RaaxDx::Unhook()
|
||||
{
|
||||
// Init MinHook
|
||||
MH_STATUS InitStats = MH_Initialize();
|
||||
if (InitStats != MH_OK && InitStats != MH_ERROR_ALREADY_INITIALIZED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
void RaaxDx::Unhook() {
|
||||
// Init MinHook
|
||||
MH_STATUS InitStats = MH_Initialize();
|
||||
if (InitStats != MH_OK && InitStats != MH_ERROR_ALREADY_INITIALIZED) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Hook Present
|
||||
if (Initalized && VFT)
|
||||
{
|
||||
MH_DisableHook((void*)VFT[8]);
|
||||
MH_RemoveHook((void*)VFT[8]);
|
||||
MH_DisableHook((void*)VFT[13]);
|
||||
MH_RemoveHook((void*)VFT[13]);
|
||||
MH_Uninitialize();
|
||||
// Hook Present
|
||||
if (Initalized && VFT) {
|
||||
MH_DisableHook((void*)VFT[8]);
|
||||
MH_RemoveHook((void*)VFT[8]);
|
||||
MH_DisableHook((void*)VFT[13]);
|
||||
MH_RemoveHook((void*)VFT[13]);
|
||||
MH_Uninitialize();
|
||||
|
||||
delete VFT;
|
||||
VFT = nullptr;
|
||||
delete VFT;
|
||||
VFT = nullptr;
|
||||
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("Unhooked")));
|
||||
DEBUG_LOG(LOG_INFO, std::string(skCrypt("Unhooked")));
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// If not initalized, throw error
|
||||
THROW_ERROR(std::string(skCrypt("RaaxDx not initalized")), false);
|
||||
// If not initalized, throw error
|
||||
THROW_ERROR(std::string(skCrypt("RaaxDx not initalized")), false);
|
||||
}
|
||||
|
||||
void RaaxDx::InitImGui(IDXGISwapChain* Swapchain)
|
||||
{
|
||||
if (SUCCEEDED(Swapchain->GetDevice(__uuidof(ID3D11Device), (void**)&Device)))
|
||||
{
|
||||
Device->GetImmediateContext(&DeviceContext);
|
||||
void RaaxDx::InitImGui(IDXGISwapChain* Swapchain) {
|
||||
if (SUCCEEDED(Swapchain->GetDevice(__uuidof(ID3D11Device), (void**)&Device))) {
|
||||
Device->GetImmediateContext(&DeviceContext);
|
||||
|
||||
DXGI_SWAP_CHAIN_DESC Desc;
|
||||
Swapchain->GetDesc(&Desc);
|
||||
Window = Desc.OutputWindow;
|
||||
DXGI_SWAP_CHAIN_DESC Desc;
|
||||
Swapchain->GetDesc(&Desc);
|
||||
Window = Desc.OutputWindow;
|
||||
|
||||
ID3D11Texture2D* BackBuffer;
|
||||
Swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&BackBuffer);
|
||||
Device->CreateRenderTargetView(BackBuffer, NULL, &RenderTargetView);
|
||||
BackBuffer->Release();
|
||||
ID3D11Texture2D* BackBuffer;
|
||||
Swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&BackBuffer);
|
||||
Device->CreateRenderTargetView(BackBuffer, NULL, &RenderTargetView);
|
||||
BackBuffer->Release();
|
||||
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
|
||||
ImGui_ImplWin32_Init(Window);
|
||||
ImGui_ImplDX11_Init(Device, DeviceContext);
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
|
||||
ImGui_ImplWin32_Init(Window);
|
||||
ImGui_ImplDX11_Init(Device, DeviceContext);
|
||||
|
||||
// revert any existing wndproc hooks
|
||||
if (Hooks::WndProc::WndProcOriginal)
|
||||
{
|
||||
LI_FN(SetWindowLongPtrA).safe()(Window, GWLP_WNDPROC, (LONG_PTR)Hooks::WndProc::WndProcOriginal);
|
||||
}
|
||||
Hooks::WndProc::WndProcOriginal = (WNDPROC)SetWindowLongPtr(Window, GWLP_WNDPROC, (__int3264)(LONG_PTR)Hooks::WndProc::WndProc);
|
||||
}
|
||||
|
||||
Hooks::WndProc::WndProcOriginal = (WNDPROC)SetWindowLongPtr(Window, GWLP_WNDPROC, (__int3264)(LONG_PTR)Hooks::WndProc::WndProc);
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
@@ -9,13 +9,10 @@
|
||||
|
||||
#include "Logger.h"
|
||||
|
||||
class ErrorManager
|
||||
{
|
||||
class ErrorManager {
|
||||
private:
|
||||
static std::string GetFileName(const char* FilePath)
|
||||
{
|
||||
if (FilePath == nullptr)
|
||||
{
|
||||
static std::string GetFileName(const char* FilePath) {
|
||||
if (FilePath == nullptr) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -26,11 +23,9 @@ private:
|
||||
}
|
||||
public:
|
||||
#if _DEBUG // If we are in debug mode, we will show the file name and line number
|
||||
static void ThrowError(const std::string& Message, const bool Close, const char* FilePath, const int Line)
|
||||
{
|
||||
static void ThrowError(std::string Message, bool Close, const char* FilePath, int Line) {
|
||||
#else
|
||||
static void ThrowError(const std::string & Message, const bool Close)
|
||||
{
|
||||
static void ThrowError(std::string Message, bool Close) {
|
||||
#endif // _DEBUG
|
||||
std::string ErrorMessageInfo = "";
|
||||
std::string ErrorMessage = "";
|
||||
@@ -38,12 +33,10 @@ public:
|
||||
#ifdef _DEBUG // If we are in debug mode, we will show the file name and line number
|
||||
std::string FileName = GetFileName(FilePath);
|
||||
|
||||
if (FileName.empty() == false)
|
||||
{
|
||||
if (FileName.empty() == false) {
|
||||
ErrorMessageInfo = Close ? std::string(skCrypt("A fatal error has occurred!\n")) : std::string(skCrypt("An error has occurred!\n")) + FileName + std::string(skCrypt(":")) + std::to_string(Line) + std::string(skCrypt("\n\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ErrorMessageInfo = Close ? std::string(skCrypt("A fatal error has occurred!\n\n")) : std::string(skCrypt("An error has occurred!\n\n"));
|
||||
}
|
||||
#else
|
||||
@@ -58,15 +51,14 @@ public:
|
||||
DEBUG_LOG(LOG_ERROR, Message.c_str());
|
||||
#endif // LOG_LEVEL > LOG_NONE
|
||||
|
||||
if (Close)
|
||||
{
|
||||
if (Close) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#if _DEBUG
|
||||
#define THROW_ERROR(message, close) ErrorManager::ThrowError(message, close, __FILE__, __LINE__)
|
||||
#define THROW_ERROR(message, close) ErrorManager::ThrowError(message, close, __FILE__, __LINE__)
|
||||
#else
|
||||
#define THROW_ERROR(message, close) ErrorManager::ThrowError(message, close)
|
||||
#define THROW_ERROR(message, close) ErrorManager::ThrowError(message, close)
|
||||
#endif // _DEBUG
|
||||
@@ -10,13 +10,11 @@
|
||||
|
||||
// Only log if the log level is above LOG_NONE
|
||||
#if LOG_LEVEL > LOG_NONE
|
||||
class Logger
|
||||
{
|
||||
class Logger {
|
||||
private:
|
||||
static std::ofstream File;
|
||||
|
||||
static std::string GetTimestamp()
|
||||
{
|
||||
static std::string GetTimestamp() {
|
||||
time_t Now = time(0);
|
||||
struct tm TimeInfo;
|
||||
localtime_s(&TimeInfo, &Now);
|
||||
@@ -25,10 +23,8 @@ private:
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
static std::string GetFileName(const char* FilePath)
|
||||
{
|
||||
if (FilePath == nullptr)
|
||||
{
|
||||
static std::string GetFileName(const char* FilePath) {
|
||||
if (FilePath == nullptr) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -39,19 +35,15 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
static void InitLogger(const std::string& FileNameWithPath)
|
||||
{
|
||||
static void InitLogger(const std::string& FileNameWithPath) {
|
||||
File.open(FileNameWithPath, std::ios::out | std::ios::app);
|
||||
if (File.is_open() == false)
|
||||
{
|
||||
if (File.is_open() == false) {
|
||||
// Failed to open the file, realistically we should show an error message here. But I can't be bothered to move defintions to CPP file so they can cross include.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
File.seekp(0, std::ios::end);
|
||||
if (!File.tellp() == 0)
|
||||
{
|
||||
if (!File.tellp() == 0) {
|
||||
File << std::endl << std::endl << std::endl;
|
||||
}
|
||||
|
||||
@@ -59,49 +51,42 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void Log(const unsigned __int8 LogLevel, const char* Message, const char* FilePath, const int Line)
|
||||
{
|
||||
if (LogLevel > LOG_LEVEL)
|
||||
{
|
||||
static void Log(unsigned __int8 LogLevel, const char* Message, const char* FilePath, int Line) {
|
||||
if (LogLevel > LOG_LEVEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::ostringstream LogStream;
|
||||
std::string FileName = GetFileName(FilePath);
|
||||
|
||||
if (FileName.empty() == false)
|
||||
{
|
||||
LogStream << skCrypt("[") << GetTimestamp() << skCrypt("] ")
|
||||
if (FileName.empty() == false) {
|
||||
LogStream << skCrypt("[")<< GetTimestamp() << skCrypt("] ")
|
||||
<< skCrypt("[") << FileName << skCrypt(":") << Line << skCrypt("] ")
|
||||
<< Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
LogStream << skCrypt("[") << GetTimestamp() << skCrypt("] ") << Message;
|
||||
}
|
||||
|
||||
File << LogStream.str() << std::endl;
|
||||
}
|
||||
|
||||
static void Log(const unsigned __int8 LogLevel, std::string Message, const char* FilePath, const int Line)
|
||||
{
|
||||
static void Log(unsigned __int8 LogLevel, std::string Message, const char* FilePath, int Line) {
|
||||
Log(LogLevel, Message.c_str(), FilePath, Line);
|
||||
}
|
||||
|
||||
static void Log(const unsigned __int8 LogLevel, const wchar_t* Message, const char* FilePath, const int Line)
|
||||
{
|
||||
Log(LogLevel, std::wstring(Message), FilePath, Line);
|
||||
}
|
||||
static void Log(unsigned __int8 LogLevel, const wchar_t* Message, const char* FilePath, int Line) {
|
||||
Log(LogLevel, std::wstring(Message), FilePath, Line);
|
||||
}
|
||||
|
||||
static void Log(const unsigned __int8 LogLevel, std::wstring Message, const char* FilePath, const int Line)
|
||||
{
|
||||
static void Log(unsigned __int8 LogLevel, std::wstring Message, const char* FilePath, int Line) {
|
||||
Log(LogLevel, std::string(Message.begin(), Message.end()).c_str(), FilePath, Line);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
inline std::ofstream Logger::File;
|
||||
|
||||
#define DEBUG_LOG(LogLevel, Message) Logger::Log(LogLevel, Message, skCrypt(__FILE__), __LINE__)
|
||||
#else
|
||||
#define DEBUG_LOG(LogLevel, Message)
|
||||
#define DEBUG_LOG(LogLevel, Message)
|
||||
#endif
|
||||
@@ -1,131 +1,120 @@
|
||||
#include "Math.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <emmintrin.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../Game/SDK/Classes/Engine_Classes.h"
|
||||
|
||||
#include "../Game/Game.h"
|
||||
|
||||
float Math::InvSqrt(const float F)
|
||||
{
|
||||
// Performs two passes of Newton-Raphson iteration on the hardware estimate
|
||||
// v^-0.5 = x
|
||||
// => x^2 = v^-1
|
||||
// => 1/(x^2) = v
|
||||
// => F(x) = x^-2 - v
|
||||
// F'(x) = -2x^-3
|
||||
float Math::InvSqrt(float F) {
|
||||
// Performs two passes of Newton-Raphson iteration on the hardware estimate
|
||||
// v^-0.5 = x
|
||||
// => x^2 = v^-1
|
||||
// => 1/(x^2) = v
|
||||
// => F(x) = x^-2 - v
|
||||
// F'(x) = -2x^-3
|
||||
|
||||
// x1 = x0 - F(x0)/F'(x0)
|
||||
// => x1 = x0 + 0.5 * (x0^-2 - Vec) * x0^3
|
||||
// => x1 = x0 + 0.5 * (x0 - Vec * x0^3)
|
||||
// => x1 = x0 + x0 * (0.5 - 0.5 * Vec * x0^2)
|
||||
//
|
||||
// This final form has one more operation than the legacy factorization (X1 = 0.5*X0*(3-(Y*X0)*X0)
|
||||
// but retains better accuracy (namely InvSqrt(1) = 1 exactly).
|
||||
// x1 = x0 - F(x0)/F'(x0)
|
||||
// => x1 = x0 + 0.5 * (x0^-2 - Vec) * x0^3
|
||||
// => x1 = x0 + 0.5 * (x0 - Vec * x0^3)
|
||||
// => x1 = x0 + x0 * (0.5 - 0.5 * Vec * x0^2)
|
||||
//
|
||||
// This final form has one more operation than the legacy factorization (X1 = 0.5*X0*(3-(Y*X0)*X0)
|
||||
// but retains better accuracy (namely InvSqrt(1) = 1 exactly).
|
||||
|
||||
const __m128 fOneHalf = _mm_set_ss(0.5f);
|
||||
__m128 Y0, X0, X1, X2, FOver2;
|
||||
float temp;
|
||||
const __m128 fOneHalf = _mm_set_ss(0.5f);
|
||||
__m128 Y0, X0, X1, X2, FOver2;
|
||||
float temp;
|
||||
|
||||
Y0 = _mm_set_ss(F);
|
||||
X0 = _mm_rsqrt_ss(Y0); // 1/sqrt estimate (12 bits)
|
||||
FOver2 = _mm_mul_ss(Y0, fOneHalf);
|
||||
Y0 = _mm_set_ss(F);
|
||||
X0 = _mm_rsqrt_ss(Y0); // 1/sqrt estimate (12 bits)
|
||||
FOver2 = _mm_mul_ss(Y0, fOneHalf);
|
||||
|
||||
// 1st Newton-Raphson iteration
|
||||
X1 = _mm_mul_ss(X0, X0);
|
||||
X1 = _mm_sub_ss(fOneHalf, _mm_mul_ss(FOver2, X1));
|
||||
X1 = _mm_add_ss(X0, _mm_mul_ss(X0, X1));
|
||||
// 1st Newton-Raphson iteration
|
||||
X1 = _mm_mul_ss(X0, X0);
|
||||
X1 = _mm_sub_ss(fOneHalf, _mm_mul_ss(FOver2, X1));
|
||||
X1 = _mm_add_ss(X0, _mm_mul_ss(X0, X1));
|
||||
|
||||
// 2nd Newton-Raphson iteration
|
||||
X2 = _mm_mul_ss(X1, X1);
|
||||
X2 = _mm_sub_ss(fOneHalf, _mm_mul_ss(FOver2, X2));
|
||||
X2 = _mm_add_ss(X1, _mm_mul_ss(X1, X2));
|
||||
// 2nd Newton-Raphson iteration
|
||||
X2 = _mm_mul_ss(X1, X1);
|
||||
X2 = _mm_sub_ss(fOneHalf, _mm_mul_ss(FOver2, X2));
|
||||
X2 = _mm_add_ss(X1, _mm_mul_ss(X1, X2));
|
||||
|
||||
_mm_store_ss(&temp, X2);
|
||||
return temp;
|
||||
_mm_store_ss(&temp, X2);
|
||||
return temp;
|
||||
}
|
||||
|
||||
float Math::GetDistance2D(const float x1, const float y1, const float x2, const float y2)
|
||||
{
|
||||
return (float)sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2));
|
||||
float Math::GetDistance2D(float x1, float y1, float x2, float y2) {
|
||||
return (float)sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2));
|
||||
}
|
||||
|
||||
SDK::FRotator Math::NormalizeAxis(SDK::FRotator& Rotation)
|
||||
{
|
||||
while (Rotation.Yaw > 180.f)
|
||||
Rotation.Yaw -= 360.f;
|
||||
while (Rotation.Yaw < -180.f)
|
||||
Rotation.Yaw += 360.f;
|
||||
SDK::FRotator Math::NormalizeAxis(SDK::FRotator Rotation) {
|
||||
while (Rotation.Yaw > 180.f)
|
||||
Rotation.Yaw -= 360.f;
|
||||
while (Rotation.Yaw < -180.f)
|
||||
Rotation.Yaw += 360.f;
|
||||
|
||||
while (Rotation.Roll > 180.f)
|
||||
Rotation.Roll -= 360.f;
|
||||
while (Rotation.Roll < -180.f)
|
||||
Rotation.Roll += 360.f;
|
||||
while (Rotation.Roll > 180.f)
|
||||
Rotation.Roll -= 360.f;
|
||||
while (Rotation.Roll < -180.f)
|
||||
Rotation.Roll += 360.f;
|
||||
|
||||
while (Rotation.Pitch > 180.f)
|
||||
Rotation.Pitch -= 360.f;
|
||||
while (Rotation.Pitch < -180.f)
|
||||
Rotation.Pitch += 360.f;
|
||||
while (Rotation.Pitch > 180.f)
|
||||
Rotation.Pitch -= 360.f;
|
||||
while (Rotation.Pitch < -180.f)
|
||||
Rotation.Pitch += 360.f;
|
||||
|
||||
return Rotation;
|
||||
return Rotation;
|
||||
}
|
||||
|
||||
float Math::NormalizeAngle(float Angle)
|
||||
{
|
||||
while (Angle > 180.f)
|
||||
{
|
||||
Angle -= 360.f;
|
||||
}
|
||||
while (Angle < -180.f)
|
||||
{
|
||||
Angle += 360.f;
|
||||
}
|
||||
return Angle;
|
||||
float Math::NormalizeAngle(float Angle) {
|
||||
while (Angle > 180.f) {
|
||||
Angle -= 360.f;
|
||||
}
|
||||
while (Angle < -180.f) {
|
||||
Angle += 360.f;
|
||||
}
|
||||
return Angle;
|
||||
}
|
||||
|
||||
float Math::DegreesToRadians(const float degrees)
|
||||
{
|
||||
return degrees * (M_PI / 180.0f);
|
||||
float Math::DegreesToRadians(float degrees) {
|
||||
return degrees * (M_PI / 180.0f);
|
||||
}
|
||||
|
||||
float Math::RadiansToDegrees(const float radians)
|
||||
{
|
||||
return radians * (180.0f / M_PI);
|
||||
float Math::RadiansToDegrees(float radians) {
|
||||
return radians * (180.0f / M_PI);
|
||||
}
|
||||
|
||||
float Math::GetDegreeDistance(const SDK::FRotator& Rotator1, const SDK::FRotator& Rotator2)
|
||||
{
|
||||
SDK::FVector ForwardVector1 = SDK::UKismetMathLibrary::GetForwardVector(Rotator1);
|
||||
SDK::FVector ForwardVector2 = SDK::UKismetMathLibrary::GetForwardVector(Rotator2);
|
||||
float Math::GetDegreeDistance(SDK::FRotator Rotator1, SDK::FRotator Rotator2) {
|
||||
SDK::FVector ForwardVector1 = SDK::UKismetMathLibrary::GetForwardVector(Rotator1);
|
||||
SDK::FVector ForwardVector2 = SDK::UKismetMathLibrary::GetForwardVector(Rotator2);
|
||||
|
||||
ForwardVector1.Normalize();
|
||||
ForwardVector2.Normalize();
|
||||
ForwardVector1.Normalize();
|
||||
ForwardVector2.Normalize();
|
||||
|
||||
float DotProduct = ForwardVector1.Dot(ForwardVector2);
|
||||
DotProduct = std::clamp(DotProduct, -1.0f, 1.0f);
|
||||
float DotProduct = ForwardVector1.Dot(ForwardVector2);
|
||||
DotProduct = std::clamp(DotProduct, -1.0f, 1.0f);
|
||||
|
||||
float AngleBetween = RadiansToDegrees(acos(DotProduct));
|
||||
float AngleBetween = RadiansToDegrees(acos(DotProduct));
|
||||
|
||||
return AngleBetween;
|
||||
return AngleBetween;
|
||||
}
|
||||
|
||||
float Math::CalculateInterpolatedValue(const float CurrentScalar, float MaxScalar, const float MinValue, const float MaxValue)
|
||||
{
|
||||
MaxScalar = min(MaxScalar, CurrentScalar);
|
||||
float Math::CalculateInterpolatedValue(float CurrentScalar, float MaxScalar, float MinValue, float MaxValue) {
|
||||
MaxScalar = min(MaxScalar, CurrentScalar);
|
||||
|
||||
float InterpolatedValue = MaxValue - (MaxValue - MinValue) * (MaxScalar / CurrentScalar);
|
||||
float InterpolatedValue = MaxValue - (MaxValue - MinValue) * (MaxScalar / CurrentScalar);
|
||||
|
||||
InterpolatedValue = std::clamp(InterpolatedValue, MinValue, MaxValue);
|
||||
InterpolatedValue = std::clamp(InterpolatedValue, MinValue, MaxValue);
|
||||
|
||||
return InterpolatedValue;
|
||||
return InterpolatedValue;
|
||||
}
|
||||
|
||||
bool Math::IsOnScreen(const SDK::FVector2D& Position)
|
||||
{
|
||||
bool OnScreenX = (Position.X >= 0.f) && (Position.X <= Game::ScreenWidth);
|
||||
bool OnScreenY = (Position.Y >= 0.f) && (Position.Y <= Game::ScreenHeight);
|
||||
bool Math::IsOnScreen(const SDK::FVector2D& Position) {
|
||||
bool OnScreenX = (Position.X >= 0.f) && (Position.X <= Game::ScreenWidth);
|
||||
bool OnScreenY = (Position.Y >= 0.f) && (Position.Y <= Game::ScreenHeight);
|
||||
|
||||
return OnScreenX && OnScreenY;
|
||||
return OnScreenX && OnScreenY;
|
||||
}
|
||||
@@ -3,23 +3,22 @@
|
||||
|
||||
#define M_PI 3.14159265358979323f
|
||||
|
||||
namespace Math
|
||||
{
|
||||
float InvSqrt(const float F);
|
||||
namespace Math {
|
||||
float InvSqrt(float F);
|
||||
|
||||
float GetDistance2D(const float x1, const float y1, const float x2, const float y2);
|
||||
float GetDistance2D(float x1, float y1, float x2, float y2);
|
||||
|
||||
SDK::FRotator NormalizeAxis(SDK::FRotator& Rotation);
|
||||
SDK::FRotator NormalizeAxis(SDK::FRotator Rotation);
|
||||
|
||||
float NormalizeAngle(float Angle);
|
||||
float NormalizeAngle(float Angle);
|
||||
|
||||
float DegreesToRadians(const float degrees);
|
||||
float DegreesToRadians(float degrees);
|
||||
|
||||
float RadiansToDegrees(const float radians);
|
||||
float RadiansToDegrees(float radians);
|
||||
|
||||
float GetDegreeDistance(const SDK::FRotator& Rotator1, const SDK::FRotator& Rotator2);
|
||||
float GetDegreeDistance(SDK::FRotator Rotator1, SDK::FRotator Rotator2);
|
||||
|
||||
float CalculateInterpolatedValue(const float CurrentScalar, float MaxScalar, const float MinValue, const float MaxValue);
|
||||
float CalculateInterpolatedValue(float CurrentScalar, float MaxScalar, float MinValue, float MaxValue);
|
||||
|
||||
bool IsOnScreen(const SDK::FVector2D& Position);
|
||||
bool IsOnScreen(const SDK::FVector2D& Position);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "../External-Libs/LazyImporter.h"
|
||||
|
||||
@@ -15,361 +15,320 @@
|
||||
// Later down the line, I will probably recode this in my own way, but for now, it's not a very big priority
|
||||
// since this works perfectly fine
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
// The worlds gayest pattern scanner. Improve later
|
||||
/*
|
||||
* @brief Scans for a pattern in a module
|
||||
*
|
||||
* @param ModuleBaseAddress - The base address of the module to scan
|
||||
* @param Signature - The pattern to scan for (example: "48 8B 05 ? ? ? ? 48 8B 0C C8")
|
||||
* @param PointerIndex - The index in the signature to return
|
||||
* @param RelativeAddress - If the address should be relative
|
||||
*
|
||||
* @return The address of the pattern
|
||||
*/
|
||||
inline uintptr_t PatternScan(uintptr_t ModuleBaseAddress, const char* Signature, int PointerIndex = 0, bool RelativeAddress = false)
|
||||
{
|
||||
static auto patternToByte = [](const char* pattern)
|
||||
{
|
||||
auto bytes = std::vector<int>{};
|
||||
const auto start = const_cast<char*>(pattern);
|
||||
const auto end = const_cast<char*>(pattern) + strlen(pattern);
|
||||
namespace Memory {
|
||||
// The worlds gayest pattern scanner. Improve later
|
||||
/*
|
||||
* @brief Scans for a pattern in a module
|
||||
*
|
||||
* @param ModuleBaseAddress - The base address of the module to scan
|
||||
* @param Signature - The pattern to scan for (example: "48 8B 05 ? ? ? ? 48 8B 0C C8")
|
||||
* @param PointerIndex - The index in the signature to return
|
||||
* @param RelativeAddress - If the address should be relative
|
||||
*
|
||||
* @return The address of the pattern
|
||||
*/
|
||||
inline uintptr_t PatternScan(uintptr_t ModuleBaseAddress, const char* Signature, int PointerIndex = 0, bool RelativeAddress = false) {
|
||||
static auto patternToByte = [](const char* pattern) { auto bytes = std::vector<int>{}; const auto start = const_cast<char*>(pattern); const auto end = const_cast<char*>(pattern) + strlen(pattern); for (auto current = start; current < end; ++current) { if (*current == '?') { ++current; if (*current == '?') ++current; bytes.push_back(-1); } else bytes.push_back(strtoul((const char*)current, ¤t, 16)); } return bytes; };
|
||||
|
||||
for (auto current = start; current < end; ++current)
|
||||
{
|
||||
if (*current == '?')
|
||||
{
|
||||
++current;
|
||||
const auto DOSHeader = (PIMAGE_DOS_HEADER)ModuleBaseAddress;
|
||||
const auto NtHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)ModuleBaseAddress + DOSHeader->e_lfanew);
|
||||
|
||||
if (*current == '?')
|
||||
++current;
|
||||
const auto SizeOfImage = NtHeaders->OptionalHeader.SizeOfImage;
|
||||
auto PatternBytes = patternToByte(Signature);
|
||||
const auto ScanBytes = reinterpret_cast<std::uint8_t*>(ModuleBaseAddress);
|
||||
|
||||
bytes.push_back(-1);
|
||||
}
|
||||
else
|
||||
bytes.push_back(strtoul((const char*)current, ¤t, 16));
|
||||
}
|
||||
const auto Size = PatternBytes.size();
|
||||
const auto Data = PatternBytes.data();
|
||||
|
||||
return bytes;
|
||||
};
|
||||
for (auto i = 0ul; i < SizeOfImage - Size; ++i) {
|
||||
bool Found = true; for (auto j = 0ul; j < Size; ++j) { if (ScanBytes[i + j] != Data[j] && Data[j] != -1) { Found = false; break; } }
|
||||
|
||||
const auto DOSHeader = (PIMAGE_DOS_HEADER)ModuleBaseAddress;
|
||||
const auto NtHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)ModuleBaseAddress + DOSHeader->e_lfanew);
|
||||
if (Found)
|
||||
{
|
||||
if (RelativeAddress)
|
||||
{
|
||||
return ((uintptr_t)((UINT_PTR)(reinterpret_cast<uintptr_t>(&ScanBytes[i])) + *(PINT)((UINT_PTR)(reinterpret_cast<uintptr_t>(&ScanBytes[i])) + ((PointerIndex)-sizeof(INT))) + (PointerIndex)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return reinterpret_cast<uintptr_t>(&ScanBytes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto SizeOfImage = NtHeaders->OptionalHeader.SizeOfImage;
|
||||
auto PatternBytes = patternToByte(Signature);
|
||||
const auto ScanBytes = reinterpret_cast<std::uint8_t*>(ModuleBaseAddress);
|
||||
|
||||
const auto Size = PatternBytes.size();
|
||||
const auto Data = PatternBytes.data();
|
||||
|
||||
for (auto i = 0ul; i < SizeOfImage - Size; ++i)
|
||||
{
|
||||
bool Found = true;
|
||||
for (auto j = 0ul; j < Size; ++j)
|
||||
{
|
||||
if (ScanBytes[i + j] != Data[j] && Data[j] != -1)
|
||||
{
|
||||
Found = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Found)
|
||||
{
|
||||
if (RelativeAddress)
|
||||
{
|
||||
return ((uintptr_t)((UINT_PTR)(reinterpret_cast<uintptr_t>(&ScanBytes[i])) + *(PINT)((UINT_PTR)(reinterpret_cast<uintptr_t>(&ScanBytes[i])) + ((PointerIndex)-sizeof(INT))) + (PointerIndex)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return reinterpret_cast<uintptr_t>(&ScanBytes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// thanks dumper-7.
|
||||
//
|
||||
// ive been doing this project for like 4 months now and i just want
|
||||
// to get it done. so yes, this is all pasted from dumper-7 for now.
|
||||
// i will recode this all as my own later on.
|
||||
// thanks dumper-7.
|
||||
//
|
||||
// ive been doing this project for like 4 months now and i just want
|
||||
// to get it done. so yes, this is all pasted from dumper-7 for now.
|
||||
// i will recode this all as my own later on.
|
||||
|
||||
inline bool IsInProcessRange(uintptr_t Address)
|
||||
{
|
||||
uintptr_t ImageBase = SDK::GetBaseAddress();
|
||||
PIMAGE_NT_HEADERS NtHeader = reinterpret_cast<PIMAGE_NT_HEADERS>(ImageBase + reinterpret_cast<PIMAGE_DOS_HEADER>(ImageBase)->e_lfanew);
|
||||
inline bool IsInProcessRange(uintptr_t Address) {
|
||||
uintptr_t ImageBase = SDK::GetBaseAddress();
|
||||
PIMAGE_NT_HEADERS NtHeader = reinterpret_cast<PIMAGE_NT_HEADERS>(ImageBase + reinterpret_cast<PIMAGE_DOS_HEADER>(ImageBase)->e_lfanew);
|
||||
|
||||
return Address > ImageBase && Address < (NtHeader->OptionalHeader.SizeOfImage + ImageBase);
|
||||
}
|
||||
return Address > ImageBase && Address < (NtHeader->OptionalHeader.SizeOfImage + ImageBase);
|
||||
}
|
||||
|
||||
template<typename StringType>
|
||||
size_t GetStringLen(StringType str)
|
||||
{
|
||||
if constexpr (std::is_same<StringType, const char*>::value)
|
||||
{
|
||||
return std::strlen(str);
|
||||
}
|
||||
else if constexpr (std::is_same<StringType, const wchar_t*>::value)
|
||||
{
|
||||
return std::wcslen(str);
|
||||
}
|
||||
}
|
||||
template<typename StringType>
|
||||
size_t GetStringLen(StringType str) {
|
||||
if constexpr (std::is_same<StringType, const char*>::value) {
|
||||
return std::strlen(str);
|
||||
}
|
||||
else if constexpr (std::is_same<StringType, const wchar_t*>::value) {
|
||||
return std::wcslen(str);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename StringType>
|
||||
int CompareStrings(StringType str1, StringType str2, size_t len)
|
||||
{
|
||||
if constexpr (std::is_same<StringType, const char*>::value)
|
||||
{
|
||||
return std::strncmp(str1, str2, len);
|
||||
}
|
||||
else if constexpr (std::is_same<StringType, const wchar_t*>::value)
|
||||
{
|
||||
return std::wcsncmp(str1, str2, len);
|
||||
}
|
||||
}
|
||||
template<typename StringType>
|
||||
int CompareStrings(StringType str1, StringType str2, size_t len) {
|
||||
if constexpr (std::is_same<StringType, const char*>::value) {
|
||||
return std::strncmp(str1, str2, len);
|
||||
}
|
||||
else if constexpr (std::is_same<StringType, const wchar_t*>::value) {
|
||||
return std::wcsncmp(str1, str2, len);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void* FindPatternInRange(std::vector<int>&& Signature, uint8_t* Start, uintptr_t Range, bool bRelative = false, uint32_t Offset = 0, int SkipCount = 0)
|
||||
{
|
||||
const auto PatternLength = Signature.size();
|
||||
const auto PatternBytes = Signature.data();
|
||||
static inline void* FindPatternInRange(std::vector<int>&& Signature, uint8_t* Start, uintptr_t Range, bool bRelative = false, uint32_t Offset = 0, int SkipCount = 0)
|
||||
{
|
||||
const auto PatternLength = Signature.size();
|
||||
const auto PatternBytes = Signature.data();
|
||||
|
||||
for (int i = 0; i < (Range - PatternLength); i++)
|
||||
{
|
||||
bool bFound = true;
|
||||
int CurrentSkips = 0;
|
||||
for (int i = 0; i < (Range - PatternLength); i++)
|
||||
{
|
||||
bool bFound = true;
|
||||
int CurrentSkips = 0;
|
||||
|
||||
for (auto j = 0ul; j < PatternLength; ++j)
|
||||
{
|
||||
if (Start[i + j] != PatternBytes[j] && PatternBytes[j] != -1)
|
||||
{
|
||||
bFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFound)
|
||||
{
|
||||
if (CurrentSkips != SkipCount)
|
||||
{
|
||||
CurrentSkips++;
|
||||
continue;
|
||||
}
|
||||
for (auto j = 0ul; j < PatternLength; ++j)
|
||||
{
|
||||
if (Start[i + j] != PatternBytes[j] && PatternBytes[j] != -1)
|
||||
{
|
||||
bFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFound)
|
||||
{
|
||||
if (CurrentSkips != SkipCount)
|
||||
{
|
||||
CurrentSkips++;
|
||||
continue;
|
||||
}
|
||||
|
||||
uintptr_t Address = uintptr_t(Start + i);
|
||||
if (bRelative)
|
||||
{
|
||||
if (Offset == -1)
|
||||
Offset = (uint32_t)PatternLength;
|
||||
uintptr_t Address = uintptr_t(Start + i);
|
||||
if (bRelative)
|
||||
{
|
||||
if (Offset == -1)
|
||||
Offset = (uint32_t)PatternLength;
|
||||
|
||||
Address = ((Address + Offset + 4) + *(int32_t*)(Address + Offset));
|
||||
}
|
||||
return (void*)Address;
|
||||
}
|
||||
}
|
||||
Address = ((Address + Offset + 4) + *(int32_t*)(Address + Offset));
|
||||
}
|
||||
return (void*)Address;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
static inline void* FindPatternInRange(const char* Signature, uint8_t* Start, uintptr_t Range, bool bRelative = false, uint32_t Offset = 0)
|
||||
{
|
||||
static auto patternToByte = [](const char* pattern) -> std::vector<int>
|
||||
{
|
||||
auto Bytes = std::vector<int>{};
|
||||
const auto Start = const_cast<char*>(pattern);
|
||||
const auto End = const_cast<char*>(pattern) + strlen(pattern);
|
||||
return nullptr;
|
||||
}
|
||||
static inline void* FindPatternInRange(const char* Signature, uint8_t* Start, uintptr_t Range, bool bRelative = false, uint32_t Offset = 0)
|
||||
{
|
||||
static auto patternToByte = [](const char* pattern) -> std::vector<int>
|
||||
{
|
||||
auto Bytes = std::vector<int>{};
|
||||
const auto Start = const_cast<char*>(pattern);
|
||||
const auto End = const_cast<char*>(pattern) + strlen(pattern);
|
||||
|
||||
for (auto Current = Start; Current < End; ++Current)
|
||||
{
|
||||
if (*Current == '?')
|
||||
{
|
||||
++Current;
|
||||
if (*Current == '?') ++Current;
|
||||
Bytes.push_back(-1);
|
||||
}
|
||||
else { Bytes.push_back(strtoul(Current, &Current, 16)); }
|
||||
}
|
||||
return Bytes;
|
||||
};
|
||||
for (auto Current = Start; Current < End; ++Current)
|
||||
{
|
||||
if (*Current == '?')
|
||||
{
|
||||
++Current;
|
||||
if (*Current == '?') ++Current;
|
||||
Bytes.push_back(-1);
|
||||
}
|
||||
else { Bytes.push_back(strtoul(Current, &Current, 16)); }
|
||||
}
|
||||
return Bytes;
|
||||
};
|
||||
|
||||
return FindPatternInRange(patternToByte(Signature), Start, Range, bRelative, Offset);
|
||||
}
|
||||
inline void* RelativePattern(uint8_t* Address, const char* Pattern, int32_t Range, int32_t Relative = 0)
|
||||
{
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
return FindPatternInRange(patternToByte(Signature), Start, Range, bRelative, Offset);
|
||||
}
|
||||
inline void* RelativePattern(uint8_t* Address, const char* Pattern, int32_t Range, int32_t Relative = 0)
|
||||
{
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
|
||||
return FindPatternInRange(Pattern, Address, Range, Relative != 0, Relative);
|
||||
}
|
||||
return FindPatternInRange(Pattern, Address, Range, Relative != 0, Relative);
|
||||
}
|
||||
|
||||
template<typename Type = const char*>
|
||||
inline uint8_t* FindByStringInAllSections(Type RefStr)
|
||||
{
|
||||
uintptr_t ImageBase = SDK::GetBaseAddress();
|
||||
PIMAGE_DOS_HEADER DosHeader = (PIMAGE_DOS_HEADER)(ImageBase);
|
||||
PIMAGE_NT_HEADERS NtHeader = (PIMAGE_NT_HEADERS)(ImageBase + DosHeader->e_lfanew);
|
||||
template<typename Type = const char*>
|
||||
inline uint8_t* FindByStringInAllSections(Type RefStr)
|
||||
{
|
||||
uintptr_t ImageBase = SDK::GetBaseAddress();
|
||||
PIMAGE_DOS_HEADER DosHeader = (PIMAGE_DOS_HEADER)(ImageBase);
|
||||
PIMAGE_NT_HEADERS NtHeader = (PIMAGE_NT_HEADERS)(ImageBase + DosHeader->e_lfanew);
|
||||
|
||||
const DWORD SizeOfImage = NtHeader->OptionalHeader.SizeOfImage;
|
||||
const DWORD SizeOfImage = NtHeader->OptionalHeader.SizeOfImage;
|
||||
|
||||
uint8_t* SearchStart = (uint8_t*)ImageBase;
|
||||
DWORD SearchRange = SizeOfImage;
|
||||
uint8_t* SearchStart = (uint8_t*)ImageBase;
|
||||
DWORD SearchRange = SizeOfImage;
|
||||
|
||||
for (int i = 0; i < (int)SearchRange; i++)
|
||||
{
|
||||
if ((SearchStart[i] == uint8_t(0x4C) || SearchStart[i] == uint8_t(0x48)) && SearchStart[i + 1] == uint8_t(0x8D))
|
||||
{
|
||||
const uint8_t* StrPtr = *(int32_t*)(SearchStart + i + 3) + 7 + SearchStart + i;
|
||||
for (int i = 0; i < (int)SearchRange; i++)
|
||||
{
|
||||
if ((SearchStart[i] == uint8_t(0x4C) || SearchStart[i] == uint8_t(0x48)) && SearchStart[i + 1] == uint8_t(0x8D))
|
||||
{
|
||||
const uint8_t* StrPtr = *(int32_t*)(SearchStart + i + 3) + 7 + SearchStart + i;
|
||||
|
||||
if (!IsInProcessRange((uintptr_t)StrPtr))
|
||||
continue;
|
||||
if (!IsInProcessRange((uintptr_t)StrPtr))
|
||||
continue;
|
||||
|
||||
if constexpr (std::is_same<Type, const char*>())
|
||||
{
|
||||
if (strcmp((const char*)RefStr, (const char*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto a = std::wstring((const wchar_t*)StrPtr);
|
||||
if constexpr (std::is_same<Type, const char*>())
|
||||
{
|
||||
if (strcmp((const char*)RefStr, (const char*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto a = std::wstring((const wchar_t*)StrPtr);
|
||||
|
||||
if (wcscmp((const wchar_t*)RefStr, (const wchar_t*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wcscmp((const wchar_t*)RefStr, (const wchar_t*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline uint8_t* FindByStringInAllSections_constchar(const char* RefStr, uint8_t* SearchStart, DWORD SearchRange)
|
||||
{
|
||||
for (int i = 0; i < (int)SearchRange; i++)
|
||||
{
|
||||
if ((SearchStart[i] == uint8_t(0x4C) || SearchStart[i] == uint8_t(0x48)) && SearchStart[i + 1] == uint8_t(0x8D))
|
||||
{
|
||||
const uint8_t* StrPtr = *(int32_t*)(SearchStart + i + 3) + 7 + SearchStart + i;
|
||||
inline uint8_t* FindByStringInAllSections_constchar(const char* RefStr, uint8_t* SearchStart, DWORD SearchRange) {
|
||||
for (int i = 0; i < (int)SearchRange; i++)
|
||||
{
|
||||
if ((SearchStart[i] == uint8_t(0x4C) || SearchStart[i] == uint8_t(0x48)) && SearchStart[i + 1] == uint8_t(0x8D))
|
||||
{
|
||||
const uint8_t* StrPtr = *(int32_t*)(SearchStart + i + 3) + 7 + SearchStart + i;
|
||||
|
||||
if (!IsInProcessRange((uintptr_t)StrPtr))
|
||||
continue;
|
||||
if (!IsInProcessRange((uintptr_t)StrPtr))
|
||||
continue;
|
||||
|
||||
if (strcmp(RefStr, (const char*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strcmp(RefStr, (const char*)StrPtr) == 0)
|
||||
{
|
||||
return { SearchStart + i };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<int Alignement = 4, typename T>
|
||||
inline int32_t FindOffset(std::vector<std::pair<void*, T>>& ObjectValuePair, int MinOffset = 0x28, int MaxOffset = 0x1A0)
|
||||
{
|
||||
int32_t HighestFoundOffset = MinOffset;
|
||||
template<int Alignement = 4, typename T>
|
||||
inline int32_t FindOffset(std::vector<std::pair<void*, T>>& ObjectValuePair, int MinOffset = 0x28, int MaxOffset = 0x1A0)
|
||||
{
|
||||
int32_t HighestFoundOffset = MinOffset;
|
||||
|
||||
for (int i = 0; i < ObjectValuePair.size(); i++)
|
||||
{
|
||||
uint8_t* BytePtr = (uint8_t*)(ObjectValuePair[i].first);
|
||||
for (int i = 0; i < ObjectValuePair.size(); i++)
|
||||
{
|
||||
uint8_t* BytePtr = (uint8_t*)(ObjectValuePair[i].first);
|
||||
|
||||
for (int j = HighestFoundOffset; j < MaxOffset; j += Alignement)
|
||||
{
|
||||
if ((*(T*)(BytePtr + j)) == ObjectValuePair[i].second && j >= HighestFoundOffset)
|
||||
{
|
||||
if (j > HighestFoundOffset)
|
||||
{
|
||||
HighestFoundOffset = j;
|
||||
i = 0;
|
||||
}
|
||||
j = MaxOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
return HighestFoundOffset;
|
||||
}
|
||||
for (int j = HighestFoundOffset; j < MaxOffset; j += Alignement)
|
||||
{
|
||||
if ((*(T*)(BytePtr + j)) == ObjectValuePair[i].second && j >= HighestFoundOffset)
|
||||
{
|
||||
if (j > HighestFoundOffset)
|
||||
{
|
||||
HighestFoundOffset = j;
|
||||
i = 0;
|
||||
}
|
||||
j = MaxOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
return HighestFoundOffset;
|
||||
}
|
||||
|
||||
static bool IsBadReadPtr(void* p)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
static bool IsBadReadPtr(void* p)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
|
||||
if (LI_FN(VirtualQuery).safe()(p, &mbi, sizeof(mbi)))
|
||||
{
|
||||
constexpr DWORD mask = (PAGE_READONLY | PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY);
|
||||
bool b = !(mbi.Protect & mask);
|
||||
if (mbi.Protect & (PAGE_GUARD | PAGE_NOACCESS))
|
||||
b = true;
|
||||
if (LI_FN(VirtualQuery).safe()(p, &mbi, sizeof(mbi)))
|
||||
{
|
||||
constexpr DWORD mask = (PAGE_READONLY | PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY);
|
||||
bool b = !(mbi.Protect & mask);
|
||||
if (mbi.Protect & (PAGE_GUARD | PAGE_NOACCESS))
|
||||
b = true;
|
||||
|
||||
return b;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
return true;
|
||||
};
|
||||
|
||||
template<bool bCheckForVft = true>
|
||||
inline int32_t GetValidPointerOffset(uint8_t* ObjA, uint8_t* ObjB, int32_t StartingOffset, int32_t MaxOffset)
|
||||
{
|
||||
if (IsBadReadPtr(ObjA) || IsBadReadPtr(ObjB))
|
||||
return -1;
|
||||
template<bool bCheckForVft = true>
|
||||
inline int32_t GetValidPointerOffset(uint8_t* ObjA, uint8_t* ObjB, int32_t StartingOffset, int32_t MaxOffset)
|
||||
{
|
||||
if (IsBadReadPtr(ObjA) || IsBadReadPtr(ObjB))
|
||||
return -1;
|
||||
|
||||
for (int j = StartingOffset; j <= MaxOffset; j += 0x8)
|
||||
{
|
||||
const bool bIsAValid = !IsBadReadPtr(*reinterpret_cast<void**>(ObjA + j)) && (bCheckForVft ? !IsBadReadPtr(**reinterpret_cast<void***>(ObjA + j)) : true);
|
||||
const bool bIsBValid = !IsBadReadPtr(*reinterpret_cast<void**>(ObjB + j)) && (bCheckForVft ? !IsBadReadPtr(**reinterpret_cast<void***>(ObjB + j)) : true);
|
||||
for (int j = StartingOffset; j <= MaxOffset; j += 0x8)
|
||||
{
|
||||
const bool bIsAValid = !IsBadReadPtr(*reinterpret_cast<void**>(ObjA + j)) && (bCheckForVft ? !IsBadReadPtr(**reinterpret_cast<void***>(ObjA + j)) : true);
|
||||
const bool bIsBValid = !IsBadReadPtr(*reinterpret_cast<void**>(ObjB + j)) && (bCheckForVft ? !IsBadReadPtr(**reinterpret_cast<void***>(ObjB + j)) : true);
|
||||
|
||||
if (bIsAValid && bIsBValid)
|
||||
return j;
|
||||
}
|
||||
if (bIsAValid && bIsBValid)
|
||||
return j;
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
|
||||
inline bool IsFunctionRet(uint8_t* Address)
|
||||
{
|
||||
int Align = 0x10 - (uintptr_t(Address) % 0x10);
|
||||
//if (Opcode == RET && (OpcodeBefore is a POP opcode || OpcodeTwoBefore is a different POP Opcode)
|
||||
return Address[0] == 0xC3 && Address[Align] == 0x40 && ((Address[-1] >= 0x58 && Address[-1] <= 0x5F) || (Address[-2] == 0x41 && (Address[-1] >= 0x58 && Address[-1] <= 0x5F)));
|
||||
}
|
||||
inline bool IsFunctionRet(uint8_t* Address)
|
||||
{
|
||||
int Align = 0x10 - (uintptr_t(Address) % 0x10);
|
||||
//if (Opcode == RET && (OpcodeBefore is a POP opcode || OpcodeTwoBefore is a different POP Opcode)
|
||||
return Address[0] == 0xC3 && Address[Align] == 0x40 && ((Address[-1] >= 0x58 && Address[-1] <= 0x5F) || (Address[-2] == 0x41 && (Address[-1] >= 0x58 && Address[-1] <= 0x5F)));
|
||||
}
|
||||
|
||||
inline uint8_t* FindFunctionEnd(uint8_t* Address)
|
||||
{
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
inline uint8_t* FindFunctionEnd(uint8_t* Address)
|
||||
{
|
||||
if (!Address)
|
||||
return nullptr;
|
||||
|
||||
int Align = 0x10 - (uintptr_t(Address) % 0x10);
|
||||
int Align = 0x10 - (uintptr_t(Address) % 0x10);
|
||||
|
||||
for (int i = 0; i < 0xFFFF; i++)
|
||||
{
|
||||
if (IsFunctionRet(Address + i))
|
||||
{
|
||||
return Address + i;
|
||||
}
|
||||
if ((uintptr_t(Address + i) % 0x10 == 0) && (Address[i] == 0x40 && (Address[i + 1] >= 0x50 && Address[i + 1] <= 0x57) && (Address[i + 2] >= 0x50 && Address[i + 2] <= 0x57)))
|
||||
{
|
||||
return Address + i;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 0xFFFF; i++)
|
||||
{
|
||||
if (IsFunctionRet(Address + i))
|
||||
{
|
||||
return Address + i;
|
||||
}
|
||||
if ((uintptr_t(Address + i) % 0x10 == 0) && (Address[i] == 0x40 && (Address[i + 1] >= 0x50 && Address[i + 1] <= 0x57) && (Address[i + 2] >= 0x50 && Address[i + 2] <= 0x57)))
|
||||
{
|
||||
return Address + i;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline uintptr_t FindNextFunctionStart(uint8_t* Address)
|
||||
{
|
||||
if (!Address)
|
||||
return 0x0;
|
||||
inline uintptr_t FindNextFunctionStart(uint8_t* Address)
|
||||
{
|
||||
if (!Address)
|
||||
return 0x0;
|
||||
|
||||
uintptr_t FuncEnd = (uintptr_t)FindFunctionEnd(Address);
|
||||
uintptr_t FuncEnd = (uintptr_t)FindFunctionEnd(Address);
|
||||
|
||||
return FuncEnd % 0x10 != 0 ? FuncEnd + (0x10 - (FuncEnd % 0x10)) : FuncEnd;
|
||||
}
|
||||
return FuncEnd % 0x10 != 0 ? FuncEnd + (0x10 - (FuncEnd % 0x10)) : FuncEnd;
|
||||
}
|
||||
|
||||
inline uintptr_t ResolveRelativeAddress(uintptr_t Address, int Offset)
|
||||
{
|
||||
return Address + Offset + 4 + *(int32_t*)(Address + Offset);
|
||||
}
|
||||
inline uintptr_t ResolveRelativeAddress(uintptr_t Address, int Offset)
|
||||
{
|
||||
return Address + Offset + 4 + *(int32_t*)(Address + Offset);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
class ReturnMutex
|
||||
{
|
||||
class ReturnMutex {
|
||||
public:
|
||||
bool WasLockedOnConstruct = false;
|
||||
bool IsLocked = false;
|
||||
bool WasLockedOnConstruct = false;
|
||||
bool IsLocked = false;
|
||||
|
||||
public:
|
||||
ReturnMutex()
|
||||
{
|
||||
if (IsLocked)
|
||||
{
|
||||
WasLockedOnConstruct = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsLocked = true;
|
||||
WasLockedOnConstruct = false;
|
||||
};
|
||||
}
|
||||
ReturnMutex() {
|
||||
if (IsLocked) {
|
||||
WasLockedOnConstruct = true;
|
||||
}
|
||||
else {
|
||||
IsLocked = true;
|
||||
WasLockedOnConstruct = false;
|
||||
};
|
||||
}
|
||||
|
||||
~ReturnMutex()
|
||||
{
|
||||
if (WasLockedOnConstruct == false)
|
||||
{
|
||||
IsLocked = false;
|
||||
}
|
||||
}
|
||||
~ReturnMutex() {
|
||||
if (WasLockedOnConstruct == false) {
|
||||
IsLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ShouldReturn()
|
||||
{
|
||||
return WasLockedOnConstruct;
|
||||
}
|
||||
bool ShouldReturn() {
|
||||
return WasLockedOnConstruct;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class ReturnLock
|
||||
{
|
||||
class ReturnLock {
|
||||
private:
|
||||
ReturnMutex* Mutex;
|
||||
ReturnMutex* Mutex;
|
||||
|
||||
public:
|
||||
ReturnLock(ReturnMutex* Mutex)
|
||||
{
|
||||
this->Mutex = Mutex;
|
||||
ReturnLock(ReturnMutex* Mutex) {
|
||||
this->Mutex = Mutex;
|
||||
|
||||
if (Mutex)
|
||||
{
|
||||
if (Mutex->IsLocked)
|
||||
{
|
||||
this->Mutex = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
Mutex->IsLocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Mutex) {
|
||||
if (Mutex->IsLocked) {
|
||||
this->Mutex = nullptr;
|
||||
}
|
||||
else {
|
||||
Mutex->IsLocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~ReturnLock()
|
||||
{
|
||||
if (Mutex)
|
||||
{
|
||||
Mutex->IsLocked = false;
|
||||
}
|
||||
}
|
||||
~ReturnLock() {
|
||||
if (Mutex) {
|
||||
Mutex->IsLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user