Skip to content

Commit

Permalink
no more of "him"
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Dec 18, 2024
1 parent 3cc2a46 commit 6ed955c
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 12 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Improved label reordering
- Fixed Crash using Chest Unlock Bypass
- Removed "him" from the credits secret
- Added **Gold Chest Bypass** to Chest Unlock Bypass
- Added **Localization / Translations**!!
-- The language can be changed in the **Config** tab of the mod menu
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "4.0.1",
"geode": "4.1.0",
"version": "v1.7.6",
"gd": {
"win": "2.2074",
Expand Down
Binary file added resources/sprites/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Client/Windows/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void Config::cocosCreate(CCMenu* menu)
FADE_ICON(478, 37, 21, 105, 11); // i dont remember
FADE_ICON(104, 21, 3, 3, 11); // ery
FADE_ICON(41, 11, 70, -1, 1); // justin
FADE_ICON(77, 1, 5, -1, 8); // baby (ninxout)
// FADE_ICON(77, 1, 5, -1, 8); // baby (ninxout)
FADE_ICON(335, 98, 41, 15, 19); // alphalaneous

aboutTab->addChild(iconsMenu);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/LanguageSelectNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool LanguageSelectNode::init()
rightBtn->setZOrder(420);
node->addChildAtPosition(rightBtn, Anchor::BottomLeft, ccp(190, 0));

node->setTouchPriority(-999999);
node->setTouchPriority(-507);

if (!TranslationManager::get()->isLanguageLoaded())
goToPage(0);
Expand Down
12 changes: 12 additions & 0 deletions src/Layers/TranslationCreditsLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ void TranslationCreditsLayer::customSetup()

clip->addChild(menu);
}
else
{
auto btn = CCMenuItemSpriteExtra::create(CCSprite::create("heart.png"_spr), this, menu_selector(TranslationCreditsLayer::onMessage));
btn->setPosition(ccp(142, 144));

gameNode->addChild(btn);
}

bool used = TranslationManager::get()->getLoadedLanguage() == language["display_name_english"];

Expand Down Expand Up @@ -211,6 +218,11 @@ void TranslationCreditsLayer::onUse(CCObject* sender)
baseLayer->addChild(btnUse, 69);
}

void TranslationCreditsLayer::onMessage(CCObject* sender)
{
FLAlertLayer::create("Contributions", "These are all the <cl>amazing</c> people who have <cc>contributed</c> to <co>qolmod</c> by translatingthe mod to this <cp>language</c>.\nThank you <cr><3</c>", "OK")->show();
}

void TranslationCreditsLayer::onPlayerProfile(CCObject* sender)
{
ProfilePage::create(sender->getTag(), false)->show();
Expand Down
1 change: 1 addition & 0 deletions src/Layers/TranslationCreditsLayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TranslationCreditsLayer : public SillyBaseLayer
void onPlayerProfile(CCObject* sender);
void onKill(CCObject* sender);
void onUse(CCObject* sender);
void onMessage(CCObject* sender);

void spawnBigParticle();
void spawnMediumParticle();
Expand Down
8 changes: 5 additions & 3 deletions src/UI/CategoryTabSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ bool CategoryTabSprite::init(CategoryTabType type, std::string name, std::string
}

label = TransLabelBMFont::create(name.c_str(), "bigFont.fnt");
label->setOnLabelUpdated([this]
{
this->setContentSize(this->getContentSize());
});

this->addChildAtPosition(background, Anchor::Center);
this->addChildAtPosition(outline, Anchor::Center);
Expand Down Expand Up @@ -91,9 +95,7 @@ void CategoryTabSprite::setContentSize(const CCSize& contentSize)
{
CCNode::setContentSize(contentSize);

label->limitLabelWidth(this->getContentWidth() / 0.5f, 0.75f, 0.1f);
// there is a better way to do this, but i have to release this update before midclipse gets android support so that can be later
label->isLimited = false;
label->limitLabelWidth((this->getContentWidth() - 7.5f) / 0.5f, 0.75f, 0.1f);
label->setScale(label->getScale() / 2);

outline->setContentSize(contentSize * 2);
Expand Down
8 changes: 8 additions & 0 deletions src/UI/TransLabelBMFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ void TransLabelBMFont::setString(const char* str)
updateTTFVisible();
}

void TransLabelBMFont::setOnLabelUpdated(std::function<void()> callback)
{
this->onLabelUpdated = callback;
}

TransLabelBMFont::~TransLabelBMFont()
{
instances.erase(std::find(instances.begin(), instances.end(), this));
Expand All @@ -181,6 +186,9 @@ void TransLabelBMFont::updateAllLabels()
{
label->limitLabelWidth(label->limitWidth, label->limitDefaultScale, label->limitMinScale);
}

if (label->onLabelUpdated)
label->onLabelUpdated();
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/UI/TransLabelBMFont.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ class TransLabelBMFont : public CCNode
std::string originalText;
std::string font;

public:
std::function<void()> onLabelUpdated;

bool isLimited = false;
private:
float limitWidth = 0.0f;
float limitDefaultScale = 0.0f;
float limitMinScale = 0.0f;

CCLabelTTF* createTTF(std::string font, float fontSize);

static inline std::vector<TransLabelBMFont*> instances = {};

CCLabelTTF* createTTF(std::string font, float fontSize);
void updateTTFVisible();

public:
bool init(std::string text, std::string font);
Expand All @@ -38,9 +39,8 @@ class TransLabelBMFont : public CCNode
void setString(const char* str);
std::string getString();

void updateTTFVisible();
void setOnLabelUpdated(std::function<void()> callback);

static void updateAllLabels();

static TransLabelBMFont* create(std::string text, std::string font);
};

0 comments on commit 6ed955c

Please sign in to comment.