Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
Fix combobox issue in stationary3
  • Loading branch information
Admiral-Fish committed Apr 2, 2019
1 parent ece8b8e commit d728796
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 39 deletions.
20 changes: 20 additions & 0 deletions Core/Util/Global.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* This file is part of PokéFinder
* Copyright (C) 2017-2019 by Admiral_Fish, bumba, and EzPzStreamz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/


#ifndef GLOBAL_HPP
#define GLOBAL_HPP

Expand Down
2 changes: 1 addition & 1 deletion Core/Util/IVChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ QVector<QVector<u8> > IVChecker::calculateIVs(QVector<u16> stats, u8 level, u8 n
{
for (u8 iv = 0; iv < 32; iv++)
{
double stat = qFloor((((2 * baseStats[i] + iv) * level) / 100.0) + 5) * natureModifier[nature][i];
double stat = qFloor((((2 * baseStats[i] + iv) * level) / 100.0) + 5) * Nature::getNatureModifier(nature)[i];

if (static_cast<u16>(stat) == stats[i])
{
Expand Down
30 changes: 1 addition & 29 deletions Core/Util/IVChecker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <Core/Parents/Pokemon.hpp>
#include <Core/Util/Characteristic.hpp>
#include <Core/Util/Global.hpp>
#include <Core/Util/Nature.hpp>

class IVChecker
{
Expand All @@ -37,35 +38,6 @@ class IVChecker
private:
QVector<QVector<u8>> ivs;
Pokemon pokemon;
const QVector<QVector<double>> natureModifier =
{
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Hardy
{ 1.0, 1.1, 0.9, 1.0, 1.0, 1.0 }, // Lonely
{ 1.0, 1.1, 1.0, 1.0, 1.0, 0.9 }, // Brave
{ 1.0, 1.1, 1.0, 0.9, 1.0, 1.0 }, // Adamant
{ 1.0, 1.1, 1.0, 1.0, 0.9, 1.0 }, // Naughty
{ 1.0, 0.9, 1.1, 1.0, 1.0, 1.0 }, // Bold
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Docile
{ 1.0, 1.0, 1.1, 1.0, 1.0, 0.9 }, // Relaxed
{ 1.0, 1.0, 1.1, 0.9, 1.0, 1.0 }, // Impish
{ 1.0, 1.0, 1.1, 1.0, 0.9, 1.0 }, // Lax
{ 1.0, 0.9, 1.0, 1.0, 1.0, 1.1 }, // Timid
{ 1.0, 1.0, 0.9, 1.0, 1.0, 1.1 }, // Hasty
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Serious
{ 1.0, 1.0, 1.0, 0.9, 1.0, 1.1 }, // Jolly
{ 1.0, 1.0, 1.0, 1.0, 0.9, 1.1 }, // Naive
{ 1.0, 0.9, 1.0, 1.1, 1.0, 1.0 }, // Modest
{ 1.0, 1.0, 0.9, 1.1, 1.0, 1.0 }, // Mild
{ 1.0, 1.0, 1.0, 1.1, 1.0, 0.9 }, // Quiet
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Bashful
{ 1.0, 1.0, 1.0, 1.1, 0.9, 1.0 }, // Rash
{ 1.0, 0.9, 1.0, 1.0, 1.1, 1.0 }, // Calm
{ 1.0, 1.0, 0.9, 1.0, 1.1, 1.0 }, // Gentle
{ 1.0, 1.0, 1.0, 1.0, 1.1, 0.9 }, // Sassy
{ 1.0, 1.0, 1.0, 0.9, 1.1, 1.0 }, // Careful
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // Quirky
};


};

Expand Down
37 changes: 35 additions & 2 deletions Core/Util/Nature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

QStringList Nature::getNatures()
{
QStringList natures =
const QStringList natures =
{
QObject::tr("Adamant"), QObject::tr("Bold"), QObject::tr("Brave"), QObject::tr("Calm"),
QObject::tr("Careful"), QObject::tr("Hasty"), QObject::tr("Impish"), QObject::tr("Jolly"),
Expand All @@ -41,7 +41,7 @@ QString Nature::getNature(u8 nature)

QStringList Nature::getFrameNatures()
{
QStringList natures =
const QStringList natures =
{
QObject::tr("Hardy"), QObject::tr("Lonely"), QObject::tr("Brave"), QObject::tr("Adamant"),
QObject::tr("Naughty"), QObject::tr("Bold"), QObject::tr("Docile"), QObject::tr("Relaxed"),
Expand All @@ -65,3 +65,36 @@ u8 Nature::getReversedNature(u8 nature)
const u8 vals[25] = { 22, 8, 2, 0, 12, 1, 21, 15, 6, 19, 17, 5, 24, 7, 11, 10, 9, 13, 20, 14, 3, 18, 16, 4, 23 };
return vals[nature];
}

QVector<double> Nature::getNatureModifier(u8 nature)
{
const QVector<QVector<double>> modifiers =
{
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Hardy
{ 1.0, 1.1, 0.9, 1.0, 1.0, 1.0 }, // Lonely
{ 1.0, 1.1, 1.0, 1.0, 1.0, 0.9 }, // Brave
{ 1.0, 1.1, 1.0, 0.9, 1.0, 1.0 }, // Adamant
{ 1.0, 1.1, 1.0, 1.0, 0.9, 1.0 }, // Naughty
{ 1.0, 0.9, 1.1, 1.0, 1.0, 1.0 }, // Bold
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Docile
{ 1.0, 1.0, 1.1, 1.0, 1.0, 0.9 }, // Relaxed
{ 1.0, 1.0, 1.1, 0.9, 1.0, 1.0 }, // Impish
{ 1.0, 1.0, 1.1, 1.0, 0.9, 1.0 }, // Lax
{ 1.0, 0.9, 1.0, 1.0, 1.0, 1.1 }, // Timid
{ 1.0, 1.0, 0.9, 1.0, 1.0, 1.1 }, // Hasty
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Serious
{ 1.0, 1.0, 1.0, 0.9, 1.0, 1.1 }, // Jolly
{ 1.0, 1.0, 1.0, 1.0, 0.9, 1.1 }, // Naive
{ 1.0, 0.9, 1.0, 1.1, 1.0, 1.0 }, // Modest
{ 1.0, 1.0, 0.9, 1.1, 1.0, 1.0 }, // Mild
{ 1.0, 1.0, 1.0, 1.1, 1.0, 0.9 }, // Quiet
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, // Bashful
{ 1.0, 1.0, 1.0, 1.1, 0.9, 1.0 }, // Rash
{ 1.0, 0.9, 1.0, 1.0, 1.1, 1.0 }, // Calm
{ 1.0, 1.0, 0.9, 1.0, 1.1, 1.0 }, // Gentle
{ 1.0, 1.0, 1.0, 1.0, 1.1, 0.9 }, // Sassy
{ 1.0, 1.0, 1.0, 0.9, 1.1, 1.0 }, // Careful
{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // Quirky
};
return modifiers.at(nature);
}
2 changes: 2 additions & 0 deletions Core/Util/Nature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@

#include <QStringList>
#include <QTranslator>
#include <QVector>
#include <Core/Util/Global.hpp>

namespace Nature
{
QStringList getNatures();
QString getNature(u8 nature);
QStringList getFrameNatures();
QVector<double> getNatureModifier(u8 nature);
u8 getAdjustedNature(u8 nature);
u8 getReversedNature(u8 nature);
};
Expand Down
3 changes: 0 additions & 3 deletions Forms/Gen3/Stationary3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ void Stationary3::on_comboBoxProfiles_currentIndexChanged(int index)
ui->labelProfileTIDValue->setText(tid);
ui->labelProfileSIDValue->setText(sid);
ui->labelProfileGameValue->setText(profile.getVersionString());

ui->comboBoxGeneratorMethod->clear();
ui->comboBoxSearcherMethod->clear();
}

void Stationary3::on_pushButtonGenerate_clicked()
Expand Down
2 changes: 1 addition & 1 deletion Forms/MainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MainWindow : public QMainWindow
QTranslator translator;
QActionGroup *langGroup;
QActionGroup *styleGroup;
const QString VERSION = "v2.3.0";
const QString VERSION = "v2.3.1";

Stationary3 *stationary3 = nullptr;
Wild3 *wild3 = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Forms/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
<string notr="true">PokéFinder 2.3.0</string>
<string notr="true">PokéFinder 2.3.1</string>
</property>
<property name="windowIcon">
<iconset>
Expand Down
2 changes: 1 addition & 1 deletion PokeFinder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG += c++1z

TARGET = PokeFinder
TEMPLATE = app
VERSION = 2.3.0
VERSION = 2.3.1
QMAKE_TARGET_DESCRIPTION = PokeFinder
QMAKE_TARGET_COPYRIGHT = Admiral_Fish

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install:
- cmd: set PATH=%QTDIR%\bin;C:\Qt\Tools\QtCreator\bin;%PATH%
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
# Linux
- sh: sudo add-apt-repository ppa:beineri/opt-qt-5.12.1-xenial -y
- sh: sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y
- sh: sudo apt-get update -qq
- sh: sudo apt-get -y install qt512base qt512svg libgl1-mesa-dev
- sh: source /opt/qt5*/bin/qt5*-env.sh
Expand Down

0 comments on commit d728796

Please sign in to comment.