Make only one airmode selectable at a time

This commit is contained in:
Simon Robertshaw 2012-07-25 14:43:56 +01:00
parent 86659f2238
commit a03e92830a
2 changed files with 8 additions and 3 deletions

View File

@ -2338,6 +2338,10 @@ void Renderer::AddDisplayMode(unsigned int mode)
{ {
return; return;
} }
if(display_modes[i] & DISPLAY_AIR)
{
display_modes.erase(display_modes.begin()+i);
}
} }
display_modes.push_back(mode); display_modes.push_back(mode);
CompileDisplayMode(); CompileDisplayMode();

View File

@ -123,10 +123,10 @@ RenderView::RenderView():
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRH)); tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRH));
AddComponent(tCheckbox); 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); displayModes.push_back(tCheckbox);
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIR)); 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"); tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4+18), ui::Point(70, 16), "Warp");
displayModes.push_back(tCheckbox); displayModes.push_back(tCheckbox);
@ -138,7 +138,7 @@ RenderView::RenderView():
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_PERS)); tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_PERS));
AddComponent(tCheckbox); 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); displayModes.push_back(tCheckbox);
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_EFFE)); tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_EFFE));
AddComponent(tCheckbox); 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(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(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(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); g->draw_line(XRES-1, 0, XRES-1, YRES+MENUSIZE, 255, 255, 255, XRES+BARSIZE);
} }