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

CSW - Rework settings #9901

Merged
merged 10 commits into from
Sep 11, 2024
Merged

CSW - Rework settings #9901

merged 10 commits into from
Sep 11, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Apr 2, 2024

When merged this pull request will:

  • Make it so that the settings don't require a mission restart to take effect.
    When a static weapon is placed down, it either remains a Vanilla weapon or is converted to CSW. If you change GVAR(defaultAssemblyMode) mid-mission, it won't change existing static weapons, but it will change all future ones, which imo doesn't make it require a mission restart.
  • Force GVAR(ammoHandling) on if GVAR(defaultAssemblyMode) is enabled.
  • Make the Check Ammo interaction always available, regardless of ammo handling.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

They aren't entirely separate. If you enable advanced assembly, you need ammo handling to be enabled.
Comment on lines +9 to +23
if (GVAR(defaultAssemblyMode) && GVAR(ammoHandling) == 0) then {
if (isServer) then {
[QGVAR(ammoHandling), 2, 2, "server"] call CBA_settings_fnc_set;
};

// Notify everyone about change
[QEGVAR(common,displayTextStructured), [composeText [
lineBreak,
parseText format [
"<t align='center'>%1</t>", format ["%1 requires %2 to be set higher than 0.", QGVAR(defaultAssemblyMode), QGVAR(ammoHandling)]
],
lineBreak,
parseText format ["<t align='center'>%1</t>", "No mission restart is required."]
], 4]] call CBA_fnc_localEvent;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another solution I had was to use a different set of global variables to use within the scripts. These global variables would copy the CBA settings at mission start, check if the settings are feasible, correct them accordingly and the variables wouldn't be touched after that.

Copy link
Contributor

Choose a reason for hiding this comment

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

What I'm reading is CBA Settings framework could use support for child/dependent settings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely.

@johnb432 johnb432 added the kind/setting Release Notes: **SETTINGS:** label Aug 31, 2024
@johnb432 johnb432 changed the title CSW - Separate advanced assembly and ammo handling settings partially CSW - Rework settings Aug 31, 2024
@johnb432 johnb432 added this to the 3.18.0 milestone Aug 31, 2024
@LinkIsGrim LinkIsGrim merged commit c5935dc into master Sep 11, 2024
4 checks passed
@LinkIsGrim LinkIsGrim deleted the csw-separate-settings branch September 11, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/setting Release Notes: **SETTINGS:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants