MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / Draw

Method Draw

src/New/Type/DigitalDisplayTypeClass.cpp:43–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void DigitalDisplayTypeClass::Draw(Point2D position, int length, int value, int maxValue, bool isBuilding, bool isInfantry, bool hasShield)
44{
45 position.X += Offset.Get().X;
46 position.Y += Offset.Get().Y;
47
48 if (hasShield)
49 {
50 if (Offset_ShieldDelta.isset())
51 {
52 position.X += Offset_ShieldDelta.Get().X;
53 position.Y += Offset_ShieldDelta.Get().Y;
54 }
55 else if (InfoType == DisplayInfoType::Shield)
56 {
57 position.Y -= 10; //default
58 }
59 }
60
61 if (isBuilding)
62 {
63 if (AnchorType_Building == BuildingSelectBracketPosition::Top)
64 position.Y -= 4; //Building's pips height
65 else if (AnchorType_Building == BuildingSelectBracketPosition::LeftTop || AnchorType_Building == BuildingSelectBracketPosition::LeftBottom)
66 position.X -= 8; //anchor to the left border of pips
67 }
68
69 if (Shape != nullptr)
70 DisplayShape(position, length, value, maxValue, isBuilding, isInfantry, hasShield);
71 else
72 DisplayText(position, length, value, maxValue, isBuilding, isInfantry, hasShield);
73}
74
75void DigitalDisplayTypeClass::DisplayText(Point2D& position, int length, int value, int maxValue, bool isBuilding, bool isInfantry, bool hasShield)
76{

Callers 1

Calls 2

issetMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected