-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update MultiplayerGameLobby controls visibility logic. #318
base: develop
Are you sure you want to change the base?
Conversation
Nightly build for this pull request:
|
1b28b1a
to
58f8aa0
Compare
58f8aa0
to
c6a54ac
Compare
c6a54ac
to
8bccb29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nitpicks. I am not quite sure this is the direction we want to take (with hardcoded suffixes and handling only the very special case of map list visibility), I would prefer a more generalized solution. But the execution of that idea is more or less fine.
@Rampastring what's your opinion? Basically the code is very specific to this case and introduces INI behavior based on section names, which is only tied to map box being shown or not.
ddGameModeMapFilter.Enable(); | ||
lblGameModeSelect.Enable(); | ||
lbGameModeMapList.Enable(); | ||
tbMapSearch.Enable(); | ||
btnPickRandomMap.Enable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you forgot btnMapSortAlphabetically
. Also wouldn't tunnel selection button need to be handled too at CnCNet game lobby? Maybe would be good to have this function as protected virtual?
DXMainClient/DXGUI/Multiplayer/GameLobby/MultiplayerGameLobby.cs
Outdated
Show resolved
Hide resolved
sourceSuffix = "_Player"; | ||
targetSuffix = "_Host"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make those consts at class level.
DXMainClient/DXGUI/Multiplayer/GameLobby/MultiplayerGameLobby.cs
Outdated
Show resolved
Hide resolved
/// Change MapList and other controls visibility. | ||
/// </summary> | ||
/// <param name="isHost">Visibility</param> | ||
private void ChangeMapListAndOtherControlsVisibility(bool isHost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fond of the name, needs something more concise.
s => ChangeMapListAndOtherControlsVisibility(false)), | ||
new ChatBoxCommand("SHOWMAPS", "Show map list (game host only)".L10N("UI:Main:ChatboxCommandShowMapsHelp"), true, | ||
s => ShowMapList()), | ||
s => ChangeMapListAndOtherControlsVisibility(true)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're mixing two things. The prefixes you have and the bool you use as a parameter suggest differentiation between host and player, yet you're mixing this with map list hidden or shown.
f9862e5
to
3bb9360
Compare
f577488
to
a2f047d
Compare
Signed-off-by: 舰队的偶像-岛风酱! <[email protected]>
a2f047d
to
5866048
Compare
This will provide more flexible control visibility support.
Applying different styles depending on the suffix will no longer be limited to "lbChatMessages" and "tbChatInput" controls.
Now we can write INI like this.
On
INItializableWindow
Initialized.ParseExtraControls()
method will create anXNAPanel
named ChatMessages.Then the
Refresh()
method will be called when creating a game or joining a game.The ChatMessages control will be renamed to ChatMessages_Host or ChatMessages_Player via the
IsHost
field. and reload its properties.