@@ -20,6 +20,16 @@ bool SwelvyBG::init(float widthmult, float hightmult, float minspeed, float maxs
2020 float y = m_obContentSize.height + 5 ;
2121 int idx = 0 ;
2222
23+ // Retrieve the color offset setting
24+ auto mod = Loader::get ()->getMod (" omgrod.geodify" );
25+ ccColor3B colorOffset = {255 , 0 , 0 }; // Default color offset
26+ if (mod) {
27+ auto colorSetting = mod->getSettingValue <std::string>(" color" );
28+ if (!colorSetting.empty ()) {
29+ sscanf (colorSetting.c_str (), " %hhu,%hhu,%hhu" , &colorOffset.r , &colorOffset.g , &colorOffset.b );
30+ }
31+ }
32+
2333 for (auto layer : std::initializer_list<std::pair<ccColor3B, const char *>> {
2434 { ccc3 (244 , 212 , 142 ), " geode.loader/swelve-layer3.png" },
2535 { ccc3 (245 , 174 , 125 ), " geode.loader/swelve-layer0.png" },
@@ -28,6 +38,13 @@ bool SwelvyBG::init(float widthmult, float hightmult, float minspeed, float maxs
2838 { ccc3 (173 , 84 , 146 ), " geode.loader/swelve-layer1.png" },
2939 { ccc3 (113 , 74 , 154 ), " geode.loader/swelve-layer0.png" },
3040 }) {
41+ // Apply the color offset
42+ ccColor3B adjustedColor = {
43+ static_cast <GLubyte>(std::min (255 , layer.first .r + colorOffset.r )),
44+ static_cast <GLubyte>(std::min (255 , layer.first .g + colorOffset.g )),
45+ static_cast <GLubyte>(std::min (255 , layer.first .b + colorOffset.b ))
46+ };
47+
3148 float speed = dis (gen);
3249 if (sign (gen) == 0 ) {
3350 speed = -speed;
@@ -45,7 +62,7 @@ bool SwelvyBG::init(float widthmult, float hightmult, float minspeed, float maxs
4562 sprite->setTextureRect (rect);
4663 sprite->setAnchorPoint ({ 0 , 1 });
4764 sprite->setContentSize ({winSize.width * widthmult, sprite->getContentSize ().height });
48- sprite->setColor (layer. first );
65+ sprite->setColor (adjustedColor );
4966 sprite->setPosition ({0 , y});
5067 sprite->schedule (schedule_selector (SwelvyBG::updateSpritePosition));
5168 sprite->setUserObject (" speed" , CCFloat::create (speed));
0 commit comments