xna-cncnet-client icon indicating copy to clipboard operation
xna-cncnet-client copied to clipboard

Modify GameInformationPanel to optionally display as an invite

Open 11EJDE11 opened this issue 11 months ago • 10 comments

Currently when you receive an invite to join a game, you can only get information about the game host and game name. This PR modifies game invite requests to show as a GameInformationPanel instead of ChoiceNotificationBox so you get the nice map thumbnail and all the other information that is normally shown about a game.

It adds Accept/Decline buttons to the GameInformationPanel which are visible if [panel].IsInvite is set.

image

First timer here so apologies if I am going about this incorrectly.

11EJDE11 avatar Jan 09 '25 02:01 11EJDE11

I'm also a first timer but damn this looks nice. Maybe place the buttons farther from each other or all the way in the left and right corners?

Saint146 avatar Jan 09 '25 13:01 Saint146

Transmitting this on behalf of @Rampastring who doesn't have convenient access to GitHub at the moment:

Could be done better by creating a game invitation panel/window that has the game information panel as a child

Metadorius avatar Jan 09 '25 15:01 Metadorius

Nightly build for this pull request:

github-actions[bot] avatar Jan 09 '25 15:01 github-actions[bot]

Thanks for the feedback Saint, Meta, and Rampa. A game invitation panel makes much more sense. I have made the requested changes.

A bug has also been fixed where if you accept an invite to a game lobby that you are already a part of, it will no longer leave lobby and attempt to join again. Previously this would quite often fail.

There is a slight change to the layout from my last commit: image

11EJDE11 avatar Jan 09 '25 23:01 11EJDE11

Hey, @11EJDE11! A pro tip about GitHub:

To quickly incorporate more than one suggested change into a single commit, you can also apply suggested changes as a batch. ...

from: Reviewing proposed changes in a pull request - GitHub Docs

pzhlkj6612 avatar Jan 10 '25 14:01 pzhlkj6612

Thanks for the review, Metadorius.

  1. Regarding the INIs - not too sure if they can be customised through there. I'm not calling ReadINIForControl so I assume not? I don't believe it was doing anything with the INIs before though either.

  2. Alpha stuff was a leftover. I've removed it now.

3.1) I have made a change so the panel will update when the game information updates.

3.2) The invite will disappear if the game has closed or the host is offline.

I've removed the border from the inner panel and have added the invitee's name back in (note: invites can only be from hosts and the host name is already on the inner panel).

Also I am new to Github and all this jazz - do I click Resolve Conversations on the ones above? I have switched to nameof as you suggested, and I am now using the button constants for size. There is no constant I could see for the padding amount so I have copied the amount from another area that had padding.

And thanks pzhlkj6612 - I could have sworn that was greyed out! Please keep the tips coming; I need them. Pretty sure I've done the last commit a bit weird. Not sure why there is a second one for changing the map to readonly. When I pushed it said I was behind so had to update to the latest branch. Did that and there was a conflict, chose the newer/local copy and then it put that one line into another commit. Pushed that and here we are.

New panel: image

11EJDE11 avatar Jan 11 '25 00:01 11EJDE11

@11EJDE11 You're welcome!

Regarding the INIs - not too sure if they can be customised through there. I'm not calling ReadINIForControl so I assume not? I don't believe it was doing anything with the INIs before though either.

This should be done. Generally the point is to have all of the client customizable since there are many users (as in modders and game maintainers) who use it and they all have different customization needs. , For example, look at GameCreationWindow -- it is customizable via INI.

I am not sure if I am a fan of combining title that is all in caps and the username.

do I click Resolve Conversations on the ones above?

Yeah.

There is no constant I could see for the padding amount so I have copied the amount from another area that had padding.

I propose to introduce one. It is used in GameInformationPanel as well.

I could have sworn that was greyed out!

That's the GitHub unintuitivity for you. It is only available in the files tab.

Metadorius avatar Jan 11 '25 16:01 Metadorius

Regarding the INIs ...

... who use it and they all have different customization needs. ...

Another example is, I'd like to hide the "GAME INFORMATION" line in the dialog. I can achieve it easily if you provide INI-ish way to customize it.

pzhlkj6612 avatar Jan 11 '25 18:01 pzhlkj6612

Any progress on this?

Metadorius avatar May 04 '25 11:05 Metadorius

Will take another look.

11EJDE11 avatar May 04 '25 13:05 11EJDE11