Skip to content

Commit

Permalink
use custom OK button to fix ui bug (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
commy2 committed Nov 21, 2018
1 parent e6b8155 commit 9ccfe59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions addons/settings/fnc_initDisplayGameOptions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,4 @@ _ctrlButtonExport ctrlAddEventHandler ["ButtonClick", {
(_display displayCtrl IDC_BTN_CONFIGURE_ADDONS) ctrlAddEventHandler ["ButtonClick", {_this call FUNC(gui_configure)}];

// ----- scripted OK button
(_display displayCtrl 999) ctrlAddEventHandler ["ButtonClick", {
call FUNC(gui_saveTempData);
ctrlParent (_this select 0) closeDisplay IDC_OK;
}];
(_display displayCtrl 999) ctrlAddEventHandler ["ButtonClick", {call FUNC(gui_saveTempData)}];
10 changes: 10 additions & 0 deletions addons/settings/fnc_openSettingsMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ _ctrlConfigureAddons call FUNC(gui_configure);
_ctrlConfigureAddons ctrlEnable false;
_ctrlConfigureAddons ctrlShow false;

// replace BI's broken OK button with our own to fix https://github.com/CBATeam/CBA_A3/issues/1027
private _ctrlScriptedOK = _dlgSettings displayCtrl 999;
_ctrlScriptedOK ctrlEnable false;
_ctrlScriptedOK ctrlShow false;

private _ctrlConfirm = _dlgSettings ctrlCreate ["RscButtonMenuOK", IDC_CANCEL];
_ctrlConfirm ctrlSetPosition ctrlPosition _ctrlScriptedOK;
_ctrlConfirm ctrlCommit 0;
_ctrlConfirm ctrlAddEventHandler ["ButtonClick", {call FUNC(gui_saveTempData)}];

// then switch right to missions tab if in 3den
if (ctrlIDD _display isEqualTo 313) then {
private _ctrlMissionButton = _dlgSettings displayCtrl IDC_BTN_MISSION;
Expand Down

0 comments on commit 9ccfe59

Please sign in to comment.