Skip to content

Commit

Permalink
2.2074 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Nov 14, 2024
1 parent 71cf572 commit b65134e
Show file tree
Hide file tree
Showing 10 changed files with 576 additions and 611 deletions.
68 changes: 34 additions & 34 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
{
"geode": "3.8.1",
"gd": {
"win": "2.206",
"android": "2.206",
"mac": "2.206"
},
"version": "v1.6.2",
"id": "alphalaneous.happy_textures",
"name": "Happy Textures :3",
"developer": "Alphalaneous",
"description": "Fixes texture pack annoyances",
"early-load": true,
"dependencies": [
"geode": "4.0.0-alpha.1",
"gd": {
"win": "2.2074",
"android": "2.2074",
"mac": "2.2074"
},
"version": "v1.6.3-alpha.1",
"id": "alphalaneous.happy_textures",
"name": "Happy Textures :3",
"developer": "Alphalaneous",
"description": "Fixes texture pack annoyances",
"early-load": true,
"dependencies": [
{
"id": "geode.node-ids",
"version": ">=v1.15.0",
"importance": "required"
}
],
"resources": {
"resources": {
"files": [
"resources/*"
"resources/*"
],
"sprites": [
"sprites/*"
]
"sprites": [
"sprites/*"
]
},
"links": {
"links": {
"homepage": "https://twitter.com/alphalaneous",
"source": "https://github.com/Alphalaneous/HappyTextures",
"community": "https://discord.gg/Txn2CA5dHF"
},
"tags": ["universal", "interface", "enhancement", "bugfix", "offline", "utility", "customization"],
"settings": {
"ccscale9sprite-fix": {
"tags": ["universal", "interface", "enhancement", "bugfix", "offline", "utility", "customization"],
"settings": {
"ccscale9sprite-fix": {
"name": "CCScale9Sprite Fix",
"description": "Fix sprite overlapping when you have transparent CCScale9Sprites (Such as on the level search page).",
"description": "Fix sprite overlapping when you have transparent CCScale9Sprites (Such as on the level search page).",
"type": "bool",
"default": true,
"platforms": ["win", "android"]
"platforms": ["win", "android"]
},
"pusab-fix": {
"pusab-fix": {
"name": "Pusab Fix",
"description": "Makes changing pusab in texture packs not affect the font within levels.",
"description": "Makes changing pusab in texture packs not affect the font within levels.",
"type": "bool",
"default": true,
"platforms": ["win", "android"]
"platforms": ["win", "android"]
},
"comment-border-fix": {
"comment-border-fix": {
"name": "Comment Border Fix",
"description": "Makes comment borders look cleaner, especially with texture packs.",
"description": "Makes comment borders look cleaner, especially with texture packs.",
"type": "bool",
"default": true
},
"ui-modifications": {
"ui-modifications": {
"name": "Allow UI Modifications",
"description": "Allow Tetxure Packs to edit the game's interface.",
"description": "Allow Tetxure Packs to edit the game's interface.",
"type": "bool",
"default": true
},
"hot-reload": {
"hot-reload": {
"name": "Hot Reload",
"description": "Allow hot reloading of UI elements, use if you are a texture pack creator.",
"description": "Allow hot reloading of UI elements, use if you are a texture pack creator.",
"type": "bool",
"default": false
}
}
}
}
29 changes: 14 additions & 15 deletions src/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ if (name == #easingTypeName) {\

#define handleModifyForType(typeName) \
if (type == #typeName) {\
UIModding::get()->handleModifications(getChildOfType<typeName>(node, index), childObject);\
UIModding::get()->handleModifications(node->getChildByType<typeName>(index), value);\
}

#define nodesFor(methodName) if(node) UIModding::get()->methodName(node, nodeAttributesObject)
#define nodesFor(methodName) if(node) UIModding::get()->methodName(node, nodeAttributes)

#define actionForName2(name, x, y, param2) if(type == #name){ \
if (!isNumber) { \
Expand Down Expand Up @@ -81,29 +81,28 @@ class $modify(name){ \
}\
};

#define setSpriteVar(varName, jsonName, type)\
#define setSpriteVar(varName, jsonName, type, unwrap)\
if (infoVal.contains(#jsonName)) {\
matjson::Value val = infoVal[#jsonName];\
if (val.is_##type()) {\
varName = val.as_##type();\
if (val.is##type()) {\
varName = val.as##type().unwrapOr(unwrap);\
}\
}

#define setSpriteVarNum(varName, jsonName, type)\
#define setSpriteVarNum(varName, jsonName, type, unwrap)\
if (infoVal.contains(#jsonName)) {\
matjson::Value val = infoVal[#jsonName];\
if (val.is_number()) {\
varName = val.as_##type();\
if (val.isNumber()) {\
varName = val.as##type().unwrapOr(unwrap);\
}\
}

#define forEvent(type, method)\
if (eventObject.contains(#type)) {\
matjson::Value eventVal = eventObject[#type];\
if (eventVal.is_object()) {\
matjson::Object event = eventVal.as_object();\
event["_pack-name"] = nodeObject["_pack-name"];\
button->set##method(event);\
if (eventVal.contains(#type)) {\
matjson::Value eventType = eventVal[#type];\
if (eventType.isObject()) {\
eventType["_pack-name"] = nodeObject["_pack-name"];\
button->set##method(eventType);\
}\
}

Expand All @@ -123,7 +122,7 @@ struct My##class : geode::Modify<My##class, class> { \
}\
}\
void checkBG(float dt) {\
CCLayerColor* child = getChildOfType<CCLayerColor>(this, 0);\
CCLayerColor* child = this->getChildByType<CCLayerColor>(0);\
if (child) {\
if (m_fields->m_lastBG != child->getColor()) {\
m_fields->m_lastBG = child->getColor();\
Expand Down
Loading

0 comments on commit b65134e

Please sign in to comment.