diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 32 | ||||
-rw-r--r-- | src/gui/ministatus.cpp | 6 | ||||
-rw-r--r-- | src/gui/okdialog.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/listbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tablemodel.cpp | 4 |
5 files changed, 23 insertions, 25 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 339cf717..c17b5e04 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -50,21 +50,6 @@ static const int BOX_WIDTH = 36; static const int BOX_HEIGHT = 36; -// Positions of the boxes, 2nd dimension is X and Y respectively. -static const int boxPosition[][2] = { - { 90, 40 }, // EQUIP_TORSO_SLOT - { 8, 78 }, // EQUIP_GLOVES_SLOT - { 70, 0 }, // EQUIP_HEAD_SLOT - { 50, 208 }, // EQUIP_LEGS_SLOT - { 90, 208 }, // EQUIP_FEET_SLOT - { 8, 168 }, // EQUIP_RING1_SLOT - { 129, 168 }, // EQUIP_RING2_SLOT - { 50, 40 }, // EQUIP_NECK_SLOT - { 8, 123 }, // EQUIP_FIGHT1_SLOT - { 129, 123 }, // EQUIP_FIGHT2_SLOT - { 129, 78 } // EQUIP_PROJECTILE_SLOT -}; - EquipmentWindow::EquipmentWindow(Equipment *equipment): Window(_("Equipment")), mEquipBox(0), @@ -210,6 +195,21 @@ namespace TmwAthena { TaEquipmentWindow::TaEquipmentWindow(Equipment *equipment): EquipmentWindow(equipment) { + // Positions of the boxes, 2nd dimension is X and Y respectively. + const int boxPosition[][2] = { + { 90, 40 }, // EQUIP_TORSO_SLOT + { 8, 78 }, // EQUIP_GLOVES_SLOT + { 70, 0 }, // EQUIP_HEAD_SLOT + { 50, 208 }, // EQUIP_LEGS_SLOT + { 90, 208 }, // EQUIP_FEET_SLOT + { 8, 168 }, // EQUIP_RING1_SLOT + { 129, 168 }, // EQUIP_RING2_SLOT + { 50, 40 }, // EQUIP_NECK_SLOT + { 8, 123 }, // EQUIP_FIGHT1_SLOT + { 129, 123 }, // EQUIP_FIGHT2_SLOT + { 129, 78 } // EQUIP_PROJECTILE_SLOT + }; + // Load equipment boxes. mEquipBox = new EquipBox[TmwAthena::EQUIP_VECTOR_END]; @@ -271,4 +271,4 @@ void TaEquipmentWindow::draw(gcn::Graphics *graphics) } } -}; +} // namespace TmwAthena diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 0fdf59b1..f3a8b807 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -92,11 +92,9 @@ MiniStatusWindow::MiniStatusWindow(): void MiniStatusWindow::setIcon(int index, AnimatedSprite *sprite) { if (index >= (int) mIcons.size()) - mIcons.resize(index + 1, NULL); - - if (mIcons[index]) - delete mIcons[index]; + mIcons.resize(index + 1); + delete mIcons[index]; mIcons[index] = sprite; } diff --git a/src/gui/okdialog.h b/src/gui/okdialog.h index 68841566..c5c29536 100644 --- a/src/gui/okdialog.h +++ b/src/gui/okdialog.h @@ -48,4 +48,4 @@ class OkDialog : public Window, public gcn::ActionListener TextBox *mTextBox; }; -#endif +#endif // OK_DIALOG_H diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 570983ca..239f4784 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -118,8 +118,6 @@ void ListBox::keyPressed(gcn::KeyEvent& keyEvent) } } -// Don't do anything on scrollwheel. ScrollArea will deal with that. - void ListBox::mousePressed(gcn::MouseEvent &mouseEvent) { if (mouseEvent.getButton() != gcn::MouseEvent::LEFT) @@ -134,10 +132,12 @@ void ListBox::mousePressed(gcn::MouseEvent &mouseEvent) void ListBox::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) { + // Don't do anything on scrollwheel. ScrollArea will deal with that. } void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) { + // Don't do anything on scrollwheel. ScrollArea will deal with that. } void ListBox::mouseDragged(gcn::MouseEvent &event) diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp index b4bbb409..477b35c0 100644 --- a/src/gui/widgets/tablemodel.cpp +++ b/src/gui/widgets/tablemodel.cpp @@ -56,7 +56,7 @@ StaticTableModel::StaticTableModel(int row, int column) : mColumns(column), mHeight(1) { - mTableModel.resize(row * column, NULL); + mTableModel.resize(row * column); mWidths.resize(column, 1); } @@ -69,7 +69,7 @@ void StaticTableModel::resize() { mRows = getRows(); mColumns = getColumns(); - mTableModel.resize(mRows * mColumns, NULL); + mTableModel.resize(mRows * mColumns); } void StaticTableModel::set(int row, int column, gcn::Widget *widget) |