diff --git a/.github/workflows/PreRelease.yml.disabled b/.github/workflows/PreRelease.yml.disabled deleted file mode 100644 index 4e7f9de..0000000 --- a/.github/workflows/PreRelease.yml.disabled +++ /dev/null @@ -1,53 +0,0 @@ -name: PreRelease - -on: - workflow_run: - workflows: ["MSBuild"] - types: - - completed # Runs when MSBuild workflow is completed - -permissions: - contents: write # Required to create a release - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Ensure full history is available for logs - - - name: Download all build artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts # Store all artifacts in this folder - - - name: Generate Release Notes - id: generate_notes - run: | - git fetch --tags - LAST_TAG=$(git describe --tags --abbrev=0 || echo "") - if [ -z "$LAST_TAG" ]; then - echo "First release, including all commits." - RELEASE_NOTES=$(git log --pretty=format:"* %s" --no-merges) - else - echo "Generating changelog from $LAST_TAG" - RELEASE_NOTES=$(git log $LAST_TAG..HEAD --pretty=format:"* %s" --no-merges) - fi - echo "RELEASE_NOTES<> $GITHUB_ENV - echo "$RELEASE_NOTES" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - tag_name: Draft.${{ github.run_number }} # Auto-incrementing version number - name: Draft.${{ github.run_number }} - body: | - ## What's Changed - ${{ env.RELEASE_NOTES }} - draft: true # Set to true if you want to review before publishing - prerelease: true - files: artifacts/Internal_*.zip # Upload all build ZIPs diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..693c9ae --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,65 @@ +name: Release Build + +on: + release: + types: [created, published] + push: + tags: + - 'v*' + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: windows-latest + timeout-minutes: 5 + strategy: + fail-fast: false + matrix: + build_configuration: [release] + architecture: [x64] + + steps: + - name: Checkout Repository with Submodules + uses: actions/checkout@v4 + with: + submodules: recursive # Fetch submodules recursively + fetch-depth: 0 # Ensures a full clone (needed for some submodules) + + - name: Initialize and Update Submodules (if needed) + run: | + git submodule sync --recursive + git submodule update --init --recursive + + - name: Install XMake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + + - name: Configure XMake + run: | + xmake f -m ${{ matrix.build_configuration }} -a ${{ matrix.architecture }} -y + + - name: Build with XMake + run: | + xmake build + + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: Internal-${{ matrix.build_configuration }}-${{ matrix.architecture }} + path: Build/${{ matrix.build_configuration }}/Internal.dll + + - name: Create Release Archive + run: | + Compress-Archive -Path Build/${{ matrix.build_configuration }}/Internal.dll -DestinationPath Internal-${{ matrix.build_configuration }}-${{ matrix.architecture }}.zip + + - name: Upload Release Asset + if: github.event_name == 'release' + uses: softprops/action-gh-release@v1 + with: + files: Internal-${{ matrix.build_configuration }}-${{ matrix.architecture }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/Xmake.yml b/.github/workflows/Xmake.yml index c13d29c..985a936 100644 --- a/.github/workflows/Xmake.yml +++ b/.github/workflows/Xmake.yml @@ -39,7 +39,7 @@ jobs: - name: Configure XMake run: | - xmake f -m ${{ matrix.build_configuration }} -a ${{ matrix.architecture }} + xmake f -m ${{ matrix.build_configuration }} -a ${{ matrix.architecture }} -y - name: Build with XMake run: | diff --git a/.gitignore b/.gitignore index c15a1c2..5715967 100644 --- a/.gitignore +++ b/.gitignore @@ -1,407 +1,5 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.tlog -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio 6 auto-generated project file (contains which files were open etc.) -*.vbp - -# Visual Studio 6 workspace and project file (working project files containing files to include in project) -*.dsw -*.dsp - -# Visual Studio 6 technical files -*.ncb -*.aps - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# Visual Studio History (VSHistory) files -.vshistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -*.sln.iml - -.vscode - -OmegaWare Framework/enc_temp_folder - -Internal/Libs/FreeType -Internal/Libs/ImGui -Internal/Libs/MinHook -Internal/Libs/Nlohmann.json \ No newline at end of file +.vscode/compile_commands.json +Build/ +.xmake +Internal/Interfaces/Unreal/SDK/ +Internal/Interfaces/Unreal/SDK.hpp \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0795c41..0000000 --- a/.gitmodules +++ /dev/null @@ -1,12 +0,0 @@ -[submodule "Internal/Libs/MinHook"] - path = Internal/Libs/MinHook - url = https://github.com/OmegaWareProjects/minhook.git -[submodule "Internal/Libs/ImGui"] - path = Internal/Libs/ImGui - url = https://github.com/ocornut/imgui.git -[submodule "Internal/Libs/Nlohmann.json"] - path = Internal/Libs/Nlohmann.json - url = https://github.com/nlohmann/json.git -[submodule "Internal/Libs/FreeType"] - path = Internal/Libs/FreeType - url = https://github.com/OmegaWareProjects/freetype.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..6503ecc --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,23 @@ +{ + "configurations": [ + { + "name": "Win32 Debug", + "compileCommands": "${workspaceFolder}/.vscode/compile_commands.json", + "cppStandard": "c++26", + "intelliSenseMode": "windows-msvc-x64", + "defines": [ + "_DEBUG" + ] + }, + { + "name": "Win32 Release", + "compileCommands": "${workspaceFolder}/.vscode/compile_commands.json", + "cppStandard": "c++26", + "intelliSenseMode": "windows-msvc-x64", + "defines": [ + "NDEBUG" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0ecca8d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "configurations": [ + { + "name": "(Windows) Attach", + "type": "cppvsdbg", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..469ced2 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,113 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "xmake: Build (Debug)", + "type": "shell", + "command": "xmake", + "args": [ + "config", + "-m", + "debug", + "-a", + "x64", + "-p", + "windows", + "&&", + "xmake", + "build" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Build in debug mode for Windows x64" + }, + { + "label": "xmake: Build (Release)", + "type": "shell", + "command": "xmake", + "args": [ + "config", + "-m", + "release", + "-a", + "x64", + "-p", + "windows", + "&&", + "xmake", + "build" + ], + "group": "build", + "problemMatcher": [], + "detail": "Build in release mode for Windows x64" + }, + { + "label": "xmake: Clean", + "type": "shell", + "command": "xmake", + "args": [ + "clean" + ], + "group": "build", + "problemMatcher": [], + "detail": "Clean build artifacts" + }, + { + "label": "xmake: Rebuild (Debug)", + "type": "shell", + "command": "xmake", + "args": [ + "config", + "-m", + "debug", + "-a", + "x64", + "-p", + "windows", + "&&", + "xmake", + "clean", + "&&", + "xmake", + "build" + ], + "group": "build", + "problemMatcher": [], + "detail": "Clean and rebuild in debug mode" + }, + { + "label": "xmake: Rebuild (Release)", + "type": "shell", + "command": "xmake", + "args": [ + "config", + "-m", + "release", + "-a", + "x64", + "-p", + "windows", + "&&", + "xmake", + "clean", + "&&", + "xmake", + "build" + ], + "group": "build", + "problemMatcher": [], + "detail": "Clean and rebuild in release mode" + }, + { + "label": "xmake: Update Compile Commands", + "type": "shell", + "command": "update_compile_commands.bat", + "group": "none", + "problemMatcher": [], + "detail": "Regenerate compile_commands.json for IntelliSense" + } + ] +} \ No newline at end of file diff --git a/Images/NewLogo.png b/Images/NewLogo.png new file mode 100644 index 0000000..a3007d3 Binary files /dev/null and b/Images/NewLogo.png differ diff --git a/Internal/Features/ExampleFeature/ExampleFeature.cpp b/Internal/Features/ExampleFeature/ExampleFeature.cpp index 4dee004..d10b380 100644 --- a/Internal/Features/ExampleFeature/ExampleFeature.cpp +++ b/Internal/Features/ExampleFeature/ExampleFeature.cpp @@ -7,21 +7,82 @@ bool ExampleFeature::SetupMenu() { "EXAMPLE_FEATURE"Hashed, "Example Feature" }, { "EXAMPLE_FEATURE_HW"Hashed, "Hello, World!" }, { "EXAMPLE_FEATURE_SLIDER"Hashed, "Example Slider" }, - { "EXAMPLE_COLORPICKER"Hashed, "Example Color Picker" } + { "EXAMPLE_COLORPICKER"Hashed, "Example Color Picker" }, + + { "EXAMPLE_FEATURE_BUTTON"Hashed, "Example Feature"}, + { "EXAMPLE_MAIN"Hashed, "Main" }, + { "EXAMPLE_SECONDARY"Hashed, "Example" }, + + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD"Hashed, "Group" }, + { "EXAMPLE_CHECKBOX"Hashed, "Log Values To Console" }, + { "EXAMPLE_COLORPICKER"Hashed, "##Color Picker" }, + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD2"Hashed, "Group 2" }, + { "EXAMPLE_TEXT"Hashed, "This is some text" }, + { "EXAMPLE_TOGGLE"Hashed, "Toggle" }, + + { "EXAMPLE_MAIN_PAGE_CHILD"Hashed, "Group 3" }, + { "EXAMPLE_COMBO"Hashed, "Combo" }, + { "EXAMPLE_INPUTTEXT"Hashed, "Input Text" }, + { "EXAMPLE_SLIDERINT"Hashed, "Slider Int" }, + { "EXAMPLE_SLIDERFLOAT"Hashed, "Slider Float" }, + { "EXAMPLE_ACCENTBUTTON"Hashed, "Accent Button" }, + + { "EXAMPLE_SECONDARY_CHILD"Hashed, "Subpage 2" }, + { "EXAMPLE_SECONDARY_TEXT"Hashed, "This is some text on the secondary page." } }); Localization::AddToLocale("GER", std::initializer_list>{ - { "EXAMPLE_FEATURE"Hashed, "Beispiel funktion" }, + { "EXAMPLE_FEATURE"Hashed, "Beispiel Funktion" }, { "EXAMPLE_FEATURE_HW"Hashed, "Hallo Welt!" }, - { "EXAMPLE_FEATURE_SLIDER"Hashed, "Beispiel Slider" }, - { "EXAMPLE_COLORPICKER"Hashed, "Beispiel Farbwähler" } + { "EXAMPLE_FEATURE_SLIDER"Hashed, "Beispiel-Schieberegler" }, + { "EXAMPLE_COLORPICKER"Hashed, "Beispiel Farbwähler" }, + + { "EXAMPLE_FEATURE_BUTTON"Hashed, "Beispiel Funktion"}, + { "EXAMPLE_MAIN"Hashed, "Haupt" }, + { "EXAMPLE_SECONDARY"Hashed, "Sekundär" }, + + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD"Hashed, "Gruppe" }, + { "EXAMPLE_CHECKBOX"Hashed, "Werte in Konsole protokollieren" }, + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD2"Hashed, "Gruppe 2" }, + { "EXAMPLE_TEXT"Hashed, "Dies ist ein Text" }, + { "EXAMPLE_TOGGLE"Hashed, "Umschalten" }, + + { "EXAMPLE_MAIN_PAGE_CHILD"Hashed, "Gruppe 3" }, + { "EXAMPLE_COMBO"Hashed, "Auswahl" }, + { "EXAMPLE_INPUTTEXT"Hashed, "Texteingabe" }, + { "EXAMPLE_SLIDERINT"Hashed, "Ganzzahl-Schieberegler" }, + { "EXAMPLE_SLIDERFLOAT"Hashed, "Dezimal-Schieberegler" }, + { "EXAMPLE_ACCENTBUTTON"Hashed, "Akzent-Schaltfläche" }, + + { "EXAMPLE_SECONDARY_CHILD"Hashed, "Unterseite 2" }, + { "EXAMPLE_SECONDARY_TEXT"Hashed, "Dies ist ein Text auf der Sekundärseite." } }); Localization::AddToLocale("POL", std::initializer_list>{ { "EXAMPLE_FEATURE"Hashed, "Przykładowa Funkcja" }, { "EXAMPLE_FEATURE_HW"Hashed, "Cześć Świecie!" }, { "EXAMPLE_FEATURE_SLIDER"Hashed, "Przykładowy suwak" }, - { "EXAMPLE_COLORPICKER"Hashed, "Przykładowy próbnik kolorów" } + { "EXAMPLE_COLORPICKER"Hashed, "Przykładowy próbnik kolorów" }, + + { "EXAMPLE_FEATURE_BUTTON"Hashed, "Przykładowa Funkcja"}, + { "EXAMPLE_MAIN"Hashed, "Główna" }, + { "EXAMPLE_SECONDARY"Hashed, "Przykład" }, + + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD"Hashed, "Grupa" }, + { "EXAMPLE_CHECKBOX"Hashed, "Rejestruj wartości w konsoli" }, + { "EXAMPLE_MAIN_PAGE_GROUP_CHILD2"Hashed, "Grupa 2" }, + { "EXAMPLE_TEXT"Hashed, "To jest jakiś tekst" }, + { "EXAMPLE_TOGGLE"Hashed, "Przełącznik" }, + + { "EXAMPLE_MAIN_PAGE_CHILD"Hashed, "Grupa 3" }, + { "EXAMPLE_COMBO"Hashed, "Wybór" }, + { "EXAMPLE_INPUTTEXT"Hashed, "Wprowadzanie tekstu" }, + { "EXAMPLE_SLIDERINT"Hashed, "Suwak liczb całkowitych" }, + { "EXAMPLE_SLIDERFLOAT"Hashed, "Suwak liczb zmiennoprzecinkowych" }, + { "EXAMPLE_ACCENTBUTTON"Hashed, "Przycisk akcentu" }, + + { "EXAMPLE_SECONDARY_CHILD"Hashed, "Podstrona 2" }, + { "EXAMPLE_SECONDARY_TEXT"Hashed, "To jest jakiś tekst na stronie drugorzędnej." } }); return true; @@ -29,6 +90,95 @@ bool ExampleFeature::SetupMenu() void ExampleFeature::HandleMenu() { - if (!m_pBodyGroup->HasParent()) - Framework::menu->GetChild("HEADER_GROUP")->GetChild("BODY")->AddElement(m_pBodyGroup.get()); + static std::once_flag onceflag; + std::call_once(onceflag, [this]() { + Framework::menu->GetChild("SIDEBAR")->InsertElementAfter(m_pExampleFeatureButton.get(), "FEATURE_SEPERATOR"); + + auto pHeaderGroup = static_cast(Framework::menu->GetChild("HEADER_GROUP")); + if (pHeaderGroup) + pHeaderGroup->AddHeaders(ExampleFeature::s_iExamplePageId, { "EXAMPLE_MAIN"Hashed, "EXAMPLE_SECONDARY"Hashed }); + + m_pMainPageGroupChild->SetCallback([]() { + float fGroupWidth = (ImGui::GetWindowWidth() - 10.0f - 10.0f * 2) / 2; + float fGroupHeight = (ImGui::GetWindowHeight() - 10.0f - 10.0f * 2) / 2; + return ImVec2(fGroupWidth, fGroupHeight); + }); + + m_pMainPageGroupChild->AddElement(m_pExampleCheckbox.get()); + + m_pExampleColorPicker->SetSameLineSizeCallback([]() { + return ImVec2(ImGui::GetWindowWidth() - 10.0f - ImGui::GetFontSize() * 2, 0); + }); + + m_pExampleColorPicker->SetValue(ImVec4(0.0f, 1.0f, 1.0f, 1.0f)); + + m_pMainPageGroupChild->AddElement(m_pExampleColorPicker.get()); + m_pMainPageGroup->AddElement(m_pMainPageGroupChild.get()); + + m_pMainPageGroupChild2->SetCallback([]() { + float fGroupWidth = (ImGui::GetWindowWidth() - 10.0f - 10.0f * 2) / 2; + return ImVec2(fGroupWidth, 0); + }); + + m_pMainPageGroupChild2->AddElement(m_pExampleText.get()); + m_pMainPageGroupChild2->AddElement(m_pExampleToggle.get()); + m_pMainPageGroup->AddElement(m_pMainPageGroupChild2.get()); + + m_pExampleCombo->AddOption("Option 1", [this]() { + if (!m_pExampleCheckbox->GetValue()) + return; + + Utils::LogDebug("ExampleFeature: Selected Option 1"); + }); + m_pExampleCombo->AddOption("Option 2", [this]() { + if (!m_pExampleCheckbox->GetValue()) + return; + + Utils::LogDebug("ExampleFeature: Selected Option 2"); + }); + m_pExampleCombo->AddOption("Option 3", [this]() { + if (!m_pExampleCheckbox->GetValue()) + return; + + Utils::LogDebug("ExampleFeature: Selected Option 3"); + }); + + m_pMainPageChild->AddElement(m_pExampleCombo.get()); + m_pMainPageChild->AddElement(m_pExampleInputText.get()); + m_pMainPageChild->AddElement(m_pExampleSliderInt.get()); + m_pMainPageChild->AddElement(m_pExampleSliderFloat.get()); + m_pMainPageChild->AddElement(m_pExampleSeperator.get()); + + m_pExampleAccentButton->SetCallback([this]() { + if (!m_pExampleCheckbox->GetValue()) + return; + + Utils::LogDebug("ExampleFeature: Accent Button Pressed"); + }); + m_pMainPageChild->AddElement(m_pExampleAccentButton.get()); + + m_pMainPage->AddElement(m_pMainPageGroup.get()); + m_pMainPage->AddElement(m_pMainPageChild.get()); + + m_pSecondaryPageChild->AddElement(m_pSecondaryPageText.get()); + m_pSecondaryPage->AddElement(m_pSecondaryPageChild.get()); + + Framework::menu->GetChild("HEADER_GROUP")->GetChild("BODY")->AddElement(m_pMainPage.get()); + Framework::menu->GetChild("HEADER_GROUP")->GetChild("BODY")->AddElement(m_pSecondaryPage.get()); + }); +} + +void ExampleFeature::Run() +{ + if (m_pExampleCheckbox->GetValue()) + { + Utils::LogDebug(std::format("ExampleFeature: Color Picker Value: R:{} G:{} B:{} A:{}", + (int)(m_pExampleColorPicker->GetValue().x * 255), + (int)(m_pExampleColorPicker->GetValue().y * 255), + (int)(m_pExampleColorPicker->GetValue().z * 255), + (int)(m_pExampleColorPicker->GetValue().w * 255))); + + Utils::LogDebug(std::format("ExampleFeature: Slider Int Value: {}", m_pExampleSliderInt->GetValue())); + Utils::LogDebug(std::format("ExampleFeature: Slider Float Value: {}", m_pExampleSliderFloat->GetValue())); + } } \ No newline at end of file diff --git a/Internal/Features/ExampleFeature/ExampleFeature.hpp b/Internal/Features/ExampleFeature/ExampleFeature.hpp index 6731225..45a8bb4 100644 --- a/Internal/Features/ExampleFeature/ExampleFeature.hpp +++ b/Internal/Features/ExampleFeature/ExampleFeature.hpp @@ -1,101 +1,122 @@ #pragma once #include "pch.h" -#include "Includes.hpp" - -class ExampleBodyGroup : public ElementBase +class ExampleFeature : public BaseFeature { -protected: - uint8_t m_iPageId; - uint8_t m_iSubPageId; +private: + inline static uint8_t s_iExamplePageId = ElementBase::AddPage("EXAMPLE_FEATURE_BUTTON"Hashed, ICON_FA_STAR); + + std::unique_ptr m_pExampleFeatureButton = std::make_unique( + std::string("EXAMPLE_FEATURE_BUTTON"), + "EXAMPLE_FEATURE_BUTTON"Hashed, + ElementBase::Style_t({ .vec2Size = ImVec2(-0.1f, 0) }), + ICON_FA_STAR, + s_iExamplePageId); + + std::unique_ptr m_pMainPage = std::make_unique( + "EXAMPLE_MAIN_PAGE", + ElementBase::Style_t(), + s_iExamplePageId, + 0); -public: - ExampleBodyGroup(std::string sUnique, Style_t stStyle = {}, uint8_t iPageId = 0, uint8_t iSubPageId = 0) - { - m_sUnique = sUnique; - m_stStyle = stStyle; - m_iPageId = iPageId; - m_iSubPageId = iSubPageId; - }; + std::unique_ptr m_pMainPageGroup = std::make_unique( + "EXAMPLE_MAIN_PAGE_GROUP", + ElementBase::Style_t()); + + std::unique_ptr m_pMainPageGroupChild = std::make_unique( + "EXAMPLE_MAIN_PAGE_GROUP_CHILD", + "EXAMPLE_MAIN_PAGE_GROUP_CHILD"Hashed, + ElementBase::Style_t(), + ImGuiChildFlags_Border); + + std::unique_ptr m_pExampleCheckbox = std::make_unique( + "EXAMPLE_CHECKBOX", + "EXAMPLE_CHECKBOX"Hashed); + + std::unique_ptr m_pExampleColorPicker = std::make_unique( + "EXAMPLE_COLORPICKER", + "EXAMPLE_COLORPICKER"Hashed, + ElementBase::Style_t{ .eSameLine = ElementBase::ESameLine::Same }); + + std::unique_ptr m_pMainPageGroupChild2 = std::make_unique( + "EXAMPLE_MAIN_PAGE_GROUP_CHILD2", + "EXAMPLE_MAIN_PAGE_GROUP_CHILD2"Hashed, + ElementBase::Style_t(), + ImGuiChildFlags_Border); - constexpr EElementType GetType() const override - { - return EElementType::BodyGroup; - }; - - void Render() override - { - if (!m_stStyle.bVisible) - return; - - if (m_iPageId != eCurrentPage || m_iSubPageId != eCurrentSubPage) - return; - - float fGroupWidth = (ImGui::GetWindowWidth() - 10.0f - 10.0f * 2) / 2; - float fGroupHeight = (ImGui::GetWindowHeight() - 10.0f - 10.0f * 2) / 2; - - ImGui::BeginGroup(); - { - ImGui::BeginChild("group1", ImVec2(fGroupWidth, fGroupHeight), ImGuiChildFlags_Border); - { - ImGui::TextDisabled("GROUP1"); - - static bool bEnabled = true; - static bool bDisabled = false; - ImAdd::SmallCheckbox("Enabled", &bEnabled); - ImAdd::SmallCheckbox("Disabled", &bDisabled); - - ImGui::SameLine(ImGui::GetWindowWidth() - 10.0f - ImGui::GetFontSize() * 2); - static ImVec4 v4Color = ImVec4(1, 1, 0, 0.5f); - ImAdd::ColorEdit4("##Color Picker", (float*)&v4Color); - } - ImGui::EndChild(); - ImGui::BeginChild("group2", ImVec2(fGroupWidth, 0), ImGuiChildFlags_Border); - { - ImGui::TextDisabled("GROUP2"); - - static bool bEnabled = true; - static bool bDisabled = false; - ImAdd::Togglebutton("Enabled", &bEnabled); - ImAdd::Togglebutton("Disabled", &bDisabled); - } - ImGui::EndChild(); - } - ImGui::EndGroup(); - ImGui::SameLine(); - ImGui::BeginChild("group3", ImVec2(0, 0), ImGuiChildFlags_Border); - { - ImGui::TextDisabled("GROUP3"); - - static int iCombo = 0; - ImAdd::Combo("Combo", &iCombo, "Item 1\0Item 2\0Item 3\0", -0.1f); - - static char inputText[32] = ""; - ImAdd::InputText("Text Input", "Write something here...", inputText, IM_ARRAYSIZE(inputText), -0.1f); - - static int iSlider = 8; - static float fSlider = 3; - ImAdd::SliderInt("Slider Int", &iSlider, 0, 10, -0.1f); - ImAdd::SliderFloat("Slider Float", &fSlider, 0, 10, -0.1f); - - ImGui::Separator(); - - ImAdd::Button("Button", ImVec2(-0.1f, 0)); - ImAdd::AcentButton("Acent button", ImVec2(-0.1f, 0)); - } - ImGui::EndChild(); - } -}; + std::unique_ptr<_Text> m_pExampleText = std::make_unique<_Text>( + "EXAMPLE_TEXT", + "EXAMPLE_TEXT"Hashed, + ElementBase::Style_t{}); -class ExampleFeature : public BaseFeature -{ -private: - std::unique_ptr m_pBodyGroup = std::make_unique("EXAMPLE_BODY_GROUP", ElementBase::Style_t(), ElementBase::EPage::Developer, 0); + std::unique_ptr m_pExampleToggle = std::make_unique( + "EXAMPLE_TOGGLE", + "EXAMPLE_TOGGLE"Hashed); + + std::unique_ptr m_pMainPageChild = std::make_unique( + "EXAMPLE_MAIN_PAGE_CHILD", + "EXAMPLE_MAIN_PAGE_CHILD"Hashed, + ElementBase::Style_t{ .eSameLine = ElementBase::ESameLine::Same, .vec2Size = ImVec2(0.f, 0.f) }, + ImGuiChildFlags_Border); + + std::unique_ptr m_pExampleCombo = std::make_unique( + "EXAMPLE_COMBO", + "EXAMPLE_COMBO"Hashed); + + //input text, slider int, slider float, seperator, AcentButton + std::unique_ptr m_pExampleInputText = std::make_unique( + "EXAMPLE_INPUTTEXT", + "EXAMPLE_INPUTTEXT"Hashed, + ElementBase::Style_t()); + + std::unique_ptr m_pExampleSliderInt = std::make_unique( + "EXAMPLE_SLIDERINT", + "EXAMPLE_SLIDERINT"Hashed, + ElementBase::Style_t(), + 0, + 100); + + std::unique_ptr m_pExampleSliderFloat = std::make_unique( + "EXAMPLE_SLIDERFLOAT", + "EXAMPLE_SLIDERFLOAT"Hashed, + ElementBase::Style_t(), + 0.f, + 1.f); + + std::unique_ptr m_pExampleSeperator = std::make_unique( + "EXAMPLE_SEPERATOR", + ElementBase::Style_t()); + + std::unique_ptr m_pExampleAccentButton = std::make_unique( + "EXAMPLE_ACCENTBUTTON", + "EXAMPLE_ACCENTBUTTON"Hashed, + ElementBase::Style_t()); + + std::unique_ptr m_pSecondaryPage = std::make_unique( + "EXAMPLE_SECONDARY_PAGE", + ElementBase::Style_t(), + s_iExamplePageId, + 1); // Set to subpage 1 + + std::unique_ptr m_pSecondaryPageChild = std::make_unique( + "EXAMPLE_SECONDARY_CHILD", + "EXAMPLE_SECONDARY_CHILD"Hashed, + ElementBase::Style_t{ .vec2Size = ImVec2(0, 0) }, + ImGuiChildFlags_Border + ); + + std::unique_ptr<_Text> m_pSecondaryPageText = std::make_unique<_Text>( + "EXAMPLE_SECONDARY_TEXT", + "EXAMPLE_SECONDARY_TEXT"Hashed, + ElementBase::Style_t{} + ); public: bool SetupMenu(); void HandleMenu(); + void Run(); + std::string GetName() { return "ExampleFeature"; }; }; diff --git a/Internal/FrameworkConfig.hpp b/Internal/FrameworkConfig.hpp index cbd1422..966a705 100644 --- a/Internal/FrameworkConfig.hpp +++ b/Internal/FrameworkConfig.hpp @@ -49,13 +49,13 @@ #define STRR(X) #X #define STR(X) STRR(X) -#define FRAMEWORK_MAJOR_VERSION 6 -#define FRAMEWORK_MINOR_VERSION 9 -#define FRAMEWORK_REWORK_VERSION 1 +#define FRAMEWORK_MAJOR_VERSION 7 +#define FRAMEWORK_MINOR_VERSION 0 +#define FRAMEWORK_REWORK_VERSION 0 #define FRAMEWORK_VERSION FRAMEWORK_MAJOR_VERSION.FRAMEWORK_MINOR_VERSION.FRAMEWORK_REWORK_VERSION #define FRAMEWORK_CODENAME "OmegaWare" -#define TARGET_GAME_NAME "TEST" +#define TARGET_GAME_NAME "" #pragma warning( push ) // disable "operator '!=': deprecated for array types" warning #pragma warning( disable : 5056) @@ -64,13 +64,13 @@ static_assert(TARGET_GAME_NAME != "", "Target game not set, this HAS to be set o #define ENGINE_UNREAL 0 #define ENGINE_UNITY 0 -#define ENGINE_OTHER 1 // Other is just the catch all for any other game engine or project +#define ENGINE_OTHER 1// Other is just the catch all for any other game engine or project static_assert((ENGINE_UNREAL + ENGINE_UNITY + ENGINE_OTHER) == 1, "Only one target engine type can be selected at a time."); // Don't allow both frameworks to be used) // Make sure a rendering API is selected and only one rendering API is selected -#define FRAMEWORK_RENDER_DYNAMIC 0 -#define FRAMEWORK_RENDER_D3D11 1 +#define FRAMEWORK_RENDER_DYNAMIC 1 +#define FRAMEWORK_RENDER_D3D11 0 #define FRAMEWORK_RENDER_D3D12 0 static_assert((FRAMEWORK_RENDER_DYNAMIC + FRAMEWORK_RENDER_D3D11 + FRAMEWORK_RENDER_D3D12) == 1, "Only one rendering API can be selected at a time,"); @@ -86,12 +86,12 @@ static_assert((FRAMEWORK_RENDER_DYNAMIC + FRAMEWORK_RENDER_D3D11 + FRAMEWORK_REN // Unreal #if ENGINE_UNREAL -#include "Interfaces/Unreal/UnrealConfig.h" +#include "Interfaces/Unreal/UnrealConfig.hpp" #endif // Unity #if ENGINE_UNITY -#include "Interfaces/Unity/UnityConfig.h" +#include "Interfaces/Unity/UnityConfig.hpp" #endif // Include the ImGui implementation for the rendering API that is being used @@ -100,7 +100,7 @@ static_assert((FRAMEWORK_RENDER_DYNAMIC + FRAMEWORK_RENDER_D3D11 + FRAMEWORK_REN #pragma comment(lib, "dxgi.lib") #include #include -#include "Libs/ImGui/backends/imgui_impl_dx11.h" +#include #endif #if FRAMEWORK_RENDER_D3D12 || FRAMEWORK_RENDER_DYNAMIC @@ -108,7 +108,7 @@ static_assert((FRAMEWORK_RENDER_DYNAMIC + FRAMEWORK_RENDER_D3D11 + FRAMEWORK_REN #pragma comment(lib, "dxgi.lib") #include #include -#include "Libs/ImGui/backends/imgui_impl_dx12.h" +#include #endif #include "GUI/Styles.hpp" // Custom ImGUI colors and font diff --git a/Internal/GUI/Addons/imgui_addons.cpp b/Internal/GUI/Addons/imgui_addons.cpp index 3bc0537..1cc2fd6 100644 --- a/Internal/GUI/Addons/imgui_addons.cpp +++ b/Internal/GUI/Addons/imgui_addons.cpp @@ -167,7 +167,7 @@ bool ImAdd::Button(const char* label, const ImVec2& size_arg) return pressed; } -bool ImAdd::AcentButton(const char* label, const ImVec2& size_arg) +bool ImAdd::AccentButton(const char* label, const ImVec2& size_arg) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) @@ -217,7 +217,23 @@ bool ImAdd::AcentButton(const char* label, const ImVec2& size_arg) if (g.LogEnabled) LogSetNextTextDecoration("[", "]"); - RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb); + + // Detect if text color is white/bright and darken it for better contrast + ImVec4 textColor = GetStyleColorVec4(ImGuiCol_Text); + float brightness = (textColor.x + textColor.y + textColor.z) / 3.0f; + if (brightness > 0.7f) // If color is bright + { + textColor.x *= 0.3f; + textColor.y *= 0.3f; + textColor.z *= 0.3f; + PushStyleColor(ImGuiCol_Text, textColor); + RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb); + PopStyleColor(); + } + else + { + RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb); + } IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags); return pressed; diff --git a/Internal/GUI/Addons/imgui_addons.hpp b/Internal/GUI/Addons/imgui_addons.hpp index bcb58f8..cf07885 100644 --- a/Internal/GUI/Addons/imgui_addons.hpp +++ b/Internal/GUI/Addons/imgui_addons.hpp @@ -1,5 +1,5 @@ #pragma once -#include "imgui_internal.h" +#include namespace ImAdd { @@ -12,7 +12,7 @@ namespace ImAdd // Clickables bool TextButton(const char* label, const ImVec2& size_arg = ImVec2(0, 0)); bool Button(const char* label, const ImVec2& size_arg = ImVec2(0, 0)); - bool AcentButton(const char* label, const ImVec2& size_arg = ImVec2(0, 0)); + bool AccentButton(const char* label, const ImVec2& size_arg = ImVec2(0, 0)); bool RadioButton(const char* label, uint8_t* v, uint8_t current_id, const ImVec2& size_arg = ImVec2(0, 0)); bool RadioButtonIcon(const char* str_id, const char* icon, const char* label, uint8_t* v, uint8_t current_id, const ImVec2& size_arg = ImVec2(0, 0)); bool Selectable(const char* label, bool selected = false, const ImVec2& size_arg = ImVec2(0, 0)); diff --git a/Internal/GUI/Custom.hpp b/Internal/GUI/Custom.hpp index 8a19213..e24694c 100644 --- a/Internal/GUI/Custom.hpp +++ b/Internal/GUI/Custom.hpp @@ -1,7 +1,7 @@ #pragma once #include "pch.h" #define IMGUI_DEFINE_MATH_OPERATORS -#include "../Libs/ImGUI/imgui_internal.h" +#include #include @@ -104,12 +104,12 @@ namespace ImGui ImU32 Black = ColorConvertFloat4ToU32({ 0.f, 0.f, 0.f, 1.f }); auto* pDL = GetBackgroundDrawList(); - pDL->AddText(CurrentFontESP, CurrentFontESP->FontSize, Pos + ImVec2(-1, -1), Black, Text); - pDL->AddText(CurrentFontESP, CurrentFontESP->FontSize, Pos + ImVec2(1, -1), Black, Text); - pDL->AddText(CurrentFontESP, CurrentFontESP->FontSize, Pos + ImVec2(-1, 1), Black, Text); - pDL->AddText(CurrentFontESP, CurrentFontESP->FontSize, Pos + ImVec2(1, 1), Black, Text); + pDL->AddText(CurrentFont, CurrentFont->FontSize, Pos + ImVec2(-1, -1), Black, Text); + pDL->AddText(CurrentFont, CurrentFont->FontSize, Pos + ImVec2(1, -1), Black, Text); + pDL->AddText(CurrentFont, CurrentFont->FontSize, Pos + ImVec2(-1, 1), Black, Text); + pDL->AddText(CurrentFont, CurrentFont->FontSize, Pos + ImVec2(1, 1), Black, Text); - pDL->AddText(CurrentFontESP, CurrentFontESP->FontSize, Pos, Color, Text); + pDL->AddText(CurrentFont, CurrentFont->FontSize, Pos, Color, Text); } static ImVector s_GroupPanelLabelStack; diff --git a/Internal/GUI/GUI.cpp b/Internal/GUI/GUI.cpp index 4b94a63..96cd65e 100644 --- a/Internal/GUI/GUI.cpp +++ b/Internal/GUI/GUI.cpp @@ -1,6 +1,4 @@ #include "pch.h" -#include "Includes.hpp" -#include "Watermark.hpp" void GUI::Render() { @@ -25,50 +23,54 @@ void GUI::Render() for (auto& pFeature : Framework::g_vecFeatures) pFeature->HandleInput(); - /* - if (GuiWatermark->GetValue()) - ShowWatermark(GuiWatermarkFPS->GetValue(), Framework::Title.c_str(), ImVec4(255, 255, 255, 255), ImVec4(255, 255, 255, 0)); - */ - if (bMenuOpen) { static std::once_flag onceflag; std::call_once(onceflag, []() { - /* - GuiCheat->SetCallback([]() { - ImGuiContext* pContext = ImGui::GetCurrentContext(); + GuiSidebar->SetPushVarsCallback([]() { + ImGuiStyle& imStyle = ImGui::GetStyle(); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, imStyle.ChildRounding); + ImGui::PushStyleColor(ImGuiCol_FrameBg, imStyle.Colors[ImGuiCol_Header]); + }); - ImVec2 vec2Size = (Framework::menu->m_stStyle.vec2Size / ImVec2{ 3.f, 2.f }) - pContext->Style.ItemSpacing; - ImVec2 vec2MaxSize = ImGui::GetContentRegionAvail(); + GuiSidebar->SetPopVarsCallback([]() { + ImGui::PopStyleColor(); + ImGui::PopStyleVar(); + }); - if (vec2Size.x > vec2MaxSize.x) - vec2Size.x = vec2MaxSize.x; + GuiSidebar->AddElement(GuiFeatureSeperator.get()); + GuiSidebar->AddElement(GuiMiscSeperator.get()); + GuiSidebar->AddElement(GuiDeveloper.get()); + GuiSidebar->AddElement(GuiConfig.get()); - if (vec2Size.y > vec2MaxSize.y) - vec2Size.y = vec2MaxSize.y; + // Set the default page (optional - defaults to 0 if not set) + ElementBase::SetDefaultPage(GuiConfig->GetPageId()); - return vec2Size; - }); + auto pHeaderGroup = static_cast(GuiHeaderGroup.get()); + if (pHeaderGroup) + { + pHeaderGroup->AddHeaders(GuiDeveloper->GetPageId(), { "DEVELOPER_MAIN"Hashed }); + pHeaderGroup->AddHeaders(GuiConfig->GetPageId(), { "CONFIG_MAIN"Hashed }); + } - GuiCheat->AddElement(GuiCheatSpacing1.get()); - GuiCheat->AddElement(GuiUnloadButton.get()); + // Update page IDs for body groups + GuiDeveloperPage->SetPageId(GuiDeveloper->GetPageId()); GuiUnloadButton->SetCallback([]() { Framework::bShouldRun = false; }); - GuiCheat->AddElement(GuiConsoleVisibility.get()); + GuiDeveloperPage->AddElement(GuiUnloadButton.get()); GuiConsoleVisibility->SetCallback([]() { Framework::console->ToggleVisibility(); - GuiConsoleVisibility->SetName(Framework::console->GetVisibility() ? "CONSOLE_HIDE"Hashed : "CONSOLE_SHOW"Hashed); }); - GuiCheat->AddElement(GuiLocalization.get()); + GuiDeveloperPage->AddElement(GuiConsoleVisibility.get()); GuiLocalization->SetCallback([]() { std::vector vecLocales = Localization::GetLocales(); for (size_t i = 0; i < vecLocales.size(); ++i) { bool bSelected = Localization::GetCurrentLocaleIndex() == i; Locale_t stLocale = vecLocales.at(i); - if (ImGui::Selectable(stLocale.sKey.c_str(), bSelected)) + if (ImAdd::Selectable(stLocale.sKey.c_str(), bSelected)) { Localization::SetLocale(stLocale.ullKeyHash); GuiLocalization->SetPreviewLabel(stLocale.sKey.c_str()); @@ -78,47 +80,23 @@ void GUI::Render() ImGui::SetItemDefaultFocus(); } }); - GuiCheat->AddElement(GuiWatermark.get()); - GuiCheat->AddElement(GuiWatermarkFPS.get()); - GuiCheat->AddElement(GuiSaveConfig.get()); + GuiDeveloperPage->AddElement(GuiLocalization.get()); + + GuiConfigPage->SetPageId(GuiConfig->GetPageId()); GuiSaveConfig->SetCallback([]() { Framework::config->SaveConfig(); }); - GuiCheat->AddElement(GuiLoadConfig.get()); + GuiConfigPage->AddElement(GuiSaveConfig.get()); GuiLoadConfig->SetCallback([]() { Framework::config->LoadConfig(); }); - */ - - GuiSidebar->SetPushVarsCallback([]() { - ImGuiStyle& imStyle = ImGui::GetStyle(); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, imStyle.ChildRounding); - ImGui::PushStyleColor(ImGuiCol_FrameBg, imStyle.Colors[ImGuiCol_Header]); - }); - - GuiSidebar->SetPopVarsCallback([]() { - ImGui::PopStyleColor(); - ImGui::PopStyleVar(); - }); - - GuiSidebar->AddElement(GuiMiscSeperator.get()); - GuiSidebar->AddElement(GuiDeveloper.get()); - GuiSidebar->AddElement(GuiStyle.get()); - GuiSidebar->AddElement(GuiSettings.get()); - GuiSidebar->AddElement(GuiConfig.get()); + GuiConfigPage->AddElement(GuiLoadConfig.get()); GuiHeaderGroup->AddElement(GuiBody.get()); + GuiBody->AddElement(GuiDeveloperPage.get()); + GuiBody->AddElement(GuiConfigPage.get()); }); - /* - GuiWatermarkFPS->SetVisible(GuiWatermark->GetValue()); - - if (!GuiCheat->HasParent()) - { - Framework::menu->AddElement(GuiCheat.get()); - } - */ - if (!GuiSidebar->HasParent()) { Framework::menu->AddElement(GuiSidebar.get()); Framework::menu->AddElement(GuiHeaderGroup.get()); @@ -134,17 +112,9 @@ void GUI::Render() // Other Render Stuff // -#if ENGINE_UNREAL - Framework::unreal->ActorLock.lock(); -#endif - for (auto& pFeature : Framework::g_vecFeatures) pFeature->Render(); -#if ENGINE_UNREAL - Framework::unreal->ActorLock.unlock(); -#endif - // Gui init shit if (Framework::menu->HasChildren()) // We have to wait till the menu has children to do the init { @@ -154,8 +124,7 @@ void GUI::Render() if (ImGui::GetIO().MouseDrawCursor) SetCursor(NULL); - // Set localization preview to the loaded locale - //GuiLocalization->SetPreviewLabel((Localization::GetInstance())->GetLocales()[(Localization::GetInstance())->GetCurrentLocaleIndex()].sKey.c_str()); + GuiLocalization->SetPreviewLabel((Localization::GetInstance())->GetLocales()[(Localization::GetInstance())->GetCurrentLocaleIndex()].sKey.c_str()); // Load the config Framework::config->LoadConfig(); diff --git a/Internal/GUI/GUI.hpp b/Internal/GUI/GUI.hpp index 89827e4..622516f 100644 --- a/Internal/GUI/GUI.hpp +++ b/Internal/GUI/GUI.hpp @@ -27,40 +27,35 @@ namespace GUI inline std::unique_ptr GuiSidebar = std::make_unique(std::string("SIDEBAR"), "SIDEBAR"Hashed, ElementBase::Style_t{ .vec2Size = ImVec2(160.f, 0.f), .iFlags = ImGuiChildFlags_Border }, ImGuiWindowFlags_NoBackground); + inline std::unique_ptr GuiFeatureSeperator = std::make_unique(std::string("FEATURE_SEPERATOR"), "FEATURE_SEPERATOR"Hashed); inline std::unique_ptr GuiMiscSeperator = std::make_unique(std::string("MISC_SEPERATOR"), "MISC_SEPERATOR"Hashed); inline std::unique_ptr GuiDeveloper = std::make_unique(std::string("DEVELOPER_BUTTON"), "DEVELOPER_BUTTON"Hashed, ElementBase::Style_t{ - .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_TERMINAL, ElementBase::EPage::Developer); - inline std::unique_ptr GuiStyle = std::make_unique(std::string("STYLE_BUTTON"), "STYLE_BUTTON"Hashed, ElementBase::Style_t{ - .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_PALLET, ElementBase::EPage::Style); - inline std::unique_ptr GuiSettings = std::make_unique(std::string("SETTINGS_BUTTON"), "SETTINGS_BUTTON"Hashed, ElementBase::Style_t{ - .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_GEAR, ElementBase::EPage::Settings); + .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_TERMINAL, true); inline std::unique_ptr GuiConfig = std::make_unique(std::string("CONFIG_BUTTON"), "CONFIG_BUTTON"Hashed, ElementBase::Style_t{ - .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_FLOPPY_DISK, ElementBase::EPage::Config); + .vec2Size = ImVec2(-0.1f, 0) }, ICON_FA_FLOPPY_DISK, true); - inline std::vector HeaderGroupHeaders = { - { ElementBase::EPage::Developer, { "MAIN"Hashed, "EXAMPLE"Hashed, "EXAMPLE2"Hashed } } - }; + // Headers are now added dynamically in GUI.cpp + inline std::vector HeaderGroupHeaders = {}; + inline std::unique_ptr GuiHeaderGroup = std::make_unique(std::string("HEADER_GROUP"), "HEADER_GROUP"Hashed, ElementBase::Style_t{ .vec2Size = ImVec2(-0.1f, 0), }, HeaderGroupHeaders); inline std::unique_ptr GuiBody = std::make_unique(std::string("BODY"), ElementBase::Style_t{ .vec2Size = ImVec2(-0.1f, 0), }); - /* - inline std::unique_ptr GuiCheat = std::make_unique(std::string("CHEAT"), "CHEAT"Hashed, ElementBase::Style_t{ - .iFlags = ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY }, ImGuiWindowFlags_HorizontalScrollbar); - inline std::unique_ptr GuiCheatSpacing1 = std::make_unique(std::string("SPACING_1"), "SPACING_1"Hashed); + // Developer Page Elements + inline std::unique_ptr GuiDeveloperPage = std::make_unique("DEVELOPER_PAGE", ElementBase::Style_t(), 0, 0); inline std::unique_ptr