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

CBA settings fixes #409

Merged
merged 1 commit into from
Jul 10, 2016
Merged

CBA settings fixes #409

merged 1 commit into from
Jul 10, 2016

Conversation

PabstMirror
Copy link
Contributor

  • Use getMissionConfigValue instead of broadcasting variable
  • Fix GET_FORCED macro

3den expressions don't happen until after preInit
So _settingsHash would always be nil in CBA_settings_fnc_init if you add settings at preInit

- Use getMissionConfigValue instead of broadcasting variable
- Fix GET_FORCED macro
@@ -141,7 +141,7 @@ if (!isNil "_settingInfo") then {
};

// --- read previous setting values from mission
_settingsHash = missionNamespace getVariable [QGVAR(hash), "Scenario" get3DENMissionAttribute QGVAR(hash)];
_settingsHash = getMissionConfigValue QGVAR(hash);

if (isNil "_settingsHash") then {
_settingsHash = NULL_HASH;
Copy link
Contributor

@commy2 commy2 Jul 7, 2016

Choose a reason for hiding this comment

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

We could use the alternative syntax of getMissionConfigValue to set NULL_HASH as default value.

There is one problem with this though. getMissionConfigValue only reports something if the mission.sqm exists. This means that all mission settings in 3den use default unless you saved the mission once.

While this makes no difference when previewing the mission (every mission settings use default there currently too), it means that when returning from preview the actual temporary mission settings and what is shown in the settings menu becomes desynched.

test:
getMissionConfigValue "cba_settings_hash"
vs.
"Scenario" get3DENMissionAttribute "cba_settings_hash"

This could be detected with missionName (will report "tempMissionSP" and "tempMissionMP" in MP 3den, as well as "" before the first preview).

We could store another copy of these settings in ui namespace if the mission was never saved. idk if that's worth it though.

@commy2 commy2 added this to the 2.4.2 milestone Jul 8, 2016
@shadez95
Copy link
Contributor

shadez95 commented Jul 9, 2016

getMissionConfigValue will not work for Linux users. Linux users are still on 1.54 I think. Refer to this for when an experimental port is released https://forums.bistudio.com/topic/188937-experimental-ports-release-announcements/

@shadez95
Copy link
Contributor

shadez95 commented Jul 9, 2016

If this is added, need to change REQUIRED_VERSION. Just saw other PR's and stuff. Yeah probably just change REQUIRED_VERSION.

@commy2
Copy link
Contributor

commy2 commented Jul 9, 2016

The functions in the settings component are only compiled on the windows version. There is no script error pop ups or anything. The feature will simply not work on the Linux/MacOS build.

@shadez95
Copy link
Contributor

shadez95 commented Jul 9, 2016

Sucks to be a Linux/MacOS user I guess lol

@commy2 commy2 merged commit 19387a2 into master Jul 10, 2016
@commy2 commy2 deleted the fixSettings branch July 10, 2016 04:16
@@ -14,7 +14,7 @@ class Cfg3DEN {
displayName = "";
tooltip = "";
defaultValue = QUOTE(NULL_HASH);
expression = QUOTE(missionNamespace setVariable [ARR_3(QUOTE(QGVAR(hash)),_value,true)]);
expression = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon at the end

@Killswitch00
Copy link
Contributor

Broken merge

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