1
- #ifndef GEODE_IS_MACOS
2
-
3
1
#include < Geode/Geode.hpp>
2
+ #include < Geode/modify/CCDrawNode.hpp>
4
3
#include " ../Client/Client.h"
5
4
6
5
using namespace geode ::prelude;
7
6
8
7
Module* noWave = nullptr ;
9
8
Module* solidWave = nullptr ;
10
9
11
- bool myDrawCircle (CCDrawNode* ins, CCPoint *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor) {
12
-
13
- if (typeinfo_cast<HardStreak*>(ins) )
10
+ class $modify (CCDrawNode)
11
+ {
12
+ bool drawPolygon (CCPoint *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor )
14
13
{
15
- if (!noWave)
16
- noWave = Client::GetModule (" no-wave" );
17
-
18
- if (!solidWave)
19
- solidWave = Client::GetModule (" solid-wave" );
14
+ if (typeinfo_cast<HardStreak*>(this ))
15
+ {
16
+ if (!noWave)
17
+ noWave = Client::GetModule (" no-wave" );
20
18
21
- if (noWave-> enabled )
22
- return true ;
19
+ if (!solidWave )
20
+ solidWave = Client::GetModule ( " solid-wave " ) ;
23
21
24
- if (solidWave->enabled )
25
- {
26
- if (fillColor.r >= 1 .0f && fillColor.g >= 1 .0f && fillColor.b >= 1 .0f && ins->getColor () != ccc3 (255 , 255 , 255 ))
22
+ if (noWave->enabled )
27
23
return true ;
28
24
29
- if (ins-> getTag () != 1 )
25
+ if (solidWave-> enabled )
30
26
{
31
- ins->setTag (1 );
32
- ins->setBlendFunc (CCSprite::create ()->getBlendFunc ());
33
- }
27
+ if (fillColor.r >= 1 .0f && fillColor.g >= 1 .0f && fillColor.b >= 1 .0f && this ->getColor () != ccc3 (255 , 255 , 255 ))
28
+ return true ;
29
+
30
+ if (this ->getTag () != 1 )
31
+ {
32
+ this ->setTag (1 );
33
+ this ->setBlendFunc (CCSprite::create ()->getBlendFunc ());
34
+ }
34
35
35
- ins->setZOrder (-1 );
36
+ this ->setZOrder (-1 );
37
+ }
36
38
}
37
- }
38
39
39
- return ins->drawPolygon (verts, count, fillColor, borderWidth, borderColor);
40
- }
41
-
42
- $execute {
43
- Mod::get ()->hook (
44
- reinterpret_cast <void *>(
45
- geode::addresser::getNonVirtual (&HardStreak::drawPolygon)
46
- ),
47
- &myDrawCircle,
48
- " cocos2d::CCDrawNode::drawPolygon" ,
49
- tulip::hook::TulipConvention::Thiscall
50
- );
51
- }
52
-
53
- #endif
40
+ return CCDrawNode::drawPolygon (verts, count, fillColor, borderWidth, borderColor);
41
+ }
42
+ };
0 commit comments