Ability to toggle Discord RPC.
Reimplementation of `bed0b55e70f13adf772584fc0d31ebfe59597115` from old origin.
This commit is contained in:
parent
ed68084e08
commit
95b8bd72d3
@ -45,7 +45,8 @@ void AOApplication::construct_lobby()
|
||||
int y = (screenGeometry.height()-w_lobby->height()) / 2;
|
||||
w_lobby->move(x, y);
|
||||
|
||||
discord->state_lobby();
|
||||
if (is_discord_enabled())
|
||||
discord->state_lobby();
|
||||
|
||||
w_lobby->show();
|
||||
}
|
||||
|
@ -143,8 +143,12 @@ public:
|
||||
//Returns the value of default_blip in config.ini
|
||||
int get_default_blip();
|
||||
|
||||
//Returns the value of the maximum amount of lines the IC chatlog
|
||||
//may contain, from config.ini.
|
||||
// Returns the value of whether Discord should be enabled on startup
|
||||
// from the config.ini.
|
||||
bool is_discord_enabled();
|
||||
|
||||
// Returns the value of the maximum amount of lines the IC chatlog
|
||||
// may contain, from config.ini.
|
||||
int get_max_log_size();
|
||||
|
||||
// Returns whether the log should go upwards (new behaviour)
|
||||
|
@ -163,6 +163,17 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi
|
||||
|
||||
GameplayForm->setWidget(8, QFormLayout::FieldRole, MasterServerLineEdit);
|
||||
|
||||
DiscordLabel = new QLabel(formLayoutWidget);
|
||||
DiscordLabel->setText("Discord:");
|
||||
DiscordLabel->setToolTip("If true, allows Discord's Rich Presence to read data about your game. These are: what server you are in, what character are you playing, and how long have you been playing for.");
|
||||
|
||||
GameplayForm->setWidget(9, QFormLayout::LabelRole, DiscordLabel);
|
||||
|
||||
DiscordCheckBox = new QCheckBox(formLayoutWidget);
|
||||
DiscordCheckBox->setChecked(ao_app->is_discord_enabled());
|
||||
|
||||
GameplayForm->setWidget(9, QFormLayout::FieldRole, DiscordCheckBox);
|
||||
|
||||
// Here we start the callwords tab.
|
||||
CallwordsTab = new QWidget();
|
||||
SettingsTabs->addTab(CallwordsTab, "Callwords");
|
||||
@ -317,6 +328,7 @@ void AOOptionsDialog::save_pressed()
|
||||
configini->setValue("default_username", UsernameLineEdit->text());
|
||||
configini->setValue("show_custom_shownames", ShownameCheckbox->isChecked());
|
||||
configini->setValue("master", MasterServerLineEdit->text());
|
||||
configini->setValue("discord", DiscordCheckBox->isChecked());
|
||||
|
||||
QFile* callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini");
|
||||
|
||||
|
@ -49,6 +49,8 @@ private:
|
||||
QFrame *NetDivider;
|
||||
QLabel *MasterServerLabel;
|
||||
QLineEdit *MasterServerLineEdit;
|
||||
QLabel *DiscordLabel;
|
||||
QCheckBox *DiscordCheckBox;
|
||||
QWidget *CallwordsTab;
|
||||
QWidget *verticalLayoutWidget;
|
||||
QVBoxLayout *CallwordsLayout;
|
||||
|
@ -731,13 +731,16 @@ void Courtroom::enter_courtroom(int p_cid)
|
||||
|
||||
if (m_cid == -1)
|
||||
{
|
||||
ao_app->discord->state_spectate();
|
||||
if (ao_app->is_discord_enabled())
|
||||
ao_app->discord->state_spectate();
|
||||
f_char = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
f_char = ao_app->get_char_name(char_list.at(m_cid).name);
|
||||
ao_app->discord->state_character(f_char.toStdString());
|
||||
|
||||
if (ao_app->is_discord_enabled())
|
||||
ao_app->discord->state_character(f_char.toStdString());
|
||||
}
|
||||
|
||||
current_char = f_char;
|
||||
|
Loading…
Reference in New Issue
Block a user