Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
54ab1546
There was an error fetching the commit references. Please try again later.
Commit
54ab1546
authored
2 years ago
by
Luke Sawczak
Committed by
Narr the Reg
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added 'Hide empty rooms' toggle to lobby
fixed typo fixed typo fixed typo clang
parent
8a33f8bd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/yuzu/multiplayer/lobby.cpp
+16
-0
16 additions, 0 deletions
src/yuzu/multiplayer/lobby.cpp
src/yuzu/multiplayer/lobby.h
+2
-0
2 additions, 0 deletions
src/yuzu/multiplayer/lobby.h
src/yuzu/multiplayer/lobby.ui
+7
-0
7 additions, 0 deletions
src/yuzu/multiplayer/lobby.ui
with
25 additions
and
0 deletions
src/yuzu/multiplayer/lobby.cpp
+
16
−
0
View file @
54ab1546
...
...
@@ -77,6 +77,7 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
// UI Buttons
connect
(
ui
->
refresh_list
,
&
QPushButton
::
clicked
,
this
,
&
Lobby
::
RefreshLobby
);
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
->
search
,
&
QLineEdit
::
textChanged
,
proxy
,
&
LobbyFilterProxyModel
::
SetFilterSearch
);
connect
(
ui
->
room_list
,
&
QTreeView
::
doubleClicked
,
this
,
&
Lobby
::
OnJoinRoom
);
...
...
@@ -329,6 +330,16 @@ bool LobbyFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
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
if
(
filter_full
)
{
QModelIndex
member_list
=
sourceModel
()
->
index
(
sourceRow
,
Column
::
MEMBER
,
sourceParent
);
...
...
@@ -399,6 +410,11 @@ void LobbyFilterProxyModel::SetFilterOwned(bool filter) {
invalidate
();
}
void
LobbyFilterProxyModel
::
SetFilterEmpty
(
bool
filter
)
{
filter_empty
=
filter
;
invalidate
();
}
void
LobbyFilterProxyModel
::
SetFilterFull
(
bool
filter
)
{
filter_full
=
filter
;
invalidate
();
...
...
This diff is collapsed.
Click to expand it.
src/yuzu/multiplayer/lobby.h
+
2
−
0
View file @
54ab1546
...
...
@@ -130,12 +130,14 @@ public:
public
slots
:
void
SetFilterOwned
(
bool
);
void
SetFilterEmpty
(
bool
);
void
SetFilterFull
(
bool
);
void
SetFilterSearch
(
const
QString
&
);
private:
QStandardItemModel
*
game_list
;
bool
filter_owned
=
false
;
bool
filter_empty
=
false
;
bool
filter_full
=
false
;
QString
filter_search
;
};
This diff is collapsed.
Click to expand it.
src/yuzu/multiplayer/lobby.ui
+
7
−
0
View file @
54ab1546
...
...
@@ -77,6 +77,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"hide_empty"
>
<property
name=
"text"
>
<string>
Hide Empty Rooms
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"hide_full"
>
<property
name=
"text"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment