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

add optional pbo to load settings from userconfig file #450

Merged
merged 4 commits into from
Aug 6, 2016

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Jul 31, 2016

  • Adds optional PBO that auto loads settings from a settings file
  • Can be used on dedicated servers to have settings that not have to be set via gui (e.g. when the mod is only server side and the settings wouldn't show up for the clients)

userconfig\cba\settings.sqf

@commy2 commy2 added the Feature label Jul 31, 2016
@commy2 commy2 added this to the 3.0.1 milestone Jul 31, 2016
ADDON = false;

// frame after preInit, but before postInit
0 spawn {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be safer and cleaner to have cba launch an event when preInit finishes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks about as safe and clean as it gets - only depends on directCall.

Copy link
Contributor Author

@commy2 commy2 Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would've used CBA_fnc_execNextFrame, but the EachFrame handler that does that is installed at postInit - many frames after preInit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a long shot, but maybe some other mod could conceivably clog the scheduler during preinit, preventing this from running before postInit.

@commy2 commy2 added the WIP label Jul 31, 2016
@commy2 commy2 removed the WIP label Aug 6, 2016
@Killswitch00 Killswitch00 merged commit f0793e1 into master Aug 6, 2016
@Killswitch00 Killswitch00 deleted the optional-file-to-load-userconfig-settings branch August 6, 2016 14:38
@PabstMirror
Copy link
Contributor

@commy2 - this still has no effect on dedicated

CBA_settings_fnc_import just saves the to the temp namespace and then exits

isNull (uiNamespace getVariable ["cba_settings_display", displayNull])
is always going to be true on dedicated and will be true on clients if that menu is closed

@commy2
Copy link
Contributor Author

commy2 commented Aug 6, 2016

It's
!isNull (uiNamespace getVariable [QGVAR(display), displayNull])
and that is not always true.

I'll see about that temp namespace issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants