From a03e92830a429e89d2c516e9b63eb44ab49e8417 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 14:43:56 +0100 Subject: [PATCH] Make only one airmode selectable at a time --- src/graphics/Renderer.cpp | 4 ++++ src/render/RenderView.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 3a03a1da4..74c2eee62 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -2338,6 +2338,10 @@ void Renderer::AddDisplayMode(unsigned int mode) { return; } + if(display_modes[i] & DISPLAY_AIR) + { + display_modes.erase(display_modes.begin()+i); + } } display_modes.push_back(mode); CompileDisplayMode(); diff --git a/src/render/RenderView.cpp b/src/render/RenderView.cpp index 4f79d4cb3..ed8e51f6c 100644 --- a/src/render/RenderView.cpp +++ b/src/render/RenderView.cpp @@ -123,10 +123,10 @@ RenderView::RenderView(): tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRH)); AddComponent(tCheckbox); - tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Air"); + /*tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Air"); displayModes.push_back(tCheckbox); tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIR)); - AddComponent(tCheckbox); + AddComponent(tCheckbox);*/ tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4+18), ui::Point(70, 16), "Warp"); displayModes.push_back(tCheckbox); @@ -138,7 +138,7 @@ RenderView::RenderView(): tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_PERS)); AddComponent(tCheckbox); - tCheckbox = new ui::Checkbox(ui::Point(411, YRES+4+18), ui::Point(70, 16), "Effect"); + tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Effect"); displayModes.push_back(tCheckbox); tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_EFFE)); AddComponent(tCheckbox); @@ -245,6 +245,7 @@ void RenderView::OnDraw() } g->draw_line(0, YRES, XRES-1, YRES, 255, 255, 255, XRES+BARSIZE); g->draw_line(180, YRES, 180, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE); + g->draw_line(330, YRES, 330, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE); g->draw_line(480, YRES, 480, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE); g->draw_line(XRES-1, 0, XRES-1, YRES+MENUSIZE, 255, 255, 255, XRES+BARSIZE); }