Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wip?) node ids ios port #46

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- name: macOS
os: macos-latest

- name: iOS
os: macos-latest
target: iOS

- name: Android32
os: ubuntu-latest
target: Android32
Expand All @@ -33,8 +37,10 @@ jobs:
- uses: actions/checkout@v4

- name: Build the mod
uses: geode-sdk/build-geode-mod@main
uses: RoootTheFox/build-geode-mod@main
with:
bindings: hiimjustin000/bindings
bindings-ref: patch-2
combine: true
target: ${{ matrix.config.target }}

Expand All @@ -44,7 +50,7 @@ jobs:
needs: ['build']

steps:
- uses: geode-sdk/build-geode-mod/combine@main
- uses: RoootTheFox/build-geode-mod/combine@main
id: build

- uses: actions/upload-artifact@v3
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
if ("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS" OR IOS)
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(NodeIDs VERSION 1.0.0)

if(${GEODE_TARGET_PLATFORM} STREQUAL "iOS")
message(STATUS "building for ios :3")
unset(CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES arm64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
set(CMAKE_SYSTEM_NAME "iOS")
endif()

file(GLOB SOURCES
src/*.cpp
)
Expand Down
14 changes: 7 additions & 7 deletions src/MoreOptionsLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace geode::node_ids;
"music-offset-input"
);

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use GEODE_IS_MOBILE instead

std::array<std::string, 10> gameplayMenu1NodeNames{
"auto-retry", "enable-faster-reset",
"hide-attempts", "flip-pause-button",
Expand All @@ -56,7 +56,7 @@ using namespace geode::node_ids;
}
}

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
std::array<std::string, 6> gameplayMenu2NodeNames{
"default-mini-icon", "switch-spider-teleport-color",
"switch-dash-fire-color", "switch-wave-trail-color",
Expand All @@ -79,7 +79,7 @@ using namespace geode::node_ids;
}
}

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
std::array<std::string, 7> practiceMenuNodeNames{
"hide-attempts", "enable-auto-checkpoints",
"enable-quick-checkpoints", "enable-death-effect",
Expand Down Expand Up @@ -110,7 +110,7 @@ using namespace geode::node_ids;
}
#endif

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
std::array<std::string, 9> performanceMenuNodeNames{
"enable-smooth-fix", "increase-draw-capacity",
"enable-low-detail", "disable-high-object-alert",
Expand Down Expand Up @@ -140,7 +140,7 @@ using namespace geode::node_ids;
}
}

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
std::array<std::string, 4> audioMenuNodeNames{
"disable-song-alert", "no-song-limit",
"reduce-quality", "audio-fix-01"
Expand Down Expand Up @@ -168,7 +168,7 @@ using namespace geode::node_ids;
}
}

#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
std::array<std::string, 10> otherMenuNodeNames{
"more-comments", "load-comments",
"new-completed-filter", "increase-local-levels-per-page",
Expand Down Expand Up @@ -217,7 +217,7 @@ using namespace geode::node_ids;
#endif


#ifdef GEODE_IS_ANDROID
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_IOS)
constexpr std::array<std::pair<int, int>, 6> pageIdxToObjectIdxStartEnd{
std::make_pair(0, 20), // 10 togglers * 2 (multiplied by 2 to account for the toggler and the info icon)
std::make_pair(20, 32), // 6 * 2
Expand Down