Skip to content

Commit 968b7d3

Browse files
try 1 :')
1 parent edfbdc0 commit 968b7d3

9 files changed

Lines changed: 86 additions & 127 deletions

File tree

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build Geode Mod
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "**"
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
config:
15+
- name: Windows
16+
os: windows-latest
17+
18+
- name: macOS
19+
os: macos-latest
20+
21+
- name: Android32
22+
os: ubuntu-latest
23+
target: Android32
24+
25+
- name: Android64
26+
os: ubuntu-latest
27+
target: Android64
28+
29+
- name: iOS
30+
os: macos-latest
31+
target: iOS
32+
33+
name: ${{ matrix.config.name }}
34+
runs-on: ${{ matrix.config.os }}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Build the mod
40+
uses: geode-sdk/build-geode-mod@main
41+
with:
42+
bindings: geode-sdk/bindings
43+
bindings-ref: main
44+
combine: true
45+
target: ${{ matrix.config.target }}
46+
47+
package:
48+
name: Package builds
49+
runs-on: ubuntu-latest
50+
needs: ['build']
51+
52+
steps:
53+
- uses: geode-sdk/build-geode-mod/combine@main
54+
id: build
55+
56+
- uses: actions/upload-artifact@v4
57+
with:
58+
name: Build Output
59+
path: ${{ steps.build.outputs.build-output }}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ else()
88
endif()
99
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1010

11-
project(Template VERSION 1.0.0)
11+
project(GDBackup VERSION 1.0.0)
1212

1313
# Set up the mod binary
1414
add_library(${PROJECT_NAME} SHARED

README.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
1-
# Template
2-
This is where she makes a mod.
1+
# GDBackup
2+
![GDBackup](./logo.png)
33

4-
<img src="logo.png" width="150" alt="the mod's logo" />
5-
6-
*Update logo.png to change your mod's icon (please)*
7-
8-
## Getting started
9-
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.
10-
11-
## Build instructions
12-
For more info, see [our docs](https://docs.geode-sdk.org/getting-started/create-mod#build)
13-
```sh
14-
# Assuming you have the Geode CLI set up already
15-
geode build
16-
```
17-
18-
# Resources
19-
* [Geode SDK Documentation](https://docs.geode-sdk.org/)
20-
* [Geode SDK Source Code](https://github.com/geode-sdk/geode/)
21-
* [Geode CLI](https://github.com/geode-sdk/cli)
22-
* [Bindings](https://github.com/geode-sdk/bindings/)
23-
* [Dev Tools](https://github.com/geode-sdk/DevTools)
4+
An alternate backup server for Geometry Dash

about.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Template Mod
2-
3-
Edit about.md to change this
1+
# GDBackup
2+
Alternate server to Geometry Dash's current backup server!
3+
Only works if your GD account is approved in the server...

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# 1.0.0
2-
- Edit this file to change your mod's changelog.
2+
- First release.

logo.png

974 KB
Loading

mod.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"geode": "$GEODE_VERSION",
2+
"geode": "4.3.0",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",
66
"mac": "2.2074",
77
"ios": "2.2074"
88
},
9-
"id": "$MOD_ID",
10-
"name": "$MOD_NAME",
11-
"version": "$MOD_VERSION",
12-
"developer": "$MOD_DEVELOPER",
13-
"description": "$MOD_DESCRIPTION"
9+
"id": "jean.gdbackup",
10+
"name": "GDBackup",
11+
"version": "1.0",
12+
"developer": "Jean",
13+
"description": "An alternate backup server."
1414
}

src/main.cpp

Lines changed: 11 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,18 @@
1-
/**
2-
* Include the Geode headers.
3-
*/
41
#include <Geode/Geode.hpp>
52

6-
/**
7-
* Brings cocos2d and all Geode namespaces to the current scope.
8-
*/
93
using namespace geode::prelude;
104

11-
/**
12-
* `$modify` lets you extend and modify GD's classes.
13-
* To hook a function in Geode, simply $modify the class
14-
* and write a new function definition with the signature of
15-
* the function you want to hook.
16-
*
17-
* Here we use the overloaded `$modify` macro to set our own class name,
18-
* so that we can use it for button callbacks.
19-
*
20-
* Notice the header being included, you *must* include the header for
21-
* the class you are modifying, or you will get a compile error.
22-
*
23-
* Another way you could do this is like this:
24-
*
25-
* struct MyMenuLayer : Modify<MyMenuLayer, MenuLayer> {};
26-
*/
27-
#include <Geode/modify/MenuLayer.hpp>
28-
class $modify(MyMenuLayer, MenuLayer) {
29-
/**
30-
* Typically classes in GD are initialized using the `init` function, (though not always!),
31-
* so here we use it to add our own button to the bottom menu.
32-
*
33-
* Note that for all hooks, your signature has to *match exactly*,
34-
* `void init()` would not place a hook!
35-
*/
36-
bool init() {
37-
/**
38-
* We call the original init function so that the
39-
* original class is properly initialized.
40-
*/
41-
if (!MenuLayer::init()) {
42-
return false;
5+
#include <Geode/modify/GJAccountManager.hpp>
6+
class $modify(GJAccountManager) {
7+
void handleIt(bool _requestSentSuccessfully, std::string _response, std::string _tag, GJHttpType _httpType) {
8+
switch(_httpType) {
9+
case GJHttpType::kGJHttpTypeGetAccountBackupURL:
10+
case GJHttpType::kGJHttpTypeGetAccountSyncURL:
11+
_response = "https://gdbackup.141412.xyz";
12+
break;
13+
default:
14+
return;
4315
}
44-
45-
/**
46-
* You can use methods from the `geode::log` namespace to log messages to the console,
47-
* being useful for debugging and such. See this page for more info about logging:
48-
* https://docs.geode-sdk.org/tutorials/logging
49-
*/
50-
log::debug("Hello from my MenuLayer::init hook! This layer has {} children.", this->getChildrenCount());
51-
52-
/**
53-
* See this page for more info about buttons
54-
* https://docs.geode-sdk.org/tutorials/buttons
55-
*/
56-
auto myButton = CCMenuItemSpriteExtra::create(
57-
CCSprite::createWithSpriteFrameName("GJ_likeBtn_001.png"),
58-
this,
59-
/**
60-
* Here we use the name we set earlier for our modify class.
61-
*/
62-
menu_selector(MyMenuLayer::onMyButton)
63-
);
64-
65-
/**
66-
* Here we access the `bottom-menu` node by its ID, and add our button to it.
67-
* Node IDs are a Geode feature, see this page for more info about it:
68-
* https://docs.geode-sdk.org/tutorials/nodetree
69-
*/
70-
auto menu = this->getChildByID("bottom-menu");
71-
menu->addChild(myButton);
72-
73-
/**
74-
* The `_spr` string literal operator just prefixes the string with
75-
* your mod id followed by a slash. This is good practice for setting your own node ids.
76-
*/
77-
myButton->setID("my-button"_spr);
78-
79-
/**
80-
* We update the layout of the menu to ensure that our button is properly placed.
81-
* This is yet another Geode feature, see this page for more info about it:
82-
* https://docs.geode-sdk.org/tutorials/layouts
83-
*/
84-
menu->updateLayout();
85-
86-
/**
87-
* We return `true` to indicate that the class was properly initialized.
88-
*/
89-
return true;
90-
}
91-
92-
/**
93-
* This is the callback function for the button we created earlier.
94-
* The signature for button callbacks must always be the same,
95-
* return type `void` and taking a `CCObject*`.
96-
*/
97-
void onMyButton(CCObject*) {
98-
FLAlertLayer::create("Geode", "Hello from my custom mod!", "OK")->show();
16+
GJAccountManager::handleIt(_requestSentSuccessfully, _response, _tag, _httpType);
9917
}
10018
};

support.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Edit this file to change your mod's support info, or delete it if you don't need it.
1+
For any help regarding the mod, ask it in the Discord server!
2+
If you aren't in it, it means that you're not eligible :(

0 commit comments

Comments
 (0)