Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 23, 2024
1 parent 633c547 commit 086f3a6
Show file tree
Hide file tree
Showing 25 changed files with 178 additions and 10 deletions.
Binary file added emojis/discord/bear.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 emojis/discord/broken_heart.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 emojis/discord/cat.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 emojis/discord/deaf_man.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 emojis/discord/deaf_person.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 emojis/discord/deaf_woman.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 emojis/discord/dog.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 emojis/discord/face_with_raised_eyebrow.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 emojis/discord/fire.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 emojis/discord/fox.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 emojis/discord/gun.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 emojis/discord/middle_finger.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 emojis/discord/moyai.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 emojis/discord/nerd.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 emojis/discord/radioactive.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 emojis/discord/shocked_face.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 emojis/discord/shushing_face.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 emojis/discord/skull.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 emojis/discord/smiling_imp.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 emojis/discord/speaking_head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"importance": "required"
}
],
"resources": {
"spritesheets": {
"GJ_EmojiSheet": [
"emojis/discord/*.png"
],
"GJ_EmojiUISheet": [
"resources/*.png"
]
}
},
"developer": "TheSillyDoggo",
"description": "geometry dash sex real ?! (not faek)"
}
Binary file added resources/emoji-icon-thicker.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 resources/emoji-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 52 additions & 8 deletions src/CCLabelBMFontExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

using namespace geode::prelude;

std::pair<std::string, std::string> _Emoji(std::string name)
{
auto spr = std::string(""_spr);

return std::pair(name, spr + (name + std::string(".png")));
}

std::vector<std::pair<std::string, std::string>> emojis = {
std::pair("auto", "diffIcon_auto_btn_001.png"),
std::pair("na", "diffIcon_00_btn_001.png"),
Expand Down Expand Up @@ -46,6 +53,28 @@ std::vector<std::pair<std::string, std::string>> emojis = {
std::pair("mod", "modBadge_01_001.png"),
std::pair("eldermod", "modBadge_02_001.png"),
std::pair("leaderboardmod", "modBadge_03_001.png"),

//discord
_Emoji("shushing_face"),
_Emoji("deaf_person"),
_Emoji("deaf_man"),
_Emoji("deaf_woman"),
_Emoji("bear"),
_Emoji("broken_heart"),
_Emoji("cat"),
_Emoji("dog"),
_Emoji("fox"),
_Emoji("gun"),
_Emoji("face_with_raised_eyebrow"),
_Emoji("middle_finger"),
_Emoji("moyai"),
_Emoji("fire"),
_Emoji("nerd"),
_Emoji("radioactive"),
_Emoji("shocked_face"),
_Emoji("skull"),
_Emoji("smiling_imp"),
_Emoji("speaking_head"),
};

enum LabelPartType
Expand Down Expand Up @@ -132,9 +161,10 @@ class CCLabelBMFontExt : public CCNode
int yPos = 0;
float height = 0;


float commentHeight = CCLabelBMFont::create("l", font.c_str())->getContentHeight();

this->removeAllChildren();

for (size_t i = 0; i < parts.size(); i++)
{
auto seg = parts[i];
Expand All @@ -150,6 +180,18 @@ class CCLabelBMFontExt : public CCNode
height = std::max<float>(height, lbl->getScaledContentSize().height);
pos += lbl->getScaledContentSize().width;
wid = std::max<float>(wid, pos);

if (maxX != 0)
{
if (pos > maxX)
{
wid = std::max<float>(wid, pos);
pos = 0;
yPos++;

lbl->setPosition(ccp(pos, -20 * yPos));
}
}
}
else if (seg.type == LabelPartType::Emoji)
{
Expand All @@ -167,15 +209,17 @@ class CCLabelBMFontExt : public CCNode
height = std::max<float>(height, emoji->getScaledContentSize().height);
pos += emoji->getScaledContentSize().width + 2 - 0.75f;
wid = std::max<float>(wid, pos);
}

if (maxX != 0)
{
if (pos > maxX)
if (maxX != 0)
{
wid = std::max<float>(wid, pos);
pos = 0;
yPos++;
if (pos > maxX)
{
wid = std::max<float>(wid, pos);
pos = 0;
yPos++;

emoji->setPosition(ccp(pos + 2, -20 * yPos));
}
}
}
}
Expand Down
118 changes: 116 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Geode/modify/CCNode.hpp>
#include <Geode/modify/TextArea.hpp>
#include <Geode/modify/CommentCell.hpp>
#include <Geode/modify/ShareCommentLayer.hpp>
#include <Geode/modify/MenuLayer.hpp>

using namespace geode::prelude;
Expand Down Expand Up @@ -42,8 +43,7 @@ class $modify (CommentCell)
{
lbl2->setPosition(txt->getPosition());
lbl2->setAnchorPoint(txt->getAnchorPoint());
lbl2->setMaxX(300);
//lbl2->limitLabelWidth(270, 0.7f, 0);
lbl2->setMaxX(310);

as<CCLayerColor*>(this->getChildren()->objectAtIndex(1))->addChild(lbl2);
}
Expand All @@ -53,6 +53,120 @@ class $modify (CommentCell)
}
};

class $modify (ShareCommentLayerExt, ShareCommentLayer)
{
CCMenu* commentMenu = nullptr;
bool visible = false;
CCTextInputNode* inp = nullptr;

void onEmojis(CCObject*)
{
m_fields->visible = !m_fields->visible;

auto menu = m_fields->commentMenu;
menu->stopAllActions();

if (m_fields->visible)
{
menu->runAction(CCEaseInOut::create(CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width, 0)), 2));
}
else
{
menu->runAction(CCEaseInOut::create(CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width + menu->getContentSize().width, 0)), 2));
}
}

void onSelectEmoji(CCObject* sender)
{
auto str = as<CCNode*>(sender)->getID();

auto inp = m_fields->inp;

std::stringstream ss;
ss << inp->getString().c_str();
ss << ":";
ss << str;
ss << ":";

inp->setString(as<gd::string>(ss.str()));
}

bool init(gd::string p0, int p1, CommentType p2, int p3, gd::string p4)
{
if (!ShareCommentLayer::init(p0, p1, p2, p3, p4))
return false;

if (auto l = as<CCLayer*>(this->getChildren()->objectAtIndex(0)))
{
if (auto i = as<CCTextInputNode*>(l->getChildren()->objectAtIndex(4)))
m_fields->inp = i;

if (auto m = as<CCMenu*>(l->getChildren()->objectAtIndex(2)))
{
auto spr = CCSprite::createWithSpriteFrameName("emoji-icon-thicker.png"_spr);
spr->setScale(0.8f);
spr->setOpacity(150);

auto btn = CCMenuItemSpriteExtra::create(spr, this, menu_selector(ShareCommentLayerExt::onEmojis));
btn->setPosition(ccp(178, 38));

m->addChild(btn);
}
}

auto menu = CCMenu::create();
menu->setContentSize(ccp(180, 170));
menu->setAnchorPoint(ccp(1, 0));
menu->ignoreAnchorPointForPosition(false);
menu->setPosition(ccp(CCDirector::get()->getWinSize().width + menu->getContentSize().width, 0));

auto bg = CCScale9Sprite::create("GJ_square05.png");
bg->setContentSize(menu->getContentSize() * 1.5f);
bg->setScale(1.0f / 1.5f);
bg->setAnchorPoint(ccp(0, 0));
bg->setPosition(ccp(0, 0));
menu->addChild(bg);

int x = 0;
int y = 0;

int rowCount = 7;

float size = (menu->getContentWidth() - 20 - 20) / (rowCount - 1);

for (size_t i = 0; i < emojis.size(); i++)
{
auto spr = CCSprite::createWithSpriteFrameName(emojis[i].second.c_str());

if (spr)
{
spr->setScale(15 / std::max(spr->getContentWidth(), spr->getContentHeight()));

auto btn = CCMenuItemSpriteExtra::create(spr, this, menu_selector(ShareCommentLayerExt::onSelectEmoji));
btn->setID(emojis[i].first);

btn->setPosition(ccp( (size * x) + 20, (size * y) + 20));
menu->addChild(btn);

x++;

if (x > (rowCount - 1))
{
x = 0;
y++;
}
}
}


this->addChild(menu);

m_fields->commentMenu = menu;

return true;
}
};

/*class $modify (TextArea)
{
void setString(gd::string p0)
Expand Down

0 comments on commit 086f3a6

Please sign in to comment.