From: <geo...@us...> - 2009-01-11 12:25:18
|
Revision: 2734 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=2734&view=rev Author: geoffthemedio Date: 2009-01-11 11:33:07 +0000 (Sun, 11 Jan 2009) Log Message: ----------- -Used new EncyclopediaDetailPanel functionality of displaying ShipDesigns to make clicking a finished ship design on the Design screen show the encyclopedia info about that design, as was previously possible for parts and hulls. Modified Paths: -------------- trunk/FreeOrion/UI/DesignWnd.cpp Modified: trunk/FreeOrion/UI/DesignWnd.cpp =================================================================== --- trunk/FreeOrion/UI/DesignWnd.cpp 2009-01-11 11:01:36 UTC (rev 2733) +++ trunk/FreeOrion/UI/DesignWnd.cpp 2009-01-11 11:33:07 UTC (rev 2734) @@ -704,6 +704,8 @@ DesignSelectedSignal; //!< an existing complete design that is known to this empire was selected (double-clicked) mutable boost::signal<void (const std::string&, const std::vector<std::string>&)> DesignComponentsSelectedSignal; //!< a hull and a set of parts (which may be empty) was selected (double-clicked) + mutable boost::signal<void (const ShipDesign*)> + DesignBrowsedSignal; //!< a completed design was browsed (clicked once) mutable boost::signal<void (const HullType*)> HullBrowsedSignal; //!< a hull was browsed (clicked once) @@ -1020,6 +1022,14 @@ void BasesListBox::PropagateLeftClickSignal(GG::ListBox::iterator it, const GG::Pt& pt) { // determine type of row that was clicked, and emit appropriate signal + CompletedDesignListBoxRow* design_row = dynamic_cast<CompletedDesignListBoxRow*>(*it); + if (design_row) { + int id = design_row->DesignID(); + const ShipDesign* design = GetShipDesign(id); + if (design) + DesignBrowsedSignal(design); + } + HullAndPartsListBoxRow* box_row = dynamic_cast<HullAndPartsListBoxRow*>(*it); if (box_row) { const std::string& hull_name = box_row->Hull(); @@ -1115,6 +1125,8 @@ DesignSelectedSignal; //!< an existing complete design that is known to this empire was selected (double-clicked) mutable boost::signal<void (const std::string&, const std::vector<std::string>&)> DesignComponentsSelectedSignal; //!< a hull and a set of parts (which may be empty) was selected (double-clicked) + mutable boost::signal<void (const ShipDesign*)> + DesignBrowsedSignal; //!< a complete design was browsed (clicked once) mutable boost::signal<void (const HullType*)> HullBrowsedSignal; //!< a hull was browsed (clicked once) private: @@ -1161,6 +1173,7 @@ m_tabs->AddWnd(m_designs_list, UserString("DESIGN_WND_FINISHED_DESIGNS")); m_designs_list->ShowCompletedDesigns(false); GG::Connect(m_designs_list->DesignSelectedSignal, DesignWnd::BaseSelector::DesignSelectedSignal); + GG::Connect(m_designs_list->DesignBrowsedSignal, DesignWnd::BaseSelector::DesignBrowsedSignal); //m_saved_designs_list = new CUIListBox(GG::X0, GG::Y0, GG::X(10), GG::X(10)); m_tabs->AddWnd(new GG::TextControl(GG::X0, GG::Y0, GG::X(30), GG::Y(20), UserString("DESIGN_NO_PART"), @@ -1894,6 +1907,7 @@ AttachChild(m_base_selector); GG::Connect(m_base_selector->DesignSelectedSignal, &MainPanel::SetDesign, m_main_panel); GG::Connect(m_base_selector->DesignComponentsSelectedSignal,&MainPanel::SetDesignComponents, m_main_panel); + GG::Connect(m_base_selector->DesignBrowsedSignal, &EncyclopediaDetailPanel::SetItem, m_detail_panel); GG::Connect(m_base_selector->HullBrowsedSignal, &EncyclopediaDetailPanel::SetItem, m_detail_panel); m_base_selector->MoveTo(GG::Pt()); |