atrooney-online-2/src/widgets/playerlistwidget.h
Salanto fb64ca386c
Add playerlist widget element (#996)
* Commit

* Boyfailure code commit

* Cooking code spaghetti

* Accidental overwrite recursive function call hell

* Implemented player list

* Add partial moderator widget

Sleepy time! Hee-Hoo!

* Moderator Dialog - Step 1 - WIP

* Appease the clang gods

* Clang appeasement policy

* *sacrifices goat to clang*

* Added player report, reworked implementation, ...

* Added player-specific report
* Reworked implementation
  * No longer uses JSON.
* Removed preset loader.

---------

Co-authored-by: TrickyLeifa <date.epoch@gmail.com>
Co-authored-by: Leifa <26681464+TrickyLeifa@users.noreply.github.com>
2024-07-12 11:48:01 +02:00

37 lines
800 B
C++

#pragma once
#include "datatypes.h"
#include <QList>
#include <QListWidget>
#include <QMap>
class AOApplication;
class PlayerListWidget : public QListWidget
{
public:
explicit PlayerListWidget(AOApplication *ao_app, QWidget *parent = nullptr);
virtual ~PlayerListWidget();
void registerPlayer(const PlayerRegister &update);
void updatePlayer(const PlayerUpdate &update);
void setAuthenticated(bool f_state);
private:
AOApplication *ao_app;
QMap<int, PlayerData> m_player_map;
QMap<int, QListWidgetItem *> m_item_map;
bool m_is_authenticated = false;
void addPlayer(int playerId);
void removePlayer(int playerId);
void updatePlayer(int playerId, bool updateIcon);
void filterPlayerList();
private Q_SLOTS:
void onCustomContextMenuRequested(const QPoint &pos);
};