From 7f6b696f376f614ac6d0e74857bb12fd675dd485 Mon Sep 17 00:00:00 2001 From: user666 Date: Sat, 19 Oct 2024 23:38:51 +0400 Subject: [PATCH] no dynamic_cast --- mod.json | 2 +- src/_main.hpp | 4 ++-- src/main.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mod.json b/mod.json index c98ce7d..fa4c22d 100644 --- a/mod.json +++ b/mod.json @@ -8,7 +8,7 @@ }, "id": "user95401.geode-mod-comments", "name": "Mod Comments", - "version": "v1.1.1", + "version": "v1.1.2", "developer": "user95401", "description": "add comments in mod popups", "tags": [ "online", "enhancement", "interface", "content", "developer" ], diff --git a/src/_main.hpp b/src/_main.hpp index 3f04d74..7b9bdb2 100644 --- a/src/_main.hpp +++ b/src/_main.hpp @@ -48,9 +48,9 @@ namespace geode::cocos { } inline std::string frameName(CCNode* node) { if (node == nullptr) return "NIL_NODE"; - if (auto textureProtocol = dynamic_cast(node)) { + if (auto textureProtocol = typeinfo_cast(node)) { if (auto texture = textureProtocol->getTexture()) { - if (auto spriteNode = dynamic_cast(node)) { + if (auto spriteNode = typeinfo_cast(node)) { auto* cachedFrames = CCSpriteFrameCache::sharedSpriteFrameCache()->m_pSpriteFrames; const auto rect = spriteNode->getTextureRect(); for (auto [key, frame] : CCDictionaryExt(cachedFrames)) { diff --git a/src/main.cpp b/src/main.cpp index 24b42f7..6b68451 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -144,7 +144,7 @@ class GitHubAuthPopup : public FLAlertLayer, FLAlertLayerProtocol { if (p0->getID() == "finish" and p1) { //code auto code = std::string(""); - auto input = dynamic_cast(p0->getChildByIDRecursive("input")); + auto input = typeinfo_cast(p0->getChildByIDRecursive("input")); if (input) code = input->getString(); // auto a = [this, protocol](matjson::Value const& catgirl) { @@ -234,9 +234,9 @@ class GitHubAuthPopup : public FLAlertLayer, FLAlertLayerProtocol { pop->show(); } void onPasteToInput(CCObject* btnObj) { - auto btn = dynamic_cast(btnObj); + auto btn = typeinfo_cast(btnObj); auto menu = btn->getParent(); - auto input = dynamic_cast(menu->getChildByIDRecursive("input")); + auto input = typeinfo_cast(menu->getChildByIDRecursive("input")); input->setString(utils::clipboard::read()); }; void onOpenupBtn(CCObject*) {