From 5d09208694460a63261a5358946092bc0bd8dd2c Mon Sep 17 00:00:00 2001 From: Alphalaneous <38200084+Alphalaneous@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:56:26 -0400 Subject: [PATCH] Fixes and more cells --- mod.json | 2 +- src/CCDirector.h | 5 ----- src/DataNode.h | 7 +------ src/FileWatcher.h | 7 +------ src/UIModding.h | 7 +------ src/Utils.h | 10 +++------- src/alerts/AlertDelegate.h | 5 ----- src/alerts/CustomAlert.h | 7 +------ src/main.cpp | 1 + src/nodes/CCLabelBMFont.h | 9 ++------- src/nodes/CCMenu.h | 5 ----- src/nodes/CCMenuItemSpriteExtra.h | 6 +----- src/nodes/CCScale9Sprite.h | 5 ----- src/nodes/CCScene.h | 7 +------ src/nodes/CCTextInputNode.h | 22 ++++++++++++++++++++++ src/nodes/CellColors.h | 12 +++++++----- src/nodes/CommentCell.h | 7 +------ src/nodes/EditLevelLayer.h | 7 +------ src/nodes/GJChestSprite.h | 7 +------ src/nodes/GJCommentListLayer.h | 7 +------ src/nodes/GJDropDownLayer.h | 5 ----- src/nodes/GJListLayer.h | 7 +------ src/nodes/InfoLayer.h | 7 +------ src/nodes/LevelSearchLayer.h | 7 +------ src/nodes/LoadingLayer.h | 7 +------ src/nodes/MenuGameLayer.h | 7 +------ src/nodes/MenuLayer.h | 7 +------ 27 files changed, 52 insertions(+), 140 deletions(-) create mode 100644 src/nodes/CCTextInputNode.h diff --git a/mod.json b/mod.json index c727592..87d8fec 100644 --- a/mod.json +++ b/mod.json @@ -5,7 +5,7 @@ "android": "2.206", "mac": "2.206" }, - "version": "v1.4.0", + "version": "v1.4.1", "id": "alphalaneous.happy_textures", "name": "Happy Textures :3", "developer": "Alphalaneous", diff --git a/src/CCDirector.h b/src/CCDirector.h index 90a0701..ea81e31 100644 --- a/src/CCDirector.h +++ b/src/CCDirector.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCDIRECTOR_H -#define MYCCDIRECTOR_H - #include #include #include "UIModding.h" @@ -34,6 +31,4 @@ class $modify(CCDirector){ } }; -#endif - #endif \ No newline at end of file diff --git a/src/DataNode.h b/src/DataNode.h index b0f7c9b..928f6b6 100644 --- a/src/DataNode.h +++ b/src/DataNode.h @@ -1,8 +1,5 @@ #pragma once -#ifndef DATANODE_H -#define DATANODE_H - #include using namespace geode::prelude; @@ -27,6 +24,4 @@ class DataNode : public CCNode { m_data = data; return true; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/FileWatcher.h b/src/FileWatcher.h index fd5f8e5..29bcf81 100644 --- a/src/FileWatcher.h +++ b/src/FileWatcher.h @@ -1,8 +1,5 @@ #pragma once -#ifndef FILEWATCHER_H -#define FILEWATCHER_H - #include #include #include @@ -79,6 +76,4 @@ class FileWatcher { auto el = m_paths.find(key); return el != m_paths.end(); } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/UIModding.h b/src/UIModding.h index 4176529..88c7525 100644 --- a/src/UIModding.h +++ b/src/UIModding.h @@ -1,8 +1,5 @@ #pragma once -#ifndef UIMODDING_H -#define UIMODDING_H - #include #include "FileWatcher.h" using namespace geode::prelude; @@ -70,6 +67,4 @@ class UIModding { }; return instance; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/Utils.h b/src/Utils.h index 58387ac..7676fc4 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -1,8 +1,5 @@ #pragma once -#ifndef HAPPYUTILS_H -#define HAPPYUTILS_H - #include using namespace geode::prelude; @@ -104,7 +101,6 @@ namespace Utils { std::string resourcesDir = fmt::format("{}{}", CCFileUtils::sharedFileUtils()->getWritablePath2(), "Resources\\"); packPaths.push_back(resourcesDir); - return packPaths; -} -} -#endif \ No newline at end of file + return packPaths; + } +} \ No newline at end of file diff --git a/src/alerts/AlertDelegate.h b/src/alerts/AlertDelegate.h index a2bcce0..ec7e913 100644 --- a/src/alerts/AlertDelegate.h +++ b/src/alerts/AlertDelegate.h @@ -1,8 +1,5 @@ #pragma once -#ifndef __BROWNALERT_HPP -#define __BROWNALERT_HPP - #include using namespace geode::prelude; @@ -21,5 +18,3 @@ class AlertDelegate : public FLAlertLayer { CCTouchDispatcher::get()->unregisterForcePrio(this); } }; - -#endif diff --git a/src/alerts/CustomAlert.h b/src/alerts/CustomAlert.h index a220e46..0985156 100644 --- a/src/alerts/CustomAlert.h +++ b/src/alerts/CustomAlert.h @@ -1,13 +1,8 @@ #pragma once -#ifndef __BLOCKMENU_HPP -#define __BLOCKMENU_HPP - #include "AlertDelegate.h" class CustomAlert : public AlertDelegate { public: static CustomAlert* create(float width, float height, std::string texture, std::string title); -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 997b270..bba325a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,7 @@ #include "nodes/MenuGameLayer.h" #include "nodes/MenuLayer.h" #include "nodes/GJChestSprite.h" +#include "nodes/CCTextInputNode.h" #include "icons/IconHandler.h" #include "CCDirector.h" diff --git a/src/nodes/CCLabelBMFont.h b/src/nodes/CCLabelBMFont.h index 01bb521..b6ba5e5 100644 --- a/src/nodes/CCLabelBMFont.h +++ b/src/nodes/CCLabelBMFont.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCLABELBMFONT_H -#define MYCCLABELBMFONT_H - #include #include #include "../Utils.h" @@ -44,7 +41,7 @@ class $modify(MyCCLabelBMFont, CCLabelBMFont){ } #endif - + return ret; } @@ -65,6 +62,4 @@ class $modify(MyCCLabelBMFont, CCLabelBMFont){ } #endif -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/CCMenu.h b/src/nodes/CCMenu.h index 8f8ff16..afa293a 100644 --- a/src/nodes/CCMenu.h +++ b/src/nodes/CCMenu.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCMENU_H -#define MYCCMENU_H - #ifdef GEODE_IS_WINDOWS #include @@ -100,6 +97,4 @@ class $modify(EventCCMenu, CCMenu){ } }; -#endif - #endif \ No newline at end of file diff --git a/src/nodes/CCMenuItemSpriteExtra.h b/src/nodes/CCMenuItemSpriteExtra.h index 48dfaa0..b7be33b 100644 --- a/src/nodes/CCMenuItemSpriteExtra.h +++ b/src/nodes/CCMenuItemSpriteExtra.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCMENUITEMSPRITEXTRA_H -#define MYCCMENUITEMSPRITEXTRA_H - #include #include #include "CCScene.h" @@ -158,5 +155,4 @@ class $modify(EventCCMenuItemSpriteExtra, CCMenuItemSpriteExtra) { } } } -}; -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/CCScale9Sprite.h b/src/nodes/CCScale9Sprite.h index 95231b9..dad252f 100644 --- a/src/nodes/CCScale9Sprite.h +++ b/src/nodes/CCScale9Sprite.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCSCALE9SPRITE_H -#define MYCCSCALE9SPRITE_H - #include #include #include "../Macros.h" @@ -232,6 +229,4 @@ class $modify(MyCCScale9Sprite, CCScale9Sprite){ } }; -#endif - #endif \ No newline at end of file diff --git a/src/nodes/CCScene.h b/src/nodes/CCScene.h index a134d8e..8dc8415 100644 --- a/src/nodes/CCScene.h +++ b/src/nodes/CCScene.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCCSCENE_H -#define MYCCSCENE_H - #include #include #include "../UIModding.h" @@ -42,6 +39,4 @@ class $modify(MyCCScene, CCScene){ } m_fields->m_currentCount = this->getChildrenCount(); } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/CCTextInputNode.h b/src/nodes/CCTextInputNode.h new file mode 100644 index 0000000..24bc98d --- /dev/null +++ b/src/nodes/CCTextInputNode.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include "../Macros.h" + +class $modify(MyCCTextInputNode, CCTextInputNode){ + + /*void refreshLabel() { + CCTextInputNode::refreshLabel(); + if (m_placeholderLabel && m_placeholderLabel->getColor() == ccColor3B{120, 170, 240}) { + m_placeholderLabel->setColor({0, 0, 0}); + + std::optional dataOpt = UIModding::get()->getColors("text-input-placeholder"); + if(dataOpt.has_value()){ + ColorData data = dataOpt.value(); + //m_placeholderLabel->setColor(data.color); + m_placeholderLabel->setOpacity(data.alpha); + } + } + }*/ //todo find method I can hook to change this +}; \ No newline at end of file diff --git a/src/nodes/CellColors.h b/src/nodes/CellColors.h index efb762b..b841af9 100644 --- a/src/nodes/CellColors.h +++ b/src/nodes/CellColors.h @@ -1,13 +1,14 @@ #pragma once -#ifndef MYLEVELCELL_H -#define MYLEVELCELL_H - #include #include #include #include #include +#include +#include +#include + #include "../Macros.h" using namespace geode::prelude; @@ -15,11 +16,12 @@ using namespace geode::prelude; setCellColors(LevelCell, loadFromLevel, GJGameLevel); setCellColors(LevelListCell, loadFromList, GJLevelList); setCellColors(GJScoreCell, loadFromScore, GJUserScore); +setCellColors(GJUserCell, loadFromScore, GJUserScore); #ifndef GEODE_IS_MACOS +setCellColors(AchievementCell, loadFromDict, CCDictionary); +setCellColors(GJMessageCell, loadFromMessage, GJUserMessage); setCellColors(MapPackCell, loadFromMapPack, GJMapPack); -#endif - #endif \ No newline at end of file diff --git a/src/nodes/CommentCell.h b/src/nodes/CommentCell.h index 4a236dd..bb3035c 100644 --- a/src/nodes/CommentCell.h +++ b/src/nodes/CommentCell.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYCOMMENTCELL_H -#define MYCOMMENTCELL_H - #include #include @@ -84,6 +81,4 @@ class $modify(MyCommentCell, CommentCell) { } } } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/EditLevelLayer.h b/src/nodes/EditLevelLayer.h index 92b1d7c..2252cd2 100644 --- a/src/nodes/EditLevelLayer.h +++ b/src/nodes/EditLevelLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYEDITLEVELLAYER_H -#define MYEDITLEVELLAYER_H - #include #include @@ -36,6 +33,4 @@ class $modify(MyEditLevelLayer, EditLevelLayer){ } return true; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/GJChestSprite.h b/src/nodes/GJChestSprite.h index 885315e..0ad786a 100644 --- a/src/nodes/GJChestSprite.h +++ b/src/nodes/GJChestSprite.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYGJCHESTSPRITE_H -#define MYGJCHESTSPRITE_H - #include #include @@ -54,6 +51,4 @@ class $modify(MyGJChestSprite, GJChestSprite){ } } } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/GJCommentListLayer.h b/src/nodes/GJCommentListLayer.h index 6eb1b30..f6761db 100644 --- a/src/nodes/GJCommentListLayer.h +++ b/src/nodes/GJCommentListLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYGJCOMMENTLISTLAYER_H -#define MYGJCOMMENTLISTLAYER_H - #include #include #include "CCScale9Sprite.h" @@ -157,6 +154,4 @@ class $modify(MyGJCommentListLayer, GJCommentListLayer) { addChild(parentNode); } #endif -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/GJDropDownLayer.h b/src/nodes/GJDropDownLayer.h index c2ca0be..4988a44 100644 --- a/src/nodes/GJDropDownLayer.h +++ b/src/nodes/GJDropDownLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYGJDROPDOWNLAYER_H -#define MYGJDROPDOWNLAYER_H - #include #include @@ -46,6 +43,4 @@ class $modify(MyGJDropDownLayer, GJDropDownLayer){ } }; -#endif - #endif \ No newline at end of file diff --git a/src/nodes/GJListLayer.h b/src/nodes/GJListLayer.h index 57a31cd..2ea63d3 100644 --- a/src/nodes/GJListLayer.h +++ b/src/nodes/GJListLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYGJLISTLAYER_H -#define MYGJLISTLAYER_H - #include #include @@ -28,6 +25,4 @@ class $modify(MyGJListLayer, GJListLayer) { } return ret; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/InfoLayer.h b/src/nodes/InfoLayer.h index 081b41f..b86f80c 100644 --- a/src/nodes/InfoLayer.h +++ b/src/nodes/InfoLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYINFOLAYER_H -#define MYINFOLAYER_H - #include #include @@ -36,6 +33,4 @@ class $modify(MyInfoLayer, InfoLayer){ } return true; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/LevelSearchLayer.h b/src/nodes/LevelSearchLayer.h index e7d90bf..471a8c7 100644 --- a/src/nodes/LevelSearchLayer.h +++ b/src/nodes/LevelSearchLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYLEVELSEARCHLAYER_H -#define MYLEVELSEARCHLAYER_H - #include #include @@ -25,6 +22,4 @@ class $modify(MyLevelSearchLayer, LevelSearchLayer){ } return true; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/LoadingLayer.h b/src/nodes/LoadingLayer.h index 9b4a000..d735ddd 100644 --- a/src/nodes/LoadingLayer.h +++ b/src/nodes/LoadingLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYLOADINGLAYER_H -#define MYLOADINGLAYER_H - #include #include @@ -15,6 +12,4 @@ class $modify(MyLoadingLayer, LoadingLayer){ UIModding::get()->colorCache.clear(); return LoadingLayer::init(p0); } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/MenuGameLayer.h b/src/nodes/MenuGameLayer.h index 3a74f1d..dea7672 100644 --- a/src/nodes/MenuGameLayer.h +++ b/src/nodes/MenuGameLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYMENUGAMELAYER_H -#define MYMENUGAMELAYER_H - #include #include @@ -60,6 +57,4 @@ class $modify(MyMenuGameLayer, MenuGameLayer){ } } } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/nodes/MenuLayer.h b/src/nodes/MenuLayer.h index 353636a..3b9157e 100644 --- a/src/nodes/MenuLayer.h +++ b/src/nodes/MenuLayer.h @@ -1,8 +1,5 @@ #pragma once -#ifndef MYMENULAYER_H -#define MYMENULAYER_H - #include #include @@ -29,6 +26,4 @@ class $modify(MyMenuLayer, MenuLayer){ } return true; } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file