]> git.localhorst.tv Git - l2e.git/commitdiff
added action menu to equipment menu
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 20 Nov 2012 19:34:51 +0000 (20:34 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 20 Nov 2012 19:34:51 +0000 (20:34 +0100)
src/main.cpp
src/menu/EquipMenu.cpp

index df5ab7a9d3de930e8abe127ecb7074e9e1b9ffdc..44ed13a39e7c81b07cf021c2f638c7913a9d1fef 100644 (file)
@@ -424,7 +424,7 @@ int main(int argc, char **argv) {
 
                graphics::MenuProperties equipmentMenuProperties;
                equipmentMenuProperties.cols = 1;
-               equipmentMenuProperties.rows = 5;
+               equipmentMenuProperties.rows = 6;
                equipmentMenuProperties.charsPerEntry = 12;
                equipmentMenuProperties.rowGap = 16;
                equipmentMenuProperties.cursor = &menuCursor;
@@ -433,6 +433,12 @@ int main(int argc, char **argv) {
                equipmentMenuProperties.iconSpace = 16;
                menuResources.equipmentMenuProperties = &equipmentMenuProperties;
 
+               menuResources.equipMenuEquipLabel = "EQUIP";
+               menuResources.equipMenuStrongestLabel = "STRONGEST";
+               menuResources.equipMenuRemoveLabel = "REMOVE";
+               menuResources.equipMenuRemoveAllLabel = "REMOVE ALL";
+               menuResources.equipMenuDropLabel = "DROP";
+
                InitScreen screen(width, height);
 
                app::State *state(0);
index da24f771f10723d342f00ea97fddf1f8fda58181..c604155861cc778196bbbf2752930574150fa46a 100644 (file)
@@ -87,12 +87,16 @@ void EquipMenu::Render(SDL_Surface *screen) {
        Vector<int> equipOffset(
                        17 * parent->Res().statusFont->CharWidth(),
                        4 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
+       Vector<int> menuOffset(
+                       15 * parent->Res().statusFont->CharWidth(),
+                       17 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
 
        parent->RenderBackground(screen);
        parent->Res().shoulderNav->Draw(screen, offset + shoulderNavOffset);
        RenderStatus(screen, offset + parent->StatusOffset(0));
        RenderStats(screen, offset + statsOffset);
-       RenderEquipmentMenu(screen, equipOffset);
+       RenderEquipmentMenu(screen, offset + equipOffset);
+       RenderActionMenu(screen, offset + menuOffset);
 }
 
 int EquipMenu::Width() const {
@@ -146,7 +150,12 @@ void EquipMenu::RenderEquipmentMenu(SDL_Surface *screen, const Vector<int> &offs
 }
 
 void EquipMenu::RenderActionMenu(SDL_Surface *screen, const Vector<int> &offset) const {
+       const Font &font(*parent->Res().statusFont);
+       const Frame &frame(*parent->Res().statusFrame);
+       const Vector<int> menuOffset(3 * font.CharWidth(), font.CharHeight() + font.CharHeight() / 2);
 
+       frame.Draw(screen, offset, 15 * font.CharWidth(), 10 * font.CharHeight());
+       actionMenu.Draw(screen, offset + menuOffset);
 }
 
 void EquipMenu::RenderInventoryMenu(SDL_Surface *screen, const Vector<int> &offset) const {