]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/ConfigMenu.cpp
added basic config menu
[l2e.git] / src / menu / ConfigMenu.cpp
index 1e27973e94e954f78957227c5263765e52dc16de..62eed325d0ff33b40ebe2b1d29bf3e714fc64d43 100644 (file)
@@ -22,8 +22,12 @@ using graphics::Frame;
 namespace menu {
 
 ConfigMenu::ConfigMenu(PartyMenu *parent)
-: parent(parent) {
-
+: parent(parent)
+, configMenu(*parent->Res().configMenuProperties) {
+       configMenu.Add(parent->Res().configMessageSpeedLabel, 0);
+       configMenu.Add(parent->Res().configBattleCursorLabel, 1);
+       configMenu.Add(parent->Res().configStatusCursorLabel, 2);
+       configMenu.Add(parent->Res().configMusicLabel, 3);
 }
 
 
@@ -62,6 +66,12 @@ void ConfigMenu::HandleEvents(const Input &input) {
        if (input.JustPressed(Input::ACTION_B)) {
                Ctrl().PopState();
        }
+       if (input.JustPressed(Input::PAD_DOWN)) {
+               configMenu.NextRow();
+       }
+       if (input.JustPressed(Input::PAD_UP)) {
+               configMenu.PreviousRow();
+       }
 }
 
 void ConfigMenu::UpdateWorld(float deltaT) {
@@ -94,8 +104,11 @@ void ConfigMenu::RenderHeadline(SDL_Surface *screen, const geometry::Vector<int>
 void ConfigMenu::RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
        const Font &font(*parent->Res().normalFont);
        const Frame &frame(*parent->Res().statusFrame);
+       const Vector<int> menuOffset(
+                       3 * font.CharWidth(), 2 * font.CharHeight());
 
        frame.Draw(screen, offset, 30 * font.CharWidth(), 14 * font.CharHeight());
+       configMenu.Draw(screen, offset + menuOffset);
 }
 
 }