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

Create a placeholder style/effect #103

Open
EseKriper opened this issue Jan 21, 2023 · 2 comments
Open

Create a placeholder style/effect #103

EseKriper opened this issue Jan 21, 2023 · 2 comments

Comments

@EseKriper
Copy link

To facilitate the use of the particles to the users I made a menu with deluxemenus and had to use placeholder api javascript to visually show the user that has that particle.

Unfortunately javascript in placeholderapi is outdated and inefficient.
We use this code to show 3 style/effect and you can see that it is not very efficient if I want to show more than 3 style/effect.

image

var contador = '%playerparticles_active_amount%'

var style1 = '%playerparticles_particle_style_1%';
var effect1 = '%playerparticles_particle_effect_1%';

var style2 = '%playerparticles_particle_style_2%';
var effect2 = '%playerparticles_particle_effect_2%';

var style3 = '%playerparticles_particle_style_3%';
var effect3 = '%playerparticles_particle_effect_3%';

var pattern = new RegExp('%');

function particula() {
var selecciones = [
style1+'/'+effect1,
style2+'/'+effect2,
style3+'/

'+effect3
];
if (contador > 0) {
return selecciones.filter(function(t) {
return pattern.test(t) == false;
}).join('\n');
} else {
return "N/A"
}
}
particula();

@EseKriper
Copy link
Author

The styles that the player has are enchanted.

image

When you enter the style you can see that the selected effect is enchanted.

image

@EseKriper
Copy link
Author

If you add a style/effect marker you can do cool things in deluxemenus like the ones above without being limited by the amount of style/effect the player has.

With the code above I'm limited to 3 style/effect, I can add more but it would be interesting if it was implemented as a placeholder of the plugin.

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

No branches or pull requests

1 participant