Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile config extensions #560

Open
wants to merge 1 commit into
base: port
Choose a base branch
from

Conversation

cylonicboom
Copy link

@cylonicboom cylonicboom commented Dec 19, 2024

Motivation

Extend the config file properties to bind properties the save files themselves. This Proof of Concept is setup for MP Profiles (Combat Simulator or CS) and to bind the Handicap setting directly to the profile itself without modifying the binary save file.

Approach - Profile Extensions Proof of Concept

Introduced new structures (struct extplayerprofile and struct extplayerprop) to encapsulate extended player profile properties. A save-specific key prefix is generated as : MpPlayer.x%-x%., fileguid.deviceserial, fileguid.fileid This approach can be extended to other save file types (game file, mp setup, bss, perfect head) and/or to associate mod-specific properties with a particular save type.

During config file initialization: fileguid like slugs are detected from the ini and a struct configentry is added to settings and the pointer is registered to an internal extended player profile table struct extplayerprofile as a new element of g_ExtendedPlayerProfiles.

When the CS file is actually loaded for the first time during the session mpExtendedProfileRegister is called w/ a parameter to actually bind the config entry to the extended profile store.

During CS file transitions the initfunc for all properties is called to ensure the right values are bound to the extended profile store / config entry.

Removed uncalled functions and hooked in config extensions into MP save / loading flow.

Related changes

@cylonicboom
Copy link
Author

The function rename is implemented elsewhere as #561

When that's merged this PR should be rebased.

@cylonicboom
Copy link
Author

Here's what this looks like in your ini:

Screenshot 2024-12-19 at 09 28 45

@cylonicboom cylonicboom force-pushed the profile-config-extensions branch from 4816c51 to 016168b Compare December 20, 2024 04:37
Initial commit: saving / loading props associated with mp profile works

initial commit: setup extended profiles right away in case they're

loaded from pak and so they can be saved to the ini

blank profile gets set correctly, but not associated yet

sane defaults, auto-inits on load

TODO:
- handle save-as-copy
- handie save new file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant