new ui stuff wip
This commit is contained in:
parent
1cc36ae0ee
commit
0276f83f3f
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "clientaccess.h"
|
#include "clientaccess.h"
|
||||||
#include "restclient.h"
|
#include "restclient.h"
|
||||||
|
#include "position.h"
|
||||||
|
|
||||||
class ClientAPI : public RestClient {
|
class ClientAPI : public RestClient {
|
||||||
public:
|
public:
|
||||||
|
@ -41,16 +42,6 @@ public:
|
||||||
};
|
};
|
||||||
static ChampSelectPhase toChampSelectPhase(const std::string& str);
|
static ChampSelectPhase toChampSelectPhase(const std::string& str);
|
||||||
|
|
||||||
enum class Position : uint32_t {
|
|
||||||
INVALID = 0,
|
|
||||||
TOP,
|
|
||||||
MIDDLE,
|
|
||||||
BOTTOM,
|
|
||||||
JUNGLE,
|
|
||||||
UTILITY
|
|
||||||
};
|
|
||||||
static Position toPosition(const std::string& str);
|
|
||||||
|
|
||||||
enum class ChampSelectActionType : uint32_t {
|
enum class ChampSelectActionType : uint32_t {
|
||||||
INVALID = 0,
|
INVALID = 0,
|
||||||
BAN,
|
BAN,
|
||||||
|
@ -165,5 +156,4 @@ private:
|
||||||
std::ostream& operator<<(std::ostream&, const ClientAPI::ReadyCheckState&);
|
std::ostream& operator<<(std::ostream&, const ClientAPI::ReadyCheckState&);
|
||||||
std::ostream& operator<<(std::ostream&, const ClientAPI::GameflowPhase&);
|
std::ostream& operator<<(std::ostream&, const ClientAPI::GameflowPhase&);
|
||||||
std::ostream& operator<<(std::ostream&, const ClientAPI::ChampSelectPhase&);
|
std::ostream& operator<<(std::ostream&, const ClientAPI::ChampSelectPhase&);
|
||||||
std::ostream& operator<<(std::ostream&, const ClientAPI::Position&);
|
|
||||||
std::ostream& operator<<(std::ostream&, const ClientAPI::ChampSelectActionType&);
|
std::ostream& operator<<(std::ostream&, const ClientAPI::ChampSelectActionType&);
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
#include "position.h"
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
public:
|
public:
|
||||||
struct StageConfig {
|
struct StageConfig {
|
||||||
|
@ -13,14 +15,26 @@ public:
|
||||||
bool enabled;
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PositionConfig {
|
||||||
|
PositionConfig();
|
||||||
|
PositionConfig(const QJsonObject&);
|
||||||
|
operator QJsonObject() const;
|
||||||
|
|
||||||
|
Position position; // top, bot, sup,...
|
||||||
|
|
||||||
|
StageConfig ban;
|
||||||
|
StageConfig pick;
|
||||||
|
};
|
||||||
|
|
||||||
struct RootConfig {
|
struct RootConfig {
|
||||||
RootConfig();
|
RootConfig();
|
||||||
RootConfig(const QJsonObject&);
|
RootConfig(const QJsonObject&);
|
||||||
operator QJsonObject() const;
|
operator QJsonObject() const;
|
||||||
|
|
||||||
StageConfig prepick;
|
PositionConfig& getPositionConfig(Position position);
|
||||||
StageConfig ban;
|
|
||||||
StageConfig pick;
|
std::vector<PositionConfig> positionConfigs;
|
||||||
|
|
||||||
bool enabledAutoAccept;
|
bool enabledAutoAccept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
#include "clientapi.h"
|
#include "clientapi.h"
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ protected:
|
||||||
uint32_t currentOffset = 0;
|
uint32_t currentOffset = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::mutex stagesMutex; // protects stagesvector
|
||||||
std::vector<Stage*> stages;
|
std::vector<Stage*> stages;
|
||||||
|
|
||||||
bool shouldrun = false;
|
bool shouldrun = false;
|
||||||
|
@ -28,10 +30,8 @@ protected:
|
||||||
public:
|
public:
|
||||||
enum class State {
|
enum class State {
|
||||||
LOBBY = 0,
|
LOBBY = 0,
|
||||||
PREPICK = 1,
|
BAN = 1,
|
||||||
BAN = 2,
|
PICK = 2,
|
||||||
PICK = 3,
|
|
||||||
GAME = 4
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LolAutoAccept();
|
LolAutoAccept();
|
||||||
|
|
|
@ -26,12 +26,9 @@ protected:
|
||||||
private slots:
|
private slots:
|
||||||
void toggleMainswitch(bool);
|
void toggleMainswitch(bool);
|
||||||
void aatoggled(bool);
|
void aatoggled(bool);
|
||||||
void pptoggled(bool);
|
|
||||||
void ppedited();
|
void tabtoggled(Position, LolAutoAccept::State, bool);
|
||||||
void bantoggled(bool);
|
void tabchanged(Position, LolAutoAccept::State);
|
||||||
void banedited();
|
|
||||||
void picktoggled(bool);
|
|
||||||
void pickedited();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// returns empty string on no match
|
// returns empty string on no match
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
|
|
||||||
|
enum class Position : uint32_t {
|
||||||
|
INVALID = 0,
|
||||||
|
TOP,
|
||||||
|
JUNGLE,
|
||||||
|
MIDDLE,
|
||||||
|
BOTTOM,
|
||||||
|
UTILITY
|
||||||
|
};
|
||||||
|
Position toPosition(const std::string& str);
|
||||||
|
std::string toString(Position p);
|
||||||
|
|
||||||
|
std::ostream& operator<<(std::ostream&, const Position&);
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(Position);
|
|
@ -0,0 +1,53 @@
|
||||||
|
#ifndef SETTINGSTAB_H
|
||||||
|
#define SETTINGSTAB_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "datadragon.h"
|
||||||
|
#include "lolautoaccept.h"
|
||||||
|
#include "stagesettings.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class SettingsTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SettingsTab : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(Position position MEMBER position READ getPosition)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit SettingsTab(QWidget *parent = nullptr);
|
||||||
|
~SettingsTab();
|
||||||
|
|
||||||
|
void setup(Config::PositionConfig& conf, DataDragon* dd = nullptr);
|
||||||
|
|
||||||
|
std::vector<StageSettings::SelectedChamp> getChamps(LolAutoAccept::State s) const;
|
||||||
|
bool getState(LolAutoAccept::State s) const;
|
||||||
|
void setChamps(LolAutoAccept::State s, const std::vector<std::string>&);
|
||||||
|
void setState(LolAutoAccept::State s, bool b);
|
||||||
|
|
||||||
|
Position getPosition() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void banToggled(bool);
|
||||||
|
void banChampsChanged();
|
||||||
|
void pickToggled(bool);
|
||||||
|
void pickChampsChanged();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void changed(Position p, LolAutoAccept::State s);
|
||||||
|
void toggled(Position p, LolAutoAccept::State s, bool newstate);
|
||||||
|
|
||||||
|
private:
|
||||||
|
StageSettings* getStage(LolAutoAccept::State s) const;
|
||||||
|
|
||||||
|
Ui::SettingsTab *ui;
|
||||||
|
|
||||||
|
Config::PositionConfig* conf;
|
||||||
|
DataDragon* dd = nullptr;
|
||||||
|
Position position;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SETTINGSTAB_H
|
|
@ -39,6 +39,7 @@ SOURCES += \
|
||||||
src/mainwindow.cpp \
|
src/mainwindow.cpp \
|
||||||
src/memoryimagecache.cpp \
|
src/memoryimagecache.cpp \
|
||||||
src/restclient.cpp \
|
src/restclient.cpp \
|
||||||
|
src/settingstab.cpp \
|
||||||
src/stagesettings.cpp \
|
src/stagesettings.cpp \
|
||||||
thirdparty/Log/Log.cpp
|
thirdparty/Log/Log.cpp
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ HEADERS += \
|
||||||
include/mainwindow.h \
|
include/mainwindow.h \
|
||||||
include/memoryimagecache.h \
|
include/memoryimagecache.h \
|
||||||
include/restclient.h \
|
include/restclient.h \
|
||||||
|
include/settingstab.h \
|
||||||
include/stagesettings.h \
|
include/stagesettings.h \
|
||||||
thirdparty/Log/Log.h
|
thirdparty/Log/Log.h
|
||||||
|
|
||||||
|
@ -71,6 +73,7 @@ OBJECTS_DIR = build/
|
||||||
FORMS += \
|
FORMS += \
|
||||||
ui/championsearch.ui \
|
ui/championsearch.ui \
|
||||||
ui/mainwindow.ui \
|
ui/mainwindow.ui \
|
||||||
|
ui/settingstab.ui \
|
||||||
ui/stagesettings.ui
|
ui/stagesettings.ui
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/include/ \
|
INCLUDEPATH += $$PWD/include/ \
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
ARR(ReadyCheckState, "Invalid", "None", "InProgress", "Accepted", "Declined");
|
ARR(ReadyCheckState, "Invalid", "None", "InProgress", "Accepted", "Declined");
|
||||||
ARR(GameflowPhase, "None", "Lobby", "Matchmaking", "CheckedIntoTournament", "ReadyCheck", "ChampSelect", "GameStart", "FailedToLaunch", "InProgress", "Reconnect", "WaitingForStats", "PreEndOfGame", "EndOfGame", "TerminatedInError");
|
ARR(GameflowPhase, "None", "Lobby", "Matchmaking", "CheckedIntoTournament", "ReadyCheck", "ChampSelect", "GameStart", "FailedToLaunch", "InProgress", "Reconnect", "WaitingForStats", "PreEndOfGame", "EndOfGame", "TerminatedInError");
|
||||||
ARR(ChampSelectPhase, "Invalid", "PLANNING", "BAN_PICK", "FINALIZATION");
|
ARR(ChampSelectPhase, "Invalid", "PLANNING", "BAN_PICK", "FINALIZATION");
|
||||||
ARR(Position, "Invalid", "top", "middle", "bottom", "jungle", "utility");
|
ARR(Position, "Invalid", "top", "jungle", "middle", "bottom", "utility");
|
||||||
ARR(ChampSelectActionType, "Invalid", "ban", "pick", "ten_bans_reveal");
|
ARR(ChampSelectActionType, "Invalid", "ban", "pick", "ten_bans_reveal");
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -60,8 +60,12 @@ ClientAPI::ChampSelectPhase ClientAPI::toChampSelectPhase(const std::string& str
|
||||||
return MAPENUM(str, ChampSelectPhase, INVALID);
|
return MAPENUM(str, ChampSelectPhase, INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientAPI::Position ClientAPI::toPosition(const std::string& str) {
|
Position toPosition(const std::string& str) {
|
||||||
return MAPENUM(str, Position, INVALID);
|
return mapEnum(str, PositionNames, PositionNamesCount, Position::INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string toString(Position p) {
|
||||||
|
return PositionNames[(int) p];
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientAPI::ChampSelectActionType ClientAPI::toChampSelectActionType(const std::string& str) {
|
ClientAPI::ChampSelectActionType ClientAPI::toChampSelectActionType(const std::string& str) {
|
||||||
|
@ -177,5 +181,9 @@ ClientAPI::ChampSelectSession::operator bool() {
|
||||||
PRINTENUM(ReadyCheckState)
|
PRINTENUM(ReadyCheckState)
|
||||||
PRINTENUM(GameflowPhase)
|
PRINTENUM(GameflowPhase)
|
||||||
PRINTENUM(ChampSelectPhase)
|
PRINTENUM(ChampSelectPhase)
|
||||||
PRINTENUM(Position)
|
|
||||||
PRINTENUM(ChampSelectActionType)
|
PRINTENUM(ChampSelectActionType)
|
||||||
|
|
||||||
|
std::ostream& operator<<(std::ostream& str, const Position & state) { \
|
||||||
|
assert(((int) state) < PositionNamesCount); \
|
||||||
|
return str << PositionNames[(int) state] << " (" << (int) state << ')'; \
|
||||||
|
}
|
||||||
|
|
|
@ -45,26 +45,71 @@ Config::StageConfig::operator QJsonObject() const {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Config::PositionConfig::PositionConfig() {}
|
||||||
|
Config::PositionConfig::PositionConfig(const QJsonObject& j) {
|
||||||
|
ban = getValue<Config::StageConfig>(j, "ban");
|
||||||
|
pick = getValue<Config::StageConfig>(j, "pick");
|
||||||
|
position = toPosition(getValue<std::string>(j, "position"));
|
||||||
|
if((int) position < 0 || position > Position::UTILITY) {
|
||||||
|
Log::warn << "invalid config value \"position\"";
|
||||||
|
position = Position::MIDDLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Config::PositionConfig::operator QJsonObject() const {
|
||||||
|
QJsonObject out;
|
||||||
|
|
||||||
|
out["ban"] = (QJsonObject) ban;
|
||||||
|
out["pick"] = (QJsonObject) pick;
|
||||||
|
out["position"] = QString::fromStdString(toString(position));
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
Config::RootConfig::RootConfig() {}
|
Config::RootConfig::RootConfig() {}
|
||||||
|
|
||||||
Config::RootConfig::RootConfig(const QJsonObject& j) {
|
Config::RootConfig::RootConfig(const QJsonObject& j) {
|
||||||
prepick = getValue<Config::StageConfig>(j, "prepick");
|
auto jposref = j["positions"];
|
||||||
ban = getValue<Config::StageConfig>(j, "ban");
|
if(jposref.isArray()) {
|
||||||
pick = getValue<Config::StageConfig>(j, "pick");
|
QJsonArray jpos = jposref.toArray();
|
||||||
enabledAutoAccept = getValue(j, "enabledAutoAccept", false);
|
|
||||||
|
positionConfigs.reserve(jpos.size());
|
||||||
|
for(QJsonValue val : jpos) {
|
||||||
|
if(val.isObject()) {
|
||||||
|
positionConfigs.emplace_back(val.toObject()); // implicit cast to PositionConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enabledAutoAccept = getValue(j, "enabledAutoAccept", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::RootConfig::operator QJsonObject() const {
|
Config::RootConfig::operator QJsonObject() const {
|
||||||
QJsonObject out;
|
QJsonObject out;
|
||||||
|
|
||||||
out.insert("prepick", (QJsonObject) prepick);
|
QJsonArray positionarr;
|
||||||
out.insert("ban", (QJsonObject) ban);
|
for(const PositionConfig& pos : positionConfigs) {
|
||||||
out.insert("pick", (QJsonObject) pick);
|
positionarr.push_back((QJsonObject) pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
out["positions"] = positionarr;
|
||||||
out.insert("enabledAutoAccept", enabledAutoAccept);
|
out.insert("enabledAutoAccept", enabledAutoAccept);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Config::PositionConfig& Config::RootConfig::getPositionConfig(Position position) {
|
||||||
|
for(uint32_t i = 0; i < positionConfigs.size(); ++i) {
|
||||||
|
if(positionConfigs.at(i).position == position) {
|
||||||
|
return positionConfigs.at(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add a new config
|
||||||
|
positionConfigs.emplace_back();
|
||||||
|
positionConfigs.back().position = position;
|
||||||
|
return positionConfigs.back();
|
||||||
|
}
|
||||||
|
|
||||||
Config::Config() {
|
Config::Config() {
|
||||||
configFolderPath = getHome() + ".config/lolautoaccept/";
|
configFolderPath = getHome() + ".config/lolautoaccept/";
|
||||||
configFilePath = configFolderPath + "config.json";
|
configFilePath = configFolderPath + "config.json";
|
||||||
|
|
|
@ -8,9 +8,9 @@ LolAutoAccept::Stage::Stage() {}
|
||||||
LolAutoAccept::Stage::~Stage() {}
|
LolAutoAccept::Stage::~Stage() {}
|
||||||
|
|
||||||
LolAutoAccept::LolAutoAccept() {
|
LolAutoAccept::LolAutoAccept() {
|
||||||
stages.reserve(4);
|
std::lock_guard lock(stagesMutex);
|
||||||
|
stages.reserve(3);
|
||||||
stages.push_back(new Stage()); // accept
|
stages.push_back(new Stage()); // accept
|
||||||
stages.push_back(new Stage()); // prepick
|
|
||||||
stages.push_back(new Stage()); // ban
|
stages.push_back(new Stage()); // ban
|
||||||
stages.push_back(new Stage()); // pick
|
stages.push_back(new Stage()); // pick
|
||||||
}
|
}
|
||||||
|
@ -18,28 +18,32 @@ LolAutoAccept::LolAutoAccept() {
|
||||||
LolAutoAccept::~LolAutoAccept() {
|
LolAutoAccept::~LolAutoAccept() {
|
||||||
stopJoinThread();
|
stopJoinThread();
|
||||||
|
|
||||||
|
std::lock_guard lock(stagesMutex);
|
||||||
for(auto s : stages) {
|
for(auto s : stages) {
|
||||||
delete s;
|
delete s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LolAutoAccept::setChamps(const std::vector<uint32_t>& champs, State s) {
|
void LolAutoAccept::setChamps(const std::vector<uint32_t>& champs, State s) {
|
||||||
if(s == State::LOBBY || s >= State::GAME) {
|
if(s == State::LOBBY || s >= State::PICK) {
|
||||||
Log::warn << "setChamps() called on invalid State";
|
Log::warn << "setChamps() called on invalid State";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
stages.at((int) s)->champids = champs;
|
std::lock_guard lock(stagesMutex);
|
||||||
stages.at((int) s)->currentOffset = 0;
|
stages.at((int) s)->champids = champs;
|
||||||
|
stages.at((int) s)->currentOffset = 0;
|
||||||
|
}
|
||||||
Log::info << "set champs on state: " << (int) s << " count: " << champs.size();
|
Log::info << "set champs on state: " << (int) s << " count: " << champs.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LolAutoAccept::setEnabled(bool b, State s) {
|
void LolAutoAccept::setEnabled(bool b, State s) {
|
||||||
if(s >= State::GAME) {
|
if(s >= State::PICK) {
|
||||||
Log::warn << "setEnabled() called on invalid State";
|
Log::warn << "setEnabled() called on invalid State";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::lock_guard lock(stagesMutex);
|
||||||
stages.at((int) s)->enabled = b;
|
stages.at((int) s)->enabled = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +87,7 @@ void LolAutoAccept::innerRun() {
|
||||||
shouldrun = true;
|
shouldrun = true;
|
||||||
|
|
||||||
while(shouldrun) {
|
while(shouldrun) {
|
||||||
|
uint32_t extrasleep = 800;
|
||||||
auto start = std::chrono::high_resolution_clock::now();
|
auto start = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
auto phase = clientapi->getGameflowPhase();
|
auto phase = clientapi->getGameflowPhase();
|
||||||
|
@ -100,8 +105,20 @@ void LolAutoAccept::innerRun() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resetAllOffsets();
|
resetAllOffsets();
|
||||||
|
extrasleep = 0; // no extra sleep
|
||||||
} else if(phase == ClientAPI::GameflowPhase::CHAMPSELECT) {
|
} else if(phase == ClientAPI::GameflowPhase::CHAMPSELECT) {
|
||||||
champSelect();
|
champSelect();
|
||||||
|
extrasleep = 0; // no extra sleep
|
||||||
|
} else if(phase == ClientAPI::GameflowPhase::INPROGRESS) {
|
||||||
|
extrasleep = 30000; // 30s bonus sleep
|
||||||
|
} else if(phase == ClientAPI::GameflowPhase::ENDOFGAME) {
|
||||||
|
extrasleep = 2000; // 2 s bonus sleep
|
||||||
|
} else if(phase == ClientAPI::GameflowPhase::PREENDOFGAME) {
|
||||||
|
extrasleep = 4000; // 4 s bonus sleep
|
||||||
|
} else if(phase == ClientAPI::GameflowPhase::WAITINGFORSTATS) {
|
||||||
|
extrasleep = 4000; // 4 s bonus sleep
|
||||||
|
} else if(phase == ClientAPI::GameflowPhase::NONE) {
|
||||||
|
extrasleep = 30000; // 30 s bonus sleep - no lobby
|
||||||
}
|
}
|
||||||
|
|
||||||
auto end = std::chrono::high_resolution_clock::now();
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
|
@ -109,7 +126,7 @@ void LolAutoAccept::innerRun() {
|
||||||
//if(dur.count() > 1e-5)
|
//if(dur.count() > 1e-5)
|
||||||
Log::note << "iteration took: " << (dur.count() * 1000) << " ms";
|
Log::note << "iteration took: " << (dur.count() * 1000) << " ms";
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(400 + extrasleep));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +193,7 @@ LolAutoAccept::ownactions_t LolAutoAccept::getOwnActions(int32_t cellid, const s
|
||||||
}
|
}
|
||||||
|
|
||||||
void LolAutoAccept::prepickPhase(const ownactions_t& ownactions) {
|
void LolAutoAccept::prepickPhase(const ownactions_t& ownactions) {
|
||||||
phase(ownactions, ClientAPI::ChampSelectActionType::PICK, State::PREPICK, false);
|
phase(ownactions, ClientAPI::ChampSelectActionType::PICK, State::PICK, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LolAutoAccept::banPhase(const ownactions_t& ownactions, const ClientAPI::ChampSelectSession& session) {
|
void LolAutoAccept::banPhase(const ownactions_t& ownactions, const ClientAPI::ChampSelectSession& session) {
|
||||||
|
@ -229,7 +246,7 @@ void LolAutoAccept::champSelect() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientAPI::Position pos = me ? me->position : ClientAPI::Position::INVALID;
|
Position pos = me ? me->position : Position::INVALID;
|
||||||
|
|
||||||
Log::debug << "cellid: " << cellid << " position: " << pos << " counter: " << session.counter << " timer: timeleftip: " << session.timer.adjustedTimeLeftInPhase << " totaltimephase: " << session.timer.totalTimeInPhase;
|
Log::debug << "cellid: " << cellid << " position: " << pos << " counter: " << session.counter << " timer: timeleftip: " << session.timer.adjustedTimeLeftInPhase << " totaltimephase: " << session.timer.totalTimeInPhase;
|
||||||
|
|
||||||
|
@ -239,6 +256,8 @@ void LolAutoAccept::champSelect() {
|
||||||
|
|
||||||
// try to prepick champ
|
// try to prepick champ
|
||||||
Log::info << "champselectphase: " << session.timer.phase;
|
Log::info << "champselectphase: " << session.timer.phase;
|
||||||
|
|
||||||
|
std::lock_guard lock(stagesMutex);
|
||||||
if(session.timer.phase == ClientAPI::ChampSelectPhase::PLANNING) {
|
if(session.timer.phase == ClientAPI::ChampSelectPhase::PLANNING) {
|
||||||
prepickPhase(ownactions);
|
prepickPhase(ownactions);
|
||||||
} else if(session.timer.phase == ClientAPI::ChampSelectPhase::BAN_PICK) {
|
} else if(session.timer.phase == ClientAPI::ChampSelectPhase::BAN_PICK) {
|
||||||
|
|
|
@ -3,26 +3,23 @@
|
||||||
|
|
||||||
#include <Log.h>
|
#include <Log.h>
|
||||||
|
|
||||||
static void applySetting(const Config::StageConfig& sc, StageSettings* ss) {
|
|
||||||
ss->setState(sc.enabled);
|
|
||||||
ss->setChampions(sc.champs);
|
|
||||||
}
|
|
||||||
|
|
||||||
MainWindow::MainWindow(LolAutoAccept& lolaa, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), lolaa(lolaa), dd(QLocale().name().toStdString()) {
|
MainWindow::MainWindow(LolAutoAccept& lolaa, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), lolaa(lolaa), dd(QLocale().name().toStdString()) {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
conf.load();
|
conf.load();
|
||||||
|
|
||||||
ui->prepickstage->setDataDragon(&dd);
|
// for all tabs - set their config and datadragon
|
||||||
ui->banstage->setDataDragon(&dd);
|
Config::RootConfig& rc = conf.getConfig();
|
||||||
ui->pickstage->setDataDragon(&dd);
|
for(int32_t tabnr = 0; tabnr < ui->tabWidget->count(); ++tabnr) {
|
||||||
|
SettingsTab* tab = (SettingsTab*) ui->tabWidget->widget(tabnr);
|
||||||
|
tab->setup(rc.getPositionConfig(tab->getPosition()), &dd);
|
||||||
|
|
||||||
|
QObject::connect(tab, SIGNAL( changed(Position, LolAutoAccept::State) ), this, SLOT( tabchanged(Position, LolAutoAccept::State) ));
|
||||||
|
QObject::connect(tab, SIGNAL( toggled(Position, LolAutoAccept::State, bool) ), this, SLOT( tabtoggled(Position, LolAutoAccept::State, bool) ));
|
||||||
|
}
|
||||||
|
|
||||||
const Config::RootConfig& rc = conf.getConfig();
|
|
||||||
ui->enableAll->setChecked(rc.enabledAutoAccept);
|
ui->enableAll->setChecked(rc.enabledAutoAccept);
|
||||||
lolaa.setEnabled(rc.enabledAutoAccept, LolAutoAccept::State::LOBBY);
|
lolaa.setEnabled(rc.enabledAutoAccept, LolAutoAccept::State::LOBBY);
|
||||||
applySetting(rc.prepick, ui->prepickstage);
|
|
||||||
applySetting(rc.ban, ui->banstage);
|
|
||||||
applySetting(rc.pick, ui->pickstage);
|
|
||||||
|
|
||||||
resizeEvent(nullptr);
|
resizeEvent(nullptr);
|
||||||
}
|
}
|
||||||
|
@ -70,16 +67,6 @@ void MainWindow::aatoggled(bool state) {
|
||||||
conf.getConfig().enabledAutoAccept = state;
|
conf.getConfig().enabledAutoAccept = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> toChampionNameList(const std::vector<StageSettings::SelectedChamp>& scs) {
|
|
||||||
std::vector<std::string> out;
|
|
||||||
|
|
||||||
for(const StageSettings::SelectedChamp& sc : scs) {
|
|
||||||
out.push_back(sc.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::vector<uint32_t> toChampionIDList(const std::vector<StageSettings::SelectedChamp>& scs) {
|
static std::vector<uint32_t> toChampionIDList(const std::vector<StageSettings::SelectedChamp>& scs) {
|
||||||
std::vector<uint32_t> out;
|
std::vector<uint32_t> out;
|
||||||
|
|
||||||
|
@ -90,41 +77,16 @@ static std::vector<uint32_t> toChampionIDList(const std::vector<StageSettings::S
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::pptoggled(bool state) {
|
void MainWindow::tabtoggled(Position p, LolAutoAccept::State s, bool state) {
|
||||||
Log::info << "enablePrePick checkbox toggled " << state;
|
Log::info << "PrePick checkbox toggled " << state << " position: " << p << " state: " << (int) s;
|
||||||
lolaa.setEnabled(state, LolAutoAccept::State::PREPICK);
|
|
||||||
conf.getConfig().prepick.enabled = state;
|
lolaa.setEnabled(state, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ppedited() {
|
void MainWindow::tabchanged(Position p, LolAutoAccept::State s) {
|
||||||
Log::info << "prepick edited";
|
Log::info << "prepick edited position: " << p << " state: " << (int) s;
|
||||||
auto champs = ui->prepickstage->getChampions();
|
|
||||||
lolaa.setChamps(toChampionIDList(champs), LolAutoAccept::State::PREPICK);
|
|
||||||
conf.getConfig().prepick.champs = toChampionNameList(champs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::bantoggled(bool state) {
|
SettingsTab* tab = (SettingsTab*) ui->tabWidget->widget((int) p -1);
|
||||||
Log::info << "enableBan checkbox toggled " << state;
|
auto champs = tab->getChamps(s);
|
||||||
lolaa.setEnabled(state, LolAutoAccept::State::BAN);
|
lolaa.setChamps(toChampionIDList(champs), s);
|
||||||
conf.getConfig().ban.enabled = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::banedited() {
|
|
||||||
Log::info << "ban edited";
|
|
||||||
auto champs = ui->banstage->getChampions();
|
|
||||||
lolaa.setChamps(toChampionIDList(champs), LolAutoAccept::State::BAN);
|
|
||||||
conf.getConfig().ban.champs = toChampionNameList(champs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::picktoggled(bool state) {
|
|
||||||
Log::info << "enablePick checkbox toggled " << state;
|
|
||||||
lolaa.setEnabled(state, LolAutoAccept::State::PICK);
|
|
||||||
conf.getConfig().pick.enabled = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::pickedited() {
|
|
||||||
Log::info << "pick edited";
|
|
||||||
auto champs = ui->pickstage->getChampions();
|
|
||||||
lolaa.setChamps(toChampionIDList(champs), LolAutoAccept::State::PICK);
|
|
||||||
conf.getConfig().pick.champs = toChampionNameList(champs);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
#include "settingstab.h"
|
||||||
|
#include "ui_settingstab.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
static std::vector<std::string> toChampionNameList(const std::vector<StageSettings::SelectedChamp>& scs) {
|
||||||
|
std::vector<std::string> out;
|
||||||
|
out.reserve(scs.size());
|
||||||
|
|
||||||
|
std::transform(scs.begin(), scs.end(), std::insert_iterator(out, out.begin()), [](const StageSettings::SelectedChamp& sc) { return sc.name; });
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsTab::SettingsTab(QWidget *parent) : QWidget(parent), ui(new Ui::SettingsTab) {
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsTab::~SettingsTab() {
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::setup(Config::PositionConfig& conf, DataDragon* dd) {
|
||||||
|
this->conf = &conf;
|
||||||
|
this->dd = dd;
|
||||||
|
|
||||||
|
ui->banstage->setDataDragon(dd);
|
||||||
|
ui->pickstage->setDataDragon(dd);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<StageSettings::SelectedChamp> SettingsTab::getChamps(LolAutoAccept::State s) const {
|
||||||
|
return getStage(s)->getChampions();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SettingsTab::getState(LolAutoAccept::State s) const {
|
||||||
|
auto stage = getStage(s);
|
||||||
|
return stage->getState();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::setChamps(LolAutoAccept::State s, const std::vector<std::string>& c) {
|
||||||
|
getStage(s)->setChampions(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::setState(LolAutoAccept::State s, bool b) {
|
||||||
|
auto stage = getStage(s);
|
||||||
|
return stage->setState(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
Position SettingsTab::getPosition() const {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::banToggled(bool b) {
|
||||||
|
conf->ban.enabled = b;
|
||||||
|
emit toggled(position, LolAutoAccept::State::BAN, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::banChampsChanged() {
|
||||||
|
conf->ban.champs = toChampionNameList(ui->banstage->getChampions());
|
||||||
|
emit changed(position, LolAutoAccept::State::BAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::pickToggled(bool b) {
|
||||||
|
conf->pick.enabled = b;
|
||||||
|
emit toggled(position, LolAutoAccept::State::PICK, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsTab::pickChampsChanged() {
|
||||||
|
conf->pick.champs = toChampionNameList(ui->pickstage->getChampions());
|
||||||
|
emit changed(position, LolAutoAccept::State::BAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
StageSettings* SettingsTab::getStage(LolAutoAccept::State s) const {
|
||||||
|
switch(s) {
|
||||||
|
case LolAutoAccept::State::BAN: return ui->banstage;
|
||||||
|
case LolAutoAccept::State::PICK: return ui->pickstage;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
assert(false); // "invalid" stage (Lobby or Game)
|
||||||
|
return nullptr;
|
||||||
|
}
|
|
@ -89,6 +89,38 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>championList</sender>
|
||||||
|
<signal>doubleClicked(QModelIndex)</signal>
|
||||||
|
<receiver>ChampionSearch</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>182</x>
|
||||||
|
<y>169</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>396</x>
|
||||||
|
<y>188</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>championList</sender>
|
||||||
|
<signal>itemActivated(QListWidgetItem*)</signal>
|
||||||
|
<receiver>ChampionSearch</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>324</x>
|
||||||
|
<y>106</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>396</x>
|
||||||
|
<y>116</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>searchChanged(QString)</slot>
|
<slot>searchChanged(QString)</slot>
|
||||||
|
|
222
ui/mainwindow.ui
222
ui/mainwindow.ui
|
@ -54,72 +54,65 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="StageSettings" name="prepickstage" native="true">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="enabled">
|
<property name="tabPosition">
|
||||||
<bool>true</bool>
|
<enum>QTabWidget::North</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="tabShape">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<enum>QTabWidget::Rounded</enum>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="currentIndex">
|
||||||
<size>
|
<number>4</number>
|
||||||
<width>100</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="name" stdset="0">
|
<property name="elideMode">
|
||||||
<string>Pre Pick</string>
|
<enum>Qt::ElideNone</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="state" stdset="0">
|
<property name="usesScrollButtons">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="tabsClosable">
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="StageSettings" name="banstage" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="name" stdset="0">
|
|
||||||
<string>Ban</string>
|
|
||||||
</property>
|
|
||||||
<property name="state" stdset="0">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="StageSettings" name="pickstage" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="name" stdset="0">
|
|
||||||
<string>Pick</string>
|
|
||||||
</property>
|
|
||||||
<property name="state" stdset="0">
|
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="SettingsTab" name="tab_top">
|
||||||
|
<property name="position" stdset="0">
|
||||||
|
<UInt>1</UInt>
|
||||||
|
</property>
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Top</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="SettingsTab" name="tab_jgl">
|
||||||
|
<property name="position" stdset="0">
|
||||||
|
<UInt>2</UInt>
|
||||||
|
</property>
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Jungle</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="SettingsTab" name="tab_mid">
|
||||||
|
<property name="position" stdset="0">
|
||||||
|
<UInt>3</UInt>
|
||||||
|
</property>
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Middle</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="SettingsTab" name="tab_bot">
|
||||||
|
<property name="position" stdset="0">
|
||||||
|
<UInt>4</UInt>
|
||||||
|
</property>
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Bottom</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="SettingsTab" name="tab_sup">
|
||||||
|
<property name="position" stdset="0">
|
||||||
|
<UInt>5</UInt>
|
||||||
|
</property>
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Support</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -139,13 +132,10 @@
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>StageSettings</class>
|
<class>SettingsTab</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>stagesettings.h</header>
|
<header>settingstab.h</header>
|
||||||
<slots>
|
<container>1</container>
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<signal>championsChanged()</signal>
|
|
||||||
</slots>
|
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
@ -170,38 +160,6 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>prepickstage</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>pptoggled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>253</x>
|
|
||||||
<y>254</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>296</x>
|
|
||||||
<y>309</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>banstage</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>bantoggled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>227</x>
|
|
||||||
<y>413</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>265</x>
|
|
||||||
<y>390</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>mainswitch</sender>
|
<sender>mainswitch</sender>
|
||||||
<signal>clicked(bool)</signal>
|
<signal>clicked(bool)</signal>
|
||||||
|
@ -218,79 +176,11 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>pickstage</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>picktoggled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>201</x>
|
|
||||||
<y>489</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>265</x>
|
|
||||||
<y>476</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>pickstage</sender>
|
|
||||||
<signal>championsChanged()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>pickedited()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>172</x>
|
|
||||||
<y>498</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>122</x>
|
|
||||||
<y>473</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>banstage</sender>
|
|
||||||
<signal>championsChanged()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>banedited()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>149</x>
|
|
||||||
<y>418</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>111</x>
|
|
||||||
<y>379</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>prepickstage</sender>
|
|
||||||
<signal>championsChanged()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>ppedited()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>185</x>
|
|
||||||
<y>254</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>122</x>
|
|
||||||
<y>308</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>aatoggled(bool)</slot>
|
<slot>aatoggled(bool)</slot>
|
||||||
<slot>pptoggled(bool)</slot>
|
<slot>tabtoggled(Position, LolAutoAccept::State, bool)</slot>
|
||||||
<slot>ppedited()</slot>
|
<slot>tabchanged(Position, LolAutoAccept::State)</slot>
|
||||||
<slot>bantoggled(bool)</slot>
|
|
||||||
<slot>picktoggled(bool)</slot>
|
|
||||||
<slot>banedited()</slot>
|
|
||||||
<slot>pickedited()</slot>
|
|
||||||
<slot>toggleMainswitch(bool)</slot>
|
<slot>toggleMainswitch(bool)</slot>
|
||||||
</slots>
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -0,0 +1,147 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>SettingsTab</class>
|
||||||
|
<widget class="QWidget" name="SettingsTab">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="StageSettings" name="banstage" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="name" stdset="0">
|
||||||
|
<string>Ban</string>
|
||||||
|
</property>
|
||||||
|
<property name="state" stdset="0">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="StageSettings" name="pickstage" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="name" stdset="0">
|
||||||
|
<string>Pick</string>
|
||||||
|
</property>
|
||||||
|
<property name="state" stdset="0">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>StageSettings</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>stagesettings.h</header>
|
||||||
|
<slots>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<signal>championsChanged()</signal>
|
||||||
|
</slots>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>banstage</sender>
|
||||||
|
<signal>championsChanged()</signal>
|
||||||
|
<receiver>SettingsTab</receiver>
|
||||||
|
<slot>banChampsChanged()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>179</x>
|
||||||
|
<y>78</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>398</x>
|
||||||
|
<y>86</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>banstage</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>SettingsTab</receiver>
|
||||||
|
<slot>banToggled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>329</x>
|
||||||
|
<y>124</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>397</x>
|
||||||
|
<y>123</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>pickstage</sender>
|
||||||
|
<signal>championsChanged()</signal>
|
||||||
|
<receiver>SettingsTab</receiver>
|
||||||
|
<slot>pickChampsChanged()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>284</x>
|
||||||
|
<y>220</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>400</x>
|
||||||
|
<y>200</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>pickstage</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>SettingsTab</receiver>
|
||||||
|
<slot>pickToggled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>344</x>
|
||||||
|
<y>257</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>400</x>
|
||||||
|
<y>257</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
<slots>
|
||||||
|
<slot>banToggled(bool)</slot>
|
||||||
|
<slot>banChampsChanged()</slot>
|
||||||
|
<slot>pickToggled(bool)</slot>
|
||||||
|
<slot>pickChampsChanged()</slot>
|
||||||
|
</slots>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue