forked from MrBesen/lolautoaccept
add smitewarn checkbox to ui
This commit is contained in:
parent
58795ad66e
commit
94020e5a04
|
@ -37,6 +37,7 @@ public:
|
||||||
std::vector<std::shared_ptr<PositionConfig>> positionConfigs;
|
std::vector<std::shared_ptr<PositionConfig>> positionConfigs;
|
||||||
|
|
||||||
bool enabledAutoAccept;
|
bool enabledAutoAccept;
|
||||||
|
bool enabledSmiteWarn;
|
||||||
};
|
};
|
||||||
|
|
||||||
Config();
|
Config();
|
||||||
|
|
|
@ -48,6 +48,7 @@ protected:
|
||||||
std::vector<RuneStyle> runestyles;
|
std::vector<RuneStyle> runestyles;
|
||||||
|
|
||||||
bool nextApplyRunes = false;
|
bool nextApplyRunes = false;
|
||||||
|
bool smiteWarnEnabled = true;
|
||||||
|
|
||||||
std::string chatid; // the chatid of the chat from the champselect
|
std::string chatid; // the chatid of the chat from the champselect
|
||||||
std::chrono::time_point<std::chrono::system_clock> lastMessageSent;
|
std::chrono::time_point<std::chrono::system_clock> lastMessageSent;
|
||||||
|
@ -64,6 +65,7 @@ public:
|
||||||
|
|
||||||
void setChamps(const std::vector<uint32_t>& champs, State s);
|
void setChamps(const std::vector<uint32_t>& champs, State s);
|
||||||
void setEnabled(bool b, State s);
|
void setEnabled(bool b, State s);
|
||||||
|
void setSmiteWarn(bool b);
|
||||||
|
|
||||||
bool init(); // returns true on success
|
bool init(); // returns true on success
|
||||||
void run();
|
void run();
|
||||||
|
|
|
@ -26,6 +26,7 @@ protected:
|
||||||
private slots:
|
private slots:
|
||||||
void toggleMainswitch(bool);
|
void toggleMainswitch(bool);
|
||||||
void aatoggled(bool);
|
void aatoggled(bool);
|
||||||
|
void smitewarntoggled(bool);
|
||||||
|
|
||||||
void tabtoggled(Position, LolAutoAccept::State, bool);
|
void tabtoggled(Position, LolAutoAccept::State, bool);
|
||||||
void tabchanged(Position, LolAutoAccept::State);
|
void tabchanged(Position, LolAutoAccept::State);
|
||||||
|
|
|
@ -87,6 +87,7 @@ Config::RootConfig::RootConfig(const QJsonObject& j) {
|
||||||
}
|
}
|
||||||
|
|
||||||
enabledAutoAccept = getValue(j, "enabledAutoAccept", true);
|
enabledAutoAccept = getValue(j, "enabledAutoAccept", true);
|
||||||
|
enabledSmiteWarn = getValue(j, "enabledSmiteWarn", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::RootConfig::operator QJsonObject() const {
|
Config::RootConfig::operator QJsonObject() const {
|
||||||
|
@ -99,6 +100,7 @@ Config::RootConfig::operator QJsonObject() const {
|
||||||
|
|
||||||
out["positions"] = positionarr;
|
out["positions"] = positionarr;
|
||||||
out.insert("enabledAutoAccept", enabledAutoAccept);
|
out.insert("enabledAutoAccept", enabledAutoAccept);
|
||||||
|
out.insert("enabledSmiteWarn", enabledSmiteWarn);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,10 @@ void LolAutoAccept::setEnabled(bool b, State s) {
|
||||||
stages.at((int) s).enabled = b;
|
stages.at((int) s).enabled = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LolAutoAccept::setSmiteWarn(bool b) {
|
||||||
|
smiteWarnEnabled = b;
|
||||||
|
}
|
||||||
|
|
||||||
bool LolAutoAccept::init() {
|
bool LolAutoAccept::init() {
|
||||||
if(clientapi) return true;
|
if(clientapi) return true;
|
||||||
|
|
||||||
|
@ -430,7 +434,9 @@ void LolAutoAccept::champSelect() {
|
||||||
// trade?
|
// trade?
|
||||||
|
|
||||||
// check for smite
|
// check for smite
|
||||||
smiteWarning(session.myTeam);
|
if(smiteWarnEnabled) {
|
||||||
|
smiteWarning(session.myTeam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nextApplyRunes) {
|
if(nextApplyRunes) {
|
||||||
|
|
|
@ -24,6 +24,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||||
ui->enableAll->setChecked(rc.enabledAutoAccept);
|
ui->enableAll->setChecked(rc.enabledAutoAccept);
|
||||||
lolaa.setEnabled(rc.enabledAutoAccept, LolAutoAccept::State::LOBBY);
|
lolaa.setEnabled(rc.enabledAutoAccept, LolAutoAccept::State::LOBBY);
|
||||||
|
|
||||||
|
ui->enableSmiteWarning->setChecked(rc.enabledSmiteWarn);
|
||||||
|
lolaa.setSmiteWarn(rc.enabledSmiteWarn);
|
||||||
|
|
||||||
resizeEvent(nullptr);
|
resizeEvent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +78,13 @@ void MainWindow::aatoggled(bool state) {
|
||||||
conf.getConfig().enabledAutoAccept = state;
|
conf.getConfig().enabledAutoAccept = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::smitewarntoggled(bool state) {
|
||||||
|
Log::info << "smitewarn checkbox toggled " << state;
|
||||||
|
|
||||||
|
lolaa.setSmiteWarn(state);
|
||||||
|
conf.getConfig().enabledSmiteWarn = state;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::tabtoggled(Position p, LolAutoAccept::State s, bool state) {
|
void MainWindow::tabtoggled(Position p, LolAutoAccept::State s, bool state) {
|
||||||
Log::info << "checkbox toggled " << state << " position: " << p << " state: " << (int) s;
|
Log::info << "checkbox toggled " << state << " position: " << p << " state: " << (int) s;
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="enableSmiteWarning">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Spam "smite" in the chat when there is not exactly 1 player with smite equiped in champ select</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable Smite Warning</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="tabPosition">
|
<property name="tabPosition">
|
||||||
|
@ -138,7 +151,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>452</width>
|
<width>452</width>
|
||||||
<height>24</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -174,8 +187,8 @@
|
||||||
<slot>aatoggled(bool)</slot>
|
<slot>aatoggled(bool)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>18</x>
|
<x>19</x>
|
||||||
<y>80</y>
|
<y>61</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>393</x>
|
<x>393</x>
|
||||||
|
@ -190,8 +203,8 @@
|
||||||
<slot>toggleMainswitch(bool)</slot>
|
<slot>toggleMainswitch(bool)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>87</x>
|
<x>88</x>
|
||||||
<y>49</y>
|
<y>38</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>1</x>
|
<x>1</x>
|
||||||
|
@ -231,6 +244,22 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>enableSmiteWarning</sender>
|
||||||
|
<signal>clicked(bool)</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>smitewarntoggled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>190</x>
|
||||||
|
<y>77</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>201</x>
|
||||||
|
<y>88</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<signal>requestTabChange(int)</signal>
|
<signal>requestTabChange(int)</signal>
|
||||||
|
@ -239,5 +268,6 @@
|
||||||
<slot>tabchanged(Position, LolAutoAccept::State)</slot>
|
<slot>tabchanged(Position, LolAutoAccept::State)</slot>
|
||||||
<slot>toggleMainswitch(bool)</slot>
|
<slot>toggleMainswitch(bool)</slot>
|
||||||
<slot>applyRunes()</slot>
|
<slot>applyRunes()</slot>
|
||||||
|
<slot>smitewarntoggled(bool)</slot>
|
||||||
</slots>
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Reference in New Issue