-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add CBA_MiscItem to virtual arsenal #744
Conversation
addons/common/XEH_preClientInit.sqf
Outdated
@@ -8,4 +8,7 @@ if (hasInterface) then { | |||
GVAR(actionListUpdated) = false; // Set true to force recreation of actions. | |||
GVAR(nextActionIndex) = 0; // Next index that will be given out. | |||
GVAR(actionListPFEH) = false; | |||
|
|||
// Add CBA_MiscItems to VirtualArsenal | |||
[missionnamespace, "arsenalOpened", {call CBA_fnc_handleArsenalOpened}] call bis_fnc_addscriptedeventhandler; |
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.
Check camelCase capitalization in:
XEH_preClientInit - line 13.
fnc_handleArsenalOpened - lines 13, 19, 21, 30-44, 51-57 and 60.
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.
[missionNamespace, "arsenalOpened", {call CBA_fnc_handleArsenalOpened}] call BIS_fnc_addScriptedEventHandler;
} forEach (configProperties [configFile >> "CfgWeapons", "(isClass _x) && {(configName _x) isKindOf ['CBA_MiscItem', configFile >> 'CfgWeapons']}"]); | ||
TRACE_2("Items to add",count _cbaMiscItems,_cbaMiscItems); | ||
|
||
|
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.
Redundant whitespace?
|
||
|
||
// Much of this is from fn_arsenal.sqf -> "ListAdd" | ||
|
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.
Same?
class InventoryItem_Base_F; | ||
class CBA_MiscItem_ItemInfo: InventoryItem_Base_F { | ||
type = 302; // "bipod" | ||
}; |
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'm wondering if this class (CBA_MiscItem_ItemInfo
) is really needed or if the modified entries couldn't just be put in CBA_MiscItem/ItemInfo
.
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.
It makes configs easier IMHO because you just add the 2 parent defines instead of having to add the full inhertiance from the parent.
Also makes it a drop in replacement for our existing configs (just change InventoryItem_Base_F
):
class ACE_fieldDressing: ACE_ItemCore {
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
|
||
#define IDC_RSCDISPLAYARSENAL_LIST 960 | ||
#define IDC_RSCDISPLAYARSENAL_TAB_CARGOMISC 24 | ||
#define IDC_RSCDISPLAYARSENAL_SORT 800 |
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.
These are already part of:
#include "\a3\ui_f\hpp\defineResinclDesign.inc"
But that file cannot be included in the components script_component.hpp, because it has a double define that crashes the binarizer. It can be included in this file though.
It's not really a miscellaneous item, is it? Making that isn't hard. It's a base class that specifically makes the item appear in the Virtual Arsenal. |
Technically it's a miscellaneous item that supports Virtual Arsenal, I'd call it "inventory miscellaneous item". Most of the commented code above is copied from |
Agreed, except the line in preInitClient.sqf^^ |
We hook into arsenal when it calls events via:
With ACE items our code takes ~15ms to finish and has no problems. https://community.bistudio.com/wiki/with
Example:
Reported: Solution I came up with is to do
Which isn't pretty, but does seem to prevent problems with |
@@ -16,66 +16,73 @@ Author: | |||
|
|||
|
|||
[missionNameSpace, "arsenalOpened", { |
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.
It's missionNamespace
I believe.
ACE and ACRE had been setting their items as minedetectors to show up in virtual arsenal.
With Arma 1.76 they now act as real mine detectors.
This PR adds a new base CfgWeapon
CBA_MiscItem
that will be manually added to the "Misc Items" tab in arsenal.Example use: