Skip to content

Commit 2c3eb42

Browse files
committed
convenience changes
1 parent caa009d commit 2c3eb42

File tree

8 files changed

+70
-30
lines changed

8 files changed

+70
-30
lines changed

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,6 @@ void PreloadSettings::load(const JsonValue& json){
6565
return;
6666
}
6767

68-
// Naughty mode.
69-
obj->read_boolean(NAUGHTY_MODE, "NAUGHTY_MODE");
70-
71-
// Developer mode stuff.
72-
const std::string* dev_token = obj->get_string("DEVELOPER_TOKEN");
73-
if (dev_token){
74-
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
75-
#if QT_VERSION < 0x060700
76-
hash.addData(dev_token->c_str(), (int)dev_token->size());
77-
#else
78-
QByteArrayView dataView(dev_token->data(), dev_token->size());
79-
hash.addData(dataView);
80-
#endif
81-
DEVELOPER_MODE = TOKENS.find(hash.result().toHex().toStdString()) != TOKENS.end();
82-
}
83-
8468
const JsonObject* debug_obj = obj->get_object("DEBUG");
8569
if (debug_obj){
8670
debug_obj->read_boolean(DEBUG.COLOR_CHECK, "COLOR_CHECK");

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class PreloadSettings{
6767

6868
void load(const JsonValue& json);
6969

70-
bool NAUGHTY_MODE = false;
71-
bool DEVELOPER_MODE = false;
70+
bool NAUGHTY_MODE = true;
71+
bool DEVELOPER_MODE = true;
7272

7373
DebugSettings DEBUG;
7474
};

SerialPrograms/Source/CommonFramework/Notifications/EventNotificationOption.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ EventNotificationOption::~EventNotificationOption(){}
176176
EventNotificationOption::EventNotificationOption(
177177
std::string label,
178178
bool enabled, bool ping,
179-
std::chrono::seconds rate_limit
179+
[[maybe_unused]] std::chrono::seconds rate_limit
180180
)
181181
: StaticTableRow(label)
182-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, rate_limit)
182+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::chrono::seconds(0))
183183
, m_test_button(*this)
184184
{
185185
add_option(m_data->m_enabled, "Enabled");
@@ -196,10 +196,10 @@ EventNotificationOption::EventNotificationOption(
196196
std::string label,
197197
bool enabled, bool ping,
198198
std::vector<std::string> tags,
199-
std::chrono::seconds rate_limit
199+
[[maybe_unused]] std::chrono::seconds rate_limit
200200
)
201201
: StaticTableRow(label)
202-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), rate_limit)
202+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), std::chrono::seconds(0))
203203
, m_test_button(*this)
204204
{
205205
add_option(m_data->m_enabled, "Enabled");
@@ -217,10 +217,10 @@ EventNotificationOption::EventNotificationOption(
217217
bool enabled, bool ping,
218218
ImageAttachmentMode screenshot,
219219
std::vector<std::string> tags,
220-
std::chrono::seconds rate_limit
220+
[[maybe_unused]] std::chrono::seconds rate_limit
221221
)
222222
: StaticTableRow(label)
223-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), rate_limit)
223+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), std::chrono::seconds(0))
224224
, m_test_button(*this)
225225
{
226226
add_option(m_data->m_enabled, "Enabled");

SerialPrograms/Source/CommonTools/Options/LanguageOCROption.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ LanguageOCRCell::LanguageOCRCell(
5151
std::forward_as_tuple(language),
5252
std::forward_as_tuple(index)
5353
);
54+
if (language == Language::French){
55+
m_default = index;
56+
m_current = index;
57+
}
5458
index++;
5559
}
5660
}

SerialPrograms/Source/CommonTools/Options/LanguageOCROption.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class LanguageOCRCell : public ConfigOption{
4444

4545
std::vector<std::pair<Language, bool>> m_case_list;
4646
std::map<Language, size_t> m_case_map;
47-
const size_t m_default;
47+
size_t m_default;
4848

4949
std::atomic<size_t> m_current;
5050
};

SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ DiscordIntegrationSettingsOption::~DiscordIntegrationSettingsOption(){
3030
DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
3131
: GroupOption(
3232
"Discord Integration Settings",
33-
LockMode::LOCK_WHILE_RUNNING,
34-
GroupOption::EnableMode::DEFAULT_DISABLED
33+
LockMode::LOCK_WHILE_RUNNING
3534
)
3635
// , m_integration_enabled(integration_enabled)
3736
, run_on_start(
3837
"<b>Run Discord Integration on Launch:</b><br>Automatically connect to Discord as soon as the program is launched.",
3938
LockMode::LOCK_WHILE_RUNNING,
40-
false
39+
true
4140
)
4241
, library0(
4342
"<b>Discord Integration Library:</b><br>Restart the program for this to take effect.",
@@ -61,7 +60,7 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
6160
true,
6261
"<b>Discord Token:</b><br>Enter your Discord bot's token. Keep it safe and don't share it with anyone.",
6362
LockMode::LOCK_WHILE_RUNNING,
64-
"", "0123456789abcdefghijklmnopqrstuvwxyzABCDEGFHIJKLMNOPQRSTUVWXYZ"
63+
std::getenv("DISCORD_BOT_TOKEN"), "0123456789abcdefghijklmnopqrstuvwxyzABCDEGFHIJKLMNOPQRSTUVWXYZ"
6564
)
6665
, command_prefix(
6766
false,
@@ -119,6 +118,50 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
119118

120119
DiscordIntegrationSettingsOption::value_changed(this);
121120

121+
{
122+
std::unique_ptr<EditableTableRow> channel = channels.make_row();
123+
DiscordIntegrationChannel* channel_casted = static_cast<DiscordIntegrationChannel*>(channel.get());
124+
channel_casted->label.set("Alone#pokemonautomation");
125+
channel_casted->channel_id.set("907578334119071775");
126+
channels.insert_row(channels.current_rows(), std::move(channel));
127+
}
128+
{
129+
std::unique_ptr<EditableTableRow> channel = channels.make_row();
130+
DiscordIntegrationChannel* channel_casted = static_cast<DiscordIntegrationChannel*>(channel.get());
131+
channel_casted->label.set("PA#shiny-bot-logs");
132+
channel_casted->tags_text.set("Showcase");
133+
channel_casted->allow_commands = false;
134+
channel_casted->channel_id.set("898882421129375835");
135+
channels.insert_row(channels.current_rows(), std::move(channel));
136+
}
137+
{
138+
std::unique_ptr<EditableTableRow> channel = channels.make_row();
139+
DiscordIntegrationChannel* channel_casted = static_cast<DiscordIntegrationChannel*>(channel.get());
140+
channel_casted->label.set("PA#live-hosting");
141+
channel_casted->tags_text.set("LiveHost");
142+
channel_casted->allow_commands = false;
143+
channel_casted->channel_id.set("885388078066307102");
144+
channels.insert_row(channels.current_rows(), std::move(channel));
145+
}
146+
{
147+
std::unique_ptr<EditableTableRow> channel = channels.make_row();
148+
DiscordIntegrationChannel* channel_casted = static_cast<DiscordIntegrationChannel*>(channel.get());
149+
channel_casted->label.set("SHA#live-hosting");
150+
channel_casted->tags_text.set("LiveHost");
151+
channel_casted->allow_commands = false;
152+
channel_casted->channel_id.set("885388760370520114");
153+
channels.insert_row(channels.current_rows(), std::move(channel));
154+
}
155+
{
156+
std::unique_ptr<EditableTableRow> channel = channels.make_row();
157+
DiscordIntegrationChannel* channel_casted = static_cast<DiscordIntegrationChannel*>(channel.get());
158+
channel_casted->label.set("PA#tera-join-reports");
159+
channel_casted->tags_text.set("Telemetry");
160+
channel_casted->allow_commands = false;
161+
channel_casted->channel_id.set("1052784581809545327");
162+
channels.insert_row(channels.current_rows(), std::move(channel));
163+
}
164+
122165
this->add_listener(*this);
123166
library0.add_listener(*this);
124167
}

SerialPrograms/Source/Integrations/DiscordSettingsOption.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DiscordMessageSettingsOption::DiscordMessageSettingsOption()
3232
false,
3333
"<b>Discord User ID:</b><br>Set this to your discord user ID to receive pings. Your ID is a number.",
3434
LockMode::LOCK_WHILE_RUNNING,
35-
"",
35+
"282197676982927375",
3636
"123456789012345678"
3737
)
3838
, message(

build.cmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pushd %~dp0
2+
cd SerialPrograms
3+
mkdir bin
4+
cd bin
5+
cmake .. -DCMAKE_PREFIX_PATH=C:\Qt\6.8.2\msvc2022_64\
6+
cmake --build . --config RelWithDebInfo --parallel 10
7+
robocopy ..\..\..\Packages\SerialPrograms\Resources\ Resources\ /s
8+
robocopy ..\..\..\CommandLineTests\ . /s
9+
popd

0 commit comments

Comments
 (0)