Skip to content

Commit

Permalink
Oh my Lord
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Oct 28, 2024
1 parent 84c141e commit 35c6d6a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(MoreIcons VERSION 1.4.0)
project(MoreIcons VERSION 1.4.1)

add_library(${PROJECT_NAME} SHARED
src/api/MoreIconsAPI.cpp
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# More Icons Changelog
## v1.4.1 (2024-10-27)
- Tweaked the trail info display in the icon kit

## v1.4.0 (2024-10-27)
- Merged the More Icons API into the mod
- Added support for events for other mods to use
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"win": "2.206",
"mac": "2.206"
},
"version": "v1.4.0",
"version": "v1.4.1",
"id": "hiimjustin000.more_icons",
"name": "More Icons",
"developer": "hiimjustin000",
Expand Down
22 changes: 21 additions & 1 deletion src/hooks/GJGarageLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class $modify(MIGarageLayer, GJGarageLayer) {
auto selectedIconType = dual ? (IconType)sdi->getSavedValue("lasttype", 0) : m_selectedIconType;
if (Mod::get()->setSavedValue<std::string>(savedType, name) == name && selectedIconType == m_iconType) {
auto trailInfo = MoreIcons::TRAIL_INFO[name];
auto popup = ItemInfoPopup::create(!trailInfo.pack.id.empty() ? 447 : 1, !trailInfo.pack.id.empty() ? UnlockType::Cube : unlockType);
auto popup = ItemInfoPopup::create(!trailInfo.pack.id.empty() ? 128 : 1, UnlockType::Cube);
if (auto nameLabel = getChildOfType<CCLabelBMFont>(popup->m_mainLayer, 0))
nameLabel->setString(name.substr(name.find_first_of(':') + 1).c_str());
if (auto achLabel = getChildOfType<CCLabelBMFont>(popup->m_mainLayer, 1)) achLabel->setString("Custom");
Expand All @@ -431,6 +431,8 @@ class $modify(MIGarageLayer, GJGarageLayer) {
}
if (auto descText = getChildOfType<TextArea>(popup->m_mainLayer, 0)) descText->setString(
fmt::format("This <cg>{}</c> is added by the <cl>More Icons</c> mod.", std::string(ItemInfoPopup::nameForUnlockType(1, unlockType))));
if (auto completionMenu = popup->m_mainLayer->getChildByID("completionMenu")) completionMenu->setVisible(false);
if (auto infoButton = popup->m_buttonMenu->getChildByID("infoButton")) infoButton->setVisible(false);
if (auto creditButton = findFirstChildRecursive<CCMenuItemSpriteExtra>(popup->m_buttonMenu, [](CCMenuItemSpriteExtra* btn) {
return typeinfo_cast<CCLabelBMFont*>(btn->getNormalImage()) != nullptr;
})) {
Expand All @@ -440,6 +442,24 @@ class $modify(MIGarageLayer, GJGarageLayer) {
creditButton->setEnabled(false);
creditButton->updateSprite();
}
if (auto p1Button = findFirstChildRecursive<CCMenuItemSpriteExtra>(popup->m_buttonMenu, [](CCMenuItemSpriteExtra* btn) {
if (auto normalImage = typeinfo_cast<CCSprite*>(btn->getNormalImage())) {
if (auto p1Label = getChildOfType<CCLabelBMFont>(normalImage, 0)) return strcmp(p1Label->getString(), "P1") == 0;
}
return false;
})) p1Button->setVisible(false);
if (auto p2Button = findFirstChildRecursive<CCMenuItemSpriteExtra>(popup->m_buttonMenu, [](CCMenuItemSpriteExtra* btn) {
if (auto normalImage = typeinfo_cast<CCSprite*>(btn->getNormalImage())) {
if (auto p2Label = getChildOfType<CCLabelBMFont>(normalImage, 0)) return strcmp(p2Label->getString(), "P2") == 0;
}
return false;
})) p2Button->setVisible(false);
if (auto gButton = findFirstChildRecursive<CCMenuItemSpriteExtra>(popup->m_buttonMenu, [](CCMenuItemSpriteExtra* btn) {
if (auto normalImage = typeinfo_cast<CCSprite*>(btn->getNormalImage())) {
if (auto gLabel = getChildOfType<CCLabelBMFont>(normalImage, 0)) return strcmp(gLabel->getString(), "G") == 0;
}
return false;
})) gButton->setVisible(false);
auto blendToggler = CCMenuItemExt::createTogglerWithStandardSprites(0.5f, [this, name](CCMenuItemToggler* sender) {
MoreIcons::TRAIL_INFO[name].blend = !sender->isToggled();
});
Expand Down

0 comments on commit 35c6d6a

Please sign in to comment.