diff --git a/.github/workflows/multi-platform.yml b/.github/workflows/multi-platform.yml new file mode 100644 index 0000000..0f41b78 --- /dev/null +++ b/.github/workflows/multi-platform.yml @@ -0,0 +1,91 @@ +name: Build Geode Mod + +permissions: + contents: write + +on: + workflow_dispatch: + push: + branches: + - '**' + +jobs: + + build: + continue-on-error: true # continue even if build failed for some platform + strategy: + + fail-fast: false + matrix: + config: + - name: Windows + os: windows-latest + + - name: macOS + os: macos-latest + + - name: Android64 + os: ubuntu-latest + target: Android64 + + - name: Android32 + os: ubuntu-latest + target: Android32 + + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + steps: + - uses: actions/checkout@v3 + + - name: Build the mod + uses: geode-sdk/build-geode-mod@main + with: + target: ${{ matrix.config.target }} + combine: true + + upload: + name: Combine and upload builds + runs-on: ubuntu-latest + needs: ['build'] + steps: + + - name: "Combine builds" + uses: geode-sdk/build-geode-mod/combine@main + id: build + + - name: "Upload artifact" + uses: actions/upload-artifact@v4 + with: + name: Build Output + path: ${{ steps.build.outputs.build-output }} + + - name: "Set up Git repository" + uses: actions/checkout@v2 + + - name: "Development Release" + uses: ncipollo/release-action@v1 + with: + name: "Development Release" + body: | + Release of success build for latest commit on `${{ github.head_ref || github.ref_name }}`. + The build workflow run for this release goes in [#${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + tag: "nightly" + prerelease: true + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: "${{steps.build.outputs.build-output}}/*" + + - name: "Get mod properties" + id: json_properties + uses: ActionsTools/read-json-action@main + with: + file_path: "mod.json" + + - name: "Try Release Version" + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "${{steps.json_properties.outputs.version}}" + artifacts: "${{steps.build.outputs.build-output}}/*" + artifactErrorsFailBuild: true + allowUpdates: false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2604c20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Macos be like +**/.DS_Store + +# Cache files for Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache + +# Ignore build folders +**/build +# Ignore platform specific build folders +build-*/ + +# Workspace files are user-specific +*.sublime-workspace + +# ILY vscode +**/.vscode + +# Local History for Visual Studio Code +.history/ + +# clangd +.cache/ + +# Visual Studio +.vs/ + +# CLion +.idea/ +/cmake-build-*/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5f91e18 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.21) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +set(CMAKE_CXX_VISIBILITY_PRESET hidden) + +project(NoGeodeUI VERSION 1.0.0) + +add_library(${PROJECT_NAME} SHARED + src/main.cpp + # Add any extra C++ source files here +) + +if (NOT DEFINED ENV{GEODE_SDK}) + message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode") +else() + message(STATUS "Found Geode: $ENV{GEODE_SDK}") +endif() + +add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode) + +setup_geode_mod(${PROJECT_NAME}) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..2dd4a22 --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "x64-Clang-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "clang_cl_x64_x64" ], + "variables": [] + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..616965f --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# NoGeodeUI +This is where she makes a mod. + +the mod's logo + +*Update logo.png to change your mod's icon (please)* + +## Getting started +We recommend heading over to [the getting started section on our docs](https://docs.geode-sdk.org/getting-started/) for useful info on what to do next. + +## Build instructions +For more info, see [our docs](https://docs.geode-sdk.org/getting-started/create-mod#build) +```sh +# Assuming you have the Geode CLI set up already +geode build +``` + +# Resources +* [Geode SDK Documentation](https://docs.geode-sdk.org/) +* [Geode SDK Source Code](https://github.com/geode-sdk/geode/) +* [Geode CLI](https://github.com/geode-sdk/cli) +* [Bindings](https://github.com/geode-sdk/bindings/) +* [Dev Tools](https://github.com/geode-sdk/DevTools) diff --git a/about.md b/about.md new file mode 100644 index 0000000..c82f684 --- /dev/null +++ b/about.md @@ -0,0 +1,3 @@ +# No Geode UI + +Remove button, loading label and all other nodes about geode loader. \ No newline at end of file diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..f3363cd Binary files /dev/null and b/logo.png differ diff --git a/mod.json b/mod.json new file mode 100644 index 0000000..04a00cc --- /dev/null +++ b/mod.json @@ -0,0 +1,15 @@ +{ + "early-load": true, + "geode": "3.4.0", + "gd": { + "win": "*", + "android": "*", + "mac": "*", + "ios": "*" + }, + "id": "user95401.no_geode_ui", + "name": "No Geode UI", + "version": "v1.0.0", + "developer": "user95401", + "description": "Remove button, loading label and all other nodes about geode loader." +} diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..8700606 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,42 @@ +#include + +using namespace geode::prelude; + +#include +class CCNodeGeodeExt : public CCNode { +public: + void customSetup() { + if (string::containsAny(this->getID(), { "geode.loader/", "geode-" })) { + auto parent = this->getParent(); + if (parent && parent->getLayout()) { + this->removeFromParentAndCleanup(0); + parent->updateLayout(); + } + } + } + static void setID_det(CCNodeGeodeExt* __this, std::string const& id) { + __this->setID(id); + if (string::containsAny(id, { "geode.loader/", "geode-" })) { + log::warn("{} \"{}\" got removed", __this, id); + __this->setVisible(0); + __this->setContentSize(CCSizeZero); + } + __this->scheduleOnce(schedule_selector(CCNodeGeodeExt::customSetup), 0.f); + } + static void hook() { + auto hook = Mod::get()->hook( + reinterpret_cast( + geode::addresser::getNonVirtual(&CCNode::setID) + ), + &CCNodeGeodeExt::setID_det, + "CCNode::setID", + tulip::hook::TulipConvention::Thiscall + ); + if (hook.has_error()) log::error("hook failed: {}", hook.error_or("no error...")); + if (hook.has_value()) log::debug("{}", hook.value()->getRuntimeInfo().dump(4)); + } +}; + +$on_mod(Loaded) { + CCNodeGeodeExt::hook(); +}; \ No newline at end of file