Skip to content
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

Arsenal - add custom right panel misc items buttons #7596

Merged
merged 27 commits into from
Jun 29, 2020
Merged

Arsenal - add custom right panel misc items buttons #7596

merged 27 commits into from
Jun 29, 2020

Conversation

shukari
Copy link
Contributor

@shukari shukari commented Mar 12, 2020

When merged this pull request will:

  • it is possible to sort special misc items in extra right panel buttons

Infos

  • with [["ACE_bloodIV_500", "ACE_Banana"], "Stuff"] call ace_arsenal_fnc_addRightPanelButton you can do an extra button there
  • original idea is from @Schwaggot
  • icon is from https://material.io/
    • icon from myself

Example for medical

With this code, you have a setting for ace_medical to add a custom button with all medical stuff.
If this is good, i can add this also to this PR.

[QGVAR(addMedicalArsenalButton), "CHECKBOX", "addMedicalArsenalButton", localize LSTRING(settingCategory), true, true, {
    if (_this && isNil QGVAR(medicalArsenalButton)) then {
        GVAR(medicalArsenalButton) = [["ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_splint",
            "ACE_morphine", "ACE_adenosine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250",
            "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot",
            "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"], "MedicalStuff", "\z\ace\addons\arsenal\data\iconCustom.paa"] call ace_arsenal_fnc_addRightPanelButton;
    };
}, true] call CBA_fnc_addSetting;

Example/Preview

20200312133049_1
20200312133118_1
20200312133128_1

@BaerMitUmlaut
Copy link
Member

That's a great idea, however I would like to see the following changes:

  • Icon should be settable
  • Tab should appear above the misc tab, because that's the "everything else" button
  • Dynamically add them (you could have the basic definition in config and then ctrlCreate them)

I know this would increase complexity, but you would just need to calculate a couple positions.

@shukari
Copy link
Contributor Author

shukari commented Mar 12, 2020

Icon should be settable

it is

* 2: picture path <STRING> (Optional)

Tab should appear above the misc tab, because that's the "everything else" button

because there are 10 static atm i placed it under that misc tab

Dynamically add them (you could have the basic definition in config and then ctrlCreate them)

because of the arsenal system and the defines i build it extra static that everything is defined and has a IDC etc. But yeah i can make it dynamic if this is wished.

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Mar 12, 2020
addons/arsenal/defines.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't binarize __EVAL, __EVAL is banned

@dedmen
Copy link
Contributor

dedmen commented Mar 12, 2020

Is there a limit? What if users push too many buttons (I'd call that unlikely to happen so prolly no matter)

addons/arsenal/defines.hpp Outdated Show resolved Hide resolved
Co-Authored-By: Dedmen Miller <dedmen@users.noreply.github.com>
@shukari
Copy link
Contributor Author

shukari commented Mar 12, 2020

Is there a limit? What if users push too many buttons (I'd call that unlikely to happen so prolly no matter)

Yeah only 10 Buttons not more

private _return = if (_position >= 0 && _position <= 9) then {

Co-Authored-By: Dedmen Miller <dedmen@users.noreply.github.com>
@dedmen
Copy link
Contributor

dedmen commented Mar 12, 2020

Yeah only 10 Buttons not more

should read before commenting...

Co-Authored-By: Dedmen Miller <dedmen@users.noreply.github.com>
@dedmen
Copy link
Contributor

dedmen commented May 5, 2020

icon is from https://material.io/

I cannot see the Apache License in your changes? Or are you trying to just relicense Apache license content as GPL? I don't think that'll work out well.

@shukari
Copy link
Contributor Author

shukari commented May 6, 2020

I cannot see the Apache License in your changes? Or are you trying to just relicense Apache license content as GPL? I don't think that'll work out well.

You now that i didnt do that on purpose.
But i see now that this is something i forgot to check.
I made my own 3 white dots.

Copy link
Contributor

@PabstMirror PabstMirror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall, just need minor fix

@PabstMirror PabstMirror modified the milestones: 3.14.0, 3.13.3 Jun 23, 2020
@shukari shukari requested review from commy2 and PabstMirror June 23, 2020 15:17
addons/arsenal/defines.hpp Outdated Show resolved Hide resolved
addons/arsenal/defines.hpp Outdated Show resolved Hide resolved
@commy2
Copy link
Contributor

commy2 commented Jun 26, 2020

Aside from these two, lgtm.

@commy2 commy2 closed this Jun 26, 2020
@commy2 commy2 reopened this Jun 26, 2020
@shukari shukari requested a review from commy2 June 26, 2020 17:22
@veteran29
Copy link
Member

Icon of custom category disappears for me when I'm focusing something in the items list:
image
image

@shukari
Copy link
Contributor Author

shukari commented Jun 28, 2020

@veteran29 good spot... the background was set after the icon... is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants