Skip to content

Commit 95de107

Browse files
committed
Update for GD 2.2074 and Geode SDK 4.8.0
- Update Geode SDK version from 4.7.0 to 4.8.0 - Fix Unicode path handling by replacing deprecated path.string() calls with string::pathToString() - Update mod version to v8.0.0-beta.11 - Add CI/CD workflow for automated building across platforms - Update README with build instructions and compatibility info - Add copilot-instructions.md for development guidelines Fixes compatibility with Geometry Dash 2.2074
1 parent 5676c4e commit 95de107

5 files changed

Lines changed: 197 additions & 7 deletions

File tree

.github/copilot-instructions.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!-- Use this file to provide workspace-specific custom instructions to Copilot. For more details, visit https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file -->
2+
3+
# Main Levels Editor - Geode Mod Development Guidelines
4+
5+
## Project Overview
6+
This is a Geode mod for Geometry Dash that allows users to customize which levels appear in the level select screen. The mod supports importing/exporting custom .level files and provides a comprehensive level editor interface.
7+
8+
## Key Technologies
9+
- **Geode SDK 4.8.0+** - Modern C++ modding framework for Geometry Dash
10+
- **CMake 3.21+** - Build system
11+
- **C++20** - Programming language standard
12+
- **Geometry Dash 2.2074** - Target game version
13+
14+
## Code Style and Conventions
15+
16+
### File Handling
17+
- Always use `string::pathToString()` instead of `std::filesystem::path::string()` for Unicode safety
18+
- Use Geode's file utilities (`file::readJson`, `file::writeJson`, etc.) instead of raw filesystem calls
19+
- Handle path operations safely with proper error checking
20+
21+
### Geode-Specific Guidelines
22+
- Use `$modify` classes for hooking game functions
23+
- Prefer Geode's UI components (`Popup`, `TextInput`, `ButtonSprite`) over raw Cocos2d
24+
- Use `Ref<>` for automatic memory management of Cocos2d objects
25+
- Follow Geode naming conventions with proper namespacing
26+
27+
### Memory Management
28+
- Use RAII principles
29+
- Prefer smart pointers and Geode's `Ref<>` system
30+
- Always check for null pointers before dereferencing
31+
- Clean up resources in destructors
32+
33+
### Error Handling
34+
- Use Geode's `Result<>` type for operations that can fail
35+
- Provide meaningful error messages to users via `Notification::create()`
36+
- Log errors using `log::error()` for debugging
37+
38+
### UI Development
39+
- Use Geode's layout system (`AxisLayout`, `RowLayout`) for responsive UIs
40+
- Make UI elements accessible and intuitive
41+
- Support both desktop and mobile interfaces
42+
- Use consistent styling with Geometry Dash's theme
43+
44+
## Architecture Notes
45+
46+
### Core Components
47+
- **Level File System**: Custom `.level` format for sharing levels with metadata and audio
48+
- **Level List Management**: Dynamic level listing configuration
49+
- **Editor Integration**: Hooks into GD's level editor for enhanced functionality
50+
- **UI Overlays**: Custom popups and menus integrated into game flow
51+
52+
### Hook Points
53+
- `LocalLevelManager`: For loading custom levels
54+
- `GameLevelManager`: For level data management
55+
- `LevelSelectLayer`: For custom level listings
56+
- `EditorUI`: For level editor enhancements
57+
58+
## Important Considerations
59+
- Always test on multiple platforms (Windows, macOS, Android)
60+
- Ensure backwards compatibility with existing .level files
61+
- Performance is critical - avoid blocking operations in game loops
62+
- Unicode support is essential for international users
63+
- Follow Geode's mod certification guidelines for distribution
64+
65+
## Common Pitfalls to Avoid
66+
- Don't use raw `std::filesystem::path::string()` - use `string::pathToString()`
67+
- Don't create UI elements on the main thread without proper scheduling
68+
- Don't forget to handle edge cases in level ID parsing
69+
- Don't modify game state without proper validation
70+
- Don't block the UI thread with heavy file operations

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build Main Levels Editor
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-windows:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Setup Geode SDK
19+
uses: geode-sdk/cli@main
20+
21+
- name: Build Windows
22+
run: |
23+
cmake -B build -DCMAKE_BUILD_TYPE=Release
24+
cmake --build build --config Release
25+
26+
- name: Upload artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: main-levels-editor-windows
30+
path: build/main.geode
31+
32+
build-android:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
submodules: recursive
39+
40+
- name: Setup Geode SDK
41+
uses: geode-sdk/cli@main
42+
43+
- name: Build Android
44+
run: |
45+
geode config setup --platform android
46+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23
47+
cmake --build build --config Release
48+
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: main-levels-editor-android
53+
path: build/main.geode
54+
55+
build-macos:
56+
runs-on: macos-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
submodules: recursive
62+
63+
- name: Setup Geode SDK
64+
uses: geode-sdk/cli@main
65+
66+
- name: Build macOS
67+
run: |
68+
cmake -B build -DCMAKE_BUILD_TYPE=Release
69+
cmake --build build --config Release
70+
71+
- name: Upload artifacts
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: main-levels-editor-macos
75+
path: build/main.geode

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,52 @@
22

33
Allows you to control what levels should be in level select layer.
44

5-
developing v8 rn/
5+
**Updated for Geometry Dash 2.2074 and Geode SDK 4.8.0**
6+
7+
## What's New in v8.0.0-beta.11
8+
9+
-**Updated for Geometry Dash 2.2074** - Full compatibility with the latest GD version
10+
-**Updated to Geode SDK 4.8.0** - Uses the latest Geode SDK with improved Unicode path handling
11+
- 🔧 **Fixed path handling** - Replaced deprecated `std::filesystem::path::string()` calls with `string::pathToString()`
12+
- 🏗️ **Added CI/CD** - Automated building for Windows, macOS, and Android
13+
14+
## Installation
15+
16+
1. Install [Geode](https://geode-sdk.org/) for Geometry Dash 2.2074
17+
2. Download the latest `.geode` file from the [releases page](https://github.com/LatterRarity70/Main-Levels-Editor/releases)
18+
3. Place it in your `geode/mods` folder
19+
4. Launch Geometry Dash
20+
21+
## Building from Source
22+
23+
### Prerequisites
24+
- CMake 3.21 or higher
25+
- [Geode SDK](https://geode-sdk.org/) set up for your platform
26+
- Visual Studio 2022 (Windows) / Xcode (macOS) / Android NDK (Android)
27+
28+
### Build Steps
29+
1. Clone the repository:
30+
```bash
31+
git clone https://github.com/LatterRarity70/Main-Levels-Editor.git
32+
cd Main-Levels-Editor
33+
```
34+
35+
2. Set up Geode SDK environment variable:
36+
```bash
37+
# Windows
38+
set GEODE_SDK=path\to\geode\sdk
39+
40+
# macOS/Linux
41+
export GEODE_SDK=/path/to/geode/sdk
42+
```
43+
44+
3. Build:
45+
```bash
46+
cmake -B build -DCMAKE_BUILD_TYPE=Release
47+
cmake --build build --config Release
48+
```
49+
50+
4. The built `.geode` file will be in the `build` directory
651

752
### Temporary guide
853

mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.7.0",
2+
"geode": "4.8.0",
33
"early-load": true,
44
"gd": {
55
"win": "2.2074",
@@ -8,7 +8,7 @@
88
"ios": "2.2074"
99
},
1010

11-
"version": "v8.0.0-beta.10",
11+
"version": "v8.0.0-beta.11",
1212
"id": "user95401.main-levels-editor",
1313
"name": "Main Levels Editor",
1414
"developer": "user95401",

src/xd.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,12 @@ class MainLevelsEditorMenu : public geode::Popup<> {
462462

463463
auto body = std::stringstream();
464464

465-
body << """" "` File:` [" + path.string() + "](file:///" + string::replace(path.string(), " ", "%20") + ")";
465+
body << """" "` File:` [" + string::pathToString(path) + "](file:///" + string::replace(string::pathToString(path), " ", "%20") + ")";
466466
body << "\n";
467-
body << "\n" "` Dir:` [" + dir.string() + "](file:///" + string::replace(dir.string(), " ", "%20") + ")";
467+
body << "\n" "` Dir:` [" + string::pathToString(dir) + "](file:///" + string::replace(string::pathToString(dir), " ", "%20") + ")";
468468
body << "\n";
469469
body << "\n" "```";
470-
body << "\n" "zip tree of \"" << std::filesystem::path(path).filename().string() << "\": ";
470+
body << "\n" "zip tree of \"" << string::pathToString(std::filesystem::path(path).filename()) << "\": ";
471471
auto unzip = file::Unzip::create(string::pathToString(path));
472472
if (unzip.err()) body
473473
<< "\n" "FAILED TO OPEN CREATED ZIP!"
@@ -477,7 +477,7 @@ class MainLevelsEditorMenu : public geode::Popup<> {
477477
body << "\n" "```";
478478
body << "\n";
479479
body << "\n" "```";
480-
body << "\n" "data \"" << std::filesystem::path(path).filename().string() << "\": ";
480+
body << "\n" "data \"" << string::pathToString(std::filesystem::path(path).filename()) << "\": ";
481481
for (auto entry : dbg_json) body
482482
<< "\n- " << entry.getKey().value_or("unk") + ": " << entry.dump();
483483
body << "\n" "```";

0 commit comments

Comments
 (0)