Settings - Fix Settings UI checkbox display, code cleanup - #1851
Open
LinkIsGrim wants to merge 4 commits into
Open
Settings - Fix Settings UI checkbox display, code cleanup#1851LinkIsGrim wants to merge 4 commits into
LinkIsGrim wants to merge 4 commits into
Conversation
PabstMirror
approved these changes
Aug 23, 2026
PabstMirror
reviewed
Aug 23, 2026
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
PabstMirror
reviewed
Aug 24, 2026
| if (_source isEqualTo "mission") then { | ||
| // a local only setting has no "overwrite clients" to tick, and a priority | ||
| // ticked in here would be sanitized away again the moment it is saved | ||
| if (_source isEqualTo "mission" && !ROW_IS_LOCAL_ONLY(_controlsGroup)) then { |
Contributor
There was a problem hiding this comment.
hemtt complains about help[L-S19]: Unneeded Not
Suggested change
| if (_source isEqualTo "mission" && !ROW_IS_LOCAL_ONLY(_controlsGroup)) then { | |
| private _isLocalOnly = ROW_IS_LOCAL_ONLY(_controlsGroup); | |
| if (_source isEqualTo "mission" && !_isLocalOnly) then { |
rautamiekka
suggested changes
Aug 24, 2026
| case "TIME": { | ||
| _settingData params ["_min", "_max"]; | ||
| _value isEqualType 0 && {_value >= _min} && {_value <= _max} && {round _value == _value} | ||
| _value isEqualType 0 && {_value >= _min} && {_value <= _max} && {round _value == _value} |
Contributor
There was a problem hiding this comment.
Suggested change
| _value isEqualType 0 && {_value >= _min} && {_value <= _max} && {round _value == _value} | |
| _value isEqualType 0 && {_value >= _min} && {_value <= _max} && {round _value isEqualTo _value} |
| private _enabled = switch (_source) do { | ||
| case "client": {CAN_SET_CLIENT_SETTINGS && {isNil {GVAR(userconfig) getVariable _setting}}}; | ||
| case "mission": {CAN_SET_MISSION_SETTINGS && {isNil {GVAR(missionConfig) getVariable _setting}}}; | ||
| case "mission": {CAN_SET_MISSION_SETTINGS && !_isLocalOnly && {isNil {GVAR(missionConfig) getVariable _setting}}}; |
Contributor
There was a problem hiding this comment.
Suggested change
| case "mission": {CAN_SET_MISSION_SETTINGS && !_isLocalOnly && {isNil {GVAR(missionConfig) getVariable _setting}}}; | |
| case "mission": {CAN_SET_MISSION_SETTINGS && !_isLocalOnly && {GVAR(missionConfig) isNil _setting}}; |
I do see the others use the older way.
Comment on lines
+247
to
+251
| #define IS_GLOBAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] == SETTING_GLOBAL_ONLY) | ||
| #define IS_LOCAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] == SETTING_LOCAL_ONLY) | ||
|
|
||
| // the same question asked of a row, which keeps its setting's _isGlobal | ||
| #define ROW_IS_LOCAL_ONLY(group) ((group getVariable [ARR_2(QGVAR(isGlobal),SETTING_LOCAL_OVERRIDABLE)]) == SETTING_LOCAL_ONLY) |
Contributor
There was a problem hiding this comment.
Suggested change
| #define IS_GLOBAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] == SETTING_GLOBAL_ONLY) | |
| #define IS_LOCAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] == SETTING_LOCAL_ONLY) | |
| // the same question asked of a row, which keeps its setting's _isGlobal | |
| #define ROW_IS_LOCAL_ONLY(group) ((group getVariable [ARR_2(QGVAR(isGlobal),SETTING_LOCAL_OVERRIDABLE)]) == SETTING_LOCAL_ONLY) | |
| #define IS_GLOBAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] isEqualTo SETTING_GLOBAL_ONLY) | |
| #define IS_LOCAL_SETTING(setting) (GVAR(default) getVariable [setting, []] param [7, 0] isEqualTo SETTING_LOCAL_ONLY) | |
| // the same question asked of a row, which keeps its setting's _isGlobal | |
| #define ROW_IS_LOCAL_ONLY(group) ((group getVariable [ARR_2(QGVAR(isGlobal),SETTING_LOCAL_OVERRIDABLE)]) isEqualTo SETTING_LOCAL_ONLY) |
| private _rowOrder = _ctrlOptionsGroup getVariable [QGVAR(rowOrder), []]; | ||
| private _headerIndex = _rowOrder findIf {!isNil {_x getVariable QGVAR(members)}}; | ||
|
|
||
| if (_headerIndex == -1) then { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (_headerIndex == -1) then { | |
| if (_headerIndex isEqualTo -1) then { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
Replace Settings - Fix showing Mission checkboxes when on Mission tab #1839.
Fix the greyed out "Mission" overwrite checkboxes appearing on the Mission and Client tabs after changing category, by putting the checkboxes back after the row's controls group is shown, rather than by skipping the
ctrlShow.Handle other edge cases:
ctrlShow, which shows every control inside it again, so the checkboxes the source doesn't use reappeared.ctrlShow trueon the addons group shows every category built inside it, so all of them were drawn on top of each other, and every row a search or a folded sub-category had hidden came back. Only the selected category is shown now, and its rows are re-filtered once the source is known again.gui_setOverwriteVisibleused toctrlEnable _showunconditionally, undoinggui_setRowEnabledfor a setting locked by userconfig, the mission or the server config. It now only ever takes the enable away, so it can't fightgui_setRowEnabledor the row'supdateUI_prioritywhen it is re-applied.Cleanup:
gui_setOverwriteVisibletakes the row instead of a single checkbox and works both out from the row's own source andisGlobal, so it is repeatable and there is one place that knows which checkboxes a source uses. Removes the duplicated condition ingui_retargetRow.gui_addonChangediterates the options groups hashmap directly instead ofkeys+get.fnc_check.sqfandfnc_gui_addonChanged.sqf.