early-access version 3361

This commit is contained in:
pineappleEA 2023-02-03 07:35:09 +01:00
parent d869fd25b4
commit 8a382bd53d
4 changed files with 26 additions and 1 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3360. This is the source code for early-access 3361.
## Legal Notice ## Legal Notice

View file

@ -77,6 +77,7 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
// UI Buttons // UI Buttons
connect(ui->refresh_list, &QPushButton::clicked, this, &Lobby::RefreshLobby); connect(ui->refresh_list, &QPushButton::clicked, this, &Lobby::RefreshLobby);
connect(ui->games_owned, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterOwned); connect(ui->games_owned, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterOwned);
connect(ui->hide_empty, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterEmpty);
connect(ui->hide_full, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterFull); connect(ui->hide_full, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterFull);
connect(ui->search, &QLineEdit::textChanged, proxy, &LobbyFilterProxyModel::SetFilterSearch); connect(ui->search, &QLineEdit::textChanged, proxy, &LobbyFilterProxyModel::SetFilterSearch);
connect(ui->room_list, &QTreeView::doubleClicked, this, &Lobby::OnJoinRoom); connect(ui->room_list, &QTreeView::doubleClicked, this, &Lobby::OnJoinRoom);
@ -329,6 +330,16 @@ bool LobbyFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
return true; return true;
} }
// filter by empty rooms
if (filter_empty) {
QModelIndex member_list = sourceModel()->index(sourceRow, Column::MEMBER, sourceParent);
int player_count =
sourceModel()->data(member_list, LobbyItemMemberList::MemberListRole).toList().size();
if (player_count == 0) {
return false;
}
}
// filter by filled rooms // filter by filled rooms
if (filter_full) { if (filter_full) {
QModelIndex member_list = sourceModel()->index(sourceRow, Column::MEMBER, sourceParent); QModelIndex member_list = sourceModel()->index(sourceRow, Column::MEMBER, sourceParent);
@ -399,6 +410,11 @@ void LobbyFilterProxyModel::SetFilterOwned(bool filter) {
invalidate(); invalidate();
} }
void LobbyFilterProxyModel::SetFilterEmpty(bool filter) {
filter_empty = filter;
invalidate();
}
void LobbyFilterProxyModel::SetFilterFull(bool filter) { void LobbyFilterProxyModel::SetFilterFull(bool filter) {
filter_full = filter; filter_full = filter;
invalidate(); invalidate();

View file

@ -130,12 +130,14 @@ public:
public slots: public slots:
void SetFilterOwned(bool); void SetFilterOwned(bool);
void SetFilterEmpty(bool);
void SetFilterFull(bool); void SetFilterFull(bool);
void SetFilterSearch(const QString&); void SetFilterSearch(const QString&);
private: private:
QStandardItemModel* game_list; QStandardItemModel* game_list;
bool filter_owned = false; bool filter_owned = false;
bool filter_empty = false;
bool filter_full = false; bool filter_full = false;
QString filter_search; QString filter_search;
}; };

View file

@ -77,6 +77,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="hide_empty">
<property name="text">
<string>Hide Empty Rooms</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="hide_full"> <widget class="QCheckBox" name="hide_full">
<property name="text"> <property name="text">