|
1 | 1 | #include "CustomSettings.hpp" |
2 | 2 | #include <Geode/loader/Dirs.hpp> |
3 | | -#include "../Notifications/EventsPush.h" |
4 | 3 | #include "../includes.h" |
5 | | -int cycleTypes = -1; |
6 | 4 |
|
7 | | -SettingNodeV3* SettingTestValue::createNode(float width) { |
8 | | - return SettingTestNode::create(static_pointer_cast<SettingTestValue>(shared_from_this()), width); |
9 | | -} |
10 | 5 | SettingNodeV3* SettingPosValue::createNode(float width) { |
11 | 6 | return SettingPosNode::create(static_pointer_cast<SettingPosValue>(shared_from_this()), width); |
12 | 7 | } |
13 | 8 | SettingNodeV3* SettingCreditsValue::createNode(float width) { |
14 | 9 | return SettingCreditsNode::create(static_pointer_cast<SettingCreditsValue>(shared_from_this()), width); |
15 | 10 | } |
16 | | - |
17 | | -void SettingTestNode::onTestBtn(CCObject*) { |
18 | | - auto scene = CCDirector::sharedDirector()->getRunningScene(); |
19 | | - cycleTypes = cycleTypes + 1; |
20 | | - if (cycleTypes > 4) cycleTypes = 0; |
21 | | - bool newRate = Mod::get()->getSettingValue<bool>("newRate"); |
22 | | - bool daily = Mod::get()->getSettingValue<bool>("daily"); |
23 | | - bool weekly = Mod::get()->getSettingValue<bool>("weekly"); |
24 | | - if (!newRate && cycleTypes == 0) cycleTypes = 1; |
25 | | - if (!daily && cycleTypes == 1) cycleTypes = 2; |
26 | | - if (!weekly && cycleTypes == 2) cycleTypes = 3; |
27 | | - if (!newRate && !daily && !weekly) { |
28 | | - cycleTypes = 5; |
29 | | - } |
30 | | - |
31 | | - sio::message::ptr data = sio::object_message::create(); |
32 | | - //{'demon': 1, 'type': 1, 'starsum': 6, 'stars': 10, 'rate': 1, 'title': 'BRAINPOWER Let the base kick!', 'level_name': 'O-oooooooooo AAAAE-A-A-I-A-U-', 'level_creator': ' JO-oooooooooooo AAE-O-A-A-U-U-A- E-eee-ee-eee AAAAE-A-E-I-E-A- JO-ooo-oo-oo-oo EEEEO-A-AAA-AAAA', 'sprite': 'GJ_square01.png'} |
33 | | - data->get_map()["coins"] = sio::int_message::create(3); |
34 | | - data->get_map()["verified_coins"] = sio::int_message::create(1); |
35 | | - data->get_map()["platformer"] = sio::int_message::create(0); |
36 | | - switch (cycleTypes) { |
37 | | - case 0: // new rate |
38 | | - data->get_map()["title"] = sio::string_message::create("New Rated Level !"); |
39 | | - data->get_map()["demon"] = sio::int_message::create(0); |
40 | | - data->get_map()["type"] = sio::int_message::create(0); |
41 | | - data->get_map()["stars"] = sio::int_message::create(1); |
42 | | - data->get_map()["starsum"] = sio::int_message::create(10); |
43 | | - data->get_map()["level_name"] = sio::string_message::create("Stereo Madness"); |
44 | | - data->get_map()["level_creator"] = sio::string_message::create("by RobTop"); |
45 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square01.png"); |
46 | | - data->get_map()["rate"] = sio::int_message::create(1); |
47 | | - break; |
48 | | - case 1: // daily |
49 | | - data->get_map()["title"] = sio::string_message::create("New Daily Level !"); |
50 | | - data->get_map()["demon"] = sio::int_message::create(0); |
51 | | - data->get_map()["type"] = sio::int_message::create(1); |
52 | | - data->get_map()["stars"] = sio::int_message::create(9); |
53 | | - data->get_map()["starsum"] = sio::int_message::create(40); |
54 | | - data->get_map()["level_name"] = sio::string_message::create("Cycles"); |
55 | | - data->get_map()["level_creator"] = sio::string_message::create("by RobTop"); |
56 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square01.png"); |
57 | | - data->get_map()["rate"] = sio::int_message::create(1); |
58 | | - break; |
59 | | - case 2: // weekly |
60 | | - data->get_map()["title"] = sio::string_message::create("New Weekly Level !"); |
61 | | - data->get_map()["demon"] = sio::int_message::create(1); |
62 | | - data->get_map()["type"] = sio::int_message::create(2); |
63 | | - data->get_map()["stars"] = sio::int_message::create(14); |
64 | | - data->get_map()["starsum"] = sio::int_message::create(7); |
65 | | - data->get_map()["level_name"] = sio::string_message::create("Theory of Everything 2"); |
66 | | - data->get_map()["level_creator"] = sio::string_message::create("by RobTop"); |
67 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square05.png"); |
68 | | - data->get_map()["rate"] = sio::int_message::create(1); |
69 | | - break; |
70 | | - case 3: // Legendary rating test |
71 | | - data->get_map()["title"] = sio::string_message::create("New Rated Level !"); |
72 | | - data->get_map()["demon"] = sio::int_message::create(0); |
73 | | - data->get_map()["type"] = sio::int_message::create(0); |
74 | | - data->get_map()["stars"] = sio::int_message::create(3); |
75 | | - data->get_map()["starsum"] = sio::int_message::create(20); |
76 | | - data->get_map()["level_name"] = sio::string_message::create("Oh no it's happening"); |
77 | | - data->get_map()["level_creator"] = sio::string_message::create("by ..."); |
78 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square01.png"); |
79 | | - data->get_map()["rate"] = sio::int_message::create(3); |
80 | | - break; |
81 | | - case 4: // Mythic rating test |
82 | | - data->get_map()["title"] = sio::string_message::create("New Rated Level !"); |
83 | | - data->get_map()["demon"] = sio::int_message::create(0); |
84 | | - data->get_map()["type"] = sio::int_message::create(0); |
85 | | - data->get_map()["stars"] = sio::int_message::create(100); |
86 | | - data->get_map()["starsum"] = sio::int_message::create(20); |
87 | | - data->get_map()["level_name"] = sio::string_message::create("FIRE IN THE HOLE!"); |
88 | | - data->get_map()["level_creator"] = sio::string_message::create("by GD Community"); |
89 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square01.png"); |
90 | | - data->get_map()["rate"] = sio::int_message::create(4); |
91 | | - break; |
92 | | - case 5: // in case the user disables everything |
93 | | - data->get_map()["title"] = sio::string_message::create("New Rated Level !"); |
94 | | - data->get_map()["demon"] = sio::int_message::create(1); |
95 | | - data->get_map()["type"] = sio::int_message::create(-1); |
96 | | - data->get_map()["stars"] = sio::int_message::create(2); |
97 | | - data->get_map()["starsum"] = sio::int_message::create(6); |
98 | | - data->get_map()["level_name"] = sio::string_message::create("Back On Track"); |
99 | | - data->get_map()["level_creator"] = sio::string_message::create("by RobTop"); |
100 | | - data->get_map()["sprite"] = sio::string_message::create("GJ_square01.png"); |
101 | | - data->get_map()["rate"] = sio::int_message::create(1); |
102 | | - break; |
103 | | - default: // not possible |
104 | | - data->get_map()["title"] = sio::string_message::create("hi there hxd user, ghidra user or ida user. (or hi RobTop) Here's a little easter egg for you :)"); |
105 | | - data->get_map()["demon"] = sio::int_message::create(1); |
106 | | - data->get_map()["type"] = sio::int_message::create(2); |
107 | | - data->get_map()["stars"] = sio::int_message::create(14); |
108 | | - data->get_map()["starsum"] = sio::int_message::create(7); |
109 | | - data->get_map()["sprite"] = sio::string_message::create("This will crash! :D"); |
110 | | - |
111 | | - break; |
112 | | - } |
113 | | - EventsPush::pushRateLevel(scene, data); |
114 | | -} |
0 commit comments