Skip to content

Commit 51a56e6

Browse files
committed
Added opacity slider & fixed some bugs
1 parent ea20159 commit 51a56e6

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v1.2.18
2+
- Added opacity scale for your child backgrounds
3+
- Fixed bug that all backgrounds colours were changed (even without activating the feature)
4+
- Fixed "The Shop" when entering on it
15
# v1.2.17
26
- Added GDUtils Discord support server for assistance or informations about next updates
37
- Added custom backgrounds & transparency

mod.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"geode": "2.0.0",
3-
"version": "v1.2.17",
3+
"version": "v1.2.18",
44
"gd": {
55
"win": "2.204",
66
"android": "2.205"
@@ -240,6 +240,17 @@
240240
"type": "bool",
241241
"default": false
242242
},
243+
"bgchild-transparency-scroll": {
244+
"name": "Transparency Opacity",
245+
"description": "Change the opacity of the transparency of child backgrounds.\n\n<cy>0</c> - Totally <cy>transparent</c>\n<cy>255</c> - Totally <cy>opaque</c>\n\n<cy>Only works if Add child BG Gradient is enabled.</c>",
246+
"type": "int",
247+
"default": 0,
248+
"min": 0,
249+
"max": 255,
250+
"control": {
251+
"slider": true
252+
}
253+
},
243254
"credits-section": {
244255
"name": "Credits",
245256
"description": "Below are the credits for those that developed the mod, and beta-tested the mod!",

src/main.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ class $modify(CCScale9Sprite) {
327327
new_color = cocos2d::ccColor3B(new_color.r * 0.79, new_color.g * 0.79, new_color.b * 0.79);
328328
}
329329
if (Mod::get()->getSettingValue<bool>("bgchild-transparency")) {
330-
CCScale9Sprite::setOpacity(0);
330+
int opacity = Mod::get()->getSettingValue<int64_t>("bgchild-transparency-scroll");
331+
CCScale9Sprite::setOpacity(opacity);
331332
}
332333
CCScale9Sprite::setColor(new_color);
333334
} else if (m_fields->isGradient && (CCScale9Sprite::getColor().r == 0 && CCScale9Sprite::getColor().g == 39 && CCScale9Sprite::getColor().b == 98)) {
@@ -339,7 +340,8 @@ class $modify(CCScale9Sprite) {
339340
new_color = cocos2d::ccColor3B(new_color.r * 0.71, new_color.g * 0.71, new_color.b * 0.71);
340341
}
341342
if (Mod::get()->getSettingValue<bool>("bgchild-transparency")) {
342-
CCScale9Sprite::setOpacity(0);
343+
int opacity = Mod::get()->getSettingValue<int64_t>("bgchild-transparency-scroll");
344+
CCScale9Sprite::setOpacity(opacity);
343345
}
344346
CCScale9Sprite::setColor(new_color);
345347
} else if (m_fields->isGradient && (CCScale9Sprite::getColor().r == 0 && CCScale9Sprite::getColor().g == 46 && CCScale9Sprite::getColor().b == 117)) {
@@ -351,7 +353,8 @@ class $modify(CCScale9Sprite) {
351353
new_color = cocos2d::ccColor3B(new_color.r * 0.74, new_color.g * 0.74, new_color.b * 0.74);
352354
}
353355
if (Mod::get()->getSettingValue<bool>("bgchild-transparency")) {
354-
CCScale9Sprite::setOpacity(0);
356+
int opacity = Mod::get()->getSettingValue<int64_t>("bgchild-transparency-scroll");
357+
CCScale9Sprite::setOpacity(opacity);
355358
}
356359
CCScale9Sprite::setColor(new_color);
357360
} else if (m_fields->isGradient && (CCScale9Sprite::getColor().r == 0 && CCScale9Sprite::getColor().g == 36 && CCScale9Sprite::getColor().b == 91)) {
@@ -363,7 +366,8 @@ class $modify(CCScale9Sprite) {
363366
new_color = cocos2d::ccColor3B(new_color.r * 0.70, new_color.g * 0.70, new_color.b * 0.70);
364367
}
365368
if (Mod::get()->getSettingValue<bool>("bgchild-transparency")) {
366-
CCScale9Sprite::setOpacity(0);
369+
int opacity = Mod::get()->getSettingValue<int64_t>("bgchild-transparency-scroll");
370+
CCScale9Sprite::setOpacity(opacity);
367371
}
368372
CCScale9Sprite::setColor(new_color);
369373
} else if (m_fields->isGradient && (CCScale9Sprite::getColor().r == 0 && CCScale9Sprite::getColor().g == 31 && CCScale9Sprite::getColor().b == 79)) {
@@ -375,7 +379,8 @@ class $modify(CCScale9Sprite) {
375379
new_color = cocos2d::ccColor3B(new_color.r * 0.67, new_color.g * 0.67, new_color.b * 0.67);
376380
}
377381
if (Mod::get()->getSettingValue<bool>("bgchild-transparency")) {
378-
CCScale9Sprite::setOpacity(0);
382+
int opacity = Mod::get()->getSettingValue<int64_t>("bgchild-transparency-scroll");
383+
CCScale9Sprite::setOpacity(opacity);
379384
}
380385
CCScale9Sprite::setColor(new_color);
381386
}

0 commit comments

Comments
 (0)