1 #ifndef _ResourceBrowseWnd_h_
2 #define _ResourceBrowseWnd_h_
3 
4 #include <GG/GGFwd.h>
5 #include <GG/BrowseInfoWnd.h>
6 
7 
8 /** A popup tooltop for display when mousing over in-game icons.
9   * A title and some detail text.*/
10 class ResourceBrowseWnd : public GG::BrowseInfoWnd {
11 public:
12     ResourceBrowseWnd(const std::string& title_text, const std::string& unit_label,
13                       float used, float output, float target_output,
14                       bool show_stockpile = false, float stockpile_use = 0.0f,
15                       float stockpile = 0.0f, float stockpile_change = 0.0f,
16                       bool show_stockpile_limit = false,
17                       float stockpile_use_limit = 0.0f);
18     void CompleteConstruction() override;
19     bool WndHasBrowseInfo(const Wnd* wnd, std::size_t mode) const override;
20     void Render() override;
21 
22 private:
23     virtual void  InitBuffer();
24 
25     GG::GL2DVertexBuffer        m_buffer;
26     std::shared_ptr<GG::Label>  m_title_text;
27 
28     bool                        m_show_points = false;
29     std::shared_ptr<GG::Label>  m_used_points_label;
30     std::shared_ptr<GG::Label>  m_used_points;
31     std::shared_ptr<GG::Label>  m_used_points_P_label;
32     std::shared_ptr<GG::Label>  m_output_points_label;
33     std::shared_ptr<GG::Label>  m_output_points;
34     std::shared_ptr<GG::Label>  m_output_points_P_label;
35     std::shared_ptr<GG::Label>  m_target_points_label;
36     std::shared_ptr<GG::Label>  m_target_points;
37     std::shared_ptr<GG::Label>  m_target_points_P_label;
38     bool                        m_show_stockpile = false;
39     std::shared_ptr<GG::Label>  m_stockpile_points_label;
40     std::shared_ptr<GG::Label>  m_stockpile_points;
41     std::shared_ptr<GG::Label>  m_stockpile_points_P_label;
42     std::shared_ptr<GG::Label>  m_stockpile_used_points_label;
43     std::shared_ptr<GG::Label>  m_stockpile_used_points;
44     std::shared_ptr<GG::Label>  m_stockpile_used_points_P_label;
45     std::shared_ptr<GG::Label>  m_stockpile_change_points_label;
46     std::shared_ptr<GG::Label>  m_stockpile_change_points;
47     std::shared_ptr<GG::Label>  m_stockpile_change_points_P_label;
48     GG::Pt                      m_offset;
49     bool                        m_show_stockpile_limit = false;
50 };
51 
52 class WastedStockpiledResourceBrowseWnd : public GG::BrowseInfoWnd {
53 public:
54     WastedStockpiledResourceBrowseWnd(const std::string& title_text,
55                                       const std::string& unit_label,
56                                       float capacity, float excess,
57                                       bool show_stockpile = false,
58                                       float stockpile_effic = 0.0f,
59                                       float to_stockpile = 0.0f,
60                                       float wasted = 0.0f,
61                                       const std::string& bottom_message = "");
62     void CompleteConstruction() override;
63     bool WndHasBrowseInfo(const Wnd* wnd, std::size_t mode) const override;
64     void Render() override;
65 
66 private:
67     virtual void  InitBuffer();
68 
69     GG::GL2DVertexBuffer        m_buffer;
70     std::shared_ptr<GG::Label>  m_title_text;
71 
72     std::shared_ptr<GG::Label>  m_output_label;
73     std::shared_ptr<GG::Label>  m_output;
74     std::shared_ptr<GG::Label>  m_output_P_label;
75     std::shared_ptr<GG::Label>  m_used_label;
76     std::shared_ptr<GG::Label>  m_used;
77     std::shared_ptr<GG::Label>  m_used_P_label;
78     std::shared_ptr<GG::Label>  m_excess_label;
79     std::shared_ptr<GG::Label>  m_excess;
80     std::shared_ptr<GG::Label>  m_excess_P_label;
81 
82     bool                        m_show_stockpile;
83     std::shared_ptr<GG::Label>  m_stockpile_label;
84     std::shared_ptr<GG::Label>  m_stockpile;
85     std::shared_ptr<GG::Label>  m_stockpile_P_label;
86 
87     std::shared_ptr<GG::Label>  m_wasted_label;
88     std::shared_ptr<GG::Label>  m_wasted;
89     std::shared_ptr<GG::Label>  m_wasted_P_label;
90 
91     std::shared_ptr<GG::Label>  m_bottom_message_text;
92 
93     GG::Pt                      m_offset;
94 };
95 
96 #endif
97