Merge branch 'master' into jgrpp
# Conflicts: # src/lang/russian.txt # src/linkgraph/linkgraph_gui.cpp # src/news_gui.cpp # src/town_cmd.cpp # src/town_gui.cpp
This commit is contained in:
@@ -19,14 +19,19 @@
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* Properties of a link between two stations.
|
||||
* Monthly statistics for a link between two stations.
|
||||
* Only the cargo type of the most saturated linkgraph is taken into account.
|
||||
*/
|
||||
struct LinkProperties {
|
||||
LinkProperties() : capacity(0), usage(0), planned(0), shared(false) {}
|
||||
LinkProperties() : capacity(0), usage(0), planned(0), cargo(CT_INVALID), shared(false) {}
|
||||
|
||||
/** Return the usage of the link to display. */
|
||||
uint Usage() const { return std::max(this->usage, this->planned); }
|
||||
|
||||
uint capacity; ///< Capacity of the link.
|
||||
uint usage; ///< Actual usage of the link.
|
||||
uint planned; ///< Planned usage of the link.
|
||||
CargoID cargo; ///< Cargo type of the link.
|
||||
bool shared; ///< If this is a shared link to be drawn dashed.
|
||||
};
|
||||
|
||||
@@ -74,6 +79,8 @@ public:
|
||||
void SetCargoMask(CargoTypes cargo_mask);
|
||||
void SetCompanyMask(uint32 company_mask);
|
||||
|
||||
bool ShowTooltip(Point pt, TooltipCloseCondition close_cond);
|
||||
|
||||
/** Mark the linkgraph dirty to be rebuilt next time Draw() is called. */
|
||||
void SetDirty() { this->dirty = true; }
|
||||
|
||||
@@ -105,7 +112,7 @@ protected:
|
||||
bool IsPointVisible(Point pt, const DrawPixelInfo *dpi, int padding = 0) const;
|
||||
void GetWidgetDpi(DrawPixelInfo *dpi, uint margin = 0) const;
|
||||
|
||||
static void AddStats(uint new_cap, uint new_usg, uint new_flow, bool new_shared, LinkProperties &cargo);
|
||||
static void AddStats(CargoID new_cargo, uint new_cap, uint new_usg, uint new_flow, bool new_shared, LinkProperties &cargo);
|
||||
static void DrawVertex(int x, int y, int size, int colour, int border_colour);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user