-
Notifications
You must be signed in to change notification settings - Fork 148
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
CBA settings fixes #409
Conversation
- 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; |
There was a problem hiding this comment.
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.
|
If this is added, need to change |
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. |
Sucks to be a Linux/MacOS user I guess lol |
@@ -14,7 +14,7 @@ class Cfg3DEN { | |||
displayName = ""; | |||
tooltip = ""; | |||
defaultValue = QUOTE(NULL_HASH); | |||
expression = QUOTE(missionNamespace setVariable [ARR_3(QUOTE(QGVAR(hash)),_value,true)]); | |||
expression = "" |
There was a problem hiding this comment.
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
Broken merge |
3den expressions don't happen until after preInit
So
_settingsHash
would always be nil inCBA_settings_fnc_init
if you add settings at preInit