X2CommunityCore / X2CommunityHighlander

MIT License
7 stars 3 forks source link

Expand XComCharacterCustomization, UICustomize to allow mod-added categories #266

Open robojumper opened 7 years ago

robojumper commented 7 years ago

The UICustomize classes (UICustomize_Info, UICustomize_Menu, UICustomize_Props) need a hook in UpdateData to allow mods to add custom entries, similar to #164.

XComCharacterCustomization is a bridge between UI and content, and needs to be expanded to handle custom categories. In the base game, this is communicated via an enum, EUICustomizeCategory, but ut's always passed as an int (not that it matters much, enum = byte). Effectively, the only place where this enum matters is XComCharacterCustomization. Thus, mods can just use custom indizes, provided XComCharacterCustomization uses callbacks if it doesn't know what to do with a given index (it wouldn't hurt to also call these if the index is a base game one, for moddability). A centralized place to distribute indizes to mods would be needed to make it easier for mods to add new parts without conflicting.

robojumper commented 7 years ago

The changes to XComCharacterCustomization can be kept minimal if overriding existing behavior is not a requirement, since mods can just provide their own callbacks for List Items and call the generic functions in XComCharacterCustomization that already operate on a content part type basis (string).

This would also eliminate the need for custom indizes.