-
Notifications
You must be signed in to change notification settings - Fork 151
Item Rename Framework #1329
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
Merged
Merged
Item Rename Framework #1329
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2ceb225
first draft proof of concept
fda4bbb
support items moving
8f89699
Merge branch 'rename' of https://github.com/synixebrett/CBA_A3 into r…
commy2 fc7614a
a MouseHolding/Moving engine
commy2 1777319
Make Item Rename Framework local; Tweak functions and initDisplayInve…
SzwedzikPL 67cdc00
Add change of picture in renameInventoryItem
SzwedzikPL 277a378
Fix error on undefined item classname
SzwedzikPL cd7d072
Merge branch 'master' into pr/1329
PabstMirror db969b3
use hashmap, configCase
PabstMirror 88ba4d4
Apply suggestions from code review
PabstMirror File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ PREP(preload3DEN); | |
PREP(preloadCurator); | ||
|
||
PREP(openItemContextMenu); | ||
|
||
PREP(getInventoryItemData); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Internal Function: cba_ui_fnc_getInventoryItemData | ||
|
||
Description: | ||
Returns item data from inventory display control | ||
|
||
Parameters: | ||
_control - RscDisplayInventory control <CONTROL> | ||
_index - Item index <NUMBER> | ||
|
||
Returns: | ||
_classname, _container, _containerType | ||
|
||
Examples: | ||
(begin example) | ||
[_groundContainer, 5] call cba_ui_fnc_getInventoryItemData; | ||
(end) | ||
|
||
Author: | ||
commy2, SynixeBrett | ||
---------------------------------------------------------------------------- */ | ||
|
||
params ["_control", "_index"]; | ||
|
||
private _unit = call CBA_fnc_currentUnit; | ||
|
||
private _container = objNull; | ||
private _containerType = _control getVariable QGVAR(containerType); | ||
switch _containerType do { | ||
case "GROUND": { | ||
_container = GVAR(CurrentGroundItemHolder); | ||
}; | ||
case "CARGO": { | ||
_container = GVAR(CurrentContainer); | ||
}; | ||
case "UNIFORM_CONTAINER": { | ||
_container = uniformContainer _unit; | ||
}; | ||
case "VEST_CONTAINER": { | ||
_container = vestContainer _unit; | ||
}; | ||
case "BACKPACK_CONTAINER": { | ||
_container = backpackContainer _unit; | ||
}; | ||
}; | ||
|
||
// Reports classname, but only for magazines. | ||
PabstMirror marked this conversation as resolved.
Show resolved
Hide resolved
|
||
private _classname = _control lbData _index; | ||
if (_classname isEqualTo "") then { | ||
// For weapons, items and glasses, use the lb index and compare with cargo item list. | ||
private _cargoItems = weaponCargo _container + itemCargo _container + magazineCargo _container; | ||
_cargoItems = _cargoItems arrayIntersect _cargoItems; | ||
|
||
_classname = _cargoItems param [_index, ""]; | ||
}; | ||
PabstMirror marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[_classname, _container, _containerType] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When I redid the inventory filtering in acemod/ACE3#9706, I found all item classnames are contained in
lbData
except for backpacks:https://github.com/acemod/ACE3/blob/b714c8bce2628ff8d4795da8a7f2fc05bb82f474/addons/inventory/functions/fnc_forceItemListUpdate.sqf#L33
Workaround for backpacks is to get them using the display name and picture.
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 would likely cause ambiguities for backpacks with linked items, as I doubt they would change the picture and display name for each variant.