progress2 icon indicating copy to clipboard operation
progress2 copied to clipboard

Gradient and leveled bars

Open Crayder opened this issue 8 years ago • 3 comments

Two suggestions:

  1. Gradient bars. Function that gives input of up to 10 colors and each color's level. You will make the gradient where each color is full at its level.
  2. Leveled bars. Same as the first suggestion, but the color just switches at once.

Crayder avatar Aug 31 '16 12:08 Crayder

Shouldn't be too hard, I'll try and get this in the next update, thanks!

Southclaws avatar Aug 31 '16 14:08 Southclaws

Yeah, I actually have the gradient code basically. It's simple stuff though.

Crayder avatar Aug 31 '16 15:08 Crayder

enum
{
    BAR_COLOUR_MODE_SINGLE = 1,
    BAR_COLOUR_MODE_LEVELED,
    BAR_COLOUR_MODE_GRADIENT
}

pbar_colourMode

// pbar_colourMode
stock GetPlayerProgressBarColourMode(playerid, PlayerBar:barid)
{
    if(!IsValidPlayerProgressBar(playerid, barid))
        return 0;

    return pbar_Data[playerid][_:barid][pbar_colourMode];
}

stock SetPlayerProgressBarDirection(playerid, PlayerBar:barid, mode)
{
    if(!IsValidPlayerProgressBar(playerid, barid))
        return 0;

    pbar_Data[playerid][_:barid][pbar_colourMode] = mode;

    _RenderBar(playerid, _:barid);

    return 1;
}

This is what I've done in the past 5 minutes... planned on doing more but leaving... xD

Crayder avatar Sep 12 '16 14:09 Crayder