wardrobe - transfer variables on item change#11139
Conversation
|
maybe we do need a before event. will add to the other PR |
|
but we have no way to know if the setVar should be global sync or not I think we may need to handle this with events inside gunbag |
|
TFAR uses setVars on backpacks for radio settings this is what I came up with for controlling setVar broadcast setting so we only transfer if explicitly set? |
| { _this call (GVAR(exceptions) get (_this#0) select 1) } | ||
| ] call CBA_fnc_addEventHandler; | ||
|
|
||
| GVAR(containerVarsToTransfer) = createHashMapFromArray [ |
There was a problem hiding this comment.
Add doc comment explaining what this does?
There was a problem hiding this comment.
Would also note in wardrobe wiki that variable needs to be added here I guess
When merged this pull request will:
If a variable is set on a unit's vest, backpack, uniform; the variables will not be present on the new one. We instead transfer all existing variables onto the new item.
I can see this PR being rejected, because we don't set these variables globally. Technically, you could set a variable on a remote unit's container. As far as I know there is no way to check if this has occurred, and this information will be lost on wardrobe change. I guess if there is an event for an item change before and after the
setLoadoutis called, then the person who made this insane decision can transfer the variables themselfIMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}.