Skip to content

Commit 00bf147

Browse files
committed
stuffs
1 parent e4d9a74 commit 00bf147

File tree

6 files changed

+68
-14
lines changed

6 files changed

+68
-14
lines changed

mod.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"files": [
2121
"res/layers.json"
22+
],
23+
"sprites": [
24+
"res/gdLogo.png"
2225
]
2326
},
2427
"settings": {

res/gdLogo.png

68.7 KB
Loading

res/layers.json

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,73 @@
22
"mods": {
33
"gd": {
44
"name": "Geometry Dash",
5-
"author": "RobTop"
5+
"author": "RobTop",
6+
"id": "0"
67
},
78
"cvolton.betterinfo": {
89
"name": "BetterInfo",
9-
"author": "Cvolton"
10+
"author": "Cvolton",
11+
"id": "1"
1012
},
1113
"dankmeme.globed2": {
1214
"name": "Globed",
13-
"author": "dankmeme"
15+
"author": "dankmeme",
16+
"id": "2"
1417
},
1518
"geode.loader": {
1619
"name": "Geode",
17-
"author": "Geode Team"
20+
"author": "Geode Team",
21+
"id": "3"
1822
},
1923
"geode.texture-loader": {
2024
"name": "Texture Loader",
21-
"author": "Geode Team"
25+
"author": "Geode Team",
26+
"id": "4"
2227
},
2328
"hiimjustin000.integrated_demonlist": {
2429
"name": "Integrated Demonlist",
25-
"author": "hiimjustin000"
30+
"author": "hiimjustin000",
31+
"id": "5"
2632
},
2733
"km7dev.gdps-switcher": {
2834
"name": "GDPS Switcher",
29-
"author": "km7dev"
35+
"author": "km7dev",
36+
"id": "6"
3037
},
3138
"limegradient.betterachievements": {
3239
"name": "BetterAchievements",
33-
"author": "limegradient"
40+
"author": "limegradient",
41+
"id": "7"
3442
},
3543
"minemaker0430.gddp_integration": {
3644
"name": "GDDP Integration",
37-
"author": "Minemaker0430"
45+
"author": "Minemaker0430",
46+
"id": "8"
3847
},
3948
"omgrod.garage_plus": {
4049
"name": "Garage Plus",
41-
"author": "OmgRod"
50+
"author": "OmgRod",
51+
"id": "9"
4252
},
4353
"omgrod.gdstream": {
4454
"name": "GDStream",
45-
"author": "OmgRod"
55+
"author": "OmgRod",
56+
"id": "10"
4657
},
4758
"omgrod.geodify": {
4859
"name": "Geodify",
49-
"author": "OmgRod"
60+
"author": "OmgRod",
61+
"id": "11"
5062
},
5163
"thesillydoggo.newgrounds_explorer": {
5264
"name": "Newgrounds Explorer",
53-
"author": "TheSillyDoggo"
65+
"author": "TheSillyDoggo",
66+
"id": "12"
5467
},
5568
"uproxide.textures": {
5669
"name": "Texture Workshop",
57-
"author": "Uproxide"
70+
"author": "Uproxide",
71+
"id": "13"
5872
}
5973
},
6074
"layers": {

src/layers/GYModTile.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
#include <Geode/Geode.hpp>
2+
#include <Geode/ui/GeodeUI.hpp>
3+
#include <Geode/Loader.hpp>
24

35
#include "GYModTile.hpp"
6+
#include "Geode/binding/ButtonSprite.hpp"
7+
#include "Geode/ui/GeodeUI.hpp"
48

59
using namespace geode::prelude;
610

11+
void GYModTile::viewMod(CCObject* sender) {
12+
log::debug("Viewing mod: {}", this->getTag());
13+
}
14+
715
GYModTile* GYModTile::create(const char *modName, const char *modAuthor, const char *modID, int tag) {
816
GYModTile* ret = new GYModTile();
917
if (ret && ret->init(modName, modAuthor, modID, tag)) {
@@ -23,6 +31,7 @@ bool GYModTile::init(const char *modName, const char *modAuthor, const char *mod
2331
auto winSize = CCDirector::sharedDirector()->getWinSize();
2432

2533
this->setContentSize({ winSize.width * 0.325f, winSize.height * 0.5f });
34+
this->setTag(tag);
2635

2736
// GJ_square04.png - The purple one
2837
auto bg = CCScale9Sprite::create("GJ_square04.png");
@@ -39,6 +48,31 @@ bool GYModTile::init(const char *modName, const char *modAuthor, const char *mod
3948
modAuthorText->setPosition({ this->getContentSize().width / 2, this->getContentSize().height - winSize.height * 0.35f });
4049
modAuthorText->setScale(0.5f);
4150
bg->addChild(modAuthorText);
51+
52+
auto sprite = CCNode::create();
53+
54+
if (modID != "gd") {
55+
sprite = geode::createServerModLogo(modID);
56+
} else {
57+
sprite = CCSprite::create("gdLogo.png"_spr);
58+
}
59+
60+
sprite->setScale((winSize.height * 0.225) / sprite->getContentSize().height);
61+
sprite->setPosition({ this->getContentSize().width / 2, this->getContentSize().height / 2 + (this->getContentSize().height * 0.1f) });
62+
63+
this->addChild(sprite);
64+
65+
auto menu = CCMenu::create();
66+
menu->setAnchorPoint({ 0, 0 });
67+
68+
auto btn = CCMenuItemSpriteExtra::create(
69+
ButtonSprite::create("View"),
70+
this,
71+
menu_selector(GYModTile::viewMod)
72+
);
73+
74+
menu->addChild(btn);
75+
this->addChild(menu);
4276

4377
return true;
4478
}

src/layers/GYModTile.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using namespace geode::prelude;
66

77
class GYModTile : public CCLayer {
88
public:
9+
void viewMod(CCObject* sender);
910
static GYModTile* create(const char *modName, const char *modAuthor, const char *modID, int tag);
1011
bool init(const char *modName, const char *modAuthor, const char *modID, int tag);
1112
};

src/layers/GYScreenshotPopup.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#pragma once
2+
13
#include <Geode/Geode.hpp>
24
#include <Geode/modify/FLAlertLayer.hpp>
35
#include <string>

0 commit comments

Comments
 (0)