-
Notifications
You must be signed in to change notification settings - Fork 737
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
Cargo - Add ability to add custom name to cargo objects #8023
Conversation
Added the ability to edit cargo objects (crates/boxes only) names. Either via in-game action on the object it self or via 3den attributes. Added a single function which spawns the UI to edit the name and also edits it. This is an scripted UI, it could be changed to a config version if wanted, but as I'm not good in UI coding I left it on this simple version mainly for testing. Added 4 new stringtable entries, 2 for action and 2 for 3den attributes.
Forgot to add the UI to the stringtable.
fixing tabs
Scripted UI is better, easier to work with.
Just leave them empty. Translators will translate (add their own languages) whenever they will.
|
I don't particularly like another interaction menu node just for that. Why not put it into the cargo menu itself? Load and then rename. I would also keep the base object name and add custom part to the end. |
Well the issue we have in our unit is that we use crates a lot for rearming, and loading the crates in to just rename them feels like extra work, and an hindrance. Also we use different boxes for different ammo type, currently I've created multiple empty boxes with different names. However this option would give mission makers/logistic workers the freedom to do stuff their own way, not being limited to the names. I could add the custom tag to the end of the normal name, however I initially didn't want to add too much text as it could be annoying. |
But it's only visible in the cargo menu anyways? I would understand if it would be displayed somewhere else. As an alternative, Rename action could be a child of the Load action to decrease clutter. |
I think a child action of Load would be good. |
When adding it as a child action to Load it would mean that you can't edit the name when you can't load it (when far away from vehicle). As it won't be visible then. I'm not 100% happy about this compromise, I do agree less clutter is better but if it would mean the action won't be available all the time I'd leave it at the mainaction.
True, but I prefer if it can be changed without needing to load an object, that way you can prepare a few crates for later. |
2 things I want for this:
|
Added new function "getNameItem" that will get the items name. Put the custom name behind the original name between brackets "[...]".
Also removed an unused _itemClass from postInit.
I've changed it so that the custom part is behind the base name (see picture below). I also saw that there are some conflicting files, I tried to merge from the master to my branch but that hasn't resolved it. |
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.
Fixed merge conflicts for you, some more styling suggestions.
Co-authored-by: jonpas <jonpas33@gmail.com>
Added my name
Just did a last test with your suggestions and the merge from master, all works as intended. |
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.
Somebody else look at the UI stuff.
Is the only holdout here the UI? |
As far as I know I've applied all the requested changes, if anything else needs to be changed be free to tell me. |
@mharis001 re-review please. |
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.
If you click the background in the GUI the edit box loses focus and cannot be clicked into. Only way to go back into the edit box is by using TAB. Also, if the edit box is not in focus, you can move the player around with WASD (use a dialog to fix).
Fixed tabs to spaces.
@mharis001 I've fixed/reworked the UI as stated in my last message, could you have another look at it? |
@JasperRab Can you fix the conflict? |
@BrettMayson Done, wasn't aware about the conflict. so thanks for reminding. |
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.
Dislike the use of ACE_gui_X
GUI base classes over the base game's RscX
. But, I guess that is an overall issue with the cargo
component.
GUI works as expected now.
* First Push Added the ability to edit cargo objects (crates/boxes only) names. Either via in-game action on the object it self or via 3den attributes. Added a single function which spawns the UI to edit the name and also edits it. This is an scripted UI, it could be changed to a config version if wanted, but as I'm not good in UI coding I left it on this simple version mainly for testing. Added 4 new stringtable entries, 2 for action and 2 for 3den attributes. * Add extra stringtable Forgot to add the UI to the stringtable. * Update fnc_renameObject.sqf fixing tabs * Show custom name only behind Added new function "getNameItem" that will get the items name. Put the custom name behind the original name between brackets "[...]". * Added "Hide Rename Action" setting Also removed an unused _itemClass from postInit. * Apply suggestions from code review Co-authored-by: jonpas <jonpas33@gmail.com> * Update AUTHORS.txt Added my name * Applied the sugesstions. * Fixed function crash * Moved to dialog. * Removed unused comment/code * Update renameMenu.hpp Fixed tabs to spaces. * Update renameMenu.hpp * move rename to common * Update addons/arsenal/ui/RscAttributes.hpp * style and use addActionToObject Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Ever had more than 5 of the same ammo boxes in a vehicle? And you need to find that one with your favorite banana?
Well with this you can change the name of the boxes that are loadable into the cargo system.
When merged this pull request will:
Pictures:
Cargo menu with custom names and default (some) names.
3den attribute where the custom name can be set by mission makers.
UI of the renaming interface.