altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Change Blip Color not working

Open Zynischer opened this issue 3 years ago • 2 comments

Description of the problem

If you create a blip and change the color, it will only refreshed on the legend, not on the map.

Reproduction steps

Create Blip on onStart() (values from database): ... var tBlip = Alt.CreateBlip(BlipType.Pickup, new Position(blip.PosX, blip.PosY, 0)); tBlip.Color = blip.Color; tBlip.Alpha = blip.Alpha; tBlip.Name = blip.Name; tBlip.ScaleXY = new Vector2(blip.ScaleX, blip.ScaleY); tBlip.ShortRange = true; tBlip.Sprite = blip.Sprite; ...

Somewhere else: await AltAsync.Do(() => { var blip = Alt.GetAllBlips().FirstOrDefault(t => t.Name.Equals(fraktion.Blip.Name)); if (blip == null) return;

        blip.Color = color;
    });

Expected behaviour

It should also refresh the icon on the map

Additional context

No response

Operating system

Debian

Version

release

Zynischer avatar Sep 23 '22 15:09 Zynischer

its refreshing if i call the method with the change twice

Zynischer avatar Sep 23 '22 15:09 Zynischer

Confirmed on 13.0-dev42

clientside code for testing:

const blip = new alt.PointBlip(0, 0, 0);
blip.name = "test";

new alt.Utils.Keybind(18 /** alt key */, () => {
    // blip color visually changes only after reopening pause menu map or minimap
    blip.color = Math.floor(Math.random() * 20);
    
    // blip color visually changes immediately
    // native.setBlipColour(blip.scriptID, Math.floor(Math.random() * 20));
});

xxshady avatar Sep 29 '22 20:09 xxshady

Can confirm this also happens on alt.RadiusBlip and alt.AreaBlip.

Easiest fix right now is to simply delete and re-create the blip..

TheDutchDev avatar Oct 30 '22 10:10 TheDutchDev

@CoffeeGen you can change color with native, see my comment above yours

xxshady avatar Oct 30 '22 11:10 xxshady

alpha setter is also broken. natives do work

TheDutchDev avatar Dec 11 '22 14:12 TheDutchDev

@Zynischer @QuiGonJinnAndTonic test on newest dev please

C0kkie avatar Jul 05 '23 20:07 C0kkie

@xxshady is this still a thing?

C0kkie avatar Jul 13 '23 11:07 C0kkie

yes

xxshady avatar Jul 13 '23 12:07 xxshady

I can provide more information, entering in pause menu refresh the color, removing the blip from the minimap when the blip is short range refresh the color and hiding an showing the hud also does (Related to pause menu).

S0P4 avatar Jul 24 '23 22:07 S0P4