|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Widget displaying players and allowing selection. More...
#include <PlayerPanel.hpp>
Inheritance diagram for PlayerPanel:
Collaboration diagram for PlayerPanel:Public Member Functions | |
| PlayerPanel ()=default | |
| ~PlayerPanel () override=default | |
| void | setWorld (const WorldState *world) |
| Sets the world state pointer. | |
| void | draw (int scaledFontSize) const override |
| Draws the panel and player list. | |
| bool | handleInput () override |
| Processes mouse clicks on player rows. | |
| std::optional< SelectionFinder::Selection > | getPendingSelection () |
| Gets and clears any pending selection made by the user. | |
| bool | isOpen () const |
| Checks if panel is currently open. | |
| void | setTeamColorFunc (std::function< Color(const std::string &)> func) |
| Sets the team color resolution function. | |
Public Member Functions inherited from IWidget | |
| virtual | ~IWidget ()=default |
Private Attributes | |
| const WorldState * | _world = nullptr |
| bool | _isOpen = false |
| std::optional< SelectionFinder::Selection > | _pendingSelection = std::nullopt |
| std::function< Color(const std::string &)> | _colorFunc |
| TooltipWidget | _background |
| std::vector< ButtonWidget > | _playerButtons |
Static Private Attributes | |
| static constexpr int | PANEL_WIDTH = 400 |
| static constexpr int | ROW_HEIGHT = 36 |
Widget displaying players and allowing selection.
Definition at line 18 of file PlayerPanel.hpp.
|
default |
|
overridedefault |
|
overridevirtual |
Draws the panel and player list.
| scaledFontSize | Base font size for UI scaling. |
Implements IWidget.
Definition at line 78 of file PlayerPanel.cpp.
References _background, _isOpen, _playerButtons, _world, and TooltipWidget::draw().
Referenced by RaylibRenderer::_render2D().
Here is the call graph for this function:
Here is the caller graph for this function:| std::optional< SelectionFinder::Selection > PlayerPanel::getPendingSelection | ( | ) |
Gets and clears any pending selection made by the user.
Definition at line 71 of file PlayerPanel.cpp.
References _pendingSelection.
Referenced by RaylibRenderer::handleInput().
Here is the caller graph for this function:
|
overridevirtual |
Processes mouse clicks on player rows.
Implements IWidget.
Definition at line 9 of file PlayerPanel.cpp.
References _background, _colorFunc, _isOpen, _pendingSelection, _playerButtons, _world, TooltipWidget::addLine(), TooltipWidget::Center, TooltipWidget::clearLines(), I18n::get(), TooltipWidget::getLastBounds(), I18n::PANEL_LVL, I18n::PANEL_PLAYER_LIST, PANEL_WIDTH, SelectionFinder::Player, WorldState::players, ROW_HEIGHT, TooltipWidget::setAnchor(), ButtonWidget::setBorderThickness(), TooltipWidget::setExtraBottomPadding(), ButtonWidget::setLabel(), TooltipWidget::setMinWidth(), ButtonWidget::setOnClick(), ButtonWidget::setPosition(), ButtonWidget::setRoundness(), ButtonWidget::setSize(), and TooltipWidget::setTextAlign().
Referenced by RaylibRenderer::handleInput().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Checks if panel is currently open.
Definition at line 41 of file PlayerPanel.hpp.
References _isOpen.
Referenced by RaylibRenderer::handleInput().
Here is the caller graph for this function:
|
inline |
Sets the team color resolution function.
Definition at line 44 of file PlayerPanel.hpp.
References _colorFunc.
Referenced by RaylibRenderer::_render2D().
Here is the caller graph for this function:| void PlayerPanel::setWorld | ( | const WorldState * | world | ) |
Sets the world state pointer.
| world | Pointer to the current world state. |
Definition at line 7 of file PlayerPanel.cpp.
References _world.
Referenced by RaylibRenderer::_render2D(), and RaylibRenderer::handleInput().
Here is the caller graph for this function:
|
mutableprivate |
Definition at line 55 of file PlayerPanel.hpp.
Referenced by draw(), and handleInput().
|
private |
Definition at line 53 of file PlayerPanel.hpp.
Referenced by handleInput(), and setTeamColorFunc().
|
private |
Definition at line 51 of file PlayerPanel.hpp.
Referenced by draw(), handleInput(), and isOpen().
|
private |
Definition at line 52 of file PlayerPanel.hpp.
Referenced by getPendingSelection(), and handleInput().
|
mutableprivate |
Definition at line 56 of file PlayerPanel.hpp.
Referenced by draw(), and handleInput().
|
private |
Definition at line 50 of file PlayerPanel.hpp.
Referenced by draw(), handleInput(), and setWorld().
|
staticconstexprprivate |
Definition at line 58 of file PlayerPanel.hpp.
Referenced by handleInput().
|
staticconstexprprivate |
Definition at line 59 of file PlayerPanel.hpp.
Referenced by handleInput().