void ShipCpanel::InitObject() { Gui::Screen::AddBaseWidget(this, 0, Gui::Screen::GetHeight()-80); SetTransparency(true); Gui::Image *img = new Gui::Image("icons/cpanel.png"); Add(img, 0, 0); m_currentMapView = MAP_SECTOR; m_useEquipWidget = new UseEquipWidget(); m_msglog = new MsgLogWidget(); m_userSelectedMfuncWidget = MFUNC_SCANNER; m_scanner->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_EQUIPMENT)); m_msglog->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_MSGLOG)); m_scanner->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_EQUIPMENT)); m_msglog->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_MSGLOG)); // where the scanner is m_mfsel = new MultiFuncSelectorWidget(); m_mfsel->onSelect.connect(sigc::mem_fun(this, &ShipCpanel::OnUserChangeMultiFunctionDisplay)); Add(m_mfsel, 656, 18); ChangeMultiFunctionDisplay(MFUNC_SCANNER); // Gui::RadioGroup *g = new Gui::RadioGroup(); Gui::ImageRadioButton *b = new Gui::ImageRadioButton(0, "icons/timeaccel0.png", "icons/timeaccel0_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_PAUSED)); b->SetShortcut(SDLK_ESCAPE, KMOD_LSHIFT); Add(b, 0, 36); m_timeAccelButtons[0] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel1.png", "icons/timeaccel1_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_1X)); b->SetShortcut(SDLK_F1, KMOD_LSHIFT); b->SetSelected(true); Add(b, 22, 36); m_timeAccelButtons[1] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel2.png", "icons/timeaccel2_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_10X)); b->SetShortcut(SDLK_F2, KMOD_LSHIFT); Add(b, 44, 36); m_timeAccelButtons[2] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel3.png", "icons/timeaccel3_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_100X)); b->SetShortcut(SDLK_F3, KMOD_LSHIFT); Add(b, 66, 36); m_timeAccelButtons[3] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel4.png", "icons/timeaccel4_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_1000X)); b->SetShortcut(SDLK_F4, KMOD_LSHIFT); Add(b, 88, 36); m_timeAccelButtons[4] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel5.png", "icons/timeaccel5_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_10000X)); b->SetShortcut(SDLK_F5, KMOD_LSHIFT); Add(b, 110, 36); m_timeAccelButtons[5] = b; m_leftButtonGroup = new Gui::RadioGroup(); m_camButton = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(m_camButton); m_camButton->SetSelected(true); m_camButton->AddState(WorldView::CAM_FRONT, "icons/cam_front.png", "icons/cam_front_on.png", Lang::FRONT_VIEW); m_camButton->AddState(WorldView::CAM_REAR, "icons/cam_rear.png", "icons/cam_rear_on.png", Lang::REAR_VIEW); m_camButton->AddState(WorldView::CAM_EXTERNAL, "icons/cam_external.png", "icons/cam_external_on.png", Lang::EXTERNAL_VIEW); m_camButton->AddState(WorldView::CAM_SIDEREAL, "icons/cam_sidereal.png", "icons/cam_sidereal_on.png", Lang::SIDEREAL_VIEW); m_camButton->SetShortcut(SDLK_F1, KMOD_NONE); m_camButton->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeCamView)); Add(m_camButton, 2, 56); Gui::MultiStateImageButton *map_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(map_button); map_button->SetSelected(false); map_button->SetShortcut(SDLK_F2, KMOD_NONE); map_button->AddState(0, "icons/cpan_f2_map.png", "icons/cpan_f2_map_on.png", Lang::NAVIGATION_STAR_MAPS); map_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeToMapView)); Add(map_button, 34, 56); Gui::MultiStateImageButton *info_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(info_button); info_button->SetSelected(false); info_button->SetShortcut(SDLK_F3, KMOD_NONE); info_button->AddState(0, "icons/cpan_f3_shipinfo.png", "icons/cpan_f3_shipinfo_on.png", Lang::SHIP_INFORMATION); info_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeInfoView)); Add(info_button, 66, 56); Gui::MultiStateImageButton *comms_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(comms_button); comms_button->SetSelected(false); comms_button->SetShortcut(SDLK_F4, KMOD_NONE); comms_button->AddState(0, "icons/comms_f4.png", "icons/comms_f4_on.png", Lang::COMMS); comms_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnClickComms)); Add(comms_button, 98, 56); m_clock = (new Gui::Label(""))->Color(1.0f,0.7f,0.0f); Add(m_clock, 4, 18); m_rightButtonGroup = new Gui::RadioGroup(); b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_sector_view.png", "icons/map_sector_view_on.png"); m_rightButtonGroup->SetSelected(0); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SECTOR)); b->SetShortcut(SDLK_F5, KMOD_NONE); b->SetToolTip(Lang::GALAXY_SECTOR_VIEW); Add(b, 674, 56); m_mapViewButtons[0] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_system_view.png", "icons/map_system_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SYSTEM)); b->SetShortcut(SDLK_F6, KMOD_NONE); b->SetToolTip(Lang::SYSTEM_ORBIT_VIEW); Add(b, 706, 56); m_mapViewButtons[1] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_sysinfo_view.png", "icons/map_sysinfo_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_INFO)); b->SetShortcut(SDLK_F7, KMOD_NONE); b->SetToolTip(Lang::STAR_SYSTEM_INFORMATION); Add(b, 738, 56); m_mapViewButtons[2] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_galactic_view.png", "icons/map_galactic_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_GALACTIC)); b->SetShortcut(SDLK_F8, KMOD_NONE); b->SetToolTip(Lang::GALACTIC_VIEW); Add(b, 770, 56); m_mapViewButtons[3] = b; img = new Gui::Image("icons/alert_green.png"); img->SetToolTip(Lang::NO_ALERT); Add(img, 780, 37); m_alertLights[0] = img; img = new Gui::Image("icons/alert_yellow.png"); img->SetToolTip(Lang::SHIP_NEARBY); Add(img, 780, 37); m_alertLights[1] = img; img = new Gui::Image("icons/alert_red.png"); img->SetToolTip(Lang::LASER_FIRE_DETECTED); Add(img, 780, 37); m_alertLights[2] = img; CameraSwitchWidget *camSwitcher = new CameraSwitchWidget(this, WorldView::CAM_FRONT); camSwitcher->SetShortcut(SDLK_1, KMOD_LSHIFT); Add(camSwitcher,0,0); camSwitcher = new CameraSwitchWidget(this, WorldView::CAM_REAR); camSwitcher->SetShortcut(SDLK_2, KMOD_LSHIFT); Add(camSwitcher,0,0); camSwitcher = new CameraSwitchWidget(this, WorldView::CAM_EXTERNAL); camSwitcher->SetShortcut(SDLK_3, KMOD_LSHIFT); Add(camSwitcher,0,0); camSwitcher = new CameraSwitchWidget(this, WorldView::CAM_SIDEREAL); camSwitcher->SetShortcut(SDLK_4, KMOD_LSHIFT); Add(camSwitcher,0,0); m_connOnDockingClearanceExpired = Pi::onDockingClearanceExpired.connect(sigc::mem_fun(this, &ShipCpanel::OnDockingClearanceExpired)); }
void ShipCpanel::InitObject() { SetTransparency(true); Gui::Image *img = new Gui::Image("icons/cpanel.png"); img->SetRenderDimensions(800, 80); Add(img, 0, 0); m_currentMapView = MAP_SECTOR; m_useEquipWidget = new UseEquipWidget(); m_msglog = new MsgLogWidget(); m_userSelectedMfuncWidget = MFUNC_SCANNER; m_scanner->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_EQUIPMENT)); m_msglog->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_MSGLOG)); m_scanner->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_EQUIPMENT)); m_msglog->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_MSGLOG)); // where the scanner is m_mfsel = new MultiFuncSelectorWidget(); m_mfsel->onSelect.connect(sigc::mem_fun(this, &ShipCpanel::OnUserChangeMultiFunctionDisplay)); Add(m_mfsel, 656, 18); ChangeMultiFunctionDisplay(MFUNC_SCANNER); // Gui::RadioGroup *g = new Gui::RadioGroup(); Gui::ImageRadioButton *b = new Gui::ImageRadioButton(0, "icons/timeaccel0.png", "icons/timeaccel0_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_PAUSED)); b->SetShortcut(SDLK_ESCAPE, KMOD_LSHIFT); b->SetRenderDimensions(22, 18); Add(b, 0, 36); m_timeAccelButtons[0] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel1.png", "icons/timeaccel1_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_1X)); b->SetShortcut(SDLK_F1, KMOD_LSHIFT); b->SetSelected(true); b->SetRenderDimensions(22, 18); Add(b, 22, 36); m_timeAccelButtons[1] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel2.png", "icons/timeaccel2_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_10X)); b->SetShortcut(SDLK_F2, KMOD_LSHIFT); b->SetRenderDimensions(22, 18); Add(b, 44, 36); m_timeAccelButtons[2] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel3.png", "icons/timeaccel3_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_100X)); b->SetShortcut(SDLK_F3, KMOD_LSHIFT); b->SetRenderDimensions(22, 18); Add(b, 66, 36); m_timeAccelButtons[3] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel4.png", "icons/timeaccel4_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_1000X)); b->SetShortcut(SDLK_F4, KMOD_LSHIFT); b->SetRenderDimensions(22, 18); Add(b, 88, 36); m_timeAccelButtons[4] = b; b = new Gui::ImageRadioButton(0, "icons/timeaccel5.png", "icons/timeaccel5_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), Game::TIMEACCEL_10000X)); b->SetShortcut(SDLK_F5, KMOD_LSHIFT); b->SetRenderDimensions(22, 18); Add(b, 110, 36); m_timeAccelButtons[5] = b; m_leftButtonGroup = new Gui::RadioGroup(); m_camButton = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(m_camButton); m_camButton->SetSelected(true); m_camButton->AddState(WorldView::CAM_INTERNAL, "icons/cam_internal.png", "icons/cam_internal_on.png", Lang::INTERNAL_VIEW); m_camButton->AddState(WorldView::CAM_EXTERNAL, "icons/cam_external.png", "icons/cam_external_on.png", Lang::EXTERNAL_VIEW); m_camButton->AddState(WorldView::CAM_SIDEREAL, "icons/cam_sidereal.png", "icons/cam_sidereal_on.png", Lang::SIDEREAL_VIEW); m_camButton->SetShortcut(SDLK_F1, KMOD_NONE); m_camButton->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeCamView)); m_camButton->SetRenderDimensions(30, 22); Add(m_camButton, 2, 56); Gui::MultiStateImageButton *map_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(map_button); map_button->SetSelected(false); map_button->SetShortcut(SDLK_F2, KMOD_NONE); map_button->AddState(0, "icons/cpan_f2_map.png", "icons/cpan_f2_map_on.png", Lang::NAVIGATION_STAR_MAPS); map_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeToMapView)); map_button->SetRenderDimensions(30, 22); Add(map_button, 34, 56); Gui::MultiStateImageButton *info_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(info_button); info_button->SetSelected(false); info_button->SetShortcut(SDLK_F3, KMOD_NONE); info_button->AddState(0, "icons/cpan_f3_shipinfo.png", "icons/cpan_f3_shipinfo_on.png", Lang::SHIP_INFORMATION); info_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeInfoView)); info_button->SetRenderDimensions(30, 22); Add(info_button, 66, 56); Gui::MultiStateImageButton *comms_button = new Gui::MultiStateImageButton(); m_leftButtonGroup->Add(comms_button); comms_button->SetSelected(false); comms_button->SetShortcut(SDLK_F4, KMOD_NONE); comms_button->AddState(0, "icons/comms_f4.png", "icons/comms_f4_on.png", Lang::COMMS); comms_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnClickComms)); comms_button->SetRenderDimensions(30, 22); Add(comms_button, 98, 56); m_clock = (new Gui::Label(""))->Color(255,178,0); Add(m_clock, 4, 18); m_rightButtonGroup = new Gui::RadioGroup(); b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_sector_view.png", "icons/map_sector_view_on.png"); m_rightButtonGroup->SetSelected(0); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SECTOR)); b->SetShortcut(SDLK_F5, KMOD_NONE); b->SetToolTip(Lang::GALAXY_SECTOR_VIEW); b->SetRenderDimensions(30, 22); Add(b, 674, 56); m_mapViewButtons[0] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_system_view.png", "icons/map_system_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SYSTEM)); b->SetShortcut(SDLK_F6, KMOD_NONE); b->SetToolTip(Lang::SYSTEM_ORBIT_VIEW); b->SetRenderDimensions(30, 22); Add(b, 706, 56); m_mapViewButtons[1] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_sysinfo_view.png", "icons/map_sysinfo_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_INFO)); b->SetShortcut(SDLK_F7, KMOD_NONE); b->SetToolTip(Lang::STAR_SYSTEM_INFORMATION); b->SetRenderDimensions(30, 22); Add(b, 738, 56); m_mapViewButtons[2] = b; b = new Gui::ImageRadioButton(m_rightButtonGroup, "icons/map_galactic_view.png", "icons/map_galactic_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_GALACTIC)); b->SetShortcut(SDLK_F8, KMOD_NONE); b->SetToolTip(Lang::GALACTIC_VIEW); b->SetRenderDimensions(30, 22); Add(b, 770, 56); m_mapViewButtons[3] = b; m_rotationDampingButton = new Gui::MultiStateImageButton(); m_rotationDampingButton->SetSelected(false); m_rotationDampingButton->AddState(0, "icons/rotation_damping_off.png", Lang::ROTATION_DAMPING_OFF); m_rotationDampingButton->AddState(1, "icons/rotation_damping_on.png", Lang::ROTATION_DAMPING_ON); m_rotationDampingButton->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnClickRotationDamping)); m_rotationDampingButton->SetRenderDimensions(20, 13); m_rotationDampingButton->SetActiveState(Pi::player->GetPlayerController()->GetRotationDamping()); Add(m_rotationDampingButton, 760, 37); m_connOnRotationDampingChanged = Pi::player->GetPlayerController()->onRotationDampingChanged.connect( sigc::mem_fun(this, &ShipCpanel::OnRotationDampingChanged)); img = new Gui::Image("icons/alert_green.png"); img->SetToolTip(Lang::NO_ALERT); img->SetRenderDimensions(20, 13); Add(img, 780, 37); m_alertLights[0] = img; img = new Gui::Image("icons/alert_yellow.png"); img->SetToolTip(Lang::SHIP_NEARBY); img->SetRenderDimensions(20, 13); Add(img, 780, 37); m_alertLights[1] = img; img = new Gui::Image("icons/alert_red.png"); img->SetToolTip(Lang::LASER_FIRE_DETECTED); img->SetRenderDimensions(20, 13); Add(img, 780, 37); m_alertLights[2] = img; m_overlay[OVERLAY_TOP_LEFT] = (new Gui::Label(""))->Color(s_hudTextColor); m_overlay[OVERLAY_TOP_RIGHT] = (new Gui::Label(""))->Color(s_hudTextColor); m_overlay[OVERLAY_BOTTOM_LEFT] = (new Gui::Label(""))->Color(s_hudTextColor); m_overlay[OVERLAY_BOTTOM_RIGHT] = (new Gui::Label(""))->Color(s_hudTextColor); Add(m_overlay[OVERLAY_TOP_LEFT], 170.0f, 2.0f); Add(m_overlay[OVERLAY_TOP_RIGHT], 500.0f, 2.0f); Add(m_overlay[OVERLAY_BOTTOM_LEFT], 150.0f, 62.0f); Add(m_overlay[OVERLAY_BOTTOM_RIGHT], 520.0f, 62.0f); m_connOnDockingClearanceExpired = Pi::onDockingClearanceExpired.connect(sigc::mem_fun(this, &ShipCpanel::OnDockingClearanceExpired)); }
ShipCpanel::ShipCpanel(): Gui::Fixed((float)Gui::Screen::GetWidth(), 80) { Gui::Screen::AddBaseWidget(this, 0, Gui::Screen::GetHeight()-80); SetTransparency(true); Gui::Image *img = new Gui::Image(PIONEER_DATA_DIR "/icons/cpanel.png"); Add(img, 0, 0); m_currentMapView = MAP_SECTOR; m_scanner = new ScannerWidget(); m_useEquipWidget = new UseEquipWidget(); m_msglog = new MsgLogWidget(); m_userSelectedMfuncWidget = MFUNC_SCANNER; m_scanner->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_EQUIPMENT)); m_msglog->onGrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncGrabFocus), MFUNC_MSGLOG)); m_scanner->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_SCANNER)); m_useEquipWidget->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_EQUIPMENT)); m_msglog->onUngrabFocus.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnMultiFuncUngrabFocus), MFUNC_MSGLOG)); // where the scanner is m_mfsel = new MultiFuncSelectorWidget(); m_mfsel->onSelect.connect(sigc::mem_fun(this, &ShipCpanel::OnUserChangeMultiFunctionDisplay)); Add(m_mfsel, 656, 18); ChangeMultiFunctionDisplay(MFUNC_SCANNER); // Gui::RadioGroup *g = new Gui::RadioGroup(); Gui::ImageRadioButton *b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel0.png", PIONEER_DATA_DIR "/icons/timeaccel0_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 0)); b->SetShortcut(SDLK_ESCAPE, KMOD_LSHIFT); Add(b, 0, 36); m_timeAccelButtons[0] = b; b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel1.png", PIONEER_DATA_DIR "/icons/timeaccel1_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 1)); b->SetShortcut(SDLK_F1, KMOD_LSHIFT); b->SetSelected(true); Add(b, 22, 36); m_timeAccelButtons[1] = b; b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel2.png", PIONEER_DATA_DIR "/icons/timeaccel2_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 2)); b->SetShortcut(SDLK_F2, KMOD_LSHIFT); Add(b, 44, 36); m_timeAccelButtons[2] = b; b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel3.png", PIONEER_DATA_DIR "/icons/timeaccel3_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 3)); b->SetShortcut(SDLK_F3, KMOD_LSHIFT); Add(b, 66, 36); m_timeAccelButtons[3] = b; b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel4.png", PIONEER_DATA_DIR "/icons/timeaccel4_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 4)); b->SetShortcut(SDLK_F4, KMOD_LSHIFT); Add(b, 88, 36); m_timeAccelButtons[4] = b; b = new Gui::ImageRadioButton(0, PIONEER_DATA_DIR "/icons/timeaccel5.png", PIONEER_DATA_DIR "/icons/timeaccel5_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnClickTimeaccel), 5)); b->SetShortcut(SDLK_F5, KMOD_LSHIFT); Add(b, 110, 36); m_timeAccelButtons[5] = b; Gui::RadioGroup *g = new Gui::RadioGroup(); Gui::MultiStateImageButton *cam_button = new Gui::MultiStateImageButton(); g->Add(cam_button); cam_button->SetSelected(true); cam_button->AddState(WorldView::CAM_FRONT, PIONEER_DATA_DIR "/icons/cam_front.png", PIONEER_DATA_DIR "/icons/cam_front_on.png", "Front view"); cam_button->AddState(WorldView::CAM_REAR, PIONEER_DATA_DIR "/icons/cam_rear.png", PIONEER_DATA_DIR "/icons/cam_rear_on.png", "Rear view"); cam_button->AddState(WorldView::CAM_EXTERNAL, PIONEER_DATA_DIR "/icons/cam_external.png", PIONEER_DATA_DIR "/icons/cam_external_on.png", "External view"); cam_button->SetShortcut(SDLK_F1, KMOD_NONE); cam_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeCamView)); Add(cam_button, 2, 56); Gui::MultiStateImageButton *map_button = new Gui::MultiStateImageButton(); g->Add(map_button); map_button->SetSelected(false); map_button->SetShortcut(SDLK_F2, KMOD_NONE); map_button->AddState(0, PIONEER_DATA_DIR "/icons/cpan_f2_map.png", PIONEER_DATA_DIR "/icons/cpan_f2_map_on.png", "Navigation and star maps"); map_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeToMapView)); Add(map_button, 34, 56); Gui::MultiStateImageButton *info_button = new Gui::MultiStateImageButton(); g->Add(info_button); info_button->SetSelected(false); info_button->SetShortcut(SDLK_F3, KMOD_NONE); info_button->AddState(0, PIONEER_DATA_DIR "/icons/cpan_f3_shipinfo.png", PIONEER_DATA_DIR "/icons/cpan_f3_shipinfo_on.png", "Ship information"); info_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnChangeInfoView)); Add(info_button, 66, 56); Gui::MultiStateImageButton *comms_button = new Gui::MultiStateImageButton(); g->Add(comms_button); comms_button->SetSelected(false); comms_button->SetShortcut(SDLK_F4, KMOD_NONE); comms_button->AddState(0, PIONEER_DATA_DIR "/icons/comms_f4.png", PIONEER_DATA_DIR "/icons/comms_f4_on.png", "Comms"); comms_button->onClick.connect(sigc::mem_fun(this, &ShipCpanel::OnClickComms)); Add(comms_button, 98, 56); m_clock = (new Gui::Label(""))->Color(1.0f,0.7f,0.0f); Add(m_clock, 4, 18); g = new Gui::RadioGroup(); b = new Gui::ImageRadioButton(g, PIONEER_DATA_DIR "/icons/map_sector_view.png", PIONEER_DATA_DIR "/icons/map_sector_view_on.png"); g->SetSelected(0); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SECTOR)); b->SetShortcut(SDLK_F5, KMOD_NONE); b->SetToolTip("Galaxy sector view"); Add(b, 674, 56); m_mapViewButtons[0] = b; b = new Gui::ImageRadioButton(g, PIONEER_DATA_DIR "/icons/map_system_view.png", PIONEER_DATA_DIR "/icons/map_system_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_SYSTEM)); b->SetShortcut(SDLK_F6, KMOD_NONE); b->SetToolTip("System orbit view"); Add(b, 706, 56); m_mapViewButtons[1] = b; b = new Gui::ImageRadioButton(g, PIONEER_DATA_DIR "/icons/map_sysinfo_view.png", PIONEER_DATA_DIR "/icons/map_sysinfo_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_INFO)); b->SetShortcut(SDLK_F7, KMOD_NONE); b->SetToolTip("Star system information"); Add(b, 738, 56); m_mapViewButtons[2] = b; b = new Gui::ImageRadioButton(g, PIONEER_DATA_DIR "/icons/map_galactic_view.png", PIONEER_DATA_DIR "/icons/map_galactic_view_on.png"); b->onSelect.connect(sigc::bind(sigc::mem_fun(this, &ShipCpanel::OnChangeMapView), MAP_GALACTIC)); b->SetShortcut(SDLK_F8, KMOD_NONE); b->SetToolTip("Galactic view"); Add(b, 770, 56); m_mapViewButtons[3] = b; m_connOnDockingClearanceExpired = Pi::onDockingClearanceExpired.connect(sigc::mem_fun(this, &ShipCpanel::OnDockingClearanceExpired)); }