-/*
- * InventoryMenu.cpp
- *
- * Created on: Nov 4, 2012
- * Author: holy
- */
-
#include "InventoryMenu.h"
#include "PartyMenu.h"
#include "Resources.h"
+#include "../app/Application.h"
#include "../app/Input.h"
#include "../common/GameConfig.h"
#include "../common/GameState.h"
#include "../common/Item.h"
#include "../graphics/Font.h"
#include "../graphics/Frame.h"
+#include "../math/Vector.h"
using app::Input;
using common::Inventory;
using common::Item;
-using geometry::Vector;
+using math::Vector;
using graphics::Font;
using graphics::Frame;
using std::swap;
} else if (itemMenu.SelectedIndex() == itemMenu.SecondaryIndex()) {
switch (menu.Selected()) {
case CHOICE_USE:
- // TODO: implement item use
+ if (itemMenu.Selected()->CanUseOnStatusScreen()) {
+ // TODO: implement item use
+ }
+ itemMenu.SetActive();
break;
case CHOICE_SORT:
// invalid state, recover
itemMenu.SetInactive();
break;
case CHOICE_DROP:
- // TODO: implement item drop
+ if (itemMenu.Selected()->CanDrop()) {
+ parent->Game().state->inventory.RemoveAll(itemMenu.Selected());
+ itemMenu.ClearEntry(itemMenu.SelectedIndex());
+ }
+ itemMenu.SetActive();
break;
}
} else {
}
}
-void InventoryMenu::UpdateWorld(float deltaT) {
+void InventoryMenu::UpdateWorld(Uint32 deltaT) {
}