forked from MrBesen/lolautoaccept
allow for a default position
This commit is contained in:
parent
ece3d162e8
commit
716a2e4067
|
@ -28,6 +28,7 @@ protected:
|
|||
std::mutex stagesMutex; // protects stagesvector
|
||||
std::vector<Stage> stages;
|
||||
Position currentPosition = Position::INVALID;
|
||||
bool currentPositionSet = false;
|
||||
|
||||
Config::RootConfig& config;
|
||||
DataDragon& dd;
|
||||
|
|
|
@ -69,7 +69,8 @@ void LolAutoAccept::stop() {
|
|||
|
||||
void LolAutoAccept::reload() {
|
||||
Log::note << "reload LolAutoAccept";
|
||||
loadPosition(currentPosition);
|
||||
if(currentPositionSet)
|
||||
loadPosition(currentPosition);
|
||||
}
|
||||
|
||||
const std::vector<RuneAspekt>& LolAutoAccept::getRuneAspekts() {
|
||||
|
@ -180,6 +181,7 @@ void LolAutoAccept::resetAllOffsets() {
|
|||
stage.currentOffset = 0;
|
||||
}
|
||||
currentPosition = Position::INVALID;
|
||||
currentPositionSet = false;
|
||||
}
|
||||
|
||||
void LolAutoAccept::resetRunes() {
|
||||
|
@ -209,6 +211,7 @@ void LolAutoAccept::loadPosition(Position pos) {
|
|||
applyConfigToStage(stages.at((int) State::PICK), posconf.pick);
|
||||
|
||||
currentPosition = pos;
|
||||
currentPositionSet = true;
|
||||
}
|
||||
|
||||
uint32_t LolAutoAccept::getChampOfState(State s) {
|
||||
|
@ -365,10 +368,6 @@ void LolAutoAccept::champSelect() {
|
|||
}
|
||||
|
||||
Position pos = me ? me->position : Position::INVALID;
|
||||
if(pos == Position::INVALID) {
|
||||
pos = Position::UTILITY; // default: support TODO: make the default changeable? extra tab?
|
||||
}
|
||||
|
||||
|
||||
// check if runes need adjustment
|
||||
if(pickedChamp != lastPickedChamp) {
|
||||
|
|
|
@ -98,8 +98,8 @@ void MainWindow::applyRunes() {
|
|||
}
|
||||
|
||||
void MainWindow::onPosChange(Position newpos) {
|
||||
if(newpos != Position::INVALID) {
|
||||
emit requestTabChange((int) newpos -1);
|
||||
}
|
||||
assert(newpos <= Position::UTILITY);
|
||||
|
||||
emit requestTabChange((int) newpos);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>638</height>
|
||||
<width>452</width>
|
||||
<height>645</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -31,7 +31,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>431</width>
|
||||
<width>465</width>
|
||||
<height>581</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideNone</enum>
|
||||
|
@ -73,6 +73,17 @@
|
|||
<property name="tabsClosable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="SettingsTab" name="tab_default">
|
||||
<property name="toolTip">
|
||||
<string>This Tab is used, when you are in a gamemode with no fixed roles</string>
|
||||
</property>
|
||||
<property name="position" stdset="0">
|
||||
<UInt>0</UInt>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Default</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="SettingsTab" name="tab_top">
|
||||
<property name="position" stdset="0">
|
||||
<UInt>1</UInt>
|
||||
|
@ -126,7 +137,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<width>452</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
Loading…
Reference in New Issue