CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
228 stars 91 forks source link

Update MultiplayerGameLobby controls visibility logic. #318

Open frg2089 opened 2 years ago

frg2089 commented 2 years ago

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.

[MultiplayerGameLobby]
$CC-ChatMessages=ChatMessages:XNAPanel

[ChatMessages]
$X=1
$Y=1
$CC-lbChatMessages=lbChatMessages:ChatListBox

[ChatMessages_Host]
$BaseSection=ChatMessages
Size=100,200
BackgroundTexture=ChatMessagesBorder_Host.png

[ChatMessages_Player]
$BaseSection=ChatMessages
Size=100,100
BackgroundTexture=ChatMessagesBorder_Player.png

On INItializableWindow Initialized. ParseExtraControls() method will create an XNAPanel 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.

github-actions[bot] commented 2 years ago

Nightly build for this pull request: