Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

Commit 0fa8602

Browse files
committed
Ability to move F block
1 parent 25e842b commit 0fa8602

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

mod.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"id": "alphalaneous.awesome_modifier_icons",
1010
"name": "Awesome Modifier Icons",
11-
"version": "v1.0.2",
11+
"version": "v1.0.3",
1212
"developer": "Alphalaneous",
1313
"description": "Makes D, J, S, H, and F blocks have icons instead of a letter!",
1414
"resources": {
@@ -33,6 +33,12 @@
3333
"description": "Show the letters instead of hiding them",
3434
"type": "bool",
3535
"default": false
36+
},
37+
"move-f-block": {
38+
"name": "Move F block",
39+
"description": "Moves the F block to be next to the other modifier blocks rather than separated by the force blocks.",
40+
"type": "bool",
41+
"default": true
3642
}
3743
}
3844
}

src/main.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <Geode/Geode.hpp>
22
#include <Geode/modify/EffectGameObject.hpp>
3+
#include <Geode/modify/EditButtonBar.hpp>
34

45
using namespace geode::prelude;
56

@@ -73,4 +74,35 @@ class $modify(MyEffectGameObject, EffectGameObject) {
7374
}
7475
}
7576
}
77+
};
78+
79+
class $modify(MyEditButtonBar, EditButtonBar) {
80+
81+
void loadFromItems(CCArray* items, int c, int r, bool unkBool) {
82+
83+
if (Mod::get()->getSettingValue<bool>("move-f-block")) {
84+
int idx = 0;
85+
int hIndex = 0;
86+
87+
for (CCNode* item : CCArrayExt<CCNode*>(items)) {
88+
if(ButtonSprite* bspr = getChildOfType<ButtonSprite>(item, 0)){
89+
if(EffectGameObject* ego = getChildOfType<EffectGameObject>(bspr, 0)){
90+
if(CCLabelBMFont* label = getChildOfType<CCLabelBMFont>(ego, 0)){
91+
std::string text = std::string(label->getString());
92+
if(text == "H"){
93+
hIndex = idx;
94+
}
95+
if(text == "F"){
96+
items->removeObject(item, false);
97+
items->insertObject(item, hIndex + 1);
98+
}
99+
}
100+
}
101+
}
102+
idx++;
103+
}
104+
}
105+
106+
EditButtonBar::loadFromItems(items, c, r, unkBool);
107+
}
76108
};

0 commit comments

Comments
 (0)