Skip to content

Commit

Permalink
Merge pull request #1 from HJfod/new
Browse files Browse the repository at this point in the history
New
  • Loading branch information
HJfod committed Apr 16, 2021
2 parents bfbfcbb + d5598cc commit d1f5999
Show file tree
Hide file tree
Showing 1,758 changed files with 390,533 additions and 10,817 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
build
*.gmd
*.gmd2
*.lvl
build/
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[submodule "submodules/Cappuccino"]
path = submodules/Cappuccino
url = https://github.com/AndreNIH/CappuccinoSDK/
[submodule "submodules/MinHook"]
path = submodules/MinHook
url = https://github.com/TsudaKageyu/minhook
[submodule "submodules/gd"]
path = submodules/gd
url = https://github.com/poweredbypie/gd.h
[submodule "submodules/nfd"]
path = submodules/nfd
url = https://github.com/mlabbe/nativefiledialog
[submodule "submodules/zipper"]
path = submodules/zipper
url = https://github.com/sebastiandev/zipper
5 changes: 2 additions & 3 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${vcpkgRoot}/x86-windows/include/**",
"${workspaceFolder}/submodules/MinHook/include/**"
"${vcpkgRoot}/x86-windows/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "windows-msvc-x64"
Expand Down
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
24 changes: 11 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"files.associations": {
"chrono": "cpp",
"xstring": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
Expand All @@ -21,7 +20,6 @@
"deque": "cpp",
"exception": "cpp",
"filesystem": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
Expand All @@ -37,24 +35,23 @@
"map": "cpp",
"memory": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"valarray": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
Expand All @@ -68,14 +65,15 @@
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"mutex": "cpp",
"random": "cpp",
"thread": "cpp"
"array": "cpp",
"forward_list": "cpp",
"numeric": "cpp",
"regex": "cpp",
"valarray": "cpp",
"random": "cpp"
}
}
Binary file added BE_Export_File-hd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BE_Export_File-uhd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BE_Export_File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BE_Import_File-hd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BE_Import_File-uhd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BE_Import_File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 28 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(PROJECT_NAME GDShare)
set(RUNNER_NAME OneTimeRunner)
# stop zipper from compiling test
set(BUILD_TEST Off CACHE BOOL "Build the test program." FORCE)

project(${PROJECT_NAME} VERSION 1.0.0)

file(GLOB_RECURSE SOURCES
main.cpp
dllmain.cpp
src/*.cpp
submodules/nfd/src/nfd_win.cpp
submodules/nfd/src/nfd_common.c
src/ext/ZlibHelper.cpp
src/ext/zip.cpp
)

set_source_files_properties(submodules/nfd/src/nfd_common.c PROPERTIES LANGUAGE CXX)

set(WIN32 ON)
Expand All @@ -26,36 +25,45 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
add_subdirectory(submodules/MinHook)
target_link_libraries(${PROJECT_NAME} submodules/MinHook/Release/minhook.x32)

add_subdirectory(submodules/zipper)
target_link_libraries(${PROJECT_NAME} submodules/zipper/Release/staticZipper)

target_include_directories(
${PROJECT_NAME} PRIVATE
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx/include
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx/kazmath/include
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx/platform/third_party/win32/OGLES
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx/platform/third_party/win32/zlib
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/cocos2dx/platform/win32
submodules/Cappuccino/template/default-cpp/cappuccino-sdk/incl/extensions
submodules/cocos2dx
submodules/cocos2dx/include
submodules/cocos2dx/kazmath/include
submodules/cocos2dx/platform/third_party/win32/OGLES
submodules/cocos2dx/platform/win32
submodules/extensions
submodules/MinHook/include
submodules/gd/include
submodules/gd
submodules/nfd/src/include
submodules/zipper/zipper
)

target_link_libraries(
${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/libcocos2d.lib
${CMAKE_SOURCE_DIR}/submodules/Cappuccino/template/default-cpp/cappuccino-sdk/lib/cappuccino.lib
${CMAKE_SOURCE_DIR}/submodules/Cappuccino/template/default-cpp/cappuccino-sdk/lib/libExtensions.lib
${CMAKE_SOURCE_DIR}/submodules/cocos2dx/libcocos2d.lib
# ${CMAKE_SOURCE_DIR}/submodules/cocos2dx/pugixml.lib
${CMAKE_SOURCE_DIR}/submodules/extensions/libExtensions.lib
)


# runner

add_executable(${RUNNER_NAME} runner.cpp)
if (COMPILE_RUNNER)

add_executable(${RUNNER_NAME} runner.cpp)

set_source_files_properties( runner.cpp PROPERTIES LANGUAGE CXX )
set_source_files_properties( runner.cpp PROPERTIES CXX_STANDARD 17 )
set_source_files_properties( runner.cpp PROPERTIES CXX_STANDARD_REQUIRED ON )

set_source_files_properties( runner.cpp PROPERTIES LANGUAGE CXX )
set_source_files_properties( runner.cpp PROPERTIES CXX_STANDARD 17 )
set_source_files_properties( runner.cpp PROPERTIES CXX_STANDARD_REQUIRED ON )
target_link_libraries(${RUNNER_NAME} WtsApi32)

target_link_libraries(${RUNNER_NAME} WtsApi32)
add_definitions(${PROJECT_SOURCE_DIR}/runner.cpp "-DNOMSGBOX")

add_definitions(${PROJECT_SOURCE_DIR}/runner.cpp "-DNOMSGBOX")
endif()

40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
# this is wip
# Integrated GDShare

Currently the mod is in an usable state, but it may (and likely) does contain bugs that need to be ironed out. If you find issues, please let me know!
This is a mod for GD that adds buttons to export / import levels.

# known bugs
# Installation

1. Download the [latest release](https://github.com/HJfod/GDShare-mod/releases/latest)
2. Unzip contents in location of choice (preferably an empty folder)
3. Run `OneTimeRunner.exe`
4. For permanent installation, you need a modloader. Follow instructions for your specific loader to finish installing:

### With MegaHack v6

1. Go to your `Geometry Dash` folder (the one with `GeometryDash.exe` in it)
2. Open `absolutedlls` with notepad
3. Add a new line and on it type "path/to/GDShare.dll" (replace path/to with the actual path to the file)

### With ModLdr

1. Add GDShare.dll to your `mods` folder

### With GDDLLLoader

1. Add GDShare.dll to your `adaf-dlls` folder

### For other modloaders

1. Ask the developer how to add normal DLLs as mods.

# Thank yous

* [Zipper](https://github.com/sebastiandev/zipper)
* [MinHook](https://github.com/TsudaKageyu/minhook)
* [nfd](https://github.com/mlabbe/nativefiledialog)
* [PoweredByPie](https://github.com/poweredbypie)
* [MatCool](https://github.com/matcool/) (tysm)
* [zmx](https://github.com/kyurime)
* And everyone else in [GDP](https://discord.gg/jEwtDBK)

* deleting a level right after importing it crashes the game
51 changes: 51 additions & 0 deletions dllmain.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include "src/mod.hpp"

// #define GDCONSOLE

#ifdef GDCONSOLE
#include "src/console.hpp"
#endif

DWORD WINAPI load_thread(LPVOID hModule) {
if (gd::init()) {

#ifdef GDCONSOLE
if (!gd::console::load()) {
MessageBoxA(nullptr, "Unable to hook up debugging console!", "GDShare", MB_ICONERROR);
FreeLibraryAndExitThread((HMODULE)hModule, 0);
return 1;
}
#endif

if (mod::load()) {
#ifdef GDCONSOLE
gd::console::awaitUnload();
#endif
} else
FreeLibraryAndExitThread((HMODULE)hModule, 0);
} else
FreeLibraryAndExitThread((HMODULE)hModule, 0);

#ifdef GDCONSOLE

mod::unload();
gd::console::unload();
FreeLibraryAndExitThread((HMODULE)hModule, 0);

#endif

return 0;
}

BOOL APIENTRY DllMain(
HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
) {
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
// what the hell is this pie
HANDLE _ = CreateThread(0, 0, load_thread, hModule, 0, nullptr);
if (_) CloseHandle(_);
}
return TRUE;
}
Binary file added gdshare_very_important_export_sound_effect.mp3
Binary file not shown.
47 changes: 0 additions & 47 deletions main.cpp

This file was deleted.

Loading

0 comments on commit d1f5999

Please sign in to comment.