|
1 | | -/* Discord Settings |
2 | | - * |
3 | | - * From: https://github.com/PokemonAutomation/ |
4 | | - * |
5 | | - */ |
6 | | - |
7 | | -#include "Common/Qt/Options/BatchWidget.h" |
8 | | -#include "CommonFramework/GlobalSettingsPanel.h" |
9 | | -#include "DiscordSettingsOption.h" |
10 | | - |
11 | | -//#include <iostream> |
12 | | -//using std::cout; |
13 | | -//using std::endl; |
14 | | - |
15 | | -namespace PokemonAutomation{ |
16 | | -namespace Integration{ |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | -DiscordMessageSettingsOption::DiscordMessageSettingsOption() |
23 | | - : BatchOption(LockMode::LOCK_WHILE_RUNNING) |
24 | | - , instance_name( |
25 | | - false, |
26 | | - "<b>Instance Name:</b><br>If you are running multiple instances of this program, give it a name to distinguish them in notifications.", |
27 | | - LockMode::LOCK_WHILE_RUNNING, |
28 | | - "", |
29 | | - "(e.g. Living Room Switch)" |
30 | | - ) |
31 | | - , user_id( |
32 | | - false, |
33 | | - "<b>Discord User ID:</b><br>Set this to your discord user ID to receive pings. Your ID is a number.", |
34 | | - LockMode::LOCK_WHILE_RUNNING, |
35 | | - "", |
36 | | - "123456789012345678" |
37 | | - ) |
38 | | - , message( |
39 | | - false, |
40 | | - "<b>Discord Message:</b><br>Message to put on every discord notification.", |
41 | | - LockMode::LOCK_WHILE_RUNNING, |
42 | | - "", |
43 | | - "(e.g. Kim's Shiny Hunt)" |
44 | | - ) |
45 | | -{ |
46 | | - PA_ADD_OPTION(instance_name); |
47 | | - PA_ADD_OPTION(user_id); |
48 | | -// if (PreloadSettings::instance().DEVELOPER_MODE){ |
49 | | -// PA_ADD_OPTION(message); |
50 | | -// } |
51 | | -} |
52 | | -class DiscordMessageSettingsOptionUI : public BatchWidget{ |
53 | | -public: |
54 | | - DiscordMessageSettingsOptionUI(QWidget& parent, DiscordMessageSettingsOption& value); |
55 | | -}; |
56 | | -DiscordMessageSettingsOptionUI::DiscordMessageSettingsOptionUI(QWidget& parent, DiscordMessageSettingsOption& value) |
57 | | - : BatchWidget(parent, value) |
58 | | -{} |
59 | | -ConfigWidget* DiscordMessageSettingsOption::make_QtWidget(QWidget& parent){ |
60 | | - return new DiscordMessageSettingsOptionUI(parent, *this); |
61 | | -} |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | -DiscordSettingsOption::DiscordSettingsOption() |
69 | | - : BatchOption(LockMode::LOCK_WHILE_RUNNING) |
70 | | -{ |
71 | | - PA_ADD_OPTION(message); |
72 | | - PA_ADD_OPTION(webhooks); |
73 | | -#ifdef PA_DPP |
74 | | - PA_ADD_OPTION(integration); |
75 | | -#endif |
76 | | -} |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | -} |
83 | | -} |
84 | | - |
| 1 | +/* Discord Settings |
| 2 | + * |
| 3 | + * From: https://github.com/PokemonAutomation/ |
| 4 | + * |
| 5 | + */ |
| 6 | + |
| 7 | +#include "Common/Qt/Options/BatchWidget.h" |
| 8 | +#include "CommonFramework/GlobalSettingsPanel.h" |
| 9 | +#include "DiscordSettingsOption.h" |
| 10 | + |
| 11 | +//#include <iostream> |
| 12 | +//using std::cout; |
| 13 | +//using std::endl; |
| 14 | + |
| 15 | +namespace PokemonAutomation{ |
| 16 | +namespace Integration{ |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +DiscordMessageSettingsOption::DiscordMessageSettingsOption() |
| 23 | + : BatchOption(LockMode::LOCK_WHILE_RUNNING) |
| 24 | + , instance_name( |
| 25 | + false, |
| 26 | + "<b>Instance Name:</b><br>If you are running multiple instances of this program, give it a name to distinguish them in notifications.", |
| 27 | + LockMode::LOCK_WHILE_RUNNING, |
| 28 | + "", |
| 29 | + "(e.g. Living Room Switch)" |
| 30 | + ) |
| 31 | + , user_id( |
| 32 | + false, |
| 33 | + "<b>Discord User ID:</b><br>Set this to your discord user ID to receive pings. Your ID is a number.", |
| 34 | + LockMode::LOCK_WHILE_RUNNING, |
| 35 | + "", |
| 36 | + "123456789012345678" |
| 37 | + ) |
| 38 | + , message( |
| 39 | + false, |
| 40 | + "<b>Discord Message:</b><br>Message to put on every discord notification.", |
| 41 | + LockMode::LOCK_WHILE_RUNNING, |
| 42 | + "", |
| 43 | + "(e.g. Kim's Shiny Hunt)" |
| 44 | + ) |
| 45 | +{ |
| 46 | + PA_ADD_OPTION(instance_name); |
| 47 | + PA_ADD_OPTION(user_id); |
| 48 | +// if (PreloadSettings::instance().DEVELOPER_MODE){ |
| 49 | +// PA_ADD_OPTION(message); |
| 50 | +// } |
| 51 | +} |
| 52 | +class DiscordMessageSettingsOptionUI : public BatchWidget{ |
| 53 | +public: |
| 54 | + DiscordMessageSettingsOptionUI(QWidget& parent, DiscordMessageSettingsOption& value); |
| 55 | +}; |
| 56 | +DiscordMessageSettingsOptionUI::DiscordMessageSettingsOptionUI(QWidget& parent, DiscordMessageSettingsOption& value) |
| 57 | + : BatchWidget(parent, value) |
| 58 | +{} |
| 59 | +ConfigWidget* DiscordMessageSettingsOption::make_QtWidget(QWidget& parent){ |
| 60 | + return new DiscordMessageSettingsOptionUI(parent, *this); |
| 61 | +} |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +DiscordSettingsOption::DiscordSettingsOption() |
| 69 | + : BatchOption(LockMode::LOCK_WHILE_RUNNING) |
| 70 | +{ |
| 71 | + PA_ADD_OPTION(message); |
| 72 | + PA_ADD_OPTION(webhooks); |
| 73 | +#ifdef PA_DPP |
| 74 | + PA_ADD_OPTION(integration); |
| 75 | +#endif |
| 76 | +} |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +} |
| 83 | +} |
| 84 | + |
0 commit comments