Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 2.0.0
**NOTICE! Modifying nodes by ID is removed. You must now modify them by their class name instead.**
- Code cleanup
- Multi pack UI modding (packs can now modify other packs based on priority in Texture Loader)
- Rewrite mod to be more efficient
- Remove old ID based modding
- Improve reliability
- Scheduling Updates
- Bug fixes
- Pack IDs for custom nodes work once again
- No longer double activates transitions
- Hot reload fixes

## 1.9.10
- Bug fixes

## 1.9.9
- Fix sprite crash

## 1.9.8
- Add basic support for SimpleAxisLayout
- Fix setDisplayFrame not using changed textures
Expand All @@ -16,7 +35,7 @@
- Fix some load delay

## 1.9.3
**NOTICE! Modifying nodes by ID will soon be depreciated. Once the next GD update comes out, I will be removing that feature in favor of modiifying nodes by their class name. This is the name BEFORE the one in quotes in DevTools. For example `ui/cvolton.betterinfo$ExtendedLevelInfo.json` will become `ui/ExtendedLevelInfo.json` and anything in the nodes folder will no longer work and should be placed in the UI folder.**
**NOTICE! Modifying nodes by ID will soon be depreciated. Once the next GD update comes out, I will be removing that feature in favor of modifying nodes by their class name. This is the name BEFORE the one in quotes in DevTools. For example `ui/cvolton.betterinfo$ExtendedLevelInfo.json` will become `ui/ExtendedLevelInfo.json` and anything in the nodes folder will no longer work and should be placed in the UI folder.**
- Fixed crash when pressing space on main menu for mac

## 1.9.2
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"geode": "4.4.0",
"geode": "4.6.1",
"gd": {
"win": "2.2074",
"android": "2.2074",
"mac": "2.2074",
"ios": "2.2074"
},
"version": "v1.9.8",
"version": "v2.0.0",
"id": "alphalaneous.happy_textures",
"name": "Happy Textures :3",
"developer": "Alphalaneous",
Expand Down
7 changes: 4 additions & 3 deletions src/BackgroundColors.h → src/BackgroundColors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#include <Geode/modify/CCDirector.hpp>
#include <Geode/modify/LeaderboardsLayer.hpp>
#include <Geode/modify/LevelBrowserLayer.hpp>
#include "UIModding.h"
#include "Macros.h"
#include "UIModding.hpp"
#include "Macros.hpp"
#include "Utils.hpp"

using namespace geode::prelude;

void setBackground(CCNode* node) {
inline void setBackground(CCNode* node) {
if (UIModding::get()->doModify) {
if (CCSprite* bg = typeinfo_cast<CCSprite*>(node->getChildByIDRecursive("background"))) {
if (bg->getColor() == ccColor3B{0, 102, 255}) {
Expand Down
16 changes: 5 additions & 11 deletions src/Callbacks.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
#include "Callbacks.h"
#include "Macros.h"
#include "Callbacks.hpp"
#include "Macros.hpp"
#include "UIModding.hpp"

Callbacks* Callbacks::instance = nullptr;

//do cursed UB stuff, currently unused but may be useful in the future

template <typename T>
FakeNodeLayer<T> Callbacks::createUBDummyLayer() {
return FakeNodeLayer<T>();
}

void Callbacks::generateAll() {
if (m_generated) return;
m_ignoreUICheck = true;
UIModding::get()->skipCheck = true;
generateMenuLayerCallbacks();
generateCreatorLayerCallbacks();
generateGarageCallbacks();
m_ignoreUICheck = false;
UIModding::get()->skipCheck = false;
m_generated = true;
}

Expand Down
17 changes: 1 addition & 16 deletions src/Callbacks.h → src/Callbacks.hpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
#pragma once

#include <Geode/Geode.hpp>
#include "Macros.h"
#include "Macros.hpp"

using namespace geode::prelude;

template <typename T>
struct FakeNodeLayer final {
char m_alloc[sizeof(T)];
T* operator->() {
return get();
}
T* get() {
return reinterpret_cast<T*>(&m_alloc);
}
};

class Callbacks {

protected:
static Callbacks* instance;
bool m_generated = false;
public:
bool m_ignoreUICheck = false;
std::map<std::string, std::map<std::string, std::pair<CCNode*, cocos2d::SEL_MenuHandler>>> m_callbacks;
std::map<std::string, Ref<CCNode>> m_layers;
Ref<CCMenuItemSpriteExtra> m_dummyButton;

template <typename T>
FakeNodeLayer<T> createUBDummyLayer();

void generateAll();
void generateMenuLayerCallbacks();
void generateCreatorLayerCallbacks();
Expand Down
26 changes: 12 additions & 14 deletions src/Config.h → src/Config.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Geode/Geode.hpp>
#include "Utils.h"
#include "Utils.hpp"
#include <geode.texture-loader/include/TextureLoader.hpp>

class Config {
Expand All @@ -27,20 +27,18 @@ class Config {

Mod* textureLoader = Loader::get()->getLoadedMod("geode.texture-loader");
if (textureLoader) {
if (textureLoader->getVersion() >= VersionInfo{1, 7, 0}) {
for (geode::texture_loader::Pack pack : geode::texture_loader::getAppliedPacks()) {
std::optional<matjson::Value> json = loadIntoJson(pack);
if (json.has_value()) {
matjson::Value jsonRes = json.value();
loadConfig(pack, jsonRes["happy-textures"]);
}
for (const geode::texture_loader::Pack& pack : geode::texture_loader::getAppliedPacks()) {
std::optional<matjson::Value> json = loadIntoJson(pack);
if (json.has_value()) {
matjson::Value jsonRes = json.value();
loadConfig(pack, jsonRes["happy-textures"]);
}
for (geode::texture_loader::Pack pack : geode::texture_loader::getAvailablePacks()) {
std::optional<matjson::Value> json = loadIntoJson(pack);
if (json.has_value()) {
matjson::Value jsonRes = json.value();
loadSettings(pack, jsonRes["happy-textures"]);
}
}
for (const geode::texture_loader::Pack& pack : geode::texture_loader::getAvailablePacks()) {
std::optional<matjson::Value> json = loadIntoJson(pack);
if (json.has_value()) {
matjson::Value jsonRes = json.value();
loadSettings(pack, jsonRes["happy-textures"]);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/DataNode.h → src/DataNode.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Geode/Geode.hpp>
#include "Macros.h"
#include "Macros.hpp"

using namespace geode::prelude;

Expand All @@ -12,13 +12,13 @@ class DataNode : public CCNode {
CCNode* m_data;

static DataNode* create(CCNode* data) {
auto node = new DataNode;
if (!node->init(data)) {
CC_SAFE_DELETE(node);
return nullptr;
auto node = new DataNode();
if (node->init(data)) {
node->autorelease();
return node;
}
node->autorelease();
return node;
delete node;
return nullptr;
}

virtual bool init(CCNode* data) {
Expand Down
3 changes: 1 addition & 2 deletions src/FileWatcher.h → src/FileWatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#include <chrono>
#include <thread>
#include <unordered_map>
#include <string>
#include <functional>
#include <Geode/Geode.hpp>
#include "Macros.h"
#include "Macros.hpp"

using namespace geode::prelude;
/**
Expand Down
3 changes: 2 additions & 1 deletion src/LabelValues.h → src/LabelValues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include <Geode/Geode.hpp>
#include <rift.hpp>
#include "Macros.h"
#include "Macros.hpp"
#include "Utils.hpp"

using namespace geode::prelude;

Expand Down
141 changes: 0 additions & 141 deletions src/Macros.h

This file was deleted.

Loading