Skip to content

Commit

Permalink
v2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Sep 16, 2024
1 parent bb45be4 commit 00eabe3
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 26 deletions.
1 change: 1 addition & 0 deletions data/globed.server.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
147.185.221.22:46644
2 changes: 1 addition & 1 deletion data/mods.list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v2.6.0-list1",
"version": "v2.7.0-list1",
"list": [

"https://github.com/MathieuAR-GDPSFH/Gauntlets-Position-Fix/releases/latest/download/jecket.gauntlets_position_fix.geode",
Expand Down
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.5.0",
"geode": "3.6.1",
"gd": {
"win": "2.206",
"android": "2.206",
Expand All @@ -8,7 +8,7 @@
},
"id": "user95401.gemetry_trash",
"name": "Gemetry Trash",
"version": "v2.6.0",
"version": "v2.7.0",
"developer": "user95401",
"description": "",
"early-load": true,
Expand Down
Binary file not shown.
Binary file added resources/sounds/playSound/playSound_01.rand
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 34 additions & 1 deletion src/_main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
#include "_main.hpp"

#ifdef GEODE_IS_WINDOWS

#include <Geode/modify/CCScene.hpp>
class $modify(WindowNameExt, CCScene) {
$override static CCScene* create() {
auto GameWindowHandle = WindowFromDC(*reinterpret_cast<HDC*>(reinterpret_cast<uintptr_t>(CCEGLView::sharedOpenGLView()->getWindow()) + 0x244));
SetWindowTextA(GameWindowHandle, Mod::get()->getName().data());
return CCScene::create();
auto rtn = CCScene::create();
return rtn;
}
};

class mouse_particle : public CCParticleSystemQuad {
public:
static inline bool created = false;
static inline Ref<CCParticleSystemQuad> shared_ref;
static void create() {
if (created) return;
created = true;
shared_ref = Ref<CCParticleSystemQuad>(GameToolbox::particleFromString(
"200a-1a0.54a0.94a-1a90a180a0a20a1a1a0a0a0a0a0a0a1a2a0a0a0.211765a0.1a0.207843a0.1a0.207843a0.1a1a0a0a0a0a0a0a0a0a0a0a0a1a0a0a0a0a0a0a0a10a0a0a0a1a1a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0"
, CCParticleSystemQuad::create(), 0));
shared_ref->setID("mouse_particle"_spr);
shared_ref->_setZOrder(INT_MAX);
shared_ref->schedule(schedule_selector(mouse_particle::sch));
SceneManager::get()->keepAcrossScenes(shared_ref);
}
void sch(float) {
shared_ref->runAction(CCRepeatForever::create(CCMoveTo::create(0.000f, getMousePos())));
auto hide = false;
if (auto game = GameManager::get()->m_gameLayer) hide = game->isRunning();
hide ? shared_ref->stopSystem() : shared_ref->resumeSystem();
}
#include <Geode/modify/CCScene.hpp>
class $modify(MouseParticleExt, MenuLayer) {
$override bool init() {
mouse_particle::create();
return MenuLayer::init();
}
};
};

#endif
4 changes: 2 additions & 2 deletions src/_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ inline auto raw_content_repo_lnk = std::string("https://raw.githubusercontent.co
#include "resources.hpp"
#include "special_sprites.hpp"
#include "hackpro.hpp"
#include "globed.hpp"
#include "random_shit/eventlevel.hpp"
#include "random_shit/ShopkepperEyebrow.hpp"
#include "random_shit/gtasamap.hpp"
#include "random_shit/menulayerruinify.hpp"
#include "random_shit/menuitems.hpp"
#include "random_shit/loadinglayer.hpp"
#include "random_shit/secondfloor.hpp"
#include "random_shit/loadinglayer.hpp"
109 changes: 109 additions & 0 deletions src/globed.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#include <Geode/Geode.hpp>
#include <Geode/ui/GeodeUI.hpp>
using namespace geode::prelude;

//data values

inline static auto globed_server = std::string("147.185.221.22:46644");

//get data

inline void loadGlobedServerInf() {
if (not globed_server.empty()) return;
auto req = web::WebRequest();
auto listener = new EventListener<web::WebTask>;
listener->bind(
[](web::WebTask::Event* e) {
if (web::WebResponse* res = e->getValue()) {
std::string data = res->string().unwrapOr("no res");
if ((res->code() < 399) and (res->code() > 10)) {
globed_server = std::regex_replace(data, std::regex("\\s"), "");
log::debug("globed_server = {}", globed_server);
}
else {
}
}
}
);
listener->setFilter(req.send(
"GET", (raw_content_repo_lnk + "/data/" + "/globed.server.inf")
));
}

$on_mod(Loaded) {
loadGlobedServerInf();
}

//dankmeme.globed2/GlobedServersLayer
class GlobedServersLayer : public CCLayer {
public:
cocos2d::CCSprite* background;
CCLayer* serverList;//GlobedServerList
CCLayer* signupLayer;//GlobedSignupLayer
void trySetupServer(float asd = 1337.f) {
if (!typeinfo_cast<GlobedServersLayer*>(this)) return;

//starter
if (asd == 1337.f) this->schedule(schedule_selector(GlobedServersLayer::trySetupServer), 0.1f);

auto scene = typeinfo_cast<CCScene*>(this->getParent());
if (scene) { if (scene != CCDirector::get()->m_pRunningScene) return; }
else return log::error("{}.scene = {}", __func__, scene);

//set current server

auto switcher = typeinfo_cast<CCMenuItemSpriteExtra*>(this->getChildByIDRecursive("btn-server-switcher"));
if (switcher) switcher->activate();
else return log::error("{}.switcher = {}", __func__, switcher);

auto ipconnect = typeinfo_cast<CCMenuItemSpriteExtra*>(this->getParent()->getChildByIDRecursive("dankmeme.globed2/server-switcher-btn-ipconnect"));
if (ipconnect) ipconnect->activate();
else return log::error("{}.ipconnect = {}", __func__, ipconnect);

auto addr = typeinfo_cast<InputNode*>(this->getParent()->getChildByIDRecursive("dankmeme.globed2/direct-connection-addr"));
if (addr) addr->setString(globed_server);
else return log::error("{}.addr = {}", __func__, addr);

auto connect = typeinfo_cast<CCMenuItemSpriteExtra*>(this->getParent()->getChildByIDRecursive("dankmeme.globed2/connect-btn"));
if (connect) connect->activate();
else return log::error("{}.connect = {}", __func__, connect);

//finish
this->unschedule(schedule_selector(GlobedServersLayer::trySetupServer));
}
void tryCustomSetup(float) {
if (!typeinfo_cast<GlobedServersLayer*>(this)) return;
this->trySetupServer();

//msg
auto text = MDTextArea::create(
"### Here was set a server hosted specially for Gemetry Trash!"
"\n"
"Hostname: `" + globed_server + "`"
"\n""\n"
"<cr>Server **don't working for 24/7** because i can forgot to launch it or smth else...</c>"
"\n""\n"
"<cf>You can ask me relaunch it in</c> [discord server](https://discord.gg/UyQytJsrGZ)<cf>!</c>"
, { serverList->getContentSize().width, 173 }
);
public_cast(text, m_bgSprite)->setVisible(0);
public_cast(text, m_scrollLayer)->m_disableMovement = 1;
text->ignoreAnchorPointForPosition(1);
text->setPositionX(10.f);
serverList->addChild(text, 3);

auto scroll = typeinfo_cast<ScrollLayer*>(serverList->getChildByIDRecursive("ScrollLayer"));
if (scroll) scroll->m_disableMovement = 1;
}
};

#include <Geode/modify/CCLayer.hpp>
class $modify(GlobedServersLayerExt, CCLayer) {
$override bool init() {
if (!CCLayer::init()) return false;
this->scheduleOnce(
schedule_selector(GlobedServersLayer::tryCustomSetup), 0.f
);
return true;
}
};
4 changes: 2 additions & 2 deletions src/random_shit/loadinglayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class $modify(LoadingLayerExt, LoadingLayer) {

auto bg = typeinfo_cast<CCSprite*>(this->getChildByID("bg-texture"));
if (bg) {
auto background = rand() % 60;
auto background = rand() % 59;
auto new_bg = CCSprite::create(fmt::format(
"game_bg_{:02d}_001.png", background
).c_str());
Expand All @@ -21,4 +21,4 @@ class $modify(LoadingLayerExt, LoadingLayer) {

return rtn;
}
};
};
76 changes: 59 additions & 17 deletions src/random_shit/menulayerruinify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
class $modify(MenuGameLayerExt, MenuGameLayer) {
$override bool init() {
auto init_result = MenuGameLayer::init();

auto pulsebg = CCSprite::create("game_bg_13_001.png");
pulsebg->setID("pulsebg");
pulsebg->setScale(1.250f);
pulsebg->setAnchorPoint({ 0.0f, 1.f });
pulsebg->setBlendFunc({ GL_ONE, GL_ONE });
pulsebg->setColor({0,0,0});
m_groundLayer->addChild(pulsebg, 10);

return init_result;
}
$override void update(float p0) {
Expand All @@ -16,6 +25,9 @@ class $modify(MenuGameLayerExt, MenuGameLayer) {
if (not fmod->m_metering) fmod->enableMetering();
auto pulse = (fmod->m_pulse1 + fmod->m_pulse2 + fmod->m_pulse3) / 3;
this->m_backgroundSprite->setOpacity(255.f - (pulse * 80.f));
if (auto pulsebg = typeinfo_cast<CCSprite*>(m_groundLayer->getChildByID("pulsebg"))) {
pulsebg->setColor(darken3B(this->m_backgroundSprite->getColor(), 255 - pulse * 60.f));
}
}
}
$override void tryJump(float p0) {
Expand Down Expand Up @@ -75,24 +87,9 @@ class $modify(MenuGameLayerExt, MenuGameLayer) {

#include <Geode/modify/MenuLayer.hpp>
class $modify(MenuLayerExt, MenuLayer) {
void putGameInScroll(float) {
MenuGameLayer* game = nullptr;
auto game_node = this->getChildByIDRecursive("main-menu-bg");
if (auto game = typeinfo_cast<MenuGameLayer*>(game_node)) {
game->removeFromParentAndCleanup(0);
auto scroll = ScrollLayer::create(game->getContentSize());
scroll->m_cutContent = false;
scroll->m_peekLimitBottom = 25.f;
scroll->m_contentLayer->addChild(game);
scroll->m_contentLayer->setContentSize(game->getContentSize());
this->addChild(scroll, -1);
}
}
$override bool init() {
srand(time(0)); //bool(rand() % 2)

this->scheduleOnce(schedule_selector(MenuLayerExt::putGameInScroll), 0.1f);

//rand bg
auto background = rand() % 60;
auto ground = rand() % 23;
Expand Down Expand Up @@ -123,8 +120,34 @@ class $modify(MenuLayerExt, MenuLayer) {
title->removeFromParentAndCleanup(0);

auto menu = CCMenu::createWithItem(CCMenuItemExt::createSpriteExtra(
title, [](auto) {
CCApplication::get()->openURL(fmt::format("http://{}", server).c_str());
title, [this](auto) {
MDPopup* mdpop = nullptr;
mdpop = MDPopup::create(
"Gemetry Trash", //reinterpret_cast<LoadingLayer*>(CCNode::create())->getLoadingString(),
"The project by a mod maker. The server is anarchic - easy mod, easy rate.""\n"
"\n"
"Probably the first GDPS, that is almost entirely a geode mod, which includes both textures and modifications. Modifications are also completely random - maybe something cool, or maybe some shit.""\n"
"\n"
"The things:" "\n"
"- easy rate" "\n"
"- easy mod" "\n"
"- random explode sound, menu music" "\n"
"- some changes in textures" "\n"
"- kill counter in the main menu" "\n"
"- the main levels have been changed" "\n"
"- automatic updates" "\n"
"- many more little things" "\n"
"\n"
"https://discord.gg/UyQytJsrGZ" "\n"
"https://gamejolt.com/games/GEOMETRY_TRASH_GDPS/776479/" "\n"
,
"Settings", "Credits",
[this, mdpop](bool btn2) {
if (not btn2) openSettingsPopup(getMod());
else openSupportPopup(getMod());
}
);
mdpop->show();
}
));

Expand All @@ -136,6 +159,25 @@ class $modify(MenuLayerExt, MenuLayer) {
menu->setPosition(pos);
parent->addChild(menu);

auto verLabel = CCLabelBMFont::create(
fmt::format(
"Platform: {}" "\n"
"Version: {}" "\n"
"Geode: {}",
GEODE_PLATFORM_NAME,
Mod::get()->getVersion().toString(),
Mod::get()->getMetadata().getGeodeVersion()
).c_str(),
fmt::format("gjFont{:02d}.fnt", rand() % 60).c_str(),
266, kCCTextAlignmentLeft
);
verLabel->limitLabelWidth(76.f, 0.525f, 0.1f);
verLabel->setPosition(CCPoint(-218.f, -36.f));
verLabel->setAnchorPoint(CCPoint(0.f, 1.f));
verLabel->setColor(ccColor3B(77, 77, 77));
verLabel->setBlendFunc({ GL_ONE, GL_ONE });
menu->addChild(verLabel);

}

//centerNode
Expand Down
17 changes: 16 additions & 1 deletion support.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
Edit this file to change your mod's support info, or delete it if you don't need it.
<cj>At first, thanks YOU ALL PLAYERS who downloaded mod and stay with us.</c>

## Contributors:

#### [ScottXD](https://www.youtube.com/@ScottXD)
```
trending icon
```

#### [LankerBG](https://www.youtube.com/@GDLankerBG)
```
play sounds
```

## Reported Bugs:
pio99, waxai

0 comments on commit 00eabe3

Please sign in to comment.