Meowtimer / c4dt

1 stars 1 forks source link

anonymous functions confuse the parser #1

Open walachey opened 8 years ago

walachey commented 8 years ago

If I have an effect with the new effect syntax, tooltip positions are off, "Open Declaration" does some random stuff, and more.

Example for copy-pasting

local RoundhouseKickEffect = new Effect
{
    Construction = func()
    {
        this.anim = this.Target->PlayAnimation("RoundhouseKick", CLONK_ANIM_SLOT_Arms, Anim_Linear(0, 0, GetAnimationLength("RoundhouseKick"), 30, ANIM_Hold));
        this.particles = 
        {
            Size = PV_Linear(0, 2),
            Alpha = PV_Linear(100, 0),
            BlitMode = GFX_BLIT_Additive
        };
        this.particles = Particles_Colored(this.particles, this.Target->GetColor());
    },
    Destruction = func()
    {
        if (this.Target)
            this.Target->StopAnimation(this.anim);
    },
    Timer = func()
    {
        this.Target->CreateParticleAtBone("SphereSpark", "skeleton_arm_hand.L", [0, 0, 0], [0, 0, 0], 15, this.particles, 1);
        this.Target->CreateParticleAtBone("SphereSpark", "skeleton_arm_hand.R", [0, 0, 0], [0, 0, 0], 15, this.particles, 1);
    }
};
Meowtimer commented 8 years ago

Wanted to fix the formatting but you already did 👍🏼