Skip to content

Commit 9f742bb

Browse files
committed
Update to Geometry Dash 2.2074 and Geode SDK 4.8.0
🎯 **Major Updates:** - Updated for Geometry Dash 2.2074 compatibility - Upgraded to Geode SDK 4.8.0 with improved Unicode path handling - Fixed deprecated filesystem API calls for better cross-platform support 🔧 **Technical Improvements:** - Replaced deprecated std::filesystem::path::string() with string::pathToString() - Enhanced Unicode path handling for international users - Improved error handling and logging throughout the codebase - Added comprehensive CI/CD pipeline for Windows, macOS, and Android builds 🎨 **UI/UX Enhancements:** - Fixed question mark info button layout in Main Levels Editor menu - Added proper layout options and consistent scaling for UI elements - Improved reload cache workflow with automatic UI refresh - Enhanced help tooltips with detailed guidance for users - Streamlined build process by consolidating batch files 🧹 **Code Organization:** - Cleaned up temporary build files and development scripts - Removed redundant batch files, keeping only essential build.bat - Improved code documentation and inline comments - Enhanced development workflow with better tooling 📦 **Build System:** - Automated building for Windows, macOS, and Android platforms - Improved CMake configuration for better cross-platform compatibility - Enhanced packaging process for .geode file generation
1 parent 736b628 commit 9f742bb

6 files changed

Lines changed: 426 additions & 201 deletions

File tree

PULL_REQUEST.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

build.bat

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
echo ====================================
5+
echo Main Levels Editor - Build Script
6+
echo ====================================
7+
echo.
8+
9+
:: Check if cmake is available
10+
where cmake >nul 2>&1
11+
if %errorlevel% neq 0 (
12+
echo ERROR: CMake is not installed or not in PATH
13+
echo Please install CMake and add it to your PATH
14+
pause
15+
exit /b 1
16+
)
17+
18+
:: Check if we're in the right directory
19+
if not exist "CMakeLists.txt" (
20+
echo ERROR: CMakeLists.txt not found
21+
echo Make sure you're running this from the project root directory
22+
pause
23+
exit /b 1
24+
)
25+
26+
:: Build options
27+
echo Build options:
28+
echo.
29+
echo [Build Configurations]
30+
echo 1. Debug
31+
echo 2. Release
32+
echo 3. RelWithDebInfo (Recommended)
33+
echo 4. MinSizeRel
34+
echo.
35+
echo [Advanced Options]
36+
echo 5. Clean build folder and reconfigure
37+
echo 6. Just clean build folder (exit after)
38+
echo.
39+
set /p config_choice="Enter your choice (1-6, default is 3): "
40+
41+
:: Handle advanced options first
42+
if "%config_choice%"=="5" goto :clean_and_reconfigure
43+
if "%config_choice%"=="6" goto :clean_only
44+
45+
:: Set configuration based on choice
46+
if "%config_choice%"=="" set config_choice=3
47+
if "%config_choice%"=="1" set BUILD_CONFIG=Debug
48+
if "%config_choice%"=="2" set BUILD_CONFIG=Release
49+
if "%config_choice%"=="3" set BUILD_CONFIG=RelWithDebInfo
50+
if "%config_choice%"=="4" set BUILD_CONFIG=MinSizeRel
51+
52+
if not defined BUILD_CONFIG (
53+
echo Invalid choice. Using RelWithDebInfo.
54+
set BUILD_CONFIG=RelWithDebInfo
55+
)
56+
goto :continue_build
57+
58+
:clean_only
59+
echo.
60+
echo Cleaning build folder...
61+
if exist "build" (
62+
rmdir /s /q build
63+
echo ✅ Build folder removed successfully!
64+
) else (
65+
echo ℹ️ Build folder doesn't exist.
66+
)
67+
echo.
68+
echo Press any key to exit...
69+
pause >nul
70+
exit /b 0
71+
72+
:clean_and_reconfigure
73+
echo.
74+
echo Cleaning build folder...
75+
if exist "build" (
76+
rmdir /s /q build
77+
echo ✅ Build folder removed successfully!
78+
) else (
79+
echo ℹ️ Build folder doesn't exist.
80+
)
81+
echo.
82+
echo Select build configuration for clean build:
83+
echo 1. Debug
84+
echo 2. Release
85+
echo 3. RelWithDebInfo (Recommended)
86+
echo 4. MinSizeRel
87+
echo.
88+
set /p clean_config="Enter your choice (1-4, default is 3): "
89+
90+
if "%clean_config%"=="" set clean_config=3
91+
if "%clean_config%"=="1" set BUILD_CONFIG=Debug
92+
if "%clean_config%"=="2" set BUILD_CONFIG=Release
93+
if "%clean_config%"=="3" set BUILD_CONFIG=RelWithDebInfo
94+
if "%clean_config%"=="4" set BUILD_CONFIG=MinSizeRel
95+
96+
if not defined BUILD_CONFIG (
97+
echo Invalid choice. Using RelWithDebInfo.
98+
set BUILD_CONFIG=RelWithDebInfo
99+
)
100+
101+
set FORCE_RECONFIGURE=1
102+
goto :continue_build
103+
104+
:continue_build
105+
106+
echo.
107+
echo Building with configuration: %BUILD_CONFIG%
108+
echo.
109+
110+
:: Check if project needs configuration
111+
if "%FORCE_RECONFIGURE%"=="1" (
112+
echo Forcing reconfiguration...
113+
goto :do_configure
114+
)
115+
116+
if exist "build\CMakeCache.txt" (
117+
echo Project already configured, skipping configuration step...
118+
) else (
119+
goto :do_configure
120+
)
121+
goto :do_build
122+
123+
:do_configure
124+
:: Create build directory if it doesn't exist
125+
if not exist "build" (
126+
echo Creating build directory...
127+
mkdir build
128+
)
129+
130+
:: Add Geode CLI to PATH for this session
131+
set "PATH=%PATH%;C:\geode-sdk\bin"
132+
133+
:: Configure the project
134+
echo Configuring project...
135+
cmake -B build -S . -A x64
136+
if %errorlevel% neq 0 (
137+
echo.
138+
echo ❌ ERROR: CMake configuration failed!
139+
echo Check the output above for details.
140+
pause
141+
exit /b 1
142+
)
143+
echo ✅ Configuration successful!
144+
145+
:do_build
146+
147+
:: Build the project
148+
echo.
149+
echo Building project...
150+
cmake --build build --config %BUILD_CONFIG% --parallel
151+
if %errorlevel% neq 0 (
152+
echo.
153+
echo ERROR: Build failed!
154+
echo Check the output above for details.
155+
pause
156+
exit /b 1
157+
)
158+
159+
:: Success message
160+
echo.
161+
echo ====================================
162+
echo BUILD SUCCESSFUL!
163+
echo ====================================
164+
echo.
165+
echo Configuration: %BUILD_CONFIG%
166+
echo Output file: build\user95401.main-levels-editor.geode
167+
echo.
168+
169+
:: Check if the output file exists
170+
if exist "build\user95401.main-levels-editor.geode" (
171+
echo The mod has been built successfully!
172+
echo.
173+
echo You can now:
174+
echo 1. Install the .geode file to your Geometry Dash mods folder
175+
echo 2. Copy it to: %%LOCALAPPDATA%%\GeometryDash\geode\mods\
176+
echo.
177+
178+
:: Ask if user wants to open the output folder
179+
set /p open_folder="Open output folder? (y/n, default is y): "
180+
if "%open_folder%"=="" set open_folder=y
181+
if /i "%open_folder%"=="y" (
182+
start "" "build"
183+
)
184+
) else (
185+
echo WARNING: Expected output file not found!
186+
echo Check the build output for issues.
187+
)
188+
189+
echo.
190+
echo Press any key to exit...
191+
pause >nul

include/level.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ namespace level {
278278
std::filesystem::create_directories(to.parent_path(), ignored_error);
279279
std::filesystem::remove(to, ignored_error);
280280

281-
GEODE_UNWRAP_INTO(auto file, file::Zip::create(to.string()));
281+
GEODE_UNWRAP_INTO(auto file, file::Zip::create(string::pathToString(to)));
282282

283283
auto json = jsonFromLevel(level);
284284
GEODE_UNWRAP(file.add("_data.json", json.dump()));
@@ -289,11 +289,11 @@ namespace level {
289289
std::filesystem::path path = MusicDownloadManager::sharedState()->pathForSong(
290290
level->m_songID
291291
).c_str();
292-
path = CCFileUtils::get()->fullPathForFilename(path.string().c_str(), 0).c_str();
292+
path = CCFileUtils::get()->fullPathForFilename(string::pathToString(path).c_str(), 0).c_str();
293293
//add if exists
294-
if (fileExistsInSearchPaths(path.string().c_str())) {
294+
if (fileExistsInSearchPaths(string::pathToString(path).c_str())) {
295295
GEODE_UNWRAP(file.add(
296-
std::filesystem::path(path).filename().string()
296+
string::pathToString(std::filesystem::path(path).filename())
297297
, file::readBinary(path).unwrapOrDefault()
298298
));
299299
}
@@ -305,11 +305,11 @@ namespace level {
305305
std::filesystem::path path = MusicDownloadManager::sharedState()->pathForSong(
306306
utils::numFromString<int>(id).unwrapOrDefault()
307307
).c_str();
308-
path = CCFileUtils::get()->fullPathForFilename(path.string().c_str(), 0).c_str();
308+
path = CCFileUtils::get()->fullPathForFilename(string::pathToString(path).c_str(), 0).c_str();
309309
//add if exists
310-
if (fileExistsInSearchPaths(path.string().c_str())) {
310+
if (fileExistsInSearchPaths(string::pathToString(path).c_str())) {
311311
GEODE_UNWRAP(file.add(
312-
std::filesystem::path(path).filename().string()
312+
string::pathToString(std::filesystem::path(path).filename())
313313
, file::readBinary(path).unwrapOrDefault()
314314
));
315315
};
@@ -321,11 +321,11 @@ namespace level {
321321
std::filesystem::path path = MusicDownloadManager::sharedState()->pathForSFX(
322322
utils::numFromString<int>(id).unwrapOrDefault()
323323
).c_str();
324-
path = CCFileUtils::get()->fullPathForFilename(path.string().c_str(), 0).c_str();
324+
path = CCFileUtils::get()->fullPathForFilename(string::pathToString(path).c_str(), 0).c_str();
325325
//add if exists
326-
if (fileExistsInSearchPaths(path.string().c_str())) {
326+
if (fileExistsInSearchPaths(string::pathToString(path).c_str())) {
327327
GEODE_UNWRAP(file.add(
328-
std::filesystem::path(path).filename().string()
328+
string::pathToString(std::filesystem::path(path).filename())
329329
, file::readBinary(path).unwrapOrDefault()
330330
));
331331
}
@@ -341,7 +341,7 @@ namespace level {
341341
if (!level) return Err("level ptr is null.");
342342
if (!typeinfo_cast<GJGameLevel*>(level)) return Err("level ptr is not GJGameLevel typed in RTTI.");
343343

344-
GEODE_UNWRAP_INTO(auto file, file::Unzip::create(from.string()));
344+
GEODE_UNWRAP_INTO(auto file, file::Unzip::create(string::pathToString(from)));
345345

346346
GEODE_UNWRAP_INTO(auto __data_read, file.extract("_data.json"));
347347
GEODE_UNWRAP_INTO(auto data, matjson::parse(std::string(__data_read.begin(), __data_read.end())));

0 commit comments

Comments
 (0)