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

Plugin feature request for adding custom operators as valid ones #41

Closed
aebian opened this issue Feb 28, 2017 · 3 comments
Closed

Plugin feature request for adding custom operators as valid ones #41

aebian opened this issue Feb 28, 2017 · 3 comments
Labels

Comments

@aebian
Copy link

aebian commented Feb 28, 2017

Plugin Version

1.0.7

Summary

Possibility to add custom operators in config files

Detail

Hi, nice plugin I like it. The only thing I would like to see is the following:

Currently me and my group have a custom written loadout system with configs.
In that particular we have an operator += that is allowed in our .cpp and therefore works.
The plugin although marks this operator as an error as it does not know that it's legit there.

As an example:

We have a base class for e.g.

class Russia {
items[] = {"ACE_morphine",1,"ACE_epinephrine",2,"};
} 

Now I want another soldier to have more medicine. If I would type just an equal sign = I would override the base class. Instead I type += so the items are getting added and not replaced.

class SomeSoldier : Russia {
items[] += {"ACE_morphine",1,"ACE_epinephrine",2,"ACRE_PRC148",2}; // Soldier will have 2 Morphine and 4 Epinephrine
}

So I'm seeking for an option to define custom operators that are valid either plugin wide or for specific files / folders.

Thanks,

A/

@kayler-renslow
Copy link
Owner

I'm not going to be adding support for custom operators because it doesn't really make sense; if an operator is allowed in header files, the grammar should allow it and similarly, if an operator isn't allowed, the grammar should have an error. There is no custom operators in header files.

I added support for += for header files, but I tested the operator with non-arrays and it didn't appear to work. So, += will only work for header array assignments (arr[] += {0})

Fixed in commit 75026d8

@Ragebone
Copy link

Ragebone commented Mar 2, 2017

There is actually a BIS article about this.
https://community.bistudio.com/wiki/Array%2B%3D

@kayler-renslow
Copy link
Owner

fixed in releaes 1.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants