Release [PC/Steam] Advanced Warfare Steam Hud Elements

xCometMods

Modder
Messages
68
Reaction score
38
Points
803
Here are the hud elements for advanced warfare v1.22[latest steam version] on PC written in c++, first to find these on PC it seems.
C++:
typedef unsigned char byte;
typedef unsigned int uint;
/*
EXAMPLE
   game_hudelem_s* Background= SetShader(client, "white", 175, 1080, 100, 100, 0, 0, 0, 200);
    game_hudelem_s*Title = SetText(client, "HIIHIHHIHIHIHIHIHIHIIHI\nHIHIHIIHIHIHIH", 100, 100, 4, 1, 255, 255, 255, 255, 255, 0, 0, 255);
    
*/
enum he_font_t {

    HE_FONT_DEFAULT = 0x0,

    HE_FONT_BIGFIXED = 0x1,

    HE_FONT_SMALLFIXED = 0x2,

    HE_FONT_OBJECTIVE = 0x3,

    HE_FONT_SMALL = 0x5,

    HE_FONT_HUDBIG = 0x6,

    HE_FONT_HUDSMALL = 0x7,

    HE_FONT_COUNT = 0x8,

};

union hudelem_color_t
{
    struct
    {
        unsigned char r;
        unsigned char g;
        unsigned char b;
        unsigned char a;
    };
    int rgba;
};

struct hudelem_s
{
    short targetent1;
    short targetent2;
    int font;
    int alignOrg;
    int alignScreen;
    float x;
    float y;
    float z;
    int type;
    float FontScale;
    int FromFontScale;
    int FontScaleStartTime;
    int FontScaleTime;
    hudelem_color_t color;
    hudelem_color_t fromColor;
    int fadeStartTime;
    int fadeTime;
    int label;
    int Width;
    int Height;
    int MaterialIndex;
    int fromWidth;
    int fromHeight;
    int moveStartTime;
    int moveTime;
    float fromX;
    float fromY;
    int fromAlignOrg;
    int fromAlignScreen;
    int scaleStartTime;
    int scaleTime;
    int time;
    int duration;
    float value;
    int text;
    float sort;
    hudelem_color_t glowColor;
    int fxBirthTime;
    int fxLetterTime;
    int fxDecayStartTime;
    int fxDecayDuration;
    int soundID;
    int unknown;
    int flags;
};

struct game_hudelem_s
{
    hudelem_s elem;
    int ClientNum;
    int team;
    int archived;
    int showInKillcam;
};



#define g_hudelems 0x144729C40 //SIZE = 0xBC
int(*G_FindConfigstringIndex)(const char* name, int start, int max, int create, const char* error) = (int(*)(const char*, int, int, int, const char*))0x140161F90;

int(*G_LocalizedStringIndex)(const char* text) = (int(*)(const char*))0x140044A50;
int(*G_MaterialIndex)(const char* text) = (int(*)(const char*))0x14003E740;

game_hudelem_s*(*HudElem_Alloc)(int clientNum, int teamNum) = (game_hudelem_s*(*)(int, int))0x1402F0780;

game_hudelem_s* SetShader(int client, const char* shader, int Width, int Height, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
{
    game_hudelem_s* elem = HudElem_Alloc(client, 0);
    elem->ClientNum = client;
    elem->elem.type = 4;
    elem->elem.MaterialIndex = G_MaterialIndex(shader);
    elem->elem.Width = Width;
    elem->elem.Height = Height;
    elem->elem.x = x;
    elem->elem.y = y;
    elem->elem.alignOrg = 0;
    elem->elem.color.r = r;
    elem->elem.color.g = g;
    elem->elem.color.b = b;
    elem->elem.color.a = a;
    elem->elem.targetent1 = 1;
    elem->elem.targetent2 = 1;
    return elem;
}
game_hudelem_s* SetText(int client, char* text, float x, float y, float fontScale, char font, unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned char glowR, unsigned char glowG, unsigned char glowB, unsigned char glowA)
{
    game_hudelem_s* elem = HudElem_Alloc(client, 0);
    elem->ClientNum = client;
    elem->elem.type = 1;
    elem->elem.font = font;
    elem->elem.FontScale = fontScale;
    elem->elem.alignOrg = 0;
    elem->elem.alignScreen = 0;
    elem->elem.x = x;
    elem->elem.y = y;
    elem->elem.color.r = r;
    elem->elem.color.g = g;
    elem->elem.color.b = b;
    elem->elem.color.a = a;
    elem->elem.glowColor.r = glowR;
    elem->elem.glowColor.g = glowG;
    elem->elem.glowColor.b = glowB;
    elem->elem.glowColor.a = glowA;
    elem->elem.text = G_LocalizedStringIndex(text);// G_LocalizedStringIndex(text);
    elem->elem.targetent1 = 1;
    elem->elem.targetent2 = 1;
    return elem;
}

void ChangeGlow(game_hudelem_s* element, byte r, byte g, byte b, byte a)
{
    element->elem.glowColor.r = r;
    element->elem.glowColor.g = g;
    element->elem.glowColor.b = b;
    element->elem.glowColor.a = a;
}

void ChangeColor(game_hudelem_s* element, byte r, byte g, byte b, byte a)
{
    element->elem.color.r = r;
    element->elem.color.g = g;
    element->elem.color.b = b;
    element->elem.color.a = a;
}

void FreeHudElement(game_hudelem_s* element)
{
    ZeroMemory(element, 0xB8);
}

void ChangeFontScale(game_hudelem_s* element, float Scale)
{
    element->elem.FontScale = Scale;
}

void ChangeText(game_hudelem_s* element, const char* Text)
{
    element->elem.text = G_FindConfigstringIndex(Text, 0x21D, 0x1FF, 1, "error");
}

void ChangeMaterial(game_hudelem_s* element, const char* material)
{
    element->elem.MaterialIndex = G_MaterialIndex(material);
}

void MoveXY(game_hudelem_s* element, float x, float y)
{
    element->elem.x = x;
    element->elem.y = y;
}
1654204294001.png
 
Last edited:
Top