From dd125d3183c613241923e26e92be74b9d06457bc Mon Sep 17 00:00:00 2001 From: mrbesen Date: Sun, 22 Jan 2023 23:46:03 +0100 Subject: [PATCH] adjust stagesettings ui; fix Enable Pick / Ban Button --- src/lolautoaccept.cpp | 9 ++++++++- ui/stagesettings.ui | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lolautoaccept.cpp b/src/lolautoaccept.cpp index 8fa04a0..29c341b 100644 --- a/src/lolautoaccept.cpp +++ b/src/lolautoaccept.cpp @@ -4,6 +4,8 @@ #include #include +#include + LolAutoAccept::Stage::Stage() {} LolAutoAccept::Stage::~Stage() {} @@ -225,7 +227,7 @@ void LolAutoAccept::resetRunes() { void LolAutoAccept::applyConfigToStage(Stage& stage, const Config::StageConfig& stageconf) { stage.champids = dd.resolveChampIDs(stageconf.champs); - stage.enabled = stage.enabled; + stage.enabled = stageconf.enabled; stage.currentOffset = 0; } @@ -326,6 +328,11 @@ void LolAutoAccept::pickPhase(const ownactions_t& ownactions) { } void LolAutoAccept::phase(const ownactions_t& ownactions, ClientAPI::ChampSelectActionType type, State s, bool complete, std::function filter) { + if ( !( stages.at((int) s).enabled ) ) { + qDebug() << (int) s << " stage is disabled. skipping"; + return; + } + for(auto it : ownactions) { if(it.type == type) { Log::info << type << " action anvailable: " << it.id << " champid: " << it.championID; diff --git a/ui/stagesettings.ui b/ui/stagesettings.ui index b3a1fdd..277ec86 100644 --- a/ui/stagesettings.ui +++ b/ui/stagesettings.ui @@ -7,7 +7,7 @@ 0 0 412 - 180 + 277 @@ -46,7 +46,7 @@ - + QLayout::SetMinAndMaxSize @@ -59,6 +59,9 @@ + + 6 + QLayout::SetMinAndMaxSize