mirror of
https://github.com/TuxSH/PkmGCTools.git
synced 2026-09-08 08:45:54 -05:00
Move names now displayed with the corresponding TMs & some refactoring.
This commit is contained in:
@@ -49,11 +49,16 @@ void ItemComboBox::resetItemList(void){
|
||||
fl &= ~1; // since (1 << (getItemCategory(<invalid item index>) )) == 1 ...
|
||||
|
||||
for (int i = 1; i <= (int)BattleCD60; ++i) { // 593
|
||||
unsigned int ctgFlg = (1U << (int)getItemCategory((ItemIndex)i, _isXD));
|
||||
ItemIndex index = (ItemIndex)i;
|
||||
unsigned int ctgFlg = (1U << (int)getItemCategory(index, _isXD));
|
||||
if ((fl & ctgFlg) != 0) {
|
||||
this->addItem(getItemName(lg, (ItemIndex)i, _isXD));
|
||||
const char* name = getItemName(lg, index, _isXD);
|
||||
this->addItem((index >= TM01 && index <= TM50)
|
||||
? QString("%1 (%2)").arg(name).arg(getPokemonMoveName(lg, getMoveForTM(index)))
|
||||
: name
|
||||
);
|
||||
_reverseIndices[i] = j;
|
||||
_indices[j++] = (ItemIndex)i;
|
||||
_indices[j++] = index;
|
||||
}
|
||||
else {
|
||||
_reverseIndices[i] = -1;
|
||||
|
||||
@@ -73,7 +73,12 @@ void ItemPocketEditor::setItemAt(int i) {
|
||||
|
||||
QTableWidgetItem *qty = new QTableWidgetItem(QString::number(items[i].quantity));
|
||||
qty->setTextAlignment((int)Qt::AlignRight | (int)Qt::AlignVCenter);
|
||||
tbl->setItem(i, 0, new QTableWidgetItem(getItemName(lg, items[i].index, isXD)));
|
||||
|
||||
const char* name = getItemName(lg, items[i].index, isXD);
|
||||
if(items[i].index >= TM01 && items[i].index <= TM50)
|
||||
tbl->setItem(i, 0, new QTableWidgetItem(QString("%1 (%2)").arg(name).arg(getPokemonMoveName(lg, getMoveForTM(items[i].index)))));
|
||||
else
|
||||
tbl->setItem(i, 0, new QTableWidgetItem(getItemName(lg, items[i].index, isXD)));
|
||||
tbl->setItem(i, 1, qty);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QComboBox>
|
||||
#include <LibPkmGC/Core/PokemonInfo.h>
|
||||
#include <LibPkmGC/Core/VersionInfo.h>
|
||||
#include <Core/IDataUI.h>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user