Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
bh
Browse files Browse the repository at this point in the history
  • Loading branch information
Uproxide committed Feb 6, 2024
1 parent 8964a9f commit 8b7fba8
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Macos be like
**/.DS_Store

# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Ignore build folders
**/build

# Workspace files are user-specific
*.sublime-workspace

# ILY vscode
**/.vscode
.idea/

# clangd
.cache/
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(Bludbath VERSION 1.0.0)

add_library(${PROJECT_NAME} SHARED
src/main.cpp
# Add your cpp files here
)

if (NOT DEFINED ENV{GEODE_SDK})
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
else()
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
endif()

add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

setup_geode_mod(${PROJECT_NAME})
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GeodeContributors

This is where she makes a mod.
11 changes: 11 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Geode Contributors

A mod that gives Geode Contributors a Special Geode Badge

## Have you Contributed to Geode Loader/Bindings and Don't have the badge?

DM Me (kotthesillyone) your GD User/Account ID and i'll add you to the next update

## Credits
* [Uproxide](user:25397826)
* cutiny_
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 1.1.0

* IDs are now online, so i dont have to update on giving a person the badge
* Support for Youtubers Mod (Xanii)
* Badge next to name
* An Icon

# 1.0.1

* Fixed Crashing on Blocking a User
* Other Fixes

# 1.0.0

* Initial Release
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"geode": "2.0.0",
"gd": {
"android": "2.205",
"win": "2.204"
},
"version": "v1.1.0",
"id": "uproxide.geodedevelopers",
"name": "Geode Contributors",
"developer": "Uproxide",
"description": "Displays a Special Badge for Geode Contributors",
"repository": "https://github.com/Uproxide/GeodeMods/tree/main/Geode%20Contributors",
"resources": {
"sprites": [
"rec/*.png"
]
},
"dependencies": [
{
"id": "geode.node-ids",
"version": ">=v1.1.4",
"importance": "required"
}
]
}
Binary file added rec/geode.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 rec/kot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/ProfilePage.hpp>
#include <Geode/binding/ProfilePage.hpp>
#include <Geode/Bindings.hpp>
#include <Geode/utils/web.hpp>
#include <Geode/loader/Loader.hpp>
#include <algorithm>
#include <set>
#include <cctype>
#include <matjson.hpp>

using namespace geode::prelude;

// sorry for the mess, im not the c++ coder lmfao

std::set<int> geodeContributors;
bool gotTheShit = false;

class $modify(ProfilePage) {
public:
bool loadedOnce = false;

bool init(int p0, bool p1) {
if (!ProfilePage::init(p0, p1)) return false;

if (!gotTheShit)
{
auto res = web::fetch("https://raw.githubusercontent.com/Uproxide/GeodeMods/main/other/contributors.txt");
if (!res) {
log::info("Failed to fetch Contributors! Your internet is probably hot ass rn :ned:");
}
else {
auto data = res.value();

std::istringstream iss(data);
int tempid;

while (iss >> tempid) {
geodeContributors.insert(tempid);
}
gotTheShit = true;
}
}




for (const auto& contributor : geodeContributors) {
if (contributor == p0) {
CCNode* first_letter = reinterpret_cast<CCNode*>(m_usernameLabel->getChildren()->objectAtIndex(0));
auto spr = CCSprite::create("geode.png"_spr);
auto layerIWant = static_cast<cocos2d::CCLayer*>(this->getChildren()->objectAtIndex(0));
spr->setScale(1.1f); // much better
spr->setPosition(first_letter->convertToWorldSpace(getPosition()));
spr->setPosition({spr->getPositionX() - 15.f, spr->getPositionY() + 10.f});
spr->setID("geode-badge");
layerIWant->addChild(spr);

auto ytbadge = static_cast<cocos2d::CCSprite*>(this->getChildren()->objectAtIndex(1));

if (Loader::get()->isModLoaded("xanii.youtubers") && ytbadge) {
ytbadge->setScale(0.4f);
ytbadge->setPosition(ccp(220.4, 274.6));
ytbadge->setZOrder(1);
}
else
{
// no error handling? this works too so erm
}
}
}
return true;
}

void setupPageInfo(gd::string name, char const* chars) {
ProfilePage::setupPageInfo(name,chars);

auto ytbadge = static_cast<cocos2d::CCSprite*>(this->getChildren()->objectAtIndex(1));
auto geodebadge = static_cast<cocos2d::CCSprite*>(this->getChildByID("geode-badge"));


if (Loader::get()->isModLoaded("xanii.youtubers") && ytbadge && geodebadge) {
ytbadge->setScale(0.4f);
ytbadge->setPosition(ccp(220.4, 274.6));
}
else
{
// no error handling?
}
}
};

0 comments on commit 8b7fba8

Please sign in to comment.