]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/CapsuleChangeMenu.cpp
switched geometric scalars from floating to fixed
[l2e.git] / src / menu / CapsuleChangeMenu.cpp
index 912f81aa513b6fde2e19d0bc2fc638256b3e0802..c19f0f599ce8802329b7d1b661cf666e7eeff5f7 100644 (file)
@@ -16,7 +16,7 @@ using app::Input;
 using common::Capsule;
 using common::Inventory;
 using common::Item;
-using geometry::Vector;
+using math::Vector;
 using graphics::Font;
 using graphics::Frame;
 
@@ -51,7 +51,8 @@ void CapsuleChangeMenu::OnResize(int width, int height) {
 
 
 void CapsuleChangeMenu::HandleEvents(const Input &input) {
-       if (input.JustPressed(Input::ACTION_B)) {
+       if (input.JustPressed(Input::ACTION_A)
+                       || input.JustPressed(Input::ACTION_B)) {
                Ctrl().PopState();
        }
 
@@ -70,6 +71,7 @@ void CapsuleChangeMenu::HandleEvents(const Input &input) {
 }
 
 void CapsuleChangeMenu::NextCapsule() {
+       int storedClass = parent->Game().state->GetCapsule().ClassIndex();
        int &index = parent->Game().state->capsule;
        ++index;
        index %= parent->Game().state->NumCapsules();
@@ -78,9 +80,11 @@ void CapsuleChangeMenu::NextCapsule() {
                ++index;
                index %= parent->Game().state->NumCapsules();
        }
+       parent->Game().state->GetCapsule().SetClass(storedClass);
 }
 
 void CapsuleChangeMenu::PreviousCapsule() {
+       int storedClass = parent->Game().state->GetCapsule().ClassIndex();
        int &index = parent->Game().state->capsule;
        --index;
        if (index < 0) index += parent->Game().state->NumCapsules();
@@ -89,6 +93,7 @@ void CapsuleChangeMenu::PreviousCapsule() {
                --index;
                if (index < 0) index += parent->Game().state->NumCapsules();
        }
+       parent->Game().state->GetCapsule().SetClass(storedClass);
 }
 
 void CapsuleChangeMenu::NextClass() {
@@ -100,7 +105,7 @@ void CapsuleChangeMenu::PreviousClass() {
 }
 
 
-void CapsuleChangeMenu::UpdateWorld(float deltaT) {
+void CapsuleChangeMenu::UpdateWorld(Uint32 deltaT) {
 
 }