General - Cleanup event capitalization (#10062)

This commit is contained in:
PabstMirror 2024-06-11 10:00:50 -05:00 committed by GitHub
parent 9760095c42
commit 898daff7f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 23 additions and 23 deletions

View File

@ -18,7 +18,7 @@
(_this select 1) params ["", "_exitCode"]; (_this select 1) params ["", "_exitCode"];
[QGVAR(displayClosed), []] call CBA_fnc_localEvent; [QGVAR(displayClosed), []] call CBA_fnc_localEvent;
removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)]; removeMissionEventHandler ["Draw3D", GVAR(camPosUpdateHandle)];
if (is3DEN) then { if (is3DEN) then {
private _centerOriginParent = objectParent GVAR(centerOrigin); private _centerOriginParent = objectParent GVAR(centerOrigin);

View File

@ -278,4 +278,4 @@ showCinemaBorder false;
//--------------- Reset camera pos //--------------- Reset camera pos
[nil, [controlNull, 0, 0]] call FUNC(handleMouse); [nil, [controlNull, 0, 0]] call FUNC(handleMouse);
GVAR(camPosUpdateHandle) = addMissionEventHandler ["draw3D", {call FUNC(updateCamPos)}]; GVAR(camPosUpdateHandle) = addMissionEventHandler ["Draw3D", {call FUNC(updateCamPos)}];

View File

@ -63,7 +63,7 @@ _target switchMove "amovpercmstpslowwrfldnon";
_target setVariable ["origin", _position]; _target setVariable ["origin", _position];
// When killed, respawn AI // When killed, respawn AI
_target addEventHandler ["killed", { _target addEventHandler ["Killed", {
params ["_target"]; params ["_target"];
// Killed may fire twice, 2nd will be null - https://github.com/acemod/ACE3/pull/7561 // Killed may fire twice, 2nd will be null - https://github.com/acemod/ACE3/pull/7561

View File

@ -137,11 +137,11 @@ if (_onCancel isEqualTo {}) then {
ctrlSetFocus _ctrlButtonCancel; ctrlSetFocus _ctrlButtonCancel;
}; };
_ctrlButtonOK ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}];
_ctrlButtonCancel ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; _ctrlButtonCancel ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}];
GVAR(errorOnOK) = _onOK; GVAR(errorOnOK) = _onOK;
GVAR(errorOnCancel) = _onCancel; GVAR(errorOnCancel) = _onCancel;
_display displayAddEventHandler ["unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; _display displayAddEventHandler ["Unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}];
_display displayAddEventHandler ["keyDown", {_this select 1 == 1}]; _display displayAddEventHandler ["KeyDown", {_this select 1 == 1}];

View File

@ -50,7 +50,7 @@ ctrlMapAnimCommit _map;
// add drawEH to draw markers next update (they will get drawn 3 times total) // add drawEH to draw markers next update (they will get drawn 3 times total)
_map setVariable ["markers", _markers]; _map setVariable ["markers", _markers];
_map ctrlAddEventHandler ["draw", { _map ctrlAddEventHandler ["Draw", {
params ["_map"]; params ["_map"];
private _markers = _map getVariable ["markers", []]; private _markers = _map getVariable ["markers", []];
TRACE_2("drawing markers",_map,count _markers); TRACE_2("drawing markers",_map,count _markers);

View File

@ -28,7 +28,7 @@ TRACE_6("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_injurer,_oldDamage,_
if !(alive _vehicle) exitWith { if !(alive _vehicle) exitWith {
private _eventHandler = _vehicle getVariable[QGVAR(handleDamage), nil]; private _eventHandler = _vehicle getVariable[QGVAR(handleDamage), nil];
if !(isNil "_eventHandler") then { if !(isNil "_eventHandler") then {
_vehicle removeEventHandler ["handleDamage", _eventHandler]; _vehicle removeEventHandler ["HandleDamage", _eventHandler];
}; };
LOG_1("Vehicle [%1] no longer alive",_vehicle); LOG_1("Vehicle [%1] no longer alive",_vehicle);
true true

View File

@ -5,7 +5,7 @@
// cannot create checkboxes which have the default value "true" // cannot create checkboxes which have the default value "true"
// 3den uses inverted checkboxes instead, but those only change in appearence // 3den uses inverted checkboxes instead, but those only change in appearence
// we have to auto set these settings manually - on mission creation // we have to auto set these settings manually - on mission creation
add3DENEventHandler ["onMissionNew", { add3DENEventHandler ["OnMissionNew", {
set3DENMissionAttributes [ set3DENMissionAttributes [
["Intel", "IntelWavesIsForced", true], ["Intel", "IntelWavesIsForced", true],
["Intel", "IntelWindIsForced", true] ["Intel", "IntelWindIsForced", true]

View File

@ -113,9 +113,9 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw",
} else { } else {
TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH)); TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH));
(_this select 1) call CBA_fnc_removePerFrameHandler; (_this select 1) call CBA_fnc_removePerFrameHandler;
(findDisplay 312) displayRemoveEventHandler ["mouseButtonDown", GVAR(moduleDestination_displayEHMouse)]; (findDisplay 312) displayRemoveEventHandler ["MouseButtonDown", GVAR(moduleDestination_displayEHMouse)];
(findDisplay 312) displayRemoveEventHandler ["KeyDown", GVAR(moduleDestination_displayEHKeyboard)]; (findDisplay 312) displayRemoveEventHandler ["KeyDown", GVAR(moduleDestination_displayEHKeyboard)];
((findDisplay 312) displayCtrl 50) ctrlRemoveEventHandler ["draw", GVAR(moduleDestination_mapDrawEH)]; ((findDisplay 312) displayCtrl 50) ctrlRemoveEventHandler ["Draw", GVAR(moduleDestination_mapDrawEH)];
GVAR(moduleDestination_displayEHMouse) = nil; GVAR(moduleDestination_displayEHMouse) = nil;
GVAR(moduleDestination_displayEHKeyboard) = nil; GVAR(moduleDestination_displayEHKeyboard) = nil;
GVAR(moduleDestination_mapDrawEH) = nil; GVAR(moduleDestination_mapDrawEH) = nil;

View File

@ -24,7 +24,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
TRACE_1("logicObject",_logic); TRACE_1("logicObject",_logic);
_control ctrlRemoveAllEventHandlers "setFocus"; _control ctrlRemoveAllEventHandlers "SetFocus";
//Specific on-load stuff: //Specific on-load stuff:
private _fnc_sliderMove = { private _fnc_sliderMove = {
@ -74,5 +74,5 @@ private _fnc_onConfirm = {
[QGVAR(GlobalSkillAI),GVAR(GlobalSkillAI)] call FUNC(moduleGlobalSetSkill); [QGVAR(GlobalSkillAI),GVAR(GlobalSkillAI)] call FUNC(moduleGlobalSetSkill);
}; };
_display displayAddEventHandler ["unload", _fnc_onUnload]; _display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];

View File

@ -24,7 +24,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
TRACE_1("logicObject",_logic); TRACE_1("logicObject",_logic);
_control ctrlRemoveAllEventHandlers "setFocus"; _control ctrlRemoveAllEventHandlers "SetFocus";
//Validate the module target: //Validate the module target:
private _unit = effectiveCommander (attachedTo _logic); private _unit = effectiveCommander (attachedTo _logic);
@ -101,7 +101,7 @@ private _fnc_onSelection = {
_ctrl ctrlSetTextColor _color; _ctrl ctrlSetTextColor _color;
_ctrl ctrlAddEventHandler ["buttonclick", _fnc_onSelection]; _ctrl ctrlAddEventHandler ["ButtonClick", _fnc_onSelection];
} forEach IDCs; } forEach IDCs;
private _fnc_onUnload = { private _fnc_onUnload = {
@ -129,5 +129,5 @@ private _fnc_onConfirm = {
deleteVehicle _logic; deleteVehicle _logic;
}; };
_display displayAddEventHandler ["unload", _fnc_onUnload]; _display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];

View File

@ -23,7 +23,7 @@ private _ctrlButtonOK = _display displayCtrl 1; // IDC_OK
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
TRACE_1("logicObject",_logic); TRACE_1("logicObject",_logic);
_control ctrlRemoveAllEventHandlers "setFocus"; _control ctrlRemoveAllEventHandlers "SetFocus";
// Validate module target // Validate module target
private _unit = attachedTo _logic; private _unit = attachedTo _logic;

View File

@ -23,7 +23,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
TRACE_1("logicObject",_logic); TRACE_1("logicObject",_logic);
_control ctrlRemoveAllEventHandlers "setFocus"; _control ctrlRemoveAllEventHandlers "SetFocus";
//Specific on-load stuff: //Specific on-load stuff:
private _listbox = _display displayCtrl 16189; private _listbox = _display displayCtrl 16189;
@ -91,5 +91,5 @@ private _fnc_onConfirm = {
}; };
_display displayAddEventHandler ["KeyUp", _fnc_onKeyUp]; _display displayAddEventHandler ["KeyUp", _fnc_onKeyUp];
_display displayAddEventHandler ["unload", _fnc_onUnload]; _display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];