• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 44076625557

17 Nov 2026 11:43AM UTC coverage: 51.803% (-0.002%) from 51.805%
44076625557

push

github

web-flow
Merge pull request #2018 from Return-To-The-Roots/refactor/lowerCamelCase-methods

Rename Msg_* handlers to lowerCamelCase

8121 of 16693 new or added lines in 565 files covered. (48.65%)

323 existing lines in 133 files now uncovered.

24236 of 46785 relevant lines covered (51.8%)

49647.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.89
/libs/s25main/controls/ctrlBuildingIcon.cpp
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#include "ctrlBuildingIcon.h"
6
#include "Loader.h"
7
#include "driver/MouseCoords.h"
8
#include "files.h"
9
#include "ogl/glArchivItem_Bitmap.h"
10
#include "gameTypes/BuildingType.h"
11
#include <string>
12

13
ctrlBuildingIcon::ctrlBuildingIcon(Window* const parent, const unsigned id, const DrawPoint& pos,
70 ✔
14
                                   const BuildingType type, const Nation nation, const unsigned short size,
15
                                   const std::string& tooltip)
70 ✔
16
    : ctrlButton(parent, id, pos, Extent(size, size), TextureColor::Grey, tooltip), type(type), nation(nation)
70 ✔
17
{}
70 ✔
18

19
/**
20
 *  zeichnet das Fenster.
21
 */
NEW
22
void ctrlBuildingIcon::drawImpl()
×
23
{
24
    if(state == ButtonState::Hover || state == ButtonState::Pressed)
×
NEW
25
        LOADER.getImageN("io", 0)->drawPart(getDrawRect());
×
NEW
26
    glArchivItem_Bitmap* image = LOADER.getNationIcon(nation, type);
×
27
    if(image)
×
NEW
28
        image->drawFull(getDrawPos() + getSize() / 2, (state == ButtonState::Pressed ? COLOR_YELLOW : COLOR_WHITE));
×
29
}
×
30

NEW
31
void ctrlBuildingIcon::drawContent() const {}
×
32

33
bool ctrlBuildingIcon::msgMouseMove(const MouseCoords& mc)
83 ✔
34
{
35
    const bool wasHovered = (state == ButtonState::Hover);
83 ✔
36
    const bool result = ctrlButton::msgMouseMove(mc);
83 ✔
37
    const bool nowHovered = (state == ButtonState::Hover);
83 ✔
38
    if(wasHovered != nowHovered && onHoverChanged_)
83 ✔
39
        onHoverChanged_(nowHovered);
5 ✔
40
    return result;
83 ✔
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc