diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:26:48 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:26:48 +0200 |
commit | 3c89797394c83db8bc2204fdf5841dd3068f09d0 (patch) | |
tree | 6fc2d3ad06b9d589851397ff723a32b231a100de /src/gui/widgets | |
parent | 51f0c23ac190c83bebeace8a49cd2ecd1143fa8c (diff) | |
download | mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.gz mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.bz2 mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.xz mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.zip |
Removed getter/setter cruft from ItemInfo
Made the class and the code in general more readable by removing all
the needless getters and setters.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/chattab.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 96feddb9..40c9b66a 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -102,7 +102,7 @@ void BrowserBox::addRow(const std::string &row) { const int id = atoi(link.link.c_str()); if (id) - link.caption = itemDb->get(id).getName(); + link.caption = itemDb->get(id).name; else link.caption = link.link; } diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 5097bffa..663464a8 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -282,12 +282,12 @@ void ChatTab::chatInput(const std::string &message) std::string temp = msg.substr(start + 1, end - start - 1); - const ItemInfo itemInfo = itemDb->get(temp); - if (itemInfo.getId() != 0) + const ItemInfo &itemInfo = itemDb->get(temp); + if (itemInfo.id != 0) { msg.insert(end, "@@"); msg.insert(start + 1, "|"); - msg.insert(start + 1, toString(itemInfo.getId())); + msg.insert(start + 1, toString(itemInfo.id)); msg.insert(start + 1, "@@"); } } diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 37a61c80..940c69f4 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -101,7 +101,7 @@ void ItemContainer::draw(gcn::Graphics *graphics) if (!mFilter.empty()) { - if (normalize(item->getInfo().getName()).find(mFilter) == std::string::npos) + if (normalize(item->getInfo().name).find(mFilter) == std::string::npos) continue; mFilteredMap[currentIndex] = item; currentIndex++; @@ -286,7 +286,7 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) // put item name into chat window if (mDescItems) { - chatWindow->addItemText(item->getInfo().getName()); + chatWindow->addItemText(item->getInfo().name); } if (mSelectedIndex == index) @@ -298,7 +298,7 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) mSelectionStatus = SEL_SELECTING; itemShortcut->setItemSelected(item->getId()); - if (item->getInfo().getEquippable()) + if (item->isEquippable()) outfitWindow->setItemSelected(item->getId()); } else |