-
Notifications
You must be signed in to change notification settings - Fork 738
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
Dragging - Improve carrying by allowing carried object to be loaded into vehicle by key or mouse #9138
Conversation
if (_target isKindOf "CAManBase") then { | ||
private _vehicles = [cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat); | ||
if ([cursorObject] isEqualTo _vehicles) then { | ||
[ACE_player, _target, cursorObject] call EFUNC(medical_treatment,loadUnit); |
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.
I think we need to check isModLoaded for medical
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.
How's this? 438d06b
// Update mouse hint | ||
private _ctrlTextLMB = (uiNamespace getVariable [QEGVAR(interaction,mouseHint), displayNull]) displayCtrl 2420; | ||
if ( | ||
!isNull cursorObject | ||
&& {([ACE_player, cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith))} | ||
&& { | ||
if (_target isKindOf "CAManBase") then { | ||
([] isNotEqualTo ([cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat))) | ||
&& {([_target, cursorObject] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} | ||
} else { | ||
[_target, cursorObject] call EFUNC(cargo,canLoadItemIn) | ||
} | ||
} | ||
) then { | ||
_ctrlTextLMB ctrlSetText localize ELSTRING(Cargo,loadObject); | ||
} else { | ||
_ctrlTextLMB ctrlSetText localize LSTRING(Drop); | ||
}; |
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.
Could maybe do what refuel
does instead of directly manipulating the mouse hint UI.
ACE3/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf
Lines 93 to 113 in f67957c
private _hintLMB = ""; | |
private _hintRMB = localize ELSTRING(dragging,Drop); | |
getCursorObjectParams params ["_cursorObject", "", "_distance"]; | |
if (!isNull _cursorObject && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE}) then { | |
if ( | |
1 == getNumber (configOf _cursorObject >> QGVAR(canReceive)) | |
&& {isNull (_cursorObject getVariable [QGVAR(nozzle), objNull])} | |
) then { | |
_hintLMB = localize LSTRING(Connect); | |
}; | |
if ([_unit, _cursorObject] call FUNC(canReturnNozzle)) then { | |
_hintRMB = localize LSTRING(Return); | |
}; | |
}; | |
private _hint = [_hintLMB, _hintRMB]; | |
if (_hint isNotEqualTo (_unit getVariable [QGVAR(hint), []])) then { | |
_unit setVariable [QGVAR(hint), _hint]; | |
_hint call EFUNC(interaction,showMouseHint); | |
}; |
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.
That's an elegant approach! I'll give it a shot.
I based what I did on
ACE3/addons/explosives/functions/fnc_setupExplosive.sqf
Lines 121 to 131 in f67957c
// Update mouse hint | |
private _ctrlTextLMB = (uiNamespace getVariable [QEGVAR(interaction,mouseHint), displayNull]) displayCtrl 2420; | |
if (_badPosition) then { | |
_ctrlTextLMB ctrlSetText localize LSTRING(BlockedAction); | |
} else { | |
if (isNull _attachVehicle) then { | |
_ctrlTextLMB ctrlSetText localize LSTRING(PlaceAction); | |
} else { | |
_ctrlTextLMB ctrlSetText localize LSTRING(AttachAction); | |
}; | |
}; |
When merged this pull request will:
IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.