Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Jul 16, 2024
1 parent 8a8bea5 commit 02858bb
Show file tree
Hide file tree
Showing 54 changed files with 385 additions and 177 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_library(${PROJECT_NAME} SHARED
src/Hooks/GlobedChatListPopup.cpp
src/Hooks/CommentCell.cpp
src/Hooks/ShareCommentLayer.cpp
src/EmojiNode.cpp
# Add your cpp files here
)

Expand Down
Binary file added emojis/other/boar.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/other/casual.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/other/catbless.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/other/catcash.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/other/catcomf.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/other/catcool.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/other/catcop.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/other/catcorn.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/other/catderp.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/other/catfacepalm.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/other/catfine.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/other/catgasm.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/other/catgasp.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/other/catgift.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/other/catgrump.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/other/catgun.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/other/cathammer.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/other/cathi.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/other/cathype.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/other/catlaugh.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/other/catlick.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/other/catloser.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/other/catlost.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/other/catlove.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/other/catlul.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/other/catlurk.png
Binary file added emojis/other/catmusik.png
Binary file added emojis/other/catok.png
Binary file added emojis/other/catpat.png
Binary file added emojis/other/catpls.png
Binary file added emojis/other/catpog.png
Binary file added emojis/other/catpout.png
Binary file added emojis/other/catree.png
Binary file added emojis/other/catshrug.png
Binary file added emojis/other/catshy.png
Binary file added emojis/other/catsimp.png
Binary file added emojis/other/catsip.png
Binary file added emojis/other/catsleep.png
Binary file added emojis/other/catsmart.png
Binary file added emojis/other/catsweat.png
Binary file added emojis/other/catthinking.png
Binary file added emojis/other/creul.png
Binary file added emojis/other/tough.png
125 changes: 6 additions & 119 deletions src/CCLabelBMFontExt.cpp
Original file line number Diff line number Diff line change
@@ -1,113 +1,5 @@
#include "CCLabelBMFontExt.hpp"

std::pair<std::string, std::string> _Emoji(const std::string &name) {
auto spr = std::string(""_spr);
return {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"),
std::pair("easy", "diffIcon_01_btn_001.png"),
std::pair("normal", "diffIcon_02_btn_001.png"),
std::pair("hard", "diffIcon_03_btn_001.png"),
std::pair("harder", "diffIcon_04_btn_001.png"),
std::pair("insane", "diffIcon_05_btn_001.png"),
std::pair("easydemon", "diffIcon_07_btn_001.png"),
std::pair("mediumdemon", "diffIcon_08_btn_001.png"),
std::pair("harddemon", "diffIcon_06_btn_001.png"),
std::pair("insanedemon", "diffIcon_09_btn_001.png"),
std::pair("extremedemon", "diffIcon_10_btn_001.png"),

std::pair("star", "GJ_starsIcon_001.png"),

std::pair("orb", "currencyOrb_001.png"),
std::pair("orbs", "currencyOrbIcon_001.png"),

std::pair("diamond", "diamond_small01_001.png"),
std::pair("diamonds", "currencyDiamondIcon_001.png"),

std::pair("like", "GJ_likesIcon_001.png"),
std::pair("dislike", "GJ_dislikesIcon_001.png"_spr), // rob i genuinely hate you for making it this differetn size it is size size different

std::pair("check", "GJ_completesIcon_001.png"),
std::pair("cross", "GJ_deleteIcon_001.png"),

std::pair("locked", "GJLargeLock_001.png"),
std::pair("lockedgray", "GJ_lockGray_001.png"),
std::pair("unlocked", "GJ_lock_open_001.png"),

std::pair("goldcoin", "GJ_coinsIcon_001.png"),
std::pair("uncollectedusercoin", "GJ_coinsIcon_gray_001.png"),
_Emoji("usercoinunverified"),
std::pair("usercoin", "GJ_coinsIcon2_001.png"),
std::pair("points", "GJ_pointsIcon_001.png"),

std::pair("mod", "modBadge_01_001.png"),
std::pair("eldermod", "modBadge_02_001.png"),
std::pair("leaderboardmod", "modBadge_03_001.png"),

//other
_Emoji("amogus"),
_Emoji("bruh"),
_Emoji("carlos"),
_Emoji("clueless"),
_Emoji("despair"),
_Emoji("despair2"),
_Emoji("ned"),
std::pair("pusab?", "pusab.png"_spr),
_Emoji("robsmile"),
_Emoji("sip"),
_Emoji("splat"),
_Emoji("teehee"),
_Emoji("trollface"),
_Emoji("true"),
_Emoji("walter"),
_Emoji("wha"),
_Emoji("whadahell"),
_Emoji("youshould"),
_Emoji("car"),
_Emoji("zoink"),
_Emoji("shocked"),
_Emoji("poppinbottles"),
_Emoji("party"),
_Emoji("potbor"),
_Emoji("dabmeup"),
_Emoji("fireinthehole"),
_Emoji("finger"),
_Emoji("soggy"),
_Emoji("mayo"),
_Emoji("divine"),
_Emoji("rattledash"),
_Emoji("gd"),

//discord
_Emoji("100"),
_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"),
_Emoji("sob"),
_Emoji("eggplant"),
_Emoji("clown"),
};

LabelPart::LabelPart(LabelPartType type, std::string ext) {
this->type = type;
this->extra = std::move(ext);
Expand All @@ -118,12 +10,7 @@ const char* LabelPart::getFileNameForEmoji()
if (type == LabelPartType::Text)
return "";

for (auto emoji : emojis) {
if (geode::utils::string::toLower(emoji.first) == geode::utils::string::toLower(extra))
return emoji.second.c_str();
}

return "";
return EmojiNode::frameForKey(extra);
}

std::string LabelPart::stringFromVector(std::vector<LabelPart> parts)
Expand Down Expand Up @@ -198,7 +85,7 @@ void CCLabelBMFontExt::setString(const char *newString, bool needUpdateLabel)

const char* CCLabelBMFontExt::getString()
{
return string;
return string.c_str();
}

void CCLabelBMFontExt::setFntFile(const char* fntFile)
Expand All @@ -209,7 +96,7 @@ void CCLabelBMFontExt::setFntFile(const char* fntFile)

const char* CCLabelBMFontExt::getFntFile()
{
return font;
return font.c_str();
}

void CCLabelBMFontExt::setCString(const char *label)
Expand Down Expand Up @@ -339,7 +226,7 @@ void CCLabelBMFontExt::updateLabel()
CCSize size = CCSizeMake(0, 0);
bool inEmoji = false;
std::string cur = "";
float h = getOriginalLabel("l", font)->getContentHeight();
float h = getOriginalLabel("l", font.c_str())->getContentHeight();
float x = 2;

for (auto ch : utils::string::split(string))
Expand Down Expand Up @@ -415,7 +302,7 @@ void CCLabelBMFontExt::updateLabel()
{
if (part.type == LabelPartType::Text)
{
auto lbl = getOriginalLabel(part.extra.c_str(), font);
auto lbl = getOriginalLabel(part.extra.c_str(), font.c_str());
lbl->setAnchorPoint(ccp(0, 0));
lbl->setColor(colour);
lbl->setOpacity(opacity);
Expand All @@ -432,7 +319,7 @@ void CCLabelBMFontExt::updateLabel()
}
else if (part.type == LabelPartType::Emoji)
{
auto spr = CCSprite::createWithSpriteFrameName(part.getFileNameForEmoji());
auto spr = EmojiNode::createWithKey(part.extra);

if (!spr)
return;
Expand Down
7 changes: 5 additions & 2 deletions src/CCLabelBMFontExt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/CCNode.hpp>
#include <Geode/modify/CCLabelBMFont.hpp>
#include "EmojiNode.hpp"

#include <iostream>
#include <regex>
Expand All @@ -11,6 +12,8 @@

using namespace geode::prelude;

//#define _Emoji(id) std::pair(id, std::string(""_spr) + id + std::string(".png"))

enum LabelPartType {
Text,
Emoji,
Expand All @@ -34,8 +37,8 @@ struct LabelPart {

class CCLabelBMFontExt : public CCLabelBMFont {
public:
const char* string = "";
const char* font = "";
std::string string = "";
std::string font = "";
CCTextAlignment alignment;
ccColor3B colour;
GLubyte opacity = 255;
Expand Down
Loading

0 comments on commit 02858bb

Please sign in to comment.