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

Allow INItializableWindow buttons/checkboxes to toggle visibility of other controls

Open Starkku opened this issue 2 years ago • 4 comments

Closes #775

  • It is now possible to set $Toggles on XNAButton or XNACheckBox & derivatives that are children of INItializableWindow. What this does is make the button/checkbox toggle visibility of the listed controls. Main use case would be additional panels for game options to conserve space where needed.

Starkku avatar Aug 30 '23 16:08 Starkku

Nightly build for this pull request:

github-actions[bot] avatar Aug 30 '23 16:08 github-actions[bot]

Since this PR has almost 1 year old I merged latest sources and this PR in a local repository for testing this variable $ToggleableControl that is mentioned in the main message and seems very useful. I have declared both controls in;

[GameLobbyBase]
...
$CC29=SuperWeaponsOptionsPanel:XNAExtraPanel ;PlayerExtraOptionsPanel
$CC30=btnSuperWeaponsOptionsOpen:XNAClientButton

Then:

[btnSuperWeaponsOptionsOpen]
...
$ToggleableControl=SuperWeaponsOptionsPanel

[SuperWeaponsOptionsPanel]
$Width=400
$Height=200
$X=0
$Y=0; - LABEL_SPACING - DEFAULT_LBL_HEIGHT + 100
SolidColorBackgroundTexture=0,0,0,128
DrawMode=Stretched
BackgroundTexture=50.png

And works very well in this panel example :-D

new xna-client-feature-01

FS-21 avatar Jul 19 '24 14:07 FS-21