CnCNet / xna-cncnet-client

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

Add campaign group selector #370

Open SadPencil opened 1 year ago

SadPencil commented 1 year ago

This PR is backward compatible as by default the option is off. Modders can enable the CampaignTagSelectorEnabled option to use this feature.

This feature enables modders to make a "choose your side" interface before the campaign selector. Choosing among "Act 1/Act 2/..." or any other tags is also possible.

The screenshot below shows the feature. (I am not an expert in beautifying user interfaces so it is only a working example. Fully configurable through ini files.)

img1 img2 img3

The modders define tags for missions in battle.ini and customize the selector window in CampaignTagSelector.ini using the new INItializableWindow ini format.

I use TSC v6 client as an example. The corresponding files are attached here.

TSC.v6.example.zip


Prerequisite of this PR: #364 (merged now) and #367 (requesting merge).

github-actions[bot] commented 1 year ago

Nightly build for this pull request:

SadPencil commented 1 year ago

Ready for review now. Prerequisite #367.

Rampastring commented 1 year ago

I'm not a fan of the design where the Battle.ini is constantly re-read and re-parsed here.

I'd rather read Battle.ini only once, have all the missions in the Missions list, and filter what is actually displayed in the list.

Metadorius commented 1 year ago

Actually wouldn't it be better to have one INI per window? So separate screens would have different Battle.ini alternatives.

Rampastring commented 1 year ago

I think the single file gives more control when it comes to the "Show All" view.

SadPencil commented 1 year ago

I'm not a fan of the design where the Battle.ini is constantly re-read and re-parsed here.

I'd rather read Battle.ini only once, have all the missions in the Missions list, and filter what is actually displayed in the list.

Thanks for the suggestion. Code updated.